hash
int64 -9,197,960,073,880,366,000
9,199,363,627B
| project
stringclasses 2
values | size
int64 2
5.68k
| label
int64 0
1
| functionSource
stringlengths 31
235k
|
---|---|---|---|---|
1,458,662,858,915,721,500 | debian | 7 | 0 | void tb_invalidate_phys_range ( tb_page_addr_t start , tb_page_addr_t end , int is_cpu_write_access ) {
while ( start < end ) {
tb_invalidate_phys_page_range ( start , end , is_cpu_write_access ) ;
start &= TARGET_PAGE_MASK ;
start += TARGET_PAGE_SIZE ;
}
} |
9,046,191,708,840,219,000 | debian | 31 | 0 | static int __tipc_nl_compat_doit ( struct tipc_nl_compat_cmd_doit * cmd , struct tipc_nl_compat_msg * msg ) {
int err ;
struct sk_buff * doit_buf ;
struct sk_buff * trans_buf ;
struct nlattr * * attrbuf ;
struct genl_info info ;
trans_buf = alloc_skb ( NLMSG_GOODSIZE , GFP_KERNEL ) ;
if ( ! trans_buf ) return - ENOMEM ;
err = ( * cmd -> transcode ) ( cmd , trans_buf , msg ) ;
if ( err ) goto trans_out ;
attrbuf = kmalloc ( ( tipc_genl_family . maxattr + 1 ) * sizeof ( struct nlattr * ) , GFP_KERNEL ) ;
if ( ! attrbuf ) {
err = - ENOMEM ;
goto trans_out ;
}
err = nla_parse ( attrbuf , tipc_genl_family . maxattr , ( const struct nlattr * ) trans_buf -> data , trans_buf -> len , NULL ) ;
if ( err ) goto parse_out ;
doit_buf = alloc_skb ( NLMSG_GOODSIZE , GFP_KERNEL ) ;
if ( ! doit_buf ) {
err = - ENOMEM ;
goto parse_out ;
}
doit_buf -> sk = msg -> dst_sk ;
memset ( & info , 0 , sizeof ( info ) ) ;
info . attrs = attrbuf ;
err = ( * cmd -> doit ) ( doit_buf , & info ) ;
kfree_skb ( doit_buf ) ;
parse_out : kfree ( attrbuf ) ;
trans_out : kfree_skb ( trans_buf ) ;
return err ;
} |
-7,117,046,864,335,130,000 | chrome | 39 | 0 | void vp9_rc_init ( const VP9EncoderConfig * oxcf , int pass , RATE_CONTROL * rc ) {
int i ;
if ( pass == 0 && oxcf -> rc_mode == VPX_CBR ) {
rc -> avg_frame_qindex [ KEY_FRAME ] = oxcf -> worst_allowed_q ;
rc -> avg_frame_qindex [ INTER_FRAME ] = oxcf -> worst_allowed_q ;
}
else {
rc -> avg_frame_qindex [ KEY_FRAME ] = ( oxcf -> worst_allowed_q + oxcf -> best_allowed_q ) / 2 ;
rc -> avg_frame_qindex [ INTER_FRAME ] = ( oxcf -> worst_allowed_q + oxcf -> best_allowed_q ) / 2 ;
}
rc -> last_q [ KEY_FRAME ] = oxcf -> best_allowed_q ;
rc -> last_q [ INTER_FRAME ] = oxcf -> best_allowed_q ;
rc -> buffer_level = rc -> starting_buffer_level ;
rc -> bits_off_target = rc -> starting_buffer_level ;
rc -> rolling_target_bits = rc -> avg_frame_bandwidth ;
rc -> rolling_actual_bits = rc -> avg_frame_bandwidth ;
rc -> long_rolling_target_bits = rc -> avg_frame_bandwidth ;
rc -> long_rolling_actual_bits = rc -> avg_frame_bandwidth ;
rc -> total_actual_bits = 0 ;
rc -> total_target_bits = 0 ;
rc -> total_target_vs_actual = 0 ;
rc -> baseline_gf_interval = DEFAULT_GF_INTERVAL ;
rc -> frames_since_key = 8 ;
rc -> this_key_frame_forced = 0 ;
rc -> next_key_frame_forced = 0 ;
rc -> source_alt_ref_pending = 0 ;
rc -> source_alt_ref_active = 0 ;
rc -> frames_till_gf_update_due = 0 ;
rc -> ni_av_qi = oxcf -> worst_allowed_q ;
rc -> ni_tot_qi = 0 ;
rc -> ni_frames = 0 ;
rc -> tot_q = 0.0 ;
rc -> avg_q = vp9_convert_qindex_to_q ( oxcf -> worst_allowed_q , oxcf -> bit_depth ) ;
for ( i = 0 ;
i < RATE_FACTOR_LEVELS ;
++ i ) {
rc -> rate_correction_factors [ i ] = 1.0 ;
}
} |
-673,406,620,978,847,500 | chrome | 12 | 0 | TEST_F ( WebFrameSimTest , ChangeBackgroundColor ) {
SimRequest main_resource ( "https://example.com/test.html" , "text/html" ) ;
LoadURL ( "https://example.com/test.html" ) ;
main_resource . Complete ( "<!DOCTYPE html><body></body>" ) ;
Element * body = GetDocument ( ) . QuerySelector ( "body" ) ;
EXPECT_TRUE ( ! ! body ) ;
Compositor ( ) . BeginFrame ( ) ;
EXPECT_EQ ( SK_ColorWHITE , Compositor ( ) . background_color ( ) ) ;
body -> SetInlineStyleProperty ( CSSPropertyBackgroundColor , "red" ) ;
Compositor ( ) . BeginFrame ( ) ;
EXPECT_EQ ( SK_ColorRED , Compositor ( ) . background_color ( ) ) ;
} |
4,180,964,683,905,831,000 | debian | 4 | 0 | static int selinux_inode_getxattr ( struct dentry * dentry , const char * name ) {
const struct cred * cred = current_cred ( ) ;
return dentry_has_perm ( cred , dentry , FILE__GETATTR ) ;
} |
-2,386,031,673,786,599,400 | debian | 121 | 1 | static gpgme_error_t status_handler ( void * opaque , int fd ) {
struct io_cb_data * data = ( struct io_cb_data * ) opaque ;
engine_gpgsm_t gpgsm = ( engine_gpgsm_t ) data -> handler_value ;
gpgme_error_t err = 0 ;
char * line ;
size_t linelen ;
do {
err = assuan_read_line ( gpgsm -> assuan_ctx , & line , & linelen ) ;
if ( err ) {
TRACE3 ( DEBUG_CTX , "gpgme:status_handler" , gpgsm , "fd 0x%x: error from assuan (%d) getting status line : %s" , fd , err , gpg_strerror ( err ) ) ;
}
else if ( linelen >= 3 && line [ 0 ] == 'E' && line [ 1 ] == 'R' && line [ 2 ] == 'R' && ( line [ 3 ] == '\0' || line [ 3 ] == ' ' ) ) {
if ( line [ 3 ] == ' ' ) err = atoi ( & line [ 4 ] ) ;
if ( ! err ) err = gpg_error ( GPG_ERR_GENERAL ) ;
TRACE2 ( DEBUG_CTX , "gpgme:status_handler" , gpgsm , "fd 0x%x: ERR line - mapped to: %s" , fd , err ? gpg_strerror ( err ) : "ok" ) ;
}
else if ( linelen >= 2 && line [ 0 ] == 'O' && line [ 1 ] == 'K' && ( line [ 2 ] == '\0' || line [ 2 ] == ' ' ) ) {
if ( gpgsm -> status . fnc ) err = gpgsm -> status . fnc ( gpgsm -> status . fnc_value , GPGME_STATUS_EOF , "" ) ;
if ( ! err && gpgsm -> colon . fnc && gpgsm -> colon . any ) {
gpgsm -> colon . any = 0 ;
err = gpgsm -> colon . fnc ( gpgsm -> colon . fnc_value , NULL ) ;
}
TRACE2 ( DEBUG_CTX , "gpgme:status_handler" , gpgsm , "fd 0x%x: OK line - final status: %s" , fd , err ? gpg_strerror ( err ) : "ok" ) ;
_gpgme_io_close ( gpgsm -> status_cb . fd ) ;
return err ;
}
else if ( linelen > 2 && line [ 0 ] == 'D' && line [ 1 ] == ' ' && gpgsm -> colon . fnc ) {
char * src = line + 2 ;
char * end = line + linelen ;
char * dst ;
char * * aline = & gpgsm -> colon . attic . line ;
int * alinelen = & gpgsm -> colon . attic . linelen ;
if ( gpgsm -> colon . attic . linesize < * alinelen + linelen + 1 ) {
char * newline = realloc ( * aline , * alinelen + linelen + 1 ) ;
if ( ! newline ) err = gpg_error_from_syserror ( ) ;
else {
* aline = newline ;
gpgsm -> colon . attic . linesize += linelen + 1 ;
}
}
if ( ! err ) {
dst = * aline + * alinelen ;
while ( ! err && src < end ) {
if ( * src == '%' && src + 2 < end ) {
++ src ;
* dst = _gpgme_hextobyte ( src ) ;
( * alinelen ) ++ ;
src += 2 ;
}
else {
* dst = * src ++ ;
( * alinelen ) ++ ;
}
if ( * dst == '\n' ) {
gpgsm -> colon . any = 1 ;
if ( * alinelen > 1 && * ( dst - 1 ) == '\r' ) dst -- ;
* dst = '\0' ;
err = gpgsm -> colon . fnc ( gpgsm -> colon . fnc_value , * aline ) ;
if ( ! err ) {
dst = * aline ;
* alinelen = 0 ;
}
}
else dst ++ ;
}
}
TRACE2 ( DEBUG_CTX , "gpgme:status_handler" , gpgsm , "fd 0x%x: D line;
final status: %s" , fd , err ? gpg_strerror ( err ) : "ok" ) ;
}
else if ( linelen > 2 && line [ 0 ] == 'D' && line [ 1 ] == ' ' && gpgsm -> inline_data ) {
char * src = line + 2 ;
char * end = line + linelen ;
char * dst = src ;
gpgme_ssize_t nwritten ;
linelen = 0 ;
while ( src < end ) {
if ( * src == '%' && src + 2 < end ) {
++ src ;
* dst ++ = _gpgme_hextobyte ( src ) ;
src += 2 ;
}
else * dst ++ = * src ++ ;
linelen ++ ;
}
src = line + 2 ;
while ( linelen > 0 ) {
nwritten = gpgme_data_write ( gpgsm -> inline_data , src , linelen ) ;
if ( ! nwritten || ( nwritten < 0 && errno != EINTR ) || nwritten > linelen ) {
err = gpg_error_from_syserror ( ) ;
break ;
}
src += nwritten ;
linelen -= nwritten ;
}
TRACE2 ( DEBUG_CTX , "gpgme:status_handler" , gpgsm , "fd 0x%x: D inlinedata;
final status: %s" , fd , err ? gpg_strerror ( err ) : "ok" ) ;
}
else if ( linelen > 2 && line [ 0 ] == 'S' && line [ 1 ] == ' ' ) {
char * rest ;
gpgme_status_code_t r ;
rest = strchr ( line + 2 , ' ' ) ;
if ( ! rest ) rest = line + linelen ;
else * ( rest ++ ) = 0 ;
r = _gpgme_parse_status ( line + 2 ) ;
if ( r >= 0 ) {
if ( gpgsm -> status . fnc ) err = gpgsm -> status . fnc ( gpgsm -> status . fnc_value , r , rest ) ;
}
else fprintf ( stderr , "[UNKNOWN STATUS]%s %s" , line + 2 , rest ) ;
TRACE3 ( DEBUG_CTX , "gpgme:status_handler" , gpgsm , "fd 0x%x: S line (%s) - final status: %s" , fd , line + 2 , err ? gpg_strerror ( err ) : "ok" ) ;
}
else if ( linelen >= 7 && line [ 0 ] == 'I' && line [ 1 ] == 'N' && line [ 2 ] == 'Q' && line [ 3 ] == 'U' && line [ 4 ] == 'I' && line [ 5 ] == 'R' && line [ 6 ] == 'E' && ( line [ 7 ] == '\0' || line [ 7 ] == ' ' ) ) {
char * keyword = line + 7 ;
while ( * keyword == ' ' ) keyword ++ ;
;
default_inq_cb ( gpgsm , keyword ) ;
assuan_write_line ( gpgsm -> assuan_ctx , "END" ) ;
}
}
while ( ! err && assuan_pending_line ( gpgsm -> assuan_ctx ) ) ;
return err ;
} |
3,599,206,110,384,554,500 | debian | 75 | 0 | static ossl_inline int sk_ ## t1 ## _num ( const STACK_OF ( t1 ) * sk ) {
return OPENSSL_sk_num ( ( const OPENSSL_STACK * ) sk ) ;
}
static ossl_inline t2 * sk_ ## t1 ## _value ( const STACK_OF ( t1 ) * sk , int idx ) {
return ( t2 * ) OPENSSL_sk_value ( ( const OPENSSL_STACK * ) sk , idx ) ;
}
static ossl_inline STACK_OF ( t1 ) * sk_ ## t1 ## _new ( sk_ ## t1 ## _compfunc compare ) {
return ( STACK_OF ( t1 ) * ) OPENSSL_sk_new ( ( OPENSSL_sk_compfunc ) compare ) ;
}
static ossl_inline STACK_OF ( t1 ) * sk_ ## t1 ## _new_null ( void ) {
return ( STACK_OF ( t1 ) * ) OPENSSL_sk_new_null ( ) ;
}
static ossl_inline STACK_OF ( t1 ) * sk_ ## t1 ## _new_reserve ( sk_ ## t1 ## _compfunc compare , int n ) {
return ( STACK_OF ( t1 ) * ) OPENSSL_sk_new_reserve ( ( OPENSSL_sk_compfunc ) compare , n ) ;
}
static ossl_inline int sk_ ## t1 ## _reserve ( STACK_OF ( t1 ) * sk , int n ) {
return OPENSSL_sk_reserve ( ( OPENSSL_STACK * ) sk , n ) ;
}
static ossl_inline void sk_ ## t1 ## _free ( STACK_OF ( t1 ) * sk ) {
OPENSSL_sk_free ( ( OPENSSL_STACK * ) sk ) ;
}
static ossl_inline void sk_ ## t1 ## _zero ( STACK_OF ( t1 ) * sk ) {
OPENSSL_sk_zero ( ( OPENSSL_STACK * ) sk ) ;
}
static ossl_inline t2 * sk_ ## t1 ## _delete ( STACK_OF ( t1 ) * sk , int i ) {
return ( t2 * ) OPENSSL_sk_delete ( ( OPENSSL_STACK * ) sk , i ) ;
}
static ossl_inline t2 * sk_ ## t1 ## _delete_ptr ( STACK_OF ( t1 ) * sk , t2 * ptr ) {
return ( t2 * ) OPENSSL_sk_delete_ptr ( ( OPENSSL_STACK * ) sk , ( const void * ) ptr ) ;
}
static ossl_inline int sk_ ## t1 ## _push ( STACK_OF ( t1 ) * sk , t2 * ptr ) {
return OPENSSL_sk_push ( ( OPENSSL_STACK * ) sk , ( const void * ) ptr ) ;
}
static ossl_inline int sk_ ## t1 ## _unshift ( STACK_OF ( t1 ) * sk , t2 * ptr ) {
return OPENSSL_sk_unshift ( ( OPENSSL_STACK * ) sk , ( const void * ) ptr ) ;
}
static ossl_inline t2 * sk_ ## t1 ## _pop ( STACK_OF ( t1 ) * sk ) {
return ( t2 * ) OPENSSL_sk_pop ( ( OPENSSL_STACK * ) sk ) ;
}
static ossl_inline t2 * sk_ ## t1 ## _shift ( STACK_OF ( t1 ) * sk ) {
return ( t2 * ) OPENSSL_sk_shift ( ( OPENSSL_STACK * ) sk ) ;
}
static ossl_inline void sk_ ## t1 ## _pop_free ( STACK_OF ( t1 ) * sk , sk_ ## t1 ## _freefunc freefunc ) {
OPENSSL_sk_pop_free ( ( OPENSSL_STACK * ) sk , ( OPENSSL_sk_freefunc ) freefunc ) ;
}
static ossl_inline int sk_ ## t1 ## _insert ( STACK_OF ( t1 ) * sk , t2 * ptr , int idx ) {
return OPENSSL_sk_insert ( ( OPENSSL_STACK * ) sk , ( const void * ) ptr , idx ) ;
}
static ossl_inline t2 * sk_ ## t1 ## _set ( STACK_OF ( t1 ) * sk , int idx , t2 * ptr ) {
return ( t2 * ) OPENSSL_sk_set ( ( OPENSSL_STACK * ) sk , idx , ( const void * ) ptr ) ;
}
static ossl_inline int sk_ ## t1 ## _find ( STACK_OF ( t1 ) * sk , t2 * ptr ) {
return OPENSSL_sk_find ( ( OPENSSL_STACK * ) sk , ( const void * ) ptr ) ;
}
static ossl_inline int sk_ ## t1 ## _find_ex ( STACK_OF ( t1 ) * sk , t2 * ptr ) {
return OPENSSL_sk_find_ex ( ( OPENSSL_STACK * ) sk , ( const void * ) ptr ) ;
}
static ossl_inline void sk_ ## t1 ## _sort ( STACK_OF ( t1 ) * sk ) {
OPENSSL_sk_sort ( ( OPENSSL_STACK * ) sk ) ;
}
static ossl_inline int sk_ ## t1 ## _is_sorted ( const STACK_OF ( t1 ) * sk ) {
return OPENSSL_sk_is_sorted ( ( const OPENSSL_STACK * ) sk ) ;
}
static ossl_inline STACK_OF ( t1 ) * sk_ ## t1 ## _dup ( const STACK_OF ( t1 ) * sk ) {
return ( STACK_OF ( t1 ) * ) OPENSSL_sk_dup ( ( const OPENSSL_STACK * ) sk ) ;
}
static ossl_inline STACK_OF ( t1 ) * sk_ ## t1 ## _deep_copy ( const STACK_OF ( t1 ) * sk , sk_ ## t1 ## _copyfunc copyfunc , sk_ ## t1 ## _freefunc freefunc ) {
return ( STACK_OF ( t1 ) * ) OPENSSL_sk_deep_copy ( ( const OPENSSL_STACK * ) sk , ( OPENSSL_sk_copyfunc ) copyfunc , ( OPENSSL_sk_freefunc ) freefunc ) ;
}
static ossl_inline sk_ ## t1 ## _compfunc sk_ ## t1 ## _set_cmp_func ( STACK_OF ( t1 ) * sk , sk_ ## t1 ## _compfunc compare ) {
return ( sk_ ## t1 ## _compfunc ) OPENSSL_sk_set_cmp_func ( ( OPENSSL_STACK * ) sk , ( OPENSSL_sk_compfunc ) compare ) ;
}
# define DEFINE_SPECIAL_STACK_OF ( t1 , t2 ) SKM_DEFINE_STACK_OF ( t1 , t2 , t2 ) # define DEFINE_STACK_OF ( t ) SKM_DEFINE_STACK_OF ( t , t , t ) # define DEFINE_SPECIAL_STACK_OF_CONST ( t1 , t2 ) SKM_DEFINE_STACK_OF ( t1 , const t2 , t2 ) # define DEFINE_STACK_OF_CONST ( t ) SKM_DEFINE_STACK_OF ( t , const t , t ) typedef char * OPENSSL_STRING ;
typedef const char * OPENSSL_CSTRING ;
DEFINE_SPECIAL_STACK_OF ( OPENSSL_STRING , char ) DEFINE_SPECIAL_STACK_OF_CONST ( OPENSSL_CSTRING , char ) |
1,760,449,185,745,615,400 | debian | 18 | 0 | TSReturnCode TSMimeHdrClone ( TSMBuffer dest_bufp , TSMBuffer src_bufp , TSMLoc src_hdr , TSMLoc * locp ) {
sdk_assert ( sdk_sanity_check_mbuffer ( dest_bufp ) == TS_SUCCESS ) ;
sdk_assert ( sdk_sanity_check_mbuffer ( src_bufp ) == TS_SUCCESS ) ;
sdk_assert ( sdk_sanity_check_mime_hdr_handle ( src_hdr ) == TS_SUCCESS ) ;
sdk_assert ( sdk_sanity_check_http_hdr_handle ( src_hdr ) == TS_SUCCESS ) ;
sdk_assert ( sdk_sanity_check_null_ptr ( ( void * ) locp ) == TS_SUCCESS ) ;
if ( ! isWriteable ( dest_bufp ) ) {
return TS_ERROR ;
}
HdrHeap * s_heap , * d_heap ;
MIMEHdrImpl * s_mh , * d_mh ;
s_heap = ( ( HdrHeapSDKHandle * ) src_bufp ) -> m_heap ;
d_heap = ( ( HdrHeapSDKHandle * ) dest_bufp ) -> m_heap ;
s_mh = _hdr_mloc_to_mime_hdr_impl ( src_hdr ) ;
d_mh = mime_hdr_clone ( s_mh , s_heap , d_heap , ( s_heap != d_heap ) ) ;
* locp = ( TSMLoc ) d_mh ;
return TS_SUCCESS ;
} |
-1,315,695,702,746,584,300 | debian | 10 | 0 | static gsize label_fill ( char * label_str , gsize pos , const header_field_info * hfinfo , const char * text ) {
gsize name_pos ;
name_pos = pos = label_concat ( label_str , pos , hfinfo -> name ) ;
pos = label_concat ( label_str , pos , ": " ) ;
pos = label_concat ( label_str , pos , text ? text : "(null)" ) ;
if ( pos >= ITEM_LABEL_LENGTH ) {
label_mark_truncated ( label_str , name_pos ) ;
}
return pos ;
} |
825,216,912,438,754,600 | debian | 4 | 0 | static int dissect_t38_OpenType_IFPPacket ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_open_type ( tvb , offset , actx , tree , hf_index , dissect_t38_IFPPacket ) ;
return offset ;
} |
-8,620,097,311,326,519,000 | chrome | 38 | 0 | err_status_t srtp_stream_dealloc ( srtp_t session , srtp_stream_ctx_t * stream ) {
err_status_t status ;
if ( session -> stream_template && stream -> rtp_cipher == session -> stream_template -> rtp_cipher ) {
}
else {
status = cipher_dealloc ( stream -> rtp_cipher ) ;
if ( status ) return status ;
}
if ( session -> stream_template && stream -> rtp_auth == session -> stream_template -> rtp_auth ) {
}
else {
status = auth_dealloc ( stream -> rtp_auth ) ;
if ( status ) return status ;
}
if ( session -> stream_template && stream -> limit == session -> stream_template -> limit ) {
}
else {
crypto_free ( stream -> limit ) ;
}
if ( session -> stream_template && stream -> rtcp_cipher == session -> stream_template -> rtcp_cipher ) {
}
else {
status = cipher_dealloc ( stream -> rtcp_cipher ) ;
if ( status ) return status ;
}
if ( session -> stream_template && stream -> rtcp_auth == session -> stream_template -> rtcp_auth ) {
}
else {
status = auth_dealloc ( stream -> rtcp_auth ) ;
if ( status ) return status ;
}
status = rdbx_dealloc ( & stream -> rtp_rdbx ) ;
if ( status ) return status ;
memset ( stream -> salt , 0 , SRTP_AEAD_SALT_LEN ) ;
memset ( stream -> c_salt , 0 , SRTP_AEAD_SALT_LEN ) ;
crypto_free ( stream ) ;
return err_status_ok ;
} |
5,575,425,611,513,297,000 | debian | 26 | 0 | static int dtls1_preprocess_fragment ( SSL * s , struct hm_header_st * msg_hdr ) {
size_t frag_off , frag_len , msg_len ;
msg_len = msg_hdr -> msg_len ;
frag_off = msg_hdr -> frag_off ;
frag_len = msg_hdr -> frag_len ;
if ( ( frag_off + frag_len ) > msg_len ) {
SSLerr ( SSL_F_DTLS1_PREPROCESS_FRAGMENT , SSL_R_EXCESSIVE_MESSAGE_SIZE ) ;
return SSL_AD_ILLEGAL_PARAMETER ;
}
if ( s -> d1 -> r_msg_hdr . frag_off == 0 ) {
if ( ! BUF_MEM_grow_clean ( s -> init_buf , msg_len + DTLS1_HM_HEADER_LENGTH ) ) {
SSLerr ( SSL_F_DTLS1_PREPROCESS_FRAGMENT , ERR_R_BUF_LIB ) ;
return SSL_AD_INTERNAL_ERROR ;
}
s -> s3 -> tmp . message_size = msg_len ;
s -> d1 -> r_msg_hdr . msg_len = msg_len ;
s -> s3 -> tmp . message_type = msg_hdr -> type ;
s -> d1 -> r_msg_hdr . type = msg_hdr -> type ;
s -> d1 -> r_msg_hdr . seq = msg_hdr -> seq ;
}
else if ( msg_len != s -> d1 -> r_msg_hdr . msg_len ) {
SSLerr ( SSL_F_DTLS1_PREPROCESS_FRAGMENT , SSL_R_EXCESSIVE_MESSAGE_SIZE ) ;
return SSL_AD_ILLEGAL_PARAMETER ;
}
return 0 ;
} |
7,549,435,794,356,072,000 | debian | 4 | 0 | static ASN1_BOOLEAN obj_to_asn1bool ( VALUE obj ) {
if ( NIL_P ( obj ) ) ossl_raise ( rb_eTypeError , "Can't convert nil into Boolean" ) ;
return RTEST ( obj ) ? 0xff : 0x0 ;
} |
-6,435,087,038,712,483,000 | debian | 52 | 0 | static inline int mpeg2_fast_decode_block_non_intra ( MpegEncContext * s , int16_t * block , int n ) {
int level , i , j , run ;
RLTable * rl = & ff_rl_mpeg1 ;
uint8_t * const scantable = s -> intra_scantable . permutated ;
const int qscale = s -> qscale ;
OPEN_READER ( re , & s -> gb ) ;
i = - 1 ;
UPDATE_CACHE ( re , & s -> gb ) ;
if ( ( ( int32_t ) GET_CACHE ( re , & s -> gb ) ) < 0 ) {
level = ( 3 * qscale ) >> 1 ;
if ( GET_CACHE ( re , & s -> gb ) & 0x40000000 ) level = - level ;
block [ 0 ] = level ;
i ++ ;
SKIP_BITS ( re , & s -> gb , 2 ) ;
if ( ( ( int32_t ) GET_CACHE ( re , & s -> gb ) ) <= ( int32_t ) 0xBFFFFFFF ) goto end ;
}
for ( ;
;
) {
GET_RL_VLC ( level , run , re , & s -> gb , rl -> rl_vlc [ 0 ] , TEX_VLC_BITS , 2 , 0 ) ;
if ( level != 0 ) {
i += run ;
j = scantable [ i ] ;
level = ( ( level * 2 + 1 ) * qscale ) >> 1 ;
level = ( level ^ SHOW_SBITS ( re , & s -> gb , 1 ) ) - SHOW_SBITS ( re , & s -> gb , 1 ) ;
SKIP_BITS ( re , & s -> gb , 1 ) ;
}
else {
run = SHOW_UBITS ( re , & s -> gb , 6 ) + 1 ;
LAST_SKIP_BITS ( re , & s -> gb , 6 ) ;
UPDATE_CACHE ( re , & s -> gb ) ;
level = SHOW_SBITS ( re , & s -> gb , 12 ) ;
SKIP_BITS ( re , & s -> gb , 12 ) ;
i += run ;
j = scantable [ i ] ;
if ( level < 0 ) {
level = ( ( - level * 2 + 1 ) * qscale ) >> 1 ;
level = - level ;
}
else {
level = ( ( level * 2 + 1 ) * qscale ) >> 1 ;
}
}
block [ j ] = level ;
if ( ( ( int32_t ) GET_CACHE ( re , & s -> gb ) ) <= ( int32_t ) 0xBFFFFFFF ) break ;
UPDATE_CACHE ( re , & s -> gb ) ;
}
end : LAST_SKIP_BITS ( re , & s -> gb , 2 ) ;
CLOSE_READER ( re , & s -> gb ) ;
s -> block_last_index [ n ] = i ;
return 0 ;
} |
-8,863,722,328,038,948,000 | debian | 56 | 0 | static gpg_err_code_t point_from_keyparam ( gcry_mpi_point_t * r_a , gcry_sexp_t keyparam , const char * name ) {
gcry_err_code_t ec ;
gcry_mpi_t a = NULL ;
gcry_mpi_point_t point ;
ec = mpi_from_keyparam ( & a , keyparam , name ) ;
if ( ec ) return ec ;
if ( a ) {
point = gcry_mpi_point_new ( 0 ) ;
ec = _gcry_ecc_os2ec ( point , a ) ;
mpi_free ( a ) ;
if ( ec ) {
gcry_mpi_point_release ( point ) ;
return ec ;
}
}
else {
char * tmpname ;
gcry_mpi_t x = NULL ;
gcry_mpi_t y = NULL ;
gcry_mpi_t z = NULL ;
tmpname = gcry_malloc ( strlen ( name ) + 2 + 1 ) ;
if ( ! tmpname ) return gpg_err_code_from_syserror ( ) ;
strcpy ( stpcpy ( tmpname , name ) , ".x" ) ;
ec = mpi_from_keyparam ( & x , keyparam , tmpname ) ;
if ( ec ) {
gcry_free ( tmpname ) ;
return ec ;
}
strcpy ( stpcpy ( tmpname , name ) , ".y" ) ;
ec = mpi_from_keyparam ( & y , keyparam , tmpname ) ;
if ( ec ) {
mpi_free ( x ) ;
gcry_free ( tmpname ) ;
return ec ;
}
strcpy ( stpcpy ( tmpname , name ) , ".z" ) ;
ec = mpi_from_keyparam ( & z , keyparam , tmpname ) ;
if ( ec ) {
mpi_free ( y ) ;
mpi_free ( x ) ;
gcry_free ( tmpname ) ;
return ec ;
}
if ( ! z ) z = mpi_set_ui ( NULL , 1 ) ;
if ( x && y ) point = gcry_mpi_point_snatch_set ( NULL , x , y , z ) ;
else {
mpi_free ( x ) ;
mpi_free ( y ) ;
mpi_free ( z ) ;
point = NULL ;
}
gcry_free ( tmpname ) ;
}
if ( point ) * r_a = point ;
return 0 ;
} |
4,489,017,523,191,997,000 | debian | 4 | 0 | static int dissect_h225_InfoRequest ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h225_InfoRequest , InfoRequest_sequence ) ;
return offset ;
} |
2,713,698,759,296,604,700 | debian | 240 | 1 | void ff_print_debug_info ( MpegEncContext * s , AVFrame * pict ) {
if ( s -> avctx -> hwaccel || ! pict || ! pict -> mb_type ) return ;
if ( s -> avctx -> debug & ( FF_DEBUG_SKIP | FF_DEBUG_QP | FF_DEBUG_MB_TYPE ) ) {
int x , y ;
av_log ( s -> avctx , AV_LOG_DEBUG , "New frame, type: " ) ;
switch ( pict -> pict_type ) {
case AV_PICTURE_TYPE_I : av_log ( s -> avctx , AV_LOG_DEBUG , "I\n" ) ;
break ;
case AV_PICTURE_TYPE_P : av_log ( s -> avctx , AV_LOG_DEBUG , "P\n" ) ;
break ;
case AV_PICTURE_TYPE_B : av_log ( s -> avctx , AV_LOG_DEBUG , "B\n" ) ;
break ;
case AV_PICTURE_TYPE_S : av_log ( s -> avctx , AV_LOG_DEBUG , "S\n" ) ;
break ;
case AV_PICTURE_TYPE_SI : av_log ( s -> avctx , AV_LOG_DEBUG , "SI\n" ) ;
break ;
case AV_PICTURE_TYPE_SP : av_log ( s -> avctx , AV_LOG_DEBUG , "SP\n" ) ;
break ;
}
for ( y = 0 ;
y < s -> mb_height ;
y ++ ) {
for ( x = 0 ;
x < s -> mb_width ;
x ++ ) {
if ( s -> avctx -> debug & FF_DEBUG_SKIP ) {
int count = s -> mbskip_table [ x + y * s -> mb_stride ] ;
if ( count > 9 ) count = 9 ;
av_log ( s -> avctx , AV_LOG_DEBUG , "%1d" , count ) ;
}
if ( s -> avctx -> debug & FF_DEBUG_QP ) {
av_log ( s -> avctx , AV_LOG_DEBUG , "%2d" , pict -> qscale_table [ x + y * s -> mb_stride ] ) ;
}
if ( s -> avctx -> debug & FF_DEBUG_MB_TYPE ) {
int mb_type = pict -> mb_type [ x + y * s -> mb_stride ] ;
if ( IS_PCM ( mb_type ) ) av_log ( s -> avctx , AV_LOG_DEBUG , "P" ) ;
else if ( IS_INTRA ( mb_type ) && IS_ACPRED ( mb_type ) ) av_log ( s -> avctx , AV_LOG_DEBUG , "A" ) ;
else if ( IS_INTRA4x4 ( mb_type ) ) av_log ( s -> avctx , AV_LOG_DEBUG , "i" ) ;
else if ( IS_INTRA16x16 ( mb_type ) ) av_log ( s -> avctx , AV_LOG_DEBUG , "I" ) ;
else if ( IS_DIRECT ( mb_type ) && IS_SKIP ( mb_type ) ) av_log ( s -> avctx , AV_LOG_DEBUG , "d" ) ;
else if ( IS_DIRECT ( mb_type ) ) av_log ( s -> avctx , AV_LOG_DEBUG , "D" ) ;
else if ( IS_GMC ( mb_type ) && IS_SKIP ( mb_type ) ) av_log ( s -> avctx , AV_LOG_DEBUG , "g" ) ;
else if ( IS_GMC ( mb_type ) ) av_log ( s -> avctx , AV_LOG_DEBUG , "G" ) ;
else if ( IS_SKIP ( mb_type ) ) av_log ( s -> avctx , AV_LOG_DEBUG , "S" ) ;
else if ( ! USES_LIST ( mb_type , 1 ) ) av_log ( s -> avctx , AV_LOG_DEBUG , ">" ) ;
else if ( ! USES_LIST ( mb_type , 0 ) ) av_log ( s -> avctx , AV_LOG_DEBUG , "<" ) ;
else {
assert ( USES_LIST ( mb_type , 0 ) && USES_LIST ( mb_type , 1 ) ) ;
av_log ( s -> avctx , AV_LOG_DEBUG , "X" ) ;
}
if ( IS_8X8 ( mb_type ) ) av_log ( s -> avctx , AV_LOG_DEBUG , "+" ) ;
else if ( IS_16X8 ( mb_type ) ) av_log ( s -> avctx , AV_LOG_DEBUG , "-" ) ;
else if ( IS_8X16 ( mb_type ) ) av_log ( s -> avctx , AV_LOG_DEBUG , "|" ) ;
else if ( IS_INTRA ( mb_type ) || IS_16X16 ( mb_type ) ) av_log ( s -> avctx , AV_LOG_DEBUG , " " ) ;
else av_log ( s -> avctx , AV_LOG_DEBUG , "?" ) ;
if ( IS_INTERLACED ( mb_type ) ) av_log ( s -> avctx , AV_LOG_DEBUG , "=" ) ;
else av_log ( s -> avctx , AV_LOG_DEBUG , " " ) ;
}
}
av_log ( s -> avctx , AV_LOG_DEBUG , "\n" ) ;
}
}
if ( ( s -> avctx -> debug & ( FF_DEBUG_VIS_QP | FF_DEBUG_VIS_MB_TYPE ) ) || ( s -> avctx -> debug_mv ) ) {
const int shift = 1 + s -> quarter_sample ;
int mb_y ;
uint8_t * ptr ;
int i ;
int h_chroma_shift , v_chroma_shift , block_height ;
const int width = s -> avctx -> width ;
const int height = s -> avctx -> height ;
const int mv_sample_log2 = 4 - pict -> motion_subsample_log2 ;
const int mv_stride = ( s -> mb_width << mv_sample_log2 ) + ( s -> codec_id == AV_CODEC_ID_H264 ? 0 : 1 ) ;
s -> low_delay = 0 ;
av_pix_fmt_get_chroma_sub_sample ( s -> avctx -> pix_fmt , & h_chroma_shift , & v_chroma_shift ) ;
for ( i = 0 ;
i < 3 ;
i ++ ) {
memcpy ( s -> visualization_buffer [ i ] , pict -> data [ i ] , ( i == 0 ) ? pict -> linesize [ i ] * height : pict -> linesize [ i ] * height >> v_chroma_shift ) ;
pict -> data [ i ] = s -> visualization_buffer [ i ] ;
}
pict -> type = FF_BUFFER_TYPE_COPY ;
ptr = pict -> data [ 0 ] ;
block_height = 16 >> v_chroma_shift ;
for ( mb_y = 0 ;
mb_y < s -> mb_height ;
mb_y ++ ) {
int mb_x ;
for ( mb_x = 0 ;
mb_x < s -> mb_width ;
mb_x ++ ) {
const int mb_index = mb_x + mb_y * s -> mb_stride ;
if ( ( s -> avctx -> debug_mv ) && pict -> motion_val ) {
int type ;
for ( type = 0 ;
type < 3 ;
type ++ ) {
int direction = 0 ;
switch ( type ) {
case 0 : if ( ( ! ( s -> avctx -> debug_mv & FF_DEBUG_VIS_MV_P_FOR ) ) || ( pict -> pict_type != AV_PICTURE_TYPE_P ) ) continue ;
direction = 0 ;
break ;
case 1 : if ( ( ! ( s -> avctx -> debug_mv & FF_DEBUG_VIS_MV_B_FOR ) ) || ( pict -> pict_type != AV_PICTURE_TYPE_B ) ) continue ;
direction = 0 ;
break ;
case 2 : if ( ( ! ( s -> avctx -> debug_mv & FF_DEBUG_VIS_MV_B_BACK ) ) || ( pict -> pict_type != AV_PICTURE_TYPE_B ) ) continue ;
direction = 1 ;
break ;
}
if ( ! USES_LIST ( pict -> mb_type [ mb_index ] , direction ) ) continue ;
if ( IS_8X8 ( pict -> mb_type [ mb_index ] ) ) {
int i ;
for ( i = 0 ;
i < 4 ;
i ++ ) {
int sx = mb_x * 16 + 4 + 8 * ( i & 1 ) ;
int sy = mb_y * 16 + 4 + 8 * ( i >> 1 ) ;
int xy = ( mb_x * 2 + ( i & 1 ) + ( mb_y * 2 + ( i >> 1 ) ) * mv_stride ) << ( mv_sample_log2 - 1 ) ;
int mx = ( pict -> motion_val [ direction ] [ xy ] [ 0 ] >> shift ) + sx ;
int my = ( pict -> motion_val [ direction ] [ xy ] [ 1 ] >> shift ) + sy ;
draw_arrow ( ptr , sx , sy , mx , my , width , height , s -> linesize , 100 ) ;
}
}
else if ( IS_16X8 ( pict -> mb_type [ mb_index ] ) ) {
int i ;
for ( i = 0 ;
i < 2 ;
i ++ ) {
int sx = mb_x * 16 + 8 ;
int sy = mb_y * 16 + 4 + 8 * i ;
int xy = ( mb_x * 2 + ( mb_y * 2 + i ) * mv_stride ) << ( mv_sample_log2 - 1 ) ;
int mx = ( pict -> motion_val [ direction ] [ xy ] [ 0 ] >> shift ) ;
int my = ( pict -> motion_val [ direction ] [ xy ] [ 1 ] >> shift ) ;
if ( IS_INTERLACED ( pict -> mb_type [ mb_index ] ) ) my *= 2 ;
draw_arrow ( ptr , sx , sy , mx + sx , my + sy , width , height , s -> linesize , 100 ) ;
}
}
else if ( IS_8X16 ( pict -> mb_type [ mb_index ] ) ) {
int i ;
for ( i = 0 ;
i < 2 ;
i ++ ) {
int sx = mb_x * 16 + 4 + 8 * i ;
int sy = mb_y * 16 + 8 ;
int xy = ( mb_x * 2 + i + mb_y * 2 * mv_stride ) << ( mv_sample_log2 - 1 ) ;
int mx = pict -> motion_val [ direction ] [ xy ] [ 0 ] >> shift ;
int my = pict -> motion_val [ direction ] [ xy ] [ 1 ] >> shift ;
if ( IS_INTERLACED ( pict -> mb_type [ mb_index ] ) ) my *= 2 ;
draw_arrow ( ptr , sx , sy , mx + sx , my + sy , width , height , s -> linesize , 100 ) ;
}
}
else {
int sx = mb_x * 16 + 8 ;
int sy = mb_y * 16 + 8 ;
int xy = ( mb_x + mb_y * mv_stride ) << mv_sample_log2 ;
int mx = pict -> motion_val [ direction ] [ xy ] [ 0 ] >> shift + sx ;
int my = pict -> motion_val [ direction ] [ xy ] [ 1 ] >> shift + sy ;
draw_arrow ( ptr , sx , sy , mx , my , width , height , s -> linesize , 100 ) ;
}
}
}
if ( ( s -> avctx -> debug & FF_DEBUG_VIS_QP ) && pict -> motion_val ) {
uint64_t c = ( pict -> qscale_table [ mb_index ] * 128 / 31 ) * 0x0101010101010101ULL ;
int y ;
for ( y = 0 ;
y < block_height ;
y ++ ) {
* ( uint64_t * ) ( pict -> data [ 1 ] + 8 * mb_x + ( block_height * mb_y + y ) * pict -> linesize [ 1 ] ) = c ;
* ( uint64_t * ) ( pict -> data [ 2 ] + 8 * mb_x + ( block_height * mb_y + y ) * pict -> linesize [ 2 ] ) = c ;
}
}
if ( ( s -> avctx -> debug & FF_DEBUG_VIS_MB_TYPE ) && pict -> motion_val ) {
int mb_type = pict -> mb_type [ mb_index ] ;
uint64_t u , v ;
int y ;
# define COLOR ( theta , r ) u = ( int ) ( 128 + r * cos ( theta * 3.141592 / 180 ) ) ;
v = ( int ) ( 128 + r * sin ( theta * 3.141592 / 180 ) ) ;
u = v = 128 ;
if ( IS_PCM ( mb_type ) ) {
COLOR ( 120 , 48 ) }
else if ( ( IS_INTRA ( mb_type ) && IS_ACPRED ( mb_type ) ) || IS_INTRA16x16 ( mb_type ) ) {
COLOR ( 30 , 48 ) }
else if ( IS_INTRA4x4 ( mb_type ) ) {
COLOR ( 90 , 48 ) }
else if ( IS_DIRECT ( mb_type ) && IS_SKIP ( mb_type ) ) {
}
else if ( IS_DIRECT ( mb_type ) ) {
COLOR ( 150 , 48 ) }
else if ( IS_GMC ( mb_type ) && IS_SKIP ( mb_type ) ) {
COLOR ( 170 , 48 ) }
else if ( IS_GMC ( mb_type ) ) {
COLOR ( 190 , 48 ) }
else if ( IS_SKIP ( mb_type ) ) {
}
else if ( ! USES_LIST ( mb_type , 1 ) ) {
COLOR ( 240 , 48 ) }
else if ( ! USES_LIST ( mb_type , 0 ) ) {
COLOR ( 0 , 48 ) }
else {
assert ( USES_LIST ( mb_type , 0 ) && USES_LIST ( mb_type , 1 ) ) ;
COLOR ( 300 , 48 ) }
u *= 0x0101010101010101ULL ;
v *= 0x0101010101010101ULL ;
for ( y = 0 ;
y < block_height ;
y ++ ) {
* ( uint64_t * ) ( pict -> data [ 1 ] + 8 * mb_x + ( block_height * mb_y + y ) * pict -> linesize [ 1 ] ) = u ;
* ( uint64_t * ) ( pict -> data [ 2 ] + 8 * mb_x + ( block_height * mb_y + y ) * pict -> linesize [ 2 ] ) = v ;
}
if ( IS_8X8 ( mb_type ) || IS_16X8 ( mb_type ) ) {
* ( uint64_t * ) ( pict -> data [ 0 ] + 16 * mb_x + 0 + ( 16 * mb_y + 8 ) * pict -> linesize [ 0 ] ) ^= 0x8080808080808080ULL ;
* ( uint64_t * ) ( pict -> data [ 0 ] + 16 * mb_x + 8 + ( 16 * mb_y + 8 ) * pict -> linesize [ 0 ] ) ^= 0x8080808080808080ULL ;
}
if ( IS_8X8 ( mb_type ) || IS_8X16 ( mb_type ) ) {
for ( y = 0 ;
y < 16 ;
y ++ ) pict -> data [ 0 ] [ 16 * mb_x + 8 + ( 16 * mb_y + y ) * pict -> linesize [ 0 ] ] ^= 0x80 ;
}
if ( IS_8X8 ( mb_type ) && mv_sample_log2 >= 2 ) {
int dm = 1 << ( mv_sample_log2 - 2 ) ;
for ( i = 0 ;
i < 4 ;
i ++ ) {
int sx = mb_x * 16 + 8 * ( i & 1 ) ;
int sy = mb_y * 16 + 8 * ( i >> 1 ) ;
int xy = ( mb_x * 2 + ( i & 1 ) + ( mb_y * 2 + ( i >> 1 ) ) * mv_stride ) << ( mv_sample_log2 - 1 ) ;
int32_t * mv = ( int32_t * ) & pict -> motion_val [ 0 ] [ xy ] ;
if ( mv [ 0 ] != mv [ dm ] || mv [ dm * mv_stride ] != mv [ dm * ( mv_stride + 1 ) ] ) for ( y = 0 ;
y < 8 ;
y ++ ) pict -> data [ 0 ] [ sx + 4 + ( sy + y ) * pict -> linesize [ 0 ] ] ^= 0x80 ;
if ( mv [ 0 ] != mv [ dm * mv_stride ] || mv [ dm ] != mv [ dm * ( mv_stride + 1 ) ] ) * ( uint64_t * ) ( pict -> data [ 0 ] + sx + ( sy + 4 ) * pict -> linesize [ 0 ] ) ^= 0x8080808080808080ULL ;
}
}
if ( IS_INTERLACED ( mb_type ) && s -> codec_id == AV_CODEC_ID_H264 ) {
}
}
s -> mbskip_table [ mb_index ] = 0 ;
}
}
}
} |
-7,187,272,991,279,784,000 | debian | 6 | 0 | static void sun4m_register_types ( void ) {
type_register_static ( & idreg_info ) ;
type_register_static ( & afx_info ) ;
type_register_static ( & prom_info ) ;
type_register_static ( & ram_info ) ;
} |
1,760,449,185,745,615,400 | debian | 4 | 0 | void TSTextLogObjectFlush ( TSTextLogObject the_object ) {
sdk_assert ( sdk_sanity_check_iocore_structure ( the_object ) == TS_SUCCESS ) ;
( ( TextLogObject * ) the_object ) -> force_new_buffer ( ) ;
} |
1,414,661,670,117,003,800 | debian | 12 | 0 | static struct ewah_bitmap * lookup_stored_bitmap ( struct stored_bitmap * st ) {
struct ewah_bitmap * parent ;
struct ewah_bitmap * composed ;
if ( st -> xor == NULL ) return st -> root ;
composed = ewah_pool_new ( ) ;
parent = lookup_stored_bitmap ( st -> xor ) ;
ewah_xor ( st -> root , parent , composed ) ;
ewah_pool_free ( st -> root ) ;
st -> root = composed ;
st -> xor = NULL ;
return composed ;
} |
7,092,216,800,726,730,000 | debian | 4 | 0 | static int dissect_h245_SEQUENCE_OF_DataApplicationCapability ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence_of ( tvb , offset , actx , tree , hf_index , ett_h245_SEQUENCE_OF_DataApplicationCapability , SEQUENCE_OF_DataApplicationCapability_sequence_of ) ;
return offset ;
} |
3,599,206,110,384,554,500 | debian | 7 | 0 | static ossl_inline sk_ ## t1 ## _compfunc sk_ ## t1 ## _set_cmp_func ( STACK_OF ( t1 ) * sk , sk_ ## t1 ## _compfunc compare ) {
return ( sk_ ## t1 ## _compfunc ) OPENSSL_sk_set_cmp_func ( ( OPENSSL_STACK * ) sk , ( OPENSSL_sk_compfunc ) compare ) ;
}
# define DEFINE_SPECIAL_STACK_OF ( t1 , t2 ) SKM_DEFINE_STACK_OF ( t1 , t2 , t2 ) # define DEFINE_STACK_OF ( t ) SKM_DEFINE_STACK_OF ( t , t , t ) # define DEFINE_SPECIAL_STACK_OF_CONST ( t1 , t2 ) SKM_DEFINE_STACK_OF ( t1 , const t2 , t2 ) # define DEFINE_STACK_OF_CONST ( t ) SKM_DEFINE_STACK_OF ( t , const t , t ) typedef char * OPENSSL_STRING ;
typedef const char * OPENSSL_CSTRING ;
DEFINE_SPECIAL_STACK_OF ( OPENSSL_STRING , char ) DEFINE_SPECIAL_STACK_OF_CONST ( OPENSSL_CSTRING , char ) typedef void * OPENSSL_BLOCK ;
DEFINE_SPECIAL_STACK_OF ( OPENSSL_BLOCK , void ) |
3,919,353,496,513,339,400 | chrome | 127 | 0 | static void t42_parse_charstrings ( T42_Face face , T42_Loader loader ) {
T42_Parser parser = & loader -> parser ;
PS_Table code_table = & loader -> charstrings ;
PS_Table name_table = & loader -> glyph_names ;
PS_Table swap_table = & loader -> swap_table ;
FT_Memory memory = parser -> root . memory ;
FT_Error error ;
PSAux_Service psaux = ( PSAux_Service ) face -> psaux ;
FT_Byte * cur ;
FT_Byte * limit = parser -> root . limit ;
FT_UInt n ;
FT_UInt notdef_index = 0 ;
FT_Byte notdef_found = 0 ;
T1_Skip_Spaces ( parser ) ;
if ( parser -> root . cursor >= limit ) {
FT_ERROR ( ( "t42_parse_charstrings: out of bounds\n" ) ) ;
error = FT_THROW ( Invalid_File_Format ) ;
goto Fail ;
}
if ( ft_isdigit ( * parser -> root . cursor ) ) {
loader -> num_glyphs = ( FT_UInt ) T1_ToInt ( parser ) ;
if ( parser -> root . error ) return ;
}
else if ( * parser -> root . cursor == '<' ) {
FT_UInt count = 0 ;
T1_Skip_PS_Token ( parser ) ;
if ( parser -> root . error ) return ;
T1_Skip_Spaces ( parser ) ;
cur = parser -> root . cursor ;
while ( parser -> root . cursor < limit ) {
if ( * parser -> root . cursor == '/' ) count ++ ;
else if ( * parser -> root . cursor == '>' ) {
loader -> num_glyphs = count ;
parser -> root . cursor = cur ;
break ;
}
T1_Skip_PS_Token ( parser ) ;
if ( parser -> root . error ) return ;
T1_Skip_Spaces ( parser ) ;
}
}
else {
FT_ERROR ( ( "t42_parse_charstrings: invalid token\n" ) ) ;
error = FT_THROW ( Invalid_File_Format ) ;
goto Fail ;
}
if ( parser -> root . cursor >= limit ) {
FT_ERROR ( ( "t42_parse_charstrings: out of bounds\n" ) ) ;
error = FT_THROW ( Invalid_File_Format ) ;
goto Fail ;
}
error = psaux -> ps_table_funcs -> init ( code_table , loader -> num_glyphs , memory ) ;
if ( error ) goto Fail ;
error = psaux -> ps_table_funcs -> init ( name_table , loader -> num_glyphs , memory ) ;
if ( error ) goto Fail ;
error = psaux -> ps_table_funcs -> init ( swap_table , 4 , memory ) ;
if ( error ) goto Fail ;
n = 0 ;
for ( ;
;
) {
T1_Skip_Spaces ( parser ) ;
cur = parser -> root . cursor ;
if ( cur >= limit ) break ;
if ( * cur == 'e' && cur + 3 < limit && cur [ 1 ] == 'n' && cur [ 2 ] == 'd' && t42_is_space ( cur [ 3 ] ) ) break ;
if ( * cur == '>' ) break ;
T1_Skip_PS_Token ( parser ) ;
if ( parser -> root . error ) return ;
if ( * cur == '/' ) {
FT_PtrDist len ;
if ( cur + 1 >= limit ) {
FT_ERROR ( ( "t42_parse_charstrings: out of bounds\n" ) ) ;
error = FT_THROW ( Invalid_File_Format ) ;
goto Fail ;
}
cur ++ ;
len = parser -> root . cursor - cur ;
error = T1_Add_Table ( name_table , n , cur , len + 1 ) ;
if ( error ) goto Fail ;
name_table -> elements [ n ] [ len ] = '\0' ;
if ( * cur == '.' && ft_strcmp ( ".notdef" , ( const char * ) ( name_table -> elements [ n ] ) ) == 0 ) {
notdef_index = n ;
notdef_found = 1 ;
}
T1_Skip_Spaces ( parser ) ;
cur = parser -> root . cursor ;
( void ) T1_ToInt ( parser ) ;
if ( parser -> root . cursor >= limit ) {
FT_ERROR ( ( "t42_parse_charstrings: out of bounds\n" ) ) ;
error = FT_THROW ( Invalid_File_Format ) ;
goto Fail ;
}
len = parser -> root . cursor - cur ;
error = T1_Add_Table ( code_table , n , cur , len + 1 ) ;
if ( error ) goto Fail ;
code_table -> elements [ n ] [ len ] = '\0' ;
n ++ ;
if ( n >= loader -> num_glyphs ) break ;
}
}
loader -> num_glyphs = n ;
if ( ! notdef_found ) {
FT_ERROR ( ( "t42_parse_charstrings: no /.notdef glyph\n" ) ) ;
error = FT_THROW ( Invalid_File_Format ) ;
goto Fail ;
}
if ( ft_strcmp ( ( const char * ) ".notdef" , ( const char * ) name_table -> elements [ 0 ] ) ) {
error = T1_Add_Table ( swap_table , 0 , name_table -> elements [ 0 ] , name_table -> lengths [ 0 ] ) ;
if ( error ) goto Fail ;
error = T1_Add_Table ( swap_table , 1 , code_table -> elements [ 0 ] , code_table -> lengths [ 0 ] ) ;
if ( error ) goto Fail ;
error = T1_Add_Table ( swap_table , 2 , name_table -> elements [ notdef_index ] , name_table -> lengths [ notdef_index ] ) ;
if ( error ) goto Fail ;
error = T1_Add_Table ( swap_table , 3 , code_table -> elements [ notdef_index ] , code_table -> lengths [ notdef_index ] ) ;
if ( error ) goto Fail ;
error = T1_Add_Table ( name_table , notdef_index , swap_table -> elements [ 0 ] , swap_table -> lengths [ 0 ] ) ;
if ( error ) goto Fail ;
error = T1_Add_Table ( code_table , notdef_index , swap_table -> elements [ 1 ] , swap_table -> lengths [ 1 ] ) ;
if ( error ) goto Fail ;
error = T1_Add_Table ( name_table , 0 , swap_table -> elements [ 2 ] , swap_table -> lengths [ 2 ] ) ;
if ( error ) goto Fail ;
error = T1_Add_Table ( code_table , 0 , swap_table -> elements [ 3 ] , swap_table -> lengths [ 3 ] ) ;
if ( error ) goto Fail ;
}
return ;
Fail : parser -> root . error = error ;
} |
-4,034,210,238,312,761,000 | debian | 4 | 0 | void pdf_update_xobject_contents ( fz_context * ctx , pdf_document * doc , pdf_xobject * form , fz_buffer * buffer ) {
pdf_update_stream ( ctx , doc , form -> obj , buffer , 0 ) ;
form -> iteration ++ ;
} |
2,335,116,444,795,821,000 | debian | 20 | 0 | static bool config_filter_match_rest ( const struct config_filter * mask , const struct config_filter * filter ) {
bool matched ;
if ( mask -> local_name != NULL ) {
if ( filter -> local_name == NULL ) return FALSE ;
T_BEGIN {
matched = config_filter_match_local_name ( mask , filter -> local_name ) ;
}
T_END ;
if ( ! matched ) return FALSE ;
}
if ( mask -> remote_bits != 0 ) {
if ( filter -> remote_bits == 0 ) return FALSE ;
if ( ! net_is_in_network ( & filter -> remote_net , & mask -> remote_net , mask -> remote_bits ) ) return FALSE ;
}
if ( mask -> local_bits != 0 ) {
if ( filter -> local_bits == 0 ) return FALSE ;
if ( ! net_is_in_network ( & filter -> local_net , & mask -> local_net , mask -> local_bits ) ) return FALSE ;
}
return TRUE ;
} |
6,120,640,898,537,304,000 | debian | 96 | 1 | static void pdf_process_extgstate ( fz_context * ctx , pdf_processor * proc , pdf_csi * csi , pdf_obj * dict ) {
pdf_obj * obj ;
obj = pdf_dict_get ( ctx , dict , PDF_NAME_LW ) ;
if ( pdf_is_number ( ctx , obj ) && proc -> op_w ) proc -> op_w ( ctx , proc , pdf_to_real ( ctx , obj ) ) ;
obj = pdf_dict_get ( ctx , dict , PDF_NAME_LC ) ;
if ( pdf_is_int ( ctx , obj ) && proc -> op_J ) proc -> op_J ( ctx , proc , fz_clampi ( pdf_to_int ( ctx , obj ) , 0 , 2 ) ) ;
obj = pdf_dict_get ( ctx , dict , PDF_NAME_LJ ) ;
if ( pdf_is_int ( ctx , obj ) && proc -> op_j ) proc -> op_j ( ctx , proc , fz_clampi ( pdf_to_int ( ctx , obj ) , 0 , 2 ) ) ;
obj = pdf_dict_get ( ctx , dict , PDF_NAME_ML ) ;
if ( pdf_is_number ( ctx , obj ) && proc -> op_M ) proc -> op_M ( ctx , proc , pdf_to_real ( ctx , obj ) ) ;
obj = pdf_dict_get ( ctx , dict , PDF_NAME_D ) ;
if ( pdf_is_array ( ctx , obj ) && proc -> op_d ) {
pdf_obj * dash_array = pdf_array_get ( ctx , obj , 0 ) ;
pdf_obj * dash_phase = pdf_array_get ( ctx , obj , 1 ) ;
proc -> op_d ( ctx , proc , dash_array , pdf_to_real ( ctx , dash_phase ) ) ;
}
obj = pdf_dict_get ( ctx , dict , PDF_NAME_RI ) ;
if ( pdf_is_name ( ctx , obj ) && proc -> op_ri ) proc -> op_ri ( ctx , proc , pdf_to_name ( ctx , obj ) ) ;
obj = pdf_dict_get ( ctx , dict , PDF_NAME_FL ) ;
if ( pdf_is_number ( ctx , obj ) && proc -> op_i ) proc -> op_i ( ctx , proc , pdf_to_real ( ctx , obj ) ) ;
obj = pdf_dict_get ( ctx , dict , PDF_NAME_Font ) ;
if ( pdf_is_array ( ctx , obj ) && proc -> op_Tf ) {
pdf_obj * font_ref = pdf_array_get ( ctx , obj , 0 ) ;
pdf_obj * font_size = pdf_array_get ( ctx , obj , 1 ) ;
pdf_font_desc * font = load_font_or_hail_mary ( ctx , csi -> doc , csi -> rdb , font_ref , 0 , csi -> cookie ) ;
fz_try ( ctx ) proc -> op_Tf ( ctx , proc , "ExtGState" , font , pdf_to_real ( ctx , font_size ) ) ;
fz_always ( ctx ) pdf_drop_font ( ctx , font ) ;
fz_catch ( ctx ) fz_rethrow ( ctx ) ;
}
obj = pdf_dict_get ( ctx , dict , PDF_NAME_OP ) ;
if ( pdf_is_bool ( ctx , obj ) && proc -> op_gs_OP ) proc -> op_gs_OP ( ctx , proc , pdf_to_bool ( ctx , obj ) ) ;
obj = pdf_dict_get ( ctx , dict , PDF_NAME_op ) ;
if ( pdf_is_bool ( ctx , obj ) && proc -> op_gs_op ) proc -> op_gs_op ( ctx , proc , pdf_to_bool ( ctx , obj ) ) ;
obj = pdf_dict_get ( ctx , dict , PDF_NAME_OPM ) ;
if ( pdf_is_int ( ctx , obj ) && proc -> op_gs_OPM ) proc -> op_gs_OPM ( ctx , proc , pdf_to_int ( ctx , obj ) ) ;
obj = pdf_dict_get ( ctx , dict , PDF_NAME_UseBlackPtComp ) ;
if ( pdf_is_name ( ctx , obj ) && proc -> op_gs_UseBlackPtComp ) proc -> op_gs_UseBlackPtComp ( ctx , proc , obj ) ;
obj = pdf_dict_get ( ctx , dict , PDF_NAME_TR2 ) ;
if ( pdf_is_name ( ctx , obj ) ) if ( ! pdf_name_eq ( ctx , obj , PDF_NAME_Identity ) && ! pdf_name_eq ( ctx , obj , PDF_NAME_Default ) ) fz_warn ( ctx , "ignoring transfer function" ) ;
if ( ! obj ) {
pdf_obj * tr = pdf_dict_get ( ctx , dict , PDF_NAME_TR ) ;
if ( pdf_is_name ( ctx , tr ) ) if ( ! pdf_name_eq ( ctx , tr , PDF_NAME_Identity ) ) fz_warn ( ctx , "ignoring transfer function" ) ;
}
obj = pdf_dict_get ( ctx , dict , PDF_NAME_CA ) ;
if ( pdf_is_number ( ctx , obj ) && proc -> op_gs_CA ) proc -> op_gs_CA ( ctx , proc , pdf_to_real ( ctx , obj ) ) ;
obj = pdf_dict_get ( ctx , dict , PDF_NAME_ca ) ;
if ( pdf_is_number ( ctx , obj ) && proc -> op_gs_ca ) proc -> op_gs_ca ( ctx , proc , pdf_to_real ( ctx , obj ) ) ;
obj = pdf_dict_get ( ctx , dict , PDF_NAME_BM ) ;
if ( pdf_is_array ( ctx , obj ) ) obj = pdf_array_get ( ctx , obj , 0 ) ;
if ( pdf_is_name ( ctx , obj ) && proc -> op_gs_BM ) proc -> op_gs_BM ( ctx , proc , pdf_to_name ( ctx , obj ) ) ;
obj = pdf_dict_get ( ctx , dict , PDF_NAME_SMask ) ;
if ( proc -> op_gs_SMask ) {
if ( pdf_is_dict ( ctx , obj ) ) {
pdf_xobject * xobj ;
pdf_obj * group , * s , * bc , * tr ;
float softmask_bc [ FZ_MAX_COLORS ] ;
fz_colorspace * colorspace ;
int colorspace_n = 1 ;
int k , luminosity ;
fz_var ( xobj ) ;
group = pdf_dict_get ( ctx , obj , PDF_NAME_G ) ;
if ( ! group ) fz_throw ( ctx , FZ_ERROR_SYNTAX , "cannot load softmask xobject (%d 0 R)" , pdf_to_num ( ctx , obj ) ) ;
xobj = pdf_load_xobject ( ctx , csi -> doc , group ) ;
fz_try ( ctx ) {
colorspace = pdf_xobject_colorspace ( ctx , xobj ) ;
if ( colorspace ) colorspace_n = fz_colorspace_n ( ctx , colorspace ) ;
for ( k = 0 ;
k < colorspace_n ;
k ++ ) softmask_bc [ k ] = 0 ;
if ( fz_colorspace_is_cmyk ( ctx , colorspace ) ) softmask_bc [ 3 ] = 1.0f ;
fz_drop_colorspace ( ctx , colorspace ) ;
bc = pdf_dict_get ( ctx , obj , PDF_NAME_BC ) ;
if ( pdf_is_array ( ctx , bc ) ) {
for ( k = 0 ;
k < colorspace_n ;
k ++ ) softmask_bc [ k ] = pdf_to_real ( ctx , pdf_array_get ( ctx , bc , k ) ) ;
}
s = pdf_dict_get ( ctx , obj , PDF_NAME_S ) ;
if ( pdf_name_eq ( ctx , s , PDF_NAME_Luminosity ) ) luminosity = 1 ;
else luminosity = 0 ;
tr = pdf_dict_get ( ctx , obj , PDF_NAME_TR ) ;
if ( tr && ! pdf_name_eq ( ctx , tr , PDF_NAME_Identity ) ) fz_warn ( ctx , "ignoring transfer function" ) ;
proc -> op_gs_SMask ( ctx , proc , xobj , csi -> rdb , softmask_bc , luminosity ) ;
}
fz_always ( ctx ) {
pdf_drop_xobject ( ctx , xobj ) ;
}
fz_catch ( ctx ) {
fz_rethrow ( ctx ) ;
}
}
else if ( pdf_is_name ( ctx , obj ) && pdf_name_eq ( ctx , obj , PDF_NAME_None ) ) {
proc -> op_gs_SMask ( ctx , proc , NULL , NULL , NULL , 0 ) ;
}
}
} |
2,064,081,176,034,684,200 | debian | 43 | 0 | static int matroska_read_seek ( AVFormatContext * s , int stream_index , int64_t timestamp , int flags ) {
MatroskaDemuxContext * matroska = s -> priv_data ;
MatroskaTrack * tracks = NULL ;
AVStream * st = s -> streams [ stream_index ] ;
int i , index , index_sub , index_min ;
if ( matroska -> cues_parsing_deferred ) {
matroska_parse_cues ( matroska ) ;
matroska -> cues_parsing_deferred = 0 ;
}
if ( ! st -> nb_index_entries ) return 0 ;
timestamp = FFMAX ( timestamp , st -> index_entries [ 0 ] . timestamp ) ;
if ( ( index = av_index_search_timestamp ( st , timestamp , flags ) ) < 0 ) {
avio_seek ( s -> pb , st -> index_entries [ st -> nb_index_entries - 1 ] . pos , SEEK_SET ) ;
matroska -> current_id = 0 ;
while ( ( index = av_index_search_timestamp ( st , timestamp , flags ) ) < 0 ) {
matroska_clear_queue ( matroska ) ;
if ( matroska_parse_cluster ( matroska ) < 0 ) break ;
}
}
matroska_clear_queue ( matroska ) ;
if ( index < 0 ) return 0 ;
index_min = index ;
tracks = matroska -> tracks . elem ;
for ( i = 0 ;
i < matroska -> tracks . nb_elem ;
i ++ ) {
tracks [ i ] . audio . pkt_cnt = 0 ;
tracks [ i ] . audio . sub_packet_cnt = 0 ;
tracks [ i ] . audio . buf_timecode = AV_NOPTS_VALUE ;
tracks [ i ] . end_timecode = 0 ;
if ( tracks [ i ] . type == MATROSKA_TRACK_TYPE_SUBTITLE && tracks [ i ] . stream -> discard != AVDISCARD_ALL ) {
index_sub = av_index_search_timestamp ( tracks [ i ] . stream , st -> index_entries [ index ] . timestamp , AVSEEK_FLAG_BACKWARD ) ;
if ( index_sub >= 0 && st -> index_entries [ index_sub ] . pos < st -> index_entries [ index_min ] . pos && st -> index_entries [ index ] . timestamp - st -> index_entries [ index_sub ] . timestamp < 30000000000 / matroska -> time_scale ) index_min = index_sub ;
}
}
avio_seek ( s -> pb , st -> index_entries [ index_min ] . pos , SEEK_SET ) ;
matroska -> current_id = 0 ;
matroska -> skip_to_keyframe = ! ( flags & AVSEEK_FLAG_ANY ) ;
matroska -> skip_to_timecode = st -> index_entries [ index ] . timestamp ;
matroska -> done = 0 ;
ff_update_cur_dts ( s , st , st -> index_entries [ index ] . timestamp ) ;
return 0 ;
} |
415,966,375,198,131,140 | debian | 10 | 0 | int mprintf_clock_stats ( sockaddr_u * addr , const char * fmt , ... ) {
va_list ap ;
int rc ;
char msg [ 512 ] ;
va_start ( ap , fmt ) ;
rc = mvsnprintf ( msg , sizeof ( msg ) , fmt , ap ) ;
va_end ( ap ) ;
if ( stats_control ) record_clock_stats ( addr , msg ) ;
return rc ;
} |
-5,249,292,504,513,104,000 | debian | 9 | 0 | char * xmlrpc_time2date ( char * buf , time_t t ) {
char timebuf [ XMLRPC_BUFSIZE ] ;
struct tm * tm ;
* buf = '\0' ;
tm = localtime ( & t ) ;
strftime ( timebuf , XMLRPC_BUFSIZE - 1 , "%Y%m%dT%I:%M:%S" , tm ) ;
snprintf ( buf , XMLRPC_BUFSIZE , "<dateTime.iso8601>%s</dateTime.iso8601>" , timebuf ) ;
return buf ;
} |
2,058,562,589,071,273,500 | chrome | 10 | 0 | int main ( int argc , char * * argv ) {
struct event signal_int ;
struct event_base * base = event_base_new ( ) ;
event_set ( & signal_int , SIGINT , EV_SIGNAL | EV_PERSIST , signal_cb , & signal_int ) ;
event_base_set ( base , & signal_int ) ;
event_add ( & signal_int , NULL ) ;
event_base_dispatch ( base ) ;
event_base_free ( base ) ;
return ( 0 ) ;
} |
4,489,017,523,191,997,000 | debian | 9 | 1 | static int dissect_h225_H221NonStandard ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
# line 790 "./asn1/h225/h225.cnf" t35CountryCode = 0 ;
t35Extension = 0 ;
manufacturerCode = 0 ;
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h225_H221NonStandard , H221NonStandard_sequence ) ;
# line 794 "./asn1/h225/h225.cnf" h221NonStandard = ( ( t35CountryCode * 256 ) + t35Extension ) * 65536 + manufacturerCode ;
proto_tree_add_uint ( tree , hf_h221Manufacturer , tvb , ( offset >> 3 ) - 4 , 4 , h221NonStandard ) ;
return offset ;
} |
355,220,887,711,506,900 | debian | 17 | 0 | static bool gincost_opexpr ( PlannerInfo * root , IndexOptInfo * index , IndexQualInfo * qinfo , GinQualCounts * counts ) {
int indexcol = qinfo -> indexcol ;
Oid clause_op = qinfo -> clause_op ;
Node * operand = qinfo -> other_operand ;
if ( ! qinfo -> varonleft ) {
clause_op = get_commutator ( clause_op ) ;
}
operand = estimate_expression_value ( root , operand ) ;
if ( IsA ( operand , RelabelType ) ) operand = ( Node * ) ( ( RelabelType * ) operand ) -> arg ;
if ( ! IsA ( operand , Const ) ) {
counts -> exactEntries ++ ;
counts -> searchEntries ++ ;
return true ;
}
if ( ( ( Const * ) operand ) -> constisnull ) return false ;
return gincost_pattern ( index , indexcol , clause_op , ( ( Const * ) operand ) -> constvalue , counts ) ;
} |
-5,861,178,779,585,942,000 | debian | 11 | 0 | int mask2plen ( uint32_t mask ) {
uint32_t bitmasks [ 33 ] = {
0x00000000 , 0x80000000 , 0xc0000000 , 0xe0000000 , 0xf0000000 , 0xf8000000 , 0xfc000000 , 0xfe000000 , 0xff000000 , 0xff800000 , 0xffc00000 , 0xffe00000 , 0xfff00000 , 0xfff80000 , 0xfffc0000 , 0xfffe0000 , 0xffff0000 , 0xffff8000 , 0xffffc000 , 0xffffe000 , 0xfffff000 , 0xfffff800 , 0xfffffc00 , 0xfffffe00 , 0xffffff00 , 0xffffff80 , 0xffffffc0 , 0xffffffe0 , 0xfffffff0 , 0xfffffff8 , 0xfffffffc , 0xfffffffe , 0xffffffff }
;
int prefix_len = 32 ;
while ( prefix_len >= 0 ) {
if ( bitmasks [ prefix_len ] == mask ) break ;
prefix_len -- ;
}
return ( prefix_len ) ;
} |
2,419,147,764,757,351,400 | debian | 4 | 0 | static unsigned virtio_s390_get_features ( void * opaque ) {
VirtIOS390Device * dev = ( VirtIOS390Device * ) opaque ;
return dev -> host_features ;
} |
-4,844,249,011,537,706,000 | chrome | 4 | 1 | static void sbr_hf_apply_noise_3 ( float ( * Y ) [ 2 ] , const float * s_m , const float * q_filt , int noise , int kx , int m_max ) {
float phi_sign = 1 - 2 * ( kx & 1 ) ;
sbr_hf_apply_noise ( Y , s_m , q_filt , noise , 0.0 , - phi_sign , m_max ) ;
} |
3,584,320,764,213,684,000 | debian | 22 | 0 | static int parse_CSortSet ( tvbuff_t * tvb , int offset , proto_tree * parent_tree , proto_tree * pad_tree , const char * fmt , ... ) {
guint32 count , i ;
proto_item * item ;
proto_tree * tree ;
const char * txt ;
va_list ap ;
va_start ( ap , fmt ) ;
txt = wmem_strdup_vprintf ( wmem_packet_scope ( ) , fmt , ap ) ;
va_end ( ap ) ;
tree = proto_tree_add_subtree ( parent_tree , tvb , offset , 0 , ett_CSortSet , & item , txt ) ;
count = tvb_get_letohl ( tvb , offset ) ;
proto_tree_add_uint ( tree , hf_mswsp_cscortset_count , tvb , offset , 4 , count ) ;
offset += 4 ;
for ( i = 0 ;
i < count ;
i ++ ) {
offset = parse_padding ( tvb , offset , 4 , tree , "padding_sortArray[%u]" , i ) ;
offset = parse_CSort ( tvb , offset , tree , pad_tree , "sortArray[%u]" , i ) ;
}
proto_item_set_end ( item , tvb , offset ) ;
return offset ;
} |
-5,493,081,488,206,620,000 | debian | 40 | 0 | static const char * update_rule_action ( cmd_parms * cmd , directory_config * dcfg , const char * p1 , const char * p2 , int offset ) {
char * my_error_msg = NULL ;
msre_rule * rule = NULL ;
msre_actionset * new_actionset = NULL ;
msre_ruleset * ruleset = dcfg -> ruleset ;
extern msc_engine * modsecurity ;
if ( ( ruleset == NULL ) || ( ruleset == NOT_SET_P ) ) {
return NULL ;
}
# ifdef DEBUG_CONF ap_log_perror ( APLOG_MARK , APLOG_STARTUP | APLOG_NOERRNO , 0 , cmd -> pool , "Update rule id=\"%s\" with action \"%s\"." , p1 , p2 ) ;
# endif rule = msre_ruleset_fetch_rule ( ruleset , p1 , offset ) ;
if ( rule == NULL ) {
# ifdef DEBUG_CONF ap_log_perror ( APLOG_MARK , APLOG_STARTUP | APLOG_NOERRNO , 0 , cmd -> pool , "Update rule id=\"%s\" with action \"%s\" failed: Rule not found." , p1 , p2 ) ;
# endif return NULL ;
}
if ( rule -> actionset == NULL ) {
return apr_psprintf ( cmd -> pool , "ModSecurity: Attempt to update action for rule \"%s\" failed: Rule does not have an actionset." , p1 ) ;
}
new_actionset = msre_actionset_create ( modsecurity -> msre , p2 , & my_error_msg ) ;
if ( new_actionset == NULL ) return FATAL_ERROR ;
if ( my_error_msg != NULL ) return my_error_msg ;
if ( ( new_actionset -> id != NOT_SET_P ) && ( rule -> actionset -> id != NULL ) && ( strcmp ( rule -> actionset -> id , new_actionset -> id ) != 0 ) ) {
return apr_psprintf ( cmd -> pool , "ModSecurity: Rule IDs cannot be updated via SecRuleUpdateActionById." ) ;
}
if ( ( new_actionset -> phase != NOT_SET ) && ( rule -> actionset -> phase != new_actionset -> phase ) ) {
return apr_psprintf ( cmd -> pool , "ModSecurity: Rule phases cannot be updated via SecRuleUpdateActionById." ) ;
}
# ifdef DEBUG_CONF {
char * actions = msre_actionset_generate_action_string ( ruleset -> mp , rule -> actionset ) ;
ap_log_perror ( APLOG_MARK , APLOG_STARTUP | APLOG_NOERRNO , 0 , cmd -> pool , "Update rule %pp id=\"%s\" old action: \"%s\"" , rule , ( rule -> actionset -> id == NOT_SET_P ? "(none)" : rule -> actionset -> id ) , actions ) ;
}
# endif rule -> actionset = msre_actionset_merge ( modsecurity -> msre , rule -> actionset , new_actionset , 1 ) ;
msre_actionset_set_defaults ( rule -> actionset ) ;
rule -> unparsed = msre_rule_generate_unparsed ( ruleset -> mp , rule , NULL , NULL , NULL ) ;
# ifdef DEBUG_CONF {
char * actions = msre_actionset_generate_action_string ( ruleset -> mp , rule -> actionset ) ;
ap_log_perror ( APLOG_MARK , APLOG_STARTUP | APLOG_NOERRNO , 0 , cmd -> pool , "Update rule %pp id=\"%s\" new action: \"%s\"" , rule , ( rule -> actionset -> id == NOT_SET_P ? "(none)" : rule -> actionset -> id ) , actions ) ;
}
# endif return NULL ;
} |
2,687,336,064,028,423,000 | chrome | 31 | 0 | static int search_request_new ( int type , const char * const name , int flags , evdns_callback_type user_callback , void * user_arg ) {
assert ( type == TYPE_A || type == TYPE_AAAA ) ;
if ( ( ( flags & DNS_QUERY_NO_SEARCH ) == 0 ) && global_search_state && global_search_state -> num_domains ) {
struct request * req ;
if ( string_num_dots ( name ) >= global_search_state -> ndots ) {
req = request_new ( type , name , flags , user_callback , user_arg ) ;
if ( ! req ) return 1 ;
req -> search_index = - 1 ;
}
else {
char * const new_name = search_make_new ( global_search_state , 0 , name ) ;
if ( ! new_name ) return 1 ;
req = request_new ( type , new_name , flags , user_callback , user_arg ) ;
free ( new_name ) ;
if ( ! req ) return 1 ;
req -> search_index = 0 ;
}
req -> search_origname = strdup ( name ) ;
req -> search_state = global_search_state ;
req -> search_flags = flags ;
global_search_state -> refcount ++ ;
request_submit ( req ) ;
return 0 ;
}
else {
struct request * const req = request_new ( type , name , flags , user_callback , user_arg ) ;
if ( ! req ) return 1 ;
request_submit ( req ) ;
return 0 ;
}
} |
-6,872,005,221,209,485,000 | chrome | 59 | 0 | static Int decGetInt ( const decNumber * dn ) {
Int theInt ;
const Unit * up ;
Int got ;
Int ilength = dn -> digits + dn -> exponent ;
Flag neg = decNumberIsNegative ( dn ) ;
# if DEC_MAX_EMAX > 999999999 # error GetInt may need updating [ for Emax ] # endif # if DEC_MIN_EMIN < - 999999999 # error GetInt may need updating [ for Emin ] # endif if ( ISZERO ( dn ) ) return 0 ;
up = dn -> lsu ;
theInt = 0 ;
if ( dn -> exponent >= 0 ) {
got = dn -> exponent ;
}
else {
Int count = - dn -> exponent ;
for ( ;
count >= DECDPUN ;
up ++ ) {
if ( * up != 0 ) return BADINT ;
count -= DECDPUN ;
}
if ( count == 0 ) got = 0 ;
else {
Int rem ;
# if DECDPUN <= 4 theInt = QUOT10 ( * up , count ) ;
rem = * up - theInt * powers [ count ] ;
# else rem = * up % powers [ count ] ;
theInt = * up / powers [ count ] ;
# endif if ( rem != 0 ) return BADINT ;
got = DECDPUN - count ;
up ++ ;
}
}
if ( got == 0 ) {
theInt = * up ;
got += DECDPUN ;
up ++ ;
}
if ( ilength < 11 ) {
Int save = theInt ;
for ( ;
got < ilength ;
up ++ ) {
theInt += * up * powers [ got ] ;
got += DECDPUN ;
}
if ( ilength == 10 ) {
if ( theInt / ( Int ) powers [ got - DECDPUN ] != ( Int ) * ( up - 1 ) ) ilength = 11 ;
else if ( neg && theInt > 1999999997 ) ilength = 11 ;
else if ( ! neg && theInt > 999999999 ) ilength = 11 ;
if ( ilength == 11 ) theInt = save ;
}
}
if ( ilength > 10 ) {
if ( theInt & 1 ) return BIGODD ;
return BIGEVEN ;
}
if ( neg ) theInt = - theInt ;
return theInt ;
} |
4,704,178,797,381,506,000 | debian | 3 | 0 | kadm5_ret_t kadm5_randkey_principal ( void * server_handle , krb5_principal principal , krb5_keyblock * * keyblocks , int * n_keys ) {
return kadm5_randkey_principal_3 ( server_handle , principal , FALSE , 0 , NULL , keyblocks , n_keys ) ;
} |
-3,740,862,514,502,467,000 | debian | 26 | 0 | static void initATTables ( struct alltabs * at , SplineFont * sf , enum fontformat format ) {
setos2 ( & at -> os2 , at , sf , format ) ;
if ( at -> opentypemode ) {
SFFindUnusedLookups ( sf ) ;
otf_dumpgpos ( at , sf ) ;
otf_dumpgsub ( at , sf ) ;
otf_dumpgdef ( at , sf ) ;
otf_dumpjstf ( at , sf ) ;
otf_dumpbase ( at , sf ) ;
otf_dump_math ( at , sf ) ;
if ( at -> gi . flags & ttf_flag_dummyDSIG ) otf_dump_dummydsig ( at , sf ) ;
}
if ( at -> dovariations ) ttf_dumpvariations ( at , sf ) ;
if ( at -> applemode ) {
if ( ! at -> opentypemode ) SFFindUnusedLookups ( sf ) ;
ttf_dumpkerns ( at , sf ) ;
aat_dumplcar ( at , sf ) ;
aat_dumpmorx ( at , sf ) ;
aat_dumpopbd ( at , sf ) ;
aat_dumpprop ( at , sf ) ;
aat_dumpbsln ( at , sf ) ;
}
if ( ! at -> applemode && ( ! at -> opentypemode || ( at -> gi . flags & ttf_flag_oldkern ) ) ) ttf_dumpkerns ( at , sf ) ;
dumpnames ( at , sf , format ) ;
redoos2 ( at ) ;
} |
7,092,216,800,726,730,000 | debian | 16 | 0 | static int dissect_h245_T_booleanArray ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
# line 766 "../../asn1/h245/h245.cnf" guint32 value ;
guint8 * buf ;
tvbuff_t * value_tvb ;
gef_ctx_t * gefx ;
offset = dissect_per_constrained_integer ( tvb , offset , actx , tree , hf_index , 0U , 255U , & value , FALSE ) ;
gefx = gef_ctx_get ( actx -> private_data ) ;
if ( gefx ) {
buf = wmem_new ( actx -> pinfo -> pool , guint8 ) ;
buf [ 0 ] = value ;
value_tvb = tvb_new_child_real_data ( tvb , buf , sizeof ( guint8 ) , sizeof ( guint8 ) ) ;
add_new_data_source ( actx -> pinfo , value_tvb , "booleanArray" ) ;
dissector_try_string ( gef_content_dissector_table , gefx -> key , value_tvb , actx -> pinfo , tree , actx ) ;
}
return offset ;
} |
2,713,698,759,296,604,700 | debian | 55 | 1 | int ff_MPV_common_frame_size_change ( MpegEncContext * s ) {
int i , err = 0 ;
if ( s -> slice_context_count > 1 ) {
for ( i = 0 ;
i < s -> slice_context_count ;
i ++ ) {
free_duplicate_context ( s -> thread_context [ i ] ) ;
}
for ( i = 1 ;
i < s -> slice_context_count ;
i ++ ) {
av_freep ( & s -> thread_context [ i ] ) ;
}
}
else free_duplicate_context ( s ) ;
free_context_frame ( s ) ;
if ( s -> picture ) for ( i = 0 ;
i < s -> picture_count ;
i ++ ) {
s -> picture [ i ] . needs_realloc = 1 ;
}
s -> last_picture_ptr = s -> next_picture_ptr = s -> current_picture_ptr = NULL ;
if ( s -> codec_id == AV_CODEC_ID_MPEG2VIDEO && ! s -> progressive_sequence ) s -> mb_height = ( s -> height + 31 ) / 32 * 2 ;
else if ( s -> codec_id != AV_CODEC_ID_H264 ) s -> mb_height = ( s -> height + 15 ) / 16 ;
if ( ( s -> width || s -> height ) && av_image_check_size ( s -> width , s -> height , 0 , s -> avctx ) ) return AVERROR_INVALIDDATA ;
if ( ( err = init_context_frame ( s ) ) ) goto fail ;
s -> thread_context [ 0 ] = s ;
if ( s -> width && s -> height ) {
int nb_slices = s -> slice_context_count ;
if ( nb_slices > 1 ) {
for ( i = 1 ;
i < nb_slices ;
i ++ ) {
s -> thread_context [ i ] = av_malloc ( sizeof ( MpegEncContext ) ) ;
memcpy ( s -> thread_context [ i ] , s , sizeof ( MpegEncContext ) ) ;
}
for ( i = 0 ;
i < nb_slices ;
i ++ ) {
if ( init_duplicate_context ( s -> thread_context [ i ] ) < 0 ) goto fail ;
s -> thread_context [ i ] -> start_mb_y = ( s -> mb_height * ( i ) + nb_slices / 2 ) / nb_slices ;
s -> thread_context [ i ] -> end_mb_y = ( s -> mb_height * ( i + 1 ) + nb_slices / 2 ) / nb_slices ;
}
}
else {
if ( init_duplicate_context ( s ) < 0 ) goto fail ;
s -> start_mb_y = 0 ;
s -> end_mb_y = s -> mb_height ;
}
s -> slice_context_count = nb_slices ;
}
return 0 ;
fail : ff_MPV_common_end ( s ) ;
return err ;
} |
6,302,861,533,225,985,000 | debian | 6 | 0 | static inline void pxa2xx_rtc_swal1_tick ( void * opaque ) {
PXA2xxRTCState * s = ( PXA2xxRTCState * ) opaque ;
s -> rtsr |= ( 1 << 8 ) ;
pxa2xx_rtc_alarm_update ( s , s -> rtsr ) ;
pxa2xx_rtc_int_update ( s ) ;
} |
2,335,222,688,263,906,300 | debian | 19 | 1 | static int finish_frame ( AVCodecContext * avctx , AVFrame * pict ) {
RV34DecContext * r = avctx -> priv_data ;
MpegEncContext * s = & r -> s ;
int got_picture = 0 ;
ff_er_frame_end ( & s -> er ) ;
ff_MPV_frame_end ( s ) ;
s -> mb_num_left = 0 ;
if ( HAVE_THREADS && ( s -> avctx -> active_thread_type & FF_THREAD_FRAME ) ) ff_thread_report_progress ( & s -> current_picture_ptr -> f , INT_MAX , 0 ) ;
if ( s -> pict_type == AV_PICTURE_TYPE_B || s -> low_delay ) {
* pict = s -> current_picture_ptr -> f ;
got_picture = 1 ;
}
else if ( s -> last_picture_ptr != NULL ) {
* pict = s -> last_picture_ptr -> f ;
got_picture = 1 ;
}
if ( got_picture ) ff_print_debug_info ( s , pict ) ;
return got_picture ;
} |
7,549,435,794,356,072,000 | debian | 4 | 0 | static VALUE ossl_asn1_ ## klass ( int argc , VALUE * argv , VALUE self ) \ {
return rb_funcall3 ( cASN1 ## klass , rb_intern ( "new" ) , argc , argv ) ;
}
OSSL_ASN1_IMPL_FACTORY_METHOD ( Boolean ) OSSL_ASN1_IMPL_FACTORY_METHOD ( Integer ) OSSL_ASN1_IMPL_FACTORY_METHOD ( Enumerated ) OSSL_ASN1_IMPL_FACTORY_METHOD ( BitString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( OctetString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( UTF8String ) OSSL_ASN1_IMPL_FACTORY_METHOD ( NumericString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( PrintableString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( T61String ) OSSL_ASN1_IMPL_FACTORY_METHOD ( VideotexString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( IA5String ) OSSL_ASN1_IMPL_FACTORY_METHOD ( GraphicString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( ISO64String ) OSSL_ASN1_IMPL_FACTORY_METHOD ( GeneralString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( UniversalString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( BMPString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( Null ) OSSL_ASN1_IMPL_FACTORY_METHOD ( ObjectId ) OSSL_ASN1_IMPL_FACTORY_METHOD ( UTCTime ) OSSL_ASN1_IMPL_FACTORY_METHOD ( GeneralizedTime ) OSSL_ASN1_IMPL_FACTORY_METHOD ( Sequence ) OSSL_ASN1_IMPL_FACTORY_METHOD ( Set ) |
-6,215,323,349,888,018,000 | debian | 50 | 0 | static void dumpTablespaces ( PGconn * conn ) {
PGresult * res ;
int i ;
if ( server_version >= 90600 ) res = executeQuery ( conn , "SELECT oid, spcname, " "pg_catalog.pg_get_userbyid(spcowner) AS spcowner, " "pg_catalog.pg_tablespace_location(oid), " "(SELECT pg_catalog.array_agg(acl) FROM (SELECT pg_catalog.unnest(coalesce(spcacl,pg_catalog.acldefault('t',spcowner))) AS acl " "EXCEPT SELECT pg_catalog.unnest(pg_catalog.acldefault('t',spcowner))) as foo)" "AS spcacl," "(SELECT pg_catalog.array_agg(acl) FROM (SELECT pg_catalog.unnest(pg_catalog.acldefault('t',spcowner)) AS acl " "EXCEPT SELECT pg_catalog.unnest(coalesce(spcacl,pg_catalog.acldefault('t',spcowner)))) as foo)" "AS rspcacl," "array_to_string(spcoptions, ', ')," "pg_catalog.shobj_description(oid, 'pg_tablespace') " "FROM pg_catalog.pg_tablespace " "WHERE spcname !~ '^pg_' " "ORDER BY 1" ) ;
else if ( server_version >= 90200 ) res = executeQuery ( conn , "SELECT oid, spcname, " "pg_catalog.pg_get_userbyid(spcowner) AS spcowner, " "pg_catalog.pg_tablespace_location(oid), spcacl, '' as rspcacl, " "array_to_string(spcoptions, ', ')," "pg_catalog.shobj_description(oid, 'pg_tablespace') " "FROM pg_catalog.pg_tablespace " "WHERE spcname !~ '^pg_' " "ORDER BY 1" ) ;
else if ( server_version >= 90000 ) res = executeQuery ( conn , "SELECT oid, spcname, " "pg_catalog.pg_get_userbyid(spcowner) AS spcowner, " "spclocation, spcacl, '' as rspcacl, " "array_to_string(spcoptions, ', ')," "pg_catalog.shobj_description(oid, 'pg_tablespace') " "FROM pg_catalog.pg_tablespace " "WHERE spcname !~ '^pg_' " "ORDER BY 1" ) ;
else if ( server_version >= 80200 ) res = executeQuery ( conn , "SELECT oid, spcname, " "pg_catalog.pg_get_userbyid(spcowner) AS spcowner, " "spclocation, spcacl, '' as rspcacl, null, " "pg_catalog.shobj_description(oid, 'pg_tablespace') " "FROM pg_catalog.pg_tablespace " "WHERE spcname !~ '^pg_' " "ORDER BY 1" ) ;
else res = executeQuery ( conn , "SELECT oid, spcname, " "pg_catalog.pg_get_userbyid(spcowner) AS spcowner, " "spclocation, spcacl, '' as rspcacl, " "null, null " "FROM pg_catalog.pg_tablespace " "WHERE spcname !~ '^pg_' " "ORDER BY 1" ) ;
if ( PQntuples ( res ) > 0 ) fprintf ( OPF , "--\n-- Tablespaces\n--\n\n" ) ;
for ( i = 0 ;
i < PQntuples ( res ) ;
i ++ ) {
PQExpBuffer buf = createPQExpBuffer ( ) ;
uint32 spcoid = atooid ( PQgetvalue ( res , i , 0 ) ) ;
char * spcname = PQgetvalue ( res , i , 1 ) ;
char * spcowner = PQgetvalue ( res , i , 2 ) ;
char * spclocation = PQgetvalue ( res , i , 3 ) ;
char * spcacl = PQgetvalue ( res , i , 4 ) ;
char * rspcacl = PQgetvalue ( res , i , 5 ) ;
char * spcoptions = PQgetvalue ( res , i , 6 ) ;
char * spccomment = PQgetvalue ( res , i , 7 ) ;
char * fspcname ;
fspcname = pg_strdup ( fmtId ( spcname ) ) ;
appendPQExpBuffer ( buf , "CREATE TABLESPACE %s" , fspcname ) ;
appendPQExpBuffer ( buf , " OWNER %s" , fmtId ( spcowner ) ) ;
appendPQExpBufferStr ( buf , " LOCATION " ) ;
appendStringLiteralConn ( buf , spclocation , conn ) ;
appendPQExpBufferStr ( buf , ";
\n" ) ;
if ( spcoptions && spcoptions [ 0 ] != '\0' ) appendPQExpBuffer ( buf , "ALTER TABLESPACE %s SET (%s);
\n" , fspcname , spcoptions ) ;
if ( ! skip_acls && ! buildACLCommands ( fspcname , NULL , "TABLESPACE" , spcacl , rspcacl , spcowner , "" , server_version , buf ) ) {
fprintf ( stderr , _ ( "%s: could not parse ACL list (%s) for tablespace \"%s\"\n" ) , progname , spcacl , fspcname ) ;
PQfinish ( conn ) ;
exit_nicely ( 1 ) ;
}
if ( spccomment && strlen ( spccomment ) ) {
appendPQExpBuffer ( buf , "COMMENT ON TABLESPACE %s IS " , fspcname ) ;
appendStringLiteralConn ( buf , spccomment , conn ) ;
appendPQExpBufferStr ( buf , ";
\n" ) ;
}
if ( ! no_security_labels && server_version >= 90200 ) buildShSecLabels ( conn , "pg_tablespace" , spcoid , buf , "TABLESPACE" , fspcname ) ;
fprintf ( OPF , "%s" , buf -> data ) ;
free ( fspcname ) ;
destroyPQExpBuffer ( buf ) ;
}
PQclear ( res ) ;
fprintf ( OPF , "\n\n" ) ;
} |
-2,908,211,205,972,632,000 | debian | 16 | 0 | int mainwindow_set_statusbar_lines ( MAIN_WINDOW_REC * window , int top , int bottom ) {
int ret ;
ret = - 1 ;
if ( top != 0 ) {
ret = window -> statusbar_lines_top ;
window -> statusbar_lines_top += top ;
window -> statusbar_lines += top ;
}
if ( bottom != 0 ) {
ret = window -> statusbar_lines_bottom ;
window -> statusbar_lines_bottom += bottom ;
window -> statusbar_lines += bottom ;
}
if ( top + bottom != 0 ) window -> size_dirty = TRUE ;
return ret ;
} |
5,357,882,892,791,796,000 | debian | 14 | 0 | static void e1000e_set_ctrl ( E1000ECore * core , int index , uint32_t val ) {
trace_e1000e_core_ctrl_write ( index , val ) ;
core -> mac [ CTRL ] = val & ~ E1000_CTRL_RST ;
core -> mac [ CTRL_DUP ] = core -> mac [ CTRL ] ;
trace_e1000e_link_set_params ( ! ! ( val & E1000_CTRL_ASDE ) , ( val & E1000_CTRL_SPD_SEL ) >> E1000_CTRL_SPD_SHIFT , ! ! ( val & E1000_CTRL_FRCSPD ) , ! ! ( val & E1000_CTRL_FRCDPX ) , ! ! ( val & E1000_CTRL_RFCE ) , ! ! ( val & E1000_CTRL_TFCE ) ) ;
if ( val & E1000_CTRL_RST ) {
trace_e1000e_core_ctrl_sw_reset ( ) ;
e1000x_reset_mac_addr ( core -> owner_nic , core -> mac , core -> permanent_mac ) ;
}
if ( val & E1000_CTRL_PHY_RST ) {
trace_e1000e_core_ctrl_phy_reset ( ) ;
core -> mac [ STATUS ] |= E1000_STATUS_PHYRA ;
}
} |
-4,136,373,206,107,992,600 | chrome | 8 | 0 | static UBool isPNJConsonant ( UChar32 c ) {
if ( c < 0xa00 || 0xa50 <= c ) {
return FALSE ;
}
else {
return ( UBool ) ( pnjMap [ c - 0xa00 ] & 1 ) ;
}
} |
6,667,142,528,452,942,000 | debian | 38 | 0 | static void write_header ( FILE * sql_file , char * db_name ) {
if ( opt_xml ) {
fputs ( "<?xml version=\"1.0\"?>\n" , sql_file ) ;
fputs ( "<mysqldump " , sql_file ) ;
fputs ( "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" , sql_file ) ;
fputs ( ">\n" , sql_file ) ;
check_io ( sql_file ) ;
}
else if ( ! opt_compact ) {
print_comment ( sql_file , 0 , "-- MySQL dump %s Distrib %s, for %s (%s)\n--\n" , DUMP_VERSION , MYSQL_SERVER_VERSION , SYSTEM_TYPE , MACHINE_TYPE ) ;
print_comment ( sql_file , 0 , "-- Host: %s Database: %s\n" , fix_for_comment ( current_host ? current_host : "localhost" ) , fix_for_comment ( db_name ? db_name : "" ) ) ;
print_comment ( sql_file , 0 , "-- ------------------------------------------------------\n" ) ;
print_comment ( sql_file , 0 , "-- Server version\t%s\n" , mysql_get_server_info ( & mysql_connection ) ) ;
if ( opt_set_charset ) fprintf ( sql_file , "\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
" "\n/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
" "\n/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
" "\n/*!40101 SET NAMES %s */;
\n" , default_charset ) ;
if ( opt_tz_utc ) {
fprintf ( sql_file , "/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
\n" ) ;
fprintf ( sql_file , "/*!40103 SET TIME_ZONE='+00:00' */;
\n" ) ;
}
if ( ! path ) {
if ( ! opt_no_create_info ) {
fprintf ( md_result_file , "\ /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
\n" ) ;
}
fprintf ( md_result_file , "\ /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
\n\ " ) ;
}
fprintf ( sql_file , "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='%s%s%s' */;
\n" "/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
\n" , path ? "" : "NO_AUTO_VALUE_ON_ZERO" , compatible_mode_normal_str [ 0 ] == 0 ? "" : "," , compatible_mode_normal_str ) ;
check_io ( sql_file ) ;
}
} |
2,917,602,761,308,156,400 | debian | 20 | 0 | static int DecodeAsn1BuildValue ( const unsigned char * * d_ptr , uint32_t * val , uint8_t numbytes , uint32_t * errcode ) {
int i ;
uint32_t value = 0 ;
if ( numbytes > 4 ) {
if ( errcode ) * errcode = ERR_DER_INVALID_SIZE ;
value = 0xffffffff ;
* val = value ;
return - 1 ;
}
else {
for ( i = 0 ;
i < numbytes ;
i ++ ) {
value = value << 8 | ( * d_ptr ) [ 0 ] ;
( * d_ptr ) ++ ;
}
}
* val = value ;
return 0 ;
} |
-7,237,039,260,294,671,000 | debian | 3 | 0 | static int dissect_nlm4_granted ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * data ) {
return dissect_nlm_granted ( tvb , 0 , pinfo , tree , 4 , ( rpc_call_info_value * ) data ) ;
} |
1,760,449,185,745,615,400 | debian | 3 | 0 | const char * TSHttpEventNameLookup ( TSEvent event ) {
return HttpDebugNames : : get_event_name ( static_cast < int > ( event ) ) ;
} |
8,346,259,359,343,160,000 | debian | 3 | 0 | static inline int ivi_scale_mv ( int mv , int mv_scale ) {
return ( mv + ( mv > 0 ) + ( mv_scale - 1 ) ) >> mv_scale ;
} |
2,895,622,461,494,525,400 | debian | 9 | 0 | static void test_fetch_str ( ) {
int rc ;
myheader ( "test_fetch_str" ) ;
rc = mysql_query ( mysql , "DROP TABLE IF EXISTS test_bind_fetch" ) ;
myquery ( rc ) ;
rc = mysql_query ( mysql , "CREATE TABLE test_bind_fetch(c1 char(10), \ c2 char(10), \ c3 char(20), \ c4 char(20), \ c5 char(30), \ c6 char(40), \ c7 char(20))" ) ;
myquery ( rc ) ;
bind_fetch ( 3 ) ;
} |
-3,889,154,245,145,552,000 | debian | 17 | 0 | static struct branch * new_branch ( const char * name ) {
unsigned int hc = hc_str ( name , strlen ( name ) ) % branch_table_sz ;
struct branch * b = lookup_branch ( name ) ;
if ( b ) die ( "Invalid attempt to create duplicate branch: %s" , name ) ;
if ( check_refname_format ( name , REFNAME_ALLOW_ONELEVEL ) ) die ( "Branch name doesn't conform to GIT standards: %s" , name ) ;
b = pool_calloc ( 1 , sizeof ( struct branch ) ) ;
b -> name = pool_strdup ( name ) ;
b -> table_next_branch = branch_table [ hc ] ;
b -> branch_tree . versions [ 0 ] . mode = S_IFDIR ;
b -> branch_tree . versions [ 1 ] . mode = S_IFDIR ;
b -> num_notes = 0 ;
b -> active = 0 ;
b -> pack_id = MAX_PACK_ID ;
branch_table [ hc ] = b ;
branch_count ++ ;
return b ;
} |
4,489,017,523,191,997,000 | debian | 4 | 0 | static int dissect_h225_SecurityCapabilities ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h225_SecurityCapabilities , SecurityCapabilities_sequence ) ;
return offset ;
} |
-5,082,285,935,423,529,000 | debian | 48 | 0 | static int dissect_rsl_ie_ch_mode ( tvbuff_t * tvb , packet_info * pinfo _U_ , proto_tree * tree , int offset , gboolean is_mandatory ) {
proto_item * ti ;
proto_tree * ie_tree ;
guint8 length ;
int ie_offset ;
guint8 ie_id ;
guint8 octet ;
if ( is_mandatory == FALSE ) {
ie_id = tvb_get_guint8 ( tvb , offset ) ;
if ( ie_id != RSL_IE_CH_MODE ) return offset ;
}
ie_tree = proto_tree_add_subtree ( tree , tvb , offset , 0 , ett_ie_ch_mode , & ti , "Channel Mode IE" ) ;
proto_tree_add_item ( ie_tree , hf_rsl_ie_id , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
offset ++ ;
length = tvb_get_guint8 ( tvb , offset ) ;
proto_item_set_len ( ti , length + 2 ) ;
proto_tree_add_item ( ie_tree , hf_rsl_ie_length , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
offset ++ ;
ie_offset = offset ;
proto_tree_add_item ( ie_tree , hf_rsl_cm_dtxd , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( ie_tree , hf_rsl_cm_dtxu , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
offset ++ ;
proto_tree_add_item ( ie_tree , hf_rsl_speech_or_data , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
octet = tvb_get_guint8 ( tvb , offset ) ;
offset ++ ;
proto_tree_add_item ( ie_tree , hf_rsl_ch_rate_and_type , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
offset ++ ;
switch ( octet ) {
case 1 : proto_tree_add_item ( ie_tree , hf_rsl_speech_coding_alg , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
break ;
case 2 : proto_tree_add_item ( ie_tree , hf_rsl_extension_bit , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( ie_tree , hf_rsl_t_nt_bit , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
octet = tvb_get_guint8 ( tvb , offset ) ;
if ( ( octet & 0x40 ) == 0x40 ) {
proto_tree_add_item ( ie_tree , hf_rsl_ra_if_data_rte , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
}
else {
proto_tree_add_item ( ie_tree , hf_rsl_data_rte , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
}
break ;
case 3 : proto_tree_add_item ( ie_tree , hf_rsl_no_resources_required , tvb , offset , 1 , ENC_NA ) ;
break ;
default : proto_tree_add_expert ( ie_tree , pinfo , & ei_rsl_speech_or_data_indicator , tvb , offset , 1 ) ;
break ;
}
offset ++ ;
return ie_offset + length ;
} |
-4,239,386,405,881,995,300 | chrome | 3 | 0 | int xmlHashUpdateEntry ( xmlHashTablePtr table , const xmlChar * name , void * userdata , xmlHashDeallocator f ) {
return ( xmlHashUpdateEntry3 ( table , name , NULL , NULL , userdata , f ) ) ;
} |
-1,929,262,071,302,712,000 | debian | 11 | 0 | static void * Type_vcgt_Dup ( struct _cms_typehandler_struct * self , const void * Ptr , cmsUInt32Number n ) {
cmsToneCurve * * OldCurves = ( cmsToneCurve * * ) Ptr ;
cmsToneCurve * * NewCurves ;
NewCurves = ( cmsToneCurve * * ) _cmsCalloc ( self -> ContextID , 3 , sizeof ( cmsToneCurve * ) ) ;
if ( NewCurves == NULL ) return NULL ;
NewCurves [ 0 ] = cmsDupToneCurve ( OldCurves [ 0 ] ) ;
NewCurves [ 1 ] = cmsDupToneCurve ( OldCurves [ 1 ] ) ;
NewCurves [ 2 ] = cmsDupToneCurve ( OldCurves [ 2 ] ) ;
return ( void * ) NewCurves ;
cmsUNUSED_PARAMETER ( n ) ;
} |
914,926,989,019,402,500 | debian | 18 | 0 | const char * xd3_mainerror ( int err_num ) {
# ifndef _WIN32 const char * x = xd3_strerror ( err_num ) ;
if ( x != NULL ) {
return x ;
}
return strerror ( err_num ) ;
# else static char err_buf [ 256 ] ;
const char * x = xd3_strerror ( err_num ) ;
if ( x != NULL ) {
return x ;
}
memset ( err_buf , 0 , 256 ) ;
FormatMessage ( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS , NULL , err_num , MAKELANGID ( LANG_NEUTRAL , SUBLANG_DEFAULT ) , err_buf , 256 , NULL ) ;
if ( err_buf [ 0 ] != 0 && err_buf [ strlen ( err_buf ) - 1 ] == '\n' ) {
err_buf [ strlen ( err_buf ) - 1 ] = 0 ;
}
return err_buf ;
# endif } |
-2,181,129,709,629,422,000 | chrome | 24 | 0 | IN_PROC_BROWSER_TEST_F ( DownloadNotificationTest , DownloadMultipleFilesOneByOne ) {
CreateDownload ( ) ;
download : : DownloadItem * first_download_item = download_item ( ) ;
std : : string first_notification_id = notification_id ( ) ;
CompleteTheDownload ( ) ;
EXPECT_EQ ( download : : DownloadItem : : COMPLETE , first_download_item -> GetState ( ) ) ;
EXPECT_TRUE ( notification ( ) ) ;
GURL url ( net : : URLRequestSlowDownloadJob : : kKnownSizeUrl ) ;
ui_test_utils : : NavigateToURL ( browser ( ) , url ) ;
WaitForDownloadNotification ( ) ;
auto notifications = GetDownloadNotifications ( ) ;
ASSERT_EQ ( 2u , notifications . size ( ) ) ;
std : : string second_notification_id = notifications [ ( notifications [ 0 ] . id ( ) == notification_id ( ) ? 1 : 0 ) ] . id ( ) ;
EXPECT_FALSE ( second_notification_id . empty ( ) ) ;
ASSERT_TRUE ( GetNotification ( second_notification_id ) ) ;
std : : vector < download : : DownloadItem * > downloads ;
GetDownloadManager ( browser ( ) ) -> GetAllDownloads ( & downloads ) ;
EXPECT_EQ ( 2u , downloads . size ( ) ) ;
EXPECT_TRUE ( first_download_item == downloads [ 0 ] || first_download_item == downloads [ 1 ] ) ;
download : : DownloadItem * second_download_item = downloads [ first_download_item == downloads [ 0 ] ? 1 : 0 ] ;
EXPECT_EQ ( download : : DownloadItem : : IN_PROGRESS , second_download_item -> GetState ( ) ) ;
CompleteTheDownload ( ) ;
EXPECT_EQ ( 2u , GetDownloadNotifications ( ) . size ( ) ) ;
} |
1,245,821,301,839,614,700 | debian | 25 | 0 | void nautilus_file_operations_link ( GList * files , GArray * relative_item_points , GFile * target_dir , GtkWindow * parent_window , NautilusCopyCallback done_callback , gpointer done_callback_data ) {
GTask * task ;
CopyMoveJob * job ;
job = op_job_new ( CopyMoveJob , parent_window ) ;
job -> done_callback = done_callback ;
job -> done_callback_data = done_callback_data ;
job -> files = g_list_copy_deep ( files , ( GCopyFunc ) g_object_ref , NULL ) ;
job -> destination = g_object_ref ( target_dir ) ;
nautilus_progress_info_set_destination ( ( ( CommonJob * ) job ) -> progress , target_dir ) ;
if ( relative_item_points != NULL && relative_item_points -> len > 0 ) {
job -> icon_positions = g_memdup ( relative_item_points -> data , sizeof ( GdkPoint ) * relative_item_points -> len ) ;
job -> n_icon_positions = relative_item_points -> len ;
}
job -> debuting_files = g_hash_table_new_full ( g_file_hash , ( GEqualFunc ) g_file_equal , g_object_unref , NULL ) ;
if ( ! nautilus_file_undo_manager_is_operating ( ) ) {
GFile * src_dir ;
src_dir = g_file_get_parent ( files -> data ) ;
job -> common . undo_info = nautilus_file_undo_info_ext_new ( NAUTILUS_FILE_UNDO_OP_CREATE_LINK , g_list_length ( files ) , src_dir , target_dir ) ;
g_object_unref ( src_dir ) ;
}
task = g_task_new ( NULL , job -> common . cancellable , link_task_done , job ) ;
g_task_set_task_data ( task , job , NULL ) ;
g_task_run_in_thread ( task , link_task_thread_func ) ;
g_object_unref ( task ) ;
} |
2,776,415,072,272,421,400 | debian | 76 | 1 | static int decode_frame ( AVCodecContext * avctx , void * data , int * got_frame , AVPacket * avpkt ) {
AnsiContext * s = avctx -> priv_data ;
uint8_t * buf = avpkt -> data ;
int buf_size = avpkt -> size ;
const uint8_t * buf_end = buf + buf_size ;
int ret , i , count ;
ret = avctx -> reget_buffer ( avctx , & s -> frame ) ;
if ( ret < 0 ) {
av_log ( avctx , AV_LOG_ERROR , "get_buffer() failed\n" ) ;
return ret ;
}
if ( ! avctx -> frame_number ) {
memset ( s -> frame . data [ 0 ] , 0 , avctx -> height * FFABS ( s -> frame . linesize [ 0 ] ) ) ;
memset ( s -> frame . data [ 1 ] , 0 , AVPALETTE_SIZE ) ;
}
s -> frame . pict_type = AV_PICTURE_TYPE_I ;
s -> frame . palette_has_changed = 1 ;
memcpy ( s -> frame . data [ 1 ] , ff_cga_palette , 16 * 4 ) ;
while ( buf < buf_end ) {
switch ( s -> state ) {
case STATE_NORMAL : switch ( buf [ 0 ] ) {
case 0x00 : case 0x07 : case 0x1A : break ;
case 0x08 : s -> x = FFMAX ( s -> x - 1 , 0 ) ;
break ;
case 0x09 : i = s -> x / FONT_WIDTH ;
count = ( ( i + 8 ) & ~ 7 ) - i ;
for ( i = 0 ;
i < count ;
i ++ ) draw_char ( avctx , ' ' ) ;
break ;
case 0x0A : hscroll ( avctx ) ;
case 0x0D : s -> x = 0 ;
break ;
case 0x0C : erase_screen ( avctx ) ;
break ;
case 0x1B : s -> state = STATE_ESCAPE ;
break ;
default : draw_char ( avctx , buf [ 0 ] ) ;
}
break ;
case STATE_ESCAPE : if ( buf [ 0 ] == '[' ) {
s -> state = STATE_CODE ;
s -> nb_args = 0 ;
s -> args [ 0 ] = 0 ;
}
else {
s -> state = STATE_NORMAL ;
draw_char ( avctx , 0x1B ) ;
continue ;
}
break ;
case STATE_CODE : switch ( buf [ 0 ] ) {
case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : if ( s -> nb_args < MAX_NB_ARGS ) s -> args [ s -> nb_args ] = s -> args [ s -> nb_args ] * 10 + buf [ 0 ] - '0' ;
break ;
case ';
' : s -> nb_args ++ ;
if ( s -> nb_args < MAX_NB_ARGS ) s -> args [ s -> nb_args ] = 0 ;
break ;
case 'M' : s -> state = STATE_MUSIC_PREAMBLE ;
break ;
case '=' : case '?' : break ;
default : if ( s -> nb_args > MAX_NB_ARGS ) av_log ( avctx , AV_LOG_WARNING , "args overflow (%i)\n" , s -> nb_args ) ;
if ( s -> nb_args < MAX_NB_ARGS && s -> args [ s -> nb_args ] ) s -> nb_args ++ ;
if ( ( ret = execute_code ( avctx , buf [ 0 ] ) ) < 0 ) return ret ;
s -> state = STATE_NORMAL ;
}
break ;
case STATE_MUSIC_PREAMBLE : if ( buf [ 0 ] == 0x0E || buf [ 0 ] == 0x1B ) s -> state = STATE_NORMAL ;
break ;
}
buf ++ ;
}
* got_frame = 1 ;
* ( AVFrame * ) data = s -> frame ;
return buf_size ;
} |
3,599,206,110,384,554,500 | debian | 31 | 0 | int PEM_write_ ## name ( FILE * fp , type * x ) ;
# define DECLARE_PEM_write_fp_const ( name , type ) int PEM_write_ ## name ( FILE * fp , const type * x ) ;
# define DECLARE_PEM_write_cb_fp ( name , type ) int PEM_write_ ## name ( FILE * fp , type * x , const EVP_CIPHER * enc , unsigned char * kstr , int klen , pem_password_cb * cb , void * u ) ;
# endif # define DECLARE_PEM_read_bio ( name , type ) type * PEM_read_bio_ ## name ( BIO * bp , type * * x , pem_password_cb * cb , void * u ) ;
# define DECLARE_PEM_write_bio ( name , type ) int PEM_write_bio_ ## name ( BIO * bp , type * x ) ;
# define DECLARE_PEM_write_bio_const ( name , type ) int PEM_write_bio_ ## name ( BIO * bp , const type * x ) ;
# define DECLARE_PEM_write_cb_bio ( name , type ) int PEM_write_bio_ ## name ( BIO * bp , type * x , const EVP_CIPHER * enc , unsigned char * kstr , int klen , pem_password_cb * cb , void * u ) ;
# define DECLARE_PEM_write ( name , type ) DECLARE_PEM_write_bio ( name , type ) DECLARE_PEM_write_fp ( name , type ) # define DECLARE_PEM_write_const ( name , type ) DECLARE_PEM_write_bio_const ( name , type ) DECLARE_PEM_write_fp_const ( name , type ) # define DECLARE_PEM_write_cb ( name , type ) DECLARE_PEM_write_cb_bio ( name , type ) DECLARE_PEM_write_cb_fp ( name , type ) # define DECLARE_PEM_read ( name , type ) DECLARE_PEM_read_bio ( name , type ) DECLARE_PEM_read_fp ( name , type ) # define DECLARE_PEM_rw ( name , type ) DECLARE_PEM_read ( name , type ) DECLARE_PEM_write ( name , type ) # define DECLARE_PEM_rw_const ( name , type ) DECLARE_PEM_read ( name , type ) DECLARE_PEM_write_const ( name , type ) # define DECLARE_PEM_rw_cb ( name , type ) DECLARE_PEM_read ( name , type ) DECLARE_PEM_write_cb ( name , type ) typedef int pem_password_cb ( char * buf , int size , int rwflag , void * userdata ) ;
int PEM_get_EVP_CIPHER_INFO ( char * header , EVP_CIPHER_INFO * cipher ) ;
int PEM_do_header ( EVP_CIPHER_INFO * cipher , unsigned char * data , long * len , pem_password_cb * callback , void * u ) ;
int PEM_read_bio ( BIO * bp , char * * name , char * * header , unsigned char * * data , long * len ) ;
# define PEM_FLAG_SECURE 0x1 # define PEM_FLAG_EAY_COMPATIBLE 0x2 # define PEM_FLAG_ONLY_B64 0x4 int PEM_read_bio_ex ( BIO * bp , char * * name , char * * header , unsigned char * * data , long * len , unsigned int flags ) ;
int PEM_bytes_read_bio_secmem ( unsigned char * * pdata , long * plen , char * * pnm , const char * name , BIO * bp , pem_password_cb * cb , void * u ) ;
int PEM_write_bio ( BIO * bp , const char * name , const char * hdr , const unsigned char * data , long len ) ;
int PEM_bytes_read_bio ( unsigned char * * pdata , long * plen , char * * pnm , const char * name , BIO * bp , pem_password_cb * cb , void * u ) ;
void * PEM_ASN1_read_bio ( d2i_of_void * d2i , const char * name , BIO * bp , void * * x , pem_password_cb * cb , void * u ) ;
int PEM_ASN1_write_bio ( i2d_of_void * i2d , const char * name , BIO * bp , void * x , const EVP_CIPHER * enc , unsigned char * kstr , int klen , pem_password_cb * cb , void * u ) ;
STACK_OF ( X509_INFO ) * PEM_X509_INFO_read_bio ( BIO * bp , STACK_OF ( X509_INFO ) * sk , pem_password_cb * cb , void * u ) ;
int PEM_X509_INFO_write_bio ( BIO * bp , X509_INFO * xi , EVP_CIPHER * enc , unsigned char * kstr , int klen , pem_password_cb * cd , void * u ) ;
# ifndef OPENSSL_NO_STDIO int PEM_read ( FILE * fp , char * * name , char * * header , unsigned char * * data , long * len ) ;
int PEM_write ( FILE * fp , const char * name , const char * hdr , const unsigned char * data , long len ) ;
void * PEM_ASN1_read ( d2i_of_void * d2i , const char * name , FILE * fp , void * * x , pem_password_cb * cb , void * u ) ;
int PEM_ASN1_write ( i2d_of_void * i2d , const char * name , FILE * fp , void * x , const EVP_CIPHER * enc , unsigned char * kstr , int klen , pem_password_cb * callback , void * u ) ;
STACK_OF ( X509_INFO ) * PEM_X509_INFO_read ( FILE * fp , STACK_OF ( X509_INFO ) * sk , pem_password_cb * cb , void * u ) ;
# endif int PEM_SignInit ( EVP_MD_CTX * ctx , EVP_MD * type ) ;
int PEM_SignUpdate ( EVP_MD_CTX * ctx , unsigned char * d , unsigned int cnt ) ;
int PEM_SignFinal ( EVP_MD_CTX * ctx , unsigned char * sigret , unsigned int * siglen , EVP_PKEY * pkey ) ;
int PEM_def_callback ( char * buf , int num , int rwflag , void * userdata ) ;
void PEM_proc_type ( char * buf , int type ) ;
void PEM_dek_info ( char * buf , const char * type , int len , char * str ) ;
# include < openssl / symhacks . h > DECLARE_PEM_rw ( X509 , X509 ) DECLARE_PEM_rw ( X509_AUX , X509 ) DECLARE_PEM_rw ( X509_REQ , X509_REQ ) |
8,693,230,691,624,197,000 | chrome | 29 | 0 | IN_PROC_BROWSER_TEST_F ( ExtensionPreferenceApiTest , MAYBE_Standard ) {
PrefService * prefs = profile_ -> GetPrefs ( ) ;
prefs -> SetBoolean ( prefs : : kAlternateErrorPagesEnabled , false ) ;
prefs -> SetBoolean ( autofill : : prefs : : kAutofillEnabledDeprecated , false ) ;
prefs -> SetBoolean ( autofill : : prefs : : kAutofillCreditCardEnabled , false ) ;
prefs -> SetBoolean ( autofill : : prefs : : kAutofillProfileEnabled , false ) ;
prefs -> SetBoolean ( prefs : : kBlockThirdPartyCookies , true ) ;
prefs -> SetBoolean ( prefs : : kEnableHyperlinkAuditing , false ) ;
prefs -> SetBoolean ( prefs : : kEnableReferrers , false ) ;
prefs -> SetBoolean ( prefs : : kOfferTranslateEnabled , false ) ;
prefs -> SetInteger ( prefs : : kNetworkPredictionOptions , chrome_browser_net : : NETWORK_PREDICTION_NEVER ) ;
prefs -> SetBoolean ( password_manager : : prefs : : kCredentialsEnableService , false ) ;
prefs -> SetBoolean ( prefs : : kSafeBrowsingEnabled , false ) ;
prefs -> SetBoolean ( prefs : : kSearchSuggestEnabled , false ) ;
prefs -> SetBoolean ( prefs : : kWebRTCMultipleRoutesEnabled , false ) ;
prefs -> SetBoolean ( prefs : : kWebRTCNonProxiedUdpEnabled , false ) ;
prefs -> SetString ( prefs : : kWebRTCIPHandlingPolicy , content : : kWebRTCIPHandlingDefaultPublicInterfaceOnly ) ;
const char kExtensionPath [ ] = "preference/standard" ;
EXPECT_TRUE ( RunExtensionSubtest ( kExtensionPath , "test.html" ) ) << message_ ;
CheckPreferencesSet ( ) ;
ReloadExtension ( last_loaded_extension_id ( ) ) ;
CheckPreferencesSet ( ) ;
extensions : : TestExtensionRegistryObserver observer ( extensions : : ExtensionRegistry : : Get ( profile_ ) , last_loaded_extension_id ( ) ) ;
UninstallExtension ( last_loaded_extension_id ( ) ) ;
observer . WaitForExtensionUninstalled ( ) ;
CheckPreferencesCleared ( ) ;
LoadExtension ( test_data_dir_ . AppendASCII ( kExtensionPath ) ) ;
CheckPreferencesCleared ( ) ;
} |
-6,552,851,419,396,579,000 | debian | 16 | 0 | static int dissect_notify_field ( tvbuff_t * tvb , int offset , packet_info * pinfo , proto_tree * tree , dcerpc_info * di , guint8 * drep , guint16 type , guint16 * data ) {
guint16 field ;
const char * str ;
offset = dissect_ndr_uint16 ( tvb , offset , pinfo , NULL , di , drep , hf_notify_field , & field ) ;
switch ( type ) {
case PRINTER_NOTIFY_TYPE : str = val_to_str_ext_const ( field , & printer_notify_option_data_vals_ext , "Unknown" ) ;
break ;
case JOB_NOTIFY_TYPE : str = val_to_str_ext_const ( field , & job_notify_option_data_vals_ext , "Unknown" ) ;
break ;
default : str = "Unknown notify type" ;
break ;
}
proto_tree_add_uint_format_value ( tree , hf_notify_field , tvb , offset - 2 , 2 , field , "%s (%d)" , str , field ) ;
if ( data ) * data = field ;
return offset ;
} |
3,246,343,243,711,264,300 | debian | 17 | 0 | static void send_version_response ( int fd , version_ack_t ack , uint32_t payload , int userid , struct query * q ) {
char out [ 9 ] ;
switch ( ack ) {
case VERSION_ACK : strncpy ( out , "VACK" , sizeof ( out ) ) ;
break ;
case VERSION_NACK : strncpy ( out , "VNAK" , sizeof ( out ) ) ;
break ;
case VERSION_FULL : strncpy ( out , "VFUL" , sizeof ( out ) ) ;
break ;
}
out [ 4 ] = ( ( payload >> 24 ) & 0xff ) ;
out [ 5 ] = ( ( payload >> 16 ) & 0xff ) ;
out [ 6 ] = ( ( payload >> 8 ) & 0xff ) ;
out [ 7 ] = ( ( payload ) & 0xff ) ;
out [ 8 ] = userid & 0xff ;
write_dns ( fd , q , out , sizeof ( out ) , users [ userid ] . downenc ) ;
} |
-320,658,364,442,495,940 | chrome | 38 | 0 | void vp8_mbpost_proc_across_ip_c ( unsigned char * src , int pitch , int rows , int cols , int flimit ) {
int r , c , i ;
unsigned char * s = src ;
unsigned char d [ 16 ] ;
for ( r = 0 ;
r < rows ;
r ++ ) {
int sumsq = 0 ;
int sum = 0 ;
for ( i = - 8 ;
i < 0 ;
i ++ ) s [ i ] = s [ 0 ] ;
for ( i = 0 ;
i < 17 ;
i ++ ) s [ i + cols ] = s [ cols - 1 ] ;
for ( i = - 8 ;
i <= 6 ;
i ++ ) {
sumsq += s [ i ] * s [ i ] ;
sum += s [ i ] ;
d [ i + 8 ] = 0 ;
}
for ( c = 0 ;
c < cols + 8 ;
c ++ ) {
int x = s [ c + 7 ] - s [ c - 8 ] ;
int y = s [ c + 7 ] + s [ c - 8 ] ;
sum += x ;
sumsq += x * y ;
d [ c & 15 ] = s [ c ] ;
if ( sumsq * 15 - sum * sum < flimit ) {
d [ c & 15 ] = ( 8 + sum + s [ c ] ) >> 4 ;
}
s [ c - 8 ] = d [ ( c - 8 ) & 15 ] ;
}
s += pitch ;
}
} |
2,626,033,973,808,493,000 | chrome | 26 | 0 | static void qcms_transform_module_matrix ( struct qcms_modular_transform * transform , float * src , float * dest , size_t length ) {
size_t i ;
struct matrix mat ;
mat . m [ 0 ] [ 0 ] = transform -> matrix . m [ 0 ] [ 0 ] ;
mat . m [ 1 ] [ 0 ] = transform -> matrix . m [ 0 ] [ 1 ] ;
mat . m [ 2 ] [ 0 ] = transform -> matrix . m [ 0 ] [ 2 ] ;
mat . m [ 0 ] [ 1 ] = transform -> matrix . m [ 1 ] [ 0 ] ;
mat . m [ 1 ] [ 1 ] = transform -> matrix . m [ 1 ] [ 1 ] ;
mat . m [ 2 ] [ 1 ] = transform -> matrix . m [ 1 ] [ 2 ] ;
mat . m [ 0 ] [ 2 ] = transform -> matrix . m [ 2 ] [ 0 ] ;
mat . m [ 1 ] [ 2 ] = transform -> matrix . m [ 2 ] [ 1 ] ;
mat . m [ 2 ] [ 2 ] = transform -> matrix . m [ 2 ] [ 2 ] ;
for ( i = 0 ;
i < length ;
i ++ ) {
float in_r = * src ++ ;
float in_g = * src ++ ;
float in_b = * src ++ ;
float out_r = mat . m [ 0 ] [ 0 ] * in_r + mat . m [ 1 ] [ 0 ] * in_g + mat . m [ 2 ] [ 0 ] * in_b ;
float out_g = mat . m [ 0 ] [ 1 ] * in_r + mat . m [ 1 ] [ 1 ] * in_g + mat . m [ 2 ] [ 1 ] * in_b ;
float out_b = mat . m [ 0 ] [ 2 ] * in_r + mat . m [ 1 ] [ 2 ] * in_g + mat . m [ 2 ] [ 2 ] * in_b ;
* dest ++ = clamp_float ( out_r ) ;
* dest ++ = clamp_float ( out_g ) ;
* dest ++ = clamp_float ( out_b ) ;
}
} |
-4,527,380,754,569,408,000 | chrome | 5 | 0 | static void _hb_ ## name ## _destroy ( hb_ ## name ## _t * l ) {
free ( l ) ;
}
HB_DEFINE_BOXED_TYPE ( name , _hb_ ## name ## _reference , _hb_ ## name ## _destroy ) ;
HB_DEFINE_OBJECT_TYPE ( buffer ) HB_DEFINE_OBJECT_TYPE ( blob ) HB_DEFINE_OBJECT_TYPE ( face ) HB_DEFINE_OBJECT_TYPE ( font ) HB_DEFINE_OBJECT_TYPE ( font_funcs ) HB_DEFINE_OBJECT_TYPE ( set ) HB_DEFINE_OBJECT_TYPE ( shape_plan ) HB_DEFINE_OBJECT_TYPE ( unicode_funcs ) HB_DEFINE_VALUE_TYPE ( feature ) HB_DEFINE_VALUE_TYPE ( glyph_info ) HB_DEFINE_VALUE_TYPE ( glyph_position ) HB_DEFINE_VALUE_TYPE ( segment_properties ) HB_DEFINE_VALUE_TYPE ( user_data_key ) |
-5,280,794,106,681,745,000 | debian | 68 | 0 | static AsfStream * gst_asf_demux_find_stream_with_complete_payload ( GstASFDemux * demux ) {
AsfPayload * best_payload = NULL ;
AsfStream * best_stream = NULL ;
guint i ;
for ( i = 0 ;
i < demux -> num_streams ;
++ i ) {
AsfStream * stream ;
int j ;
stream = & demux -> stream [ i ] ;
if ( stream -> payloads -> len > 0 ) {
AsfPayload * payload = NULL ;
gint last_idx ;
if ( GST_ASF_DEMUX_IS_REVERSE_PLAYBACK ( demux -> segment ) ) {
if ( stream -> is_video ) {
if ( stream -> reverse_kf_ready ) {
payload = & g_array_index ( stream -> payloads , AsfPayload , stream -> kf_pos ) ;
if ( G_UNLIKELY ( ! GST_CLOCK_TIME_IS_VALID ( payload -> ts ) ) ) {
continue ;
}
}
else {
continue ;
}
}
else {
for ( j = stream -> payloads -> len - 1 ;
j >= 0 && ( payload == NULL || ! GST_CLOCK_TIME_IS_VALID ( payload -> ts ) ) ;
-- j ) {
payload = & g_array_index ( stream -> payloads , AsfPayload , j ) ;
}
if ( ! gst_asf_payload_is_complete ( payload ) ) continue ;
}
}
else {
for ( last_idx = stream -> payloads -> len - 1 ;
last_idx >= 0 && ( payload == NULL || ! GST_CLOCK_TIME_IS_VALID ( payload -> ts ) ) ;
-- last_idx ) {
payload = & g_array_index ( stream -> payloads , AsfPayload , last_idx ) ;
}
if ( GST_CLOCK_TIME_IS_VALID ( payload -> ts ) ) gst_asf_demux_check_segment_ts ( demux , payload -> ts ) ;
if ( G_UNLIKELY ( GST_CLOCK_TIME_IS_VALID ( payload -> ts ) && ( payload -> ts < demux -> segment . start ) ) ) {
if ( G_UNLIKELY ( ( ! demux -> keyunit_sync ) && ( ! demux -> accurate ) && payload -> keyframe ) ) {
GST_DEBUG_OBJECT ( stream -> pad , "Found keyframe, updating segment start to %" GST_TIME_FORMAT , GST_TIME_ARGS ( payload -> ts ) ) ;
demux -> segment . start = payload -> ts ;
demux -> segment . time = payload -> ts ;
}
else {
GST_DEBUG_OBJECT ( stream -> pad , "Last queued payload has timestamp %" GST_TIME_FORMAT " which is before our segment start %" GST_TIME_FORMAT ", not pushing yet" , GST_TIME_ARGS ( payload -> ts ) , GST_TIME_ARGS ( demux -> segment . start ) ) ;
continue ;
}
}
payload = NULL ;
for ( j = 0 ;
j < stream -> payloads -> len && ( payload == NULL || ! GST_CLOCK_TIME_IS_VALID ( payload -> ts ) ) ;
++ j ) {
payload = & g_array_index ( stream -> payloads , AsfPayload , j ) ;
}
if ( ! gst_asf_payload_is_complete ( payload ) ) continue ;
}
if ( best_stream == NULL || best_payload -> ts > payload -> ts ) {
best_stream = stream ;
best_payload = payload ;
}
}
}
return best_stream ;
} |
-5,992,472,514,718,425,000 | debian | 23 | 0 | static char * lxc_cgroup_get_hierarchy_abs_path ( const char * subsystem , const char * name , const char * lxcpath ) {
struct cgroup_meta_data * meta ;
struct cgroup_process_info * base_info , * info ;
struct cgroup_mount_point * mp ;
char * result = NULL ;
meta = lxc_cgroup_load_meta ( ) ;
if ( ! meta ) return NULL ;
base_info = lxc_cgroup_get_container_info ( name , lxcpath , meta ) ;
if ( ! base_info ) goto out1 ;
info = find_info_for_subsystem ( base_info , subsystem ) ;
if ( ! info ) goto out2 ;
if ( info -> designated_mount_point ) {
mp = info -> designated_mount_point ;
}
else {
mp = lxc_cgroup_find_mount_point ( info -> hierarchy , info -> cgroup_path , true ) ;
if ( ! mp ) goto out3 ;
}
result = cgroup_to_absolute_path ( mp , info -> cgroup_path , NULL ) ;
out3 : out2 : lxc_cgroup_process_info_free ( base_info ) ;
out1 : lxc_cgroup_put_meta ( meta ) ;
return result ;
} |
1,458,662,858,915,721,500 | debian | 47 | 0 | void tb_phys_invalidate ( TranslationBlock * tb , tb_page_addr_t page_addr ) {
CPUArchState * env ;
PageDesc * p ;
unsigned int h , n1 ;
tb_page_addr_t phys_pc ;
TranslationBlock * tb1 , * tb2 ;
phys_pc = tb -> page_addr [ 0 ] + ( tb -> pc & ~ TARGET_PAGE_MASK ) ;
h = tb_phys_hash_func ( phys_pc ) ;
tb_hash_remove ( & tcg_ctx . tb_ctx . tb_phys_hash [ h ] , tb ) ;
if ( tb -> page_addr [ 0 ] != page_addr ) {
p = page_find ( tb -> page_addr [ 0 ] >> TARGET_PAGE_BITS ) ;
tb_page_remove ( & p -> first_tb , tb ) ;
invalidate_page_bitmap ( p ) ;
}
if ( tb -> page_addr [ 1 ] != - 1 && tb -> page_addr [ 1 ] != page_addr ) {
p = page_find ( tb -> page_addr [ 1 ] >> TARGET_PAGE_BITS ) ;
tb_page_remove ( & p -> first_tb , tb ) ;
invalidate_page_bitmap ( p ) ;
}
tcg_ctx . tb_ctx . tb_invalidated_flag = 1 ;
h = tb_jmp_cache_hash_func ( tb -> pc ) ;
for ( env = first_cpu ;
env != NULL ;
env = env -> next_cpu ) {
if ( env -> tb_jmp_cache [ h ] == tb ) {
env -> tb_jmp_cache [ h ] = NULL ;
}
}
tb_jmp_remove ( tb , 0 ) ;
tb_jmp_remove ( tb , 1 ) ;
tb1 = tb -> jmp_first ;
for ( ;
;
) {
n1 = ( uintptr_t ) tb1 & 3 ;
if ( n1 == 2 ) {
break ;
}
tb1 = ( TranslationBlock * ) ( ( uintptr_t ) tb1 & ~ 3 ) ;
tb2 = tb1 -> jmp_next [ n1 ] ;
tb_reset_jump ( tb1 , n1 ) ;
tb1 -> jmp_next [ n1 ] = NULL ;
tb1 = tb2 ;
}
tb -> jmp_first = ( TranslationBlock * ) ( ( uintptr_t ) tb | 2 ) ;
tcg_ctx . tb_ctx . tb_phys_invalidate_count ++ ;
} |
-4,979,531,020,783,645,000 | debian | 26 | 0 | bool start_postmaster ( ClusterInfo * cluster , bool throw_error ) {
char cmd [ MAXPGPATH * 4 + 1000 ] ;
PGconn * conn ;
bool pg_ctl_return = false ;
char socket_string [ MAXPGPATH + 200 ] ;
static bool exit_hook_registered = false ;
if ( ! exit_hook_registered ) {
atexit ( stop_postmaster_atexit ) ;
exit_hook_registered = true ;
}
socket_string [ 0 ] = '\0' ;
# ifdef HAVE_UNIX_SOCKETS strcat ( socket_string , " -c listen_addresses='' -c unix_socket_permissions=0700" ) ;
if ( cluster -> sockdir ) snprintf ( socket_string + strlen ( socket_string ) , sizeof ( socket_string ) - strlen ( socket_string ) , " -c %s='%s'" , ( GET_MAJOR_VERSION ( cluster -> major_version ) < 903 ) ? "unix_socket_directory" : "unix_socket_directories" , cluster -> sockdir ) ;
# endif snprintf ( cmd , sizeof ( cmd ) , "\"%s/pg_ctl\" -w -l \"%s\" -D \"%s\" -o \"-p %d%s%s %s%s\" start" , cluster -> bindir , SERVER_LOG_FILE , cluster -> pgconfig , cluster -> port , ( cluster -> controldata . cat_ver >= BINARY_UPGRADE_SERVER_FLAG_CAT_VER ) ? " -b" : " -c autovacuum=off -c autovacuum_freeze_max_age=2000000000" , ( cluster == & new_cluster ) ? " -c synchronous_commit=off -c fsync=off -c full_page_writes=off" : "" , cluster -> pgopts ? cluster -> pgopts : "" , socket_string ) ;
pg_ctl_return = exec_prog ( SERVER_START_LOG_FILE , ( strcmp ( SERVER_LOG_FILE , SERVER_START_LOG_FILE ) != 0 ) ? SERVER_LOG_FILE : NULL , false , "%s" , cmd ) ;
if ( ! pg_ctl_return && ! throw_error ) return false ;
if ( pg_ctl_return ) os_info . running_cluster = cluster ;
if ( ( conn = get_db_conn ( cluster , "template1" ) ) == NULL || PQstatus ( conn ) != CONNECTION_OK ) {
pg_log ( PG_REPORT , "\nconnection to database failed: %s\n" , PQerrorMessage ( conn ) ) ;
if ( conn ) PQfinish ( conn ) ;
pg_fatal ( "could not connect to %s postmaster started with the command:\n" "%s\n" , CLUSTER_NAME ( cluster ) , cmd ) ;
}
PQfinish ( conn ) ;
if ( ! pg_ctl_return ) pg_fatal ( "pg_ctl failed to start the %s server, or connection failed\n" , CLUSTER_NAME ( cluster ) ) ;
return true ;
} |
3,599,206,110,384,554,500 | debian | 92 | 0 | void name ## _free ( type * a ) ;
# define DECLARE_ASN1_PRINT_FUNCTION ( stname ) DECLARE_ASN1_PRINT_FUNCTION_fname ( stname , stname ) # define DECLARE_ASN1_PRINT_FUNCTION_fname ( stname , fname ) int fname ## _print_ctx ( BIO * out , stname * x , int indent , const ASN1_PCTX * pctx ) ;
# define D2I_OF ( type ) type * ( * ) ( type * * , const unsigned char * * , long ) # define I2D_OF ( type ) int ( * ) ( type * , unsigned char * * ) # define I2D_OF_const ( type ) int ( * ) ( const type * , unsigned char * * ) # define CHECKED_D2I_OF ( type , d2i ) ( ( d2i_of_void * ) ( 1 ? d2i : ( ( D2I_OF ( type ) ) 0 ) ) ) # define CHECKED_I2D_OF ( type , i2d ) ( ( i2d_of_void * ) ( 1 ? i2d : ( ( I2D_OF ( type ) ) 0 ) ) ) # define CHECKED_NEW_OF ( type , xnew ) ( ( void * ( * ) ( void ) ) ( 1 ? xnew : ( ( type * ( * ) ( void ) ) 0 ) ) ) # define CHECKED_PTR_OF ( type , p ) ( ( void * ) ( 1 ? p : ( type * ) 0 ) ) # define CHECKED_PPTR_OF ( type , p ) ( ( void * * ) ( 1 ? p : ( type * * ) 0 ) ) # define TYPEDEF_D2I_OF ( type ) typedef type * d2i_of_ ## type ( type * * , const unsigned char * * , long ) # define TYPEDEF_I2D_OF ( type ) typedef int i2d_of_ ## type ( type * , unsigned char * * ) # define TYPEDEF_D2I2D_OF ( type ) TYPEDEF_D2I_OF ( type ) ;
TYPEDEF_I2D_OF ( type ) TYPEDEF_D2I2D_OF ( void ) ;
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION typedef const ASN1_ITEM ASN1_ITEM_EXP ;
# define ASN1_ITEM_ptr ( iptr ) ( iptr ) # define ASN1_ITEM_ref ( iptr ) ( & ( iptr ## _it ) ) # define ASN1_ITEM_rptr ( ref ) ( & ( ref ## _it ) ) # define DECLARE_ASN1_ITEM ( name ) OPENSSL_EXTERN const ASN1_ITEM name ## _it ;
# else typedef const ASN1_ITEM * ASN1_ITEM_EXP ( void ) ;
# define ASN1_ITEM_ptr ( iptr ) ( iptr ( ) ) # define ASN1_ITEM_ref ( iptr ) ( iptr ## _it ) # define ASN1_ITEM_rptr ( ref ) ( ref ## _it ( ) ) # define DECLARE_ASN1_ITEM ( name ) const ASN1_ITEM * name ## _it ( void ) ;
# endif # define ASN1_STRFLGS_ESC_2253 1 # define ASN1_STRFLGS_ESC_CTRL 2 # define ASN1_STRFLGS_ESC_MSB 4 # define ASN1_STRFLGS_ESC_QUOTE 8 # define CHARTYPE_PRINTABLESTRING 0x10 # define CHARTYPE_FIRST_ESC_2253 0x20 # define CHARTYPE_LAST_ESC_2253 0x40 # define ASN1_STRFLGS_UTF8_CONVERT 0x10 # define ASN1_STRFLGS_IGNORE_TYPE 0x20 # define ASN1_STRFLGS_SHOW_TYPE 0x40 # define ASN1_STRFLGS_DUMP_ALL 0x80 # define ASN1_STRFLGS_DUMP_UNKNOWN 0x100 # define ASN1_STRFLGS_DUMP_DER 0x200 # define ASN1_STRFLGS_ESC_2254 0x400 # define ASN1_STRFLGS_RFC2253 ( ASN1_STRFLGS_ESC_2253 | ASN1_STRFLGS_ESC_CTRL | ASN1_STRFLGS_ESC_MSB | ASN1_STRFLGS_UTF8_CONVERT | ASN1_STRFLGS_DUMP_UNKNOWN | ASN1_STRFLGS_DUMP_DER ) DEFINE_STACK_OF ( ASN1_INTEGER ) DEFINE_STACK_OF ( ASN1_GENERALSTRING ) DEFINE_STACK_OF ( ASN1_UTF8STRING ) typedef struct asn1_type_st {
int type ;
union {
char * ptr ;
ASN1_BOOLEAN boolean ;
ASN1_STRING * asn1_string ;
ASN1_OBJECT * object ;
ASN1_INTEGER * integer ;
ASN1_ENUMERATED * enumerated ;
ASN1_BIT_STRING * bit_string ;
ASN1_OCTET_STRING * octet_string ;
ASN1_PRINTABLESTRING * printablestring ;
ASN1_T61STRING * t61string ;
ASN1_IA5STRING * ia5string ;
ASN1_GENERALSTRING * generalstring ;
ASN1_BMPSTRING * bmpstring ;
ASN1_UNIVERSALSTRING * universalstring ;
ASN1_UTCTIME * utctime ;
ASN1_GENERALIZEDTIME * generalizedtime ;
ASN1_VISIBLESTRING * visiblestring ;
ASN1_UTF8STRING * utf8string ;
ASN1_STRING * set ;
ASN1_STRING * sequence ;
ASN1_VALUE * asn1_value ;
}
value ;
}
ASN1_TYPE ;
DEFINE_STACK_OF ( ASN1_TYPE ) typedef STACK_OF ( ASN1_TYPE ) ASN1_SEQUENCE_ANY ;
DECLARE_ASN1_ENCODE_FUNCTIONS_const ( ASN1_SEQUENCE_ANY , ASN1_SEQUENCE_ANY ) DECLARE_ASN1_ENCODE_FUNCTIONS_const ( ASN1_SEQUENCE_ANY , ASN1_SET_ANY ) typedef struct BIT_STRING_BITNAME_st {
int bitnum ;
const char * lname ;
const char * sname ;
}
BIT_STRING_BITNAME ;
# define B_ASN1_TIME B_ASN1_UTCTIME | B_ASN1_GENERALIZEDTIME # define B_ASN1_PRINTABLE B_ASN1_NUMERICSTRING | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING | B_ASN1_BIT_STRING | B_ASN1_UNIVERSALSTRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING | B_ASN1_SEQUENCE | B_ASN1_UNKNOWN # define B_ASN1_DIRECTORYSTRING B_ASN1_PRINTABLESTRING | B_ASN1_TELETEXSTRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING | B_ASN1_UTF8STRING # define B_ASN1_DISPLAYTEXT B_ASN1_IA5STRING | B_ASN1_VISIBLESTRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING DECLARE_ASN1_FUNCTIONS_fname ( ASN1_TYPE , ASN1_ANY , ASN1_TYPE ) int ASN1_TYPE_get ( const ASN1_TYPE * a ) ;
void ASN1_TYPE_set ( ASN1_TYPE * a , int type , void * value ) ;
int ASN1_TYPE_set1 ( ASN1_TYPE * a , int type , const void * value ) ;
int ASN1_TYPE_cmp ( const ASN1_TYPE * a , const ASN1_TYPE * b ) ;
ASN1_TYPE * ASN1_TYPE_pack_sequence ( const ASN1_ITEM * it , void * s , ASN1_TYPE * * t ) ;
void * ASN1_TYPE_unpack_sequence ( const ASN1_ITEM * it , const ASN1_TYPE * t ) ;
ASN1_OBJECT * ASN1_OBJECT_new ( void ) ;
void ASN1_OBJECT_free ( ASN1_OBJECT * a ) ;
int i2d_ASN1_OBJECT ( const ASN1_OBJECT * a , unsigned char * * pp ) ;
ASN1_OBJECT * d2i_ASN1_OBJECT ( ASN1_OBJECT * * a , const unsigned char * * pp , long length ) ;
DECLARE_ASN1_ITEM ( ASN1_OBJECT ) DEFINE_STACK_OF ( ASN1_OBJECT ) ASN1_STRING * ASN1_STRING_new ( void ) ;
void ASN1_STRING_free ( ASN1_STRING * a ) ;
void ASN1_STRING_clear_free ( ASN1_STRING * a ) ;
int ASN1_STRING_copy ( ASN1_STRING * dst , const ASN1_STRING * str ) ;
ASN1_STRING * ASN1_STRING_dup ( const ASN1_STRING * a ) ;
ASN1_STRING * ASN1_STRING_type_new ( int type ) ;
int ASN1_STRING_cmp ( const ASN1_STRING * a , const ASN1_STRING * b ) ;
int ASN1_STRING_set ( ASN1_STRING * str , const void * data , int len ) ;
void ASN1_STRING_set0 ( ASN1_STRING * str , void * data , int len ) ;
int ASN1_STRING_length ( const ASN1_STRING * x ) ;
void ASN1_STRING_length_set ( ASN1_STRING * x , int n ) ;
int ASN1_STRING_type ( const ASN1_STRING * x ) ;
DEPRECATEDIN_1_1_0 ( unsigned char * ASN1_STRING_data ( ASN1_STRING * x ) ) const unsigned char * ASN1_STRING_get0_data ( const ASN1_STRING * x ) ;
DECLARE_ASN1_FUNCTIONS ( ASN1_BIT_STRING ) int ASN1_BIT_STRING_set ( ASN1_BIT_STRING * a , unsigned char * d , int length ) ;
int ASN1_BIT_STRING_set_bit ( ASN1_BIT_STRING * a , int n , int value ) ;
int ASN1_BIT_STRING_get_bit ( const ASN1_BIT_STRING * a , int n ) ;
int ASN1_BIT_STRING_check ( const ASN1_BIT_STRING * a , const unsigned char * flags , int flags_len ) ;
int ASN1_BIT_STRING_name_print ( BIO * out , ASN1_BIT_STRING * bs , BIT_STRING_BITNAME * tbl , int indent ) ;
int ASN1_BIT_STRING_num_asc ( const char * name , BIT_STRING_BITNAME * tbl ) ;
int ASN1_BIT_STRING_set_asc ( ASN1_BIT_STRING * bs , const char * name , int value , BIT_STRING_BITNAME * tbl ) ;
DECLARE_ASN1_FUNCTIONS ( ASN1_INTEGER ) ASN1_INTEGER * d2i_ASN1_UINTEGER ( ASN1_INTEGER * * a , const unsigned char * * pp , long length ) ;
ASN1_INTEGER * ASN1_INTEGER_dup ( const ASN1_INTEGER * x ) ;
int ASN1_INTEGER_cmp ( const ASN1_INTEGER * x , const ASN1_INTEGER * y ) ;
DECLARE_ASN1_FUNCTIONS ( ASN1_ENUMERATED ) int ASN1_UTCTIME_check ( const ASN1_UTCTIME * a ) ;
ASN1_UTCTIME * ASN1_UTCTIME_set ( ASN1_UTCTIME * s , time_t t ) ;
ASN1_UTCTIME * ASN1_UTCTIME_adj ( ASN1_UTCTIME * s , time_t t , int offset_day , long offset_sec ) ;
int ASN1_UTCTIME_set_string ( ASN1_UTCTIME * s , const char * str ) ;
int ASN1_UTCTIME_cmp_time_t ( const ASN1_UTCTIME * s , time_t t ) ;
int ASN1_GENERALIZEDTIME_check ( const ASN1_GENERALIZEDTIME * a ) ;
ASN1_GENERALIZEDTIME * ASN1_GENERALIZEDTIME_set ( ASN1_GENERALIZEDTIME * s , time_t t ) ;
ASN1_GENERALIZEDTIME * ASN1_GENERALIZEDTIME_adj ( ASN1_GENERALIZEDTIME * s , time_t t , int offset_day , long offset_sec ) ;
int ASN1_GENERALIZEDTIME_set_string ( ASN1_GENERALIZEDTIME * s , const char * str ) ;
int ASN1_TIME_diff ( int * pday , int * psec , const ASN1_TIME * from , const ASN1_TIME * to ) ;
DECLARE_ASN1_FUNCTIONS ( ASN1_OCTET_STRING ) ASN1_OCTET_STRING * ASN1_OCTET_STRING_dup ( const ASN1_OCTET_STRING * a ) ;
int ASN1_OCTET_STRING_cmp ( const ASN1_OCTET_STRING * a , const ASN1_OCTET_STRING * b ) ;
int ASN1_OCTET_STRING_set ( ASN1_OCTET_STRING * str , const unsigned char * data , int len ) ;
DECLARE_ASN1_FUNCTIONS ( ASN1_VISIBLESTRING ) DECLARE_ASN1_FUNCTIONS ( ASN1_UNIVERSALSTRING ) DECLARE_ASN1_FUNCTIONS ( ASN1_UTF8STRING ) DECLARE_ASN1_FUNCTIONS ( ASN1_NULL ) DECLARE_ASN1_FUNCTIONS ( ASN1_BMPSTRING ) int UTF8_getc ( const unsigned char * str , int len , unsigned long * val ) ;
int UTF8_putc ( unsigned char * str , int len , unsigned long value ) ;
DECLARE_ASN1_FUNCTIONS_name ( ASN1_STRING , ASN1_PRINTABLE ) DECLARE_ASN1_FUNCTIONS_name ( ASN1_STRING , DIRECTORYSTRING ) DECLARE_ASN1_FUNCTIONS_name ( ASN1_STRING , DISPLAYTEXT ) DECLARE_ASN1_FUNCTIONS ( ASN1_PRINTABLESTRING ) DECLARE_ASN1_FUNCTIONS ( ASN1_T61STRING ) DECLARE_ASN1_FUNCTIONS ( ASN1_IA5STRING ) DECLARE_ASN1_FUNCTIONS ( ASN1_GENERALSTRING ) DECLARE_ASN1_FUNCTIONS ( ASN1_UTCTIME ) DECLARE_ASN1_FUNCTIONS ( ASN1_GENERALIZEDTIME ) DECLARE_ASN1_FUNCTIONS ( ASN1_TIME ) |
-6,552,851,419,396,579,000 | debian | 11 | 0 | static int SpoolssEnumPrinterDataEx_q ( tvbuff_t * tvb , int offset , packet_info * pinfo , proto_tree * tree , dcerpc_info * di , guint8 * drep ) {
char * key_name ;
proto_item * hidden_item ;
hidden_item = proto_tree_add_uint ( tree , hf_printerdata , tvb , offset , 0 , 1 ) ;
PROTO_ITEM_SET_HIDDEN ( hidden_item ) ;
offset = dissect_nt_policy_hnd ( tvb , offset , pinfo , tree , di , drep , hf_hnd , NULL , NULL , FALSE , FALSE ) ;
offset = dissect_ndr_cvstring ( tvb , offset , pinfo , tree , di , drep , sizeof ( guint16 ) , hf_printerdata_key , TRUE , & key_name ) ;
col_append_fstr ( pinfo -> cinfo , COL_INFO , ", %s" , key_name ) ;
offset = dissect_ndr_uint32 ( tvb , offset , pinfo , tree , di , drep , hf_offered , NULL ) ;
return offset ;
} |
-5,361,762,812,461,355,000 | chrome | 101 | 1 | static void UConverter_toUnicode_CompoundText_OFFSETS ( UConverterToUnicodeArgs * args , UErrorCode * err ) {
const char * mySource = ( char * ) args -> source ;
UChar * myTarget = args -> target ;
const char * mySourceLimit = args -> sourceLimit ;
const char * tmpSourceLimit = mySourceLimit ;
uint32_t mySourceChar = 0x0000 ;
COMPOUND_TEXT_CONVERTERS currentState , tmpState ;
int32_t sourceOffset = 0 ;
UConverterDataCompoundText * myConverterData = ( UConverterDataCompoundText * ) args -> converter -> extraInfo ;
UConverterSharedData * savedSharedData = NULL ;
UConverterToUnicodeArgs subArgs ;
int32_t minArgsSize ;
if ( args -> size < sizeof ( UConverterToUnicodeArgs ) ) {
minArgsSize = args -> size ;
}
else {
minArgsSize = ( int32_t ) sizeof ( UConverterToUnicodeArgs ) ;
}
uprv_memcpy ( & subArgs , args , minArgsSize ) ;
subArgs . size = ( uint16_t ) minArgsSize ;
currentState = tmpState = myConverterData -> state ;
while ( mySource < mySourceLimit ) {
if ( myTarget < args -> targetLimit ) {
if ( args -> converter -> toULength > 0 ) {
mySourceChar = args -> converter -> toUBytes [ 0 ] ;
}
else {
mySourceChar = ( uint8_t ) * mySource ;
}
if ( mySourceChar == ESC_START ) {
tmpState = findStateFromEscSeq ( mySource , mySourceLimit , args -> converter -> toUBytes , args -> converter -> toULength , err ) ;
if ( * err == U_TRUNCATED_CHAR_FOUND ) {
for ( ;
mySource < mySourceLimit ;
) {
args -> converter -> toUBytes [ args -> converter -> toULength ++ ] = * mySource ++ ;
}
* err = U_ZERO_ERROR ;
break ;
}
else if ( tmpState == INVALID ) {
if ( args -> converter -> toULength == 0 ) {
mySource ++ ;
}
* err = U_ILLEGAL_CHAR_FOUND ;
break ;
}
if ( tmpState != currentState ) {
currentState = tmpState ;
}
sourceOffset = uprv_strlen ( ( char * ) escSeqCompoundText [ currentState ] ) - args -> converter -> toULength ;
mySource += sourceOffset ;
args -> converter -> toULength = 0 ;
}
if ( currentState == COMPOUND_TEXT_SINGLE_0 ) {
while ( mySource < mySourceLimit ) {
if ( * mySource == ESC_START ) {
break ;
}
if ( myTarget < args -> targetLimit ) {
* myTarget ++ = 0x00ff & ( * mySource ++ ) ;
}
else {
* err = U_BUFFER_OVERFLOW_ERROR ;
break ;
}
}
}
else if ( mySource < mySourceLimit ) {
sourceOffset = findNextEsc ( mySource , mySourceLimit ) ;
tmpSourceLimit = mySource + sourceOffset ;
subArgs . source = mySource ;
subArgs . sourceLimit = tmpSourceLimit ;
subArgs . target = myTarget ;
savedSharedData = subArgs . converter -> sharedData ;
subArgs . converter -> sharedData = myConverterData -> myConverterArray [ currentState ] ;
ucnv_MBCSToUnicodeWithOffsets ( & subArgs , err ) ;
subArgs . converter -> sharedData = savedSharedData ;
mySource = subArgs . source ;
myTarget = subArgs . target ;
if ( U_FAILURE ( * err ) ) {
if ( * err == U_BUFFER_OVERFLOW_ERROR ) {
if ( subArgs . converter -> UCharErrorBufferLength > 0 ) {
uprv_memcpy ( args -> converter -> UCharErrorBuffer , subArgs . converter -> UCharErrorBuffer , subArgs . converter -> UCharErrorBufferLength ) ;
}
args -> converter -> UCharErrorBufferLength = subArgs . converter -> UCharErrorBufferLength ;
subArgs . converter -> UCharErrorBufferLength = 0 ;
}
break ;
}
}
}
else {
* err = U_BUFFER_OVERFLOW_ERROR ;
break ;
}
}
myConverterData -> state = currentState ;
args -> target = myTarget ;
args -> source = mySource ;
} |
-2,943,582,541,244,388,000 | chrome | 36 | 0 | unsigned int vp9_sub_pixel_avg_variance ## W ## x ## H ## _c ( const uint8_t * src , int src_stride , int xoffset , int yoffset , const uint8_t * dst , int dst_stride , unsigned int * sse , const uint8_t * second_pred ) {
uint16_t fdata3 [ ( H + 1 ) * W ] ;
uint8_t temp2 [ H * W ] ;
DECLARE_ALIGNED_ARRAY ( 16 , uint8_t , temp3 , H * W ) ;
var_filter_block2d_bil_first_pass ( src , fdata3 , src_stride , 1 , H + 1 , W , BILINEAR_FILTERS_2TAP ( xoffset ) ) ;
var_filter_block2d_bil_second_pass ( fdata3 , temp2 , W , W , H , W , BILINEAR_FILTERS_2TAP ( yoffset ) ) ;
vp9_comp_avg_pred ( temp3 , second_pred , W , H , temp2 , W ) ;
return vp9_variance ## W ## x ## H ## _c ( temp3 , W , dst , dst_stride , sse ) ;
\ }
void vp9_get16x16var_c ( const uint8_t * src_ptr , int source_stride , const uint8_t * ref_ptr , int ref_stride , unsigned int * sse , int * sum ) {
variance ( src_ptr , source_stride , ref_ptr , ref_stride , 16 , 16 , sse , sum ) ;
}
void vp9_get8x8var_c ( const uint8_t * src_ptr , int source_stride , const uint8_t * ref_ptr , int ref_stride , unsigned int * sse , int * sum ) {
variance ( src_ptr , source_stride , ref_ptr , ref_stride , 8 , 8 , sse , sum ) ;
}
unsigned int vp9_mse16x16_c ( const uint8_t * src , int src_stride , const uint8_t * ref , int ref_stride , unsigned int * sse ) {
int sum ;
variance ( src , src_stride , ref , ref_stride , 16 , 16 , sse , & sum ) ;
return * sse ;
}
unsigned int vp9_mse16x8_c ( const uint8_t * src , int src_stride , const uint8_t * ref , int ref_stride , unsigned int * sse ) {
int sum ;
variance ( src , src_stride , ref , ref_stride , 16 , 8 , sse , & sum ) ;
return * sse ;
}
unsigned int vp9_mse8x16_c ( const uint8_t * src , int src_stride , const uint8_t * ref , int ref_stride , unsigned int * sse ) {
int sum ;
variance ( src , src_stride , ref , ref_stride , 8 , 16 , sse , & sum ) ;
return * sse ;
}
unsigned int vp9_mse8x8_c ( const uint8_t * src , int src_stride , const uint8_t * ref , int ref_stride , unsigned int * sse ) {
int sum ;
variance ( src , src_stride , ref , ref_stride , 8 , 8 , sse , & sum ) ;
return * sse ;
}
VAR ( 4 , 4 ) SUBPIX_VAR ( 4 , 4 ) SUBPIX_AVG_VAR ( 4 , 4 ) |
-3,223,310,365,196,836,400 | debian | 155 | 0 | static int decode_frame ( AVCodecContext * avctx , void * data , int * got_frame , AVPacket * avpkt ) {
const uint8_t * buf = avpkt -> data ;
int buf_size = avpkt -> size ;
VmncContext * const c = avctx -> priv_data ;
uint8_t * outptr ;
const uint8_t * src = buf ;
int dx , dy , w , h , depth , enc , chunks , res , size_left , ret ;
if ( ( ret = ff_reget_buffer ( avctx , & c -> pic ) ) < 0 ) {
av_log ( avctx , AV_LOG_ERROR , "reget_buffer() failed\n" ) ;
return ret ;
}
c -> pic . key_frame = 0 ;
c -> pic . pict_type = AV_PICTURE_TYPE_P ;
if ( c -> screendta ) {
int i ;
w = c -> cur_w ;
if ( c -> width < c -> cur_x + w ) w = c -> width - c -> cur_x ;
h = c -> cur_h ;
if ( c -> height < c -> cur_y + h ) h = c -> height - c -> cur_y ;
dx = c -> cur_x ;
if ( dx < 0 ) {
w += dx ;
dx = 0 ;
}
dy = c -> cur_y ;
if ( dy < 0 ) {
h += dy ;
dy = 0 ;
}
if ( ( w > 0 ) && ( h > 0 ) ) {
outptr = c -> pic . data [ 0 ] + dx * c -> bpp2 + dy * c -> pic . linesize [ 0 ] ;
for ( i = 0 ;
i < h ;
i ++ ) {
memcpy ( outptr , c -> screendta + i * c -> cur_w * c -> bpp2 , w * c -> bpp2 ) ;
outptr += c -> pic . linesize [ 0 ] ;
}
}
}
src += 2 ;
chunks = AV_RB16 ( src ) ;
src += 2 ;
while ( chunks -- ) {
dx = AV_RB16 ( src ) ;
src += 2 ;
dy = AV_RB16 ( src ) ;
src += 2 ;
w = AV_RB16 ( src ) ;
src += 2 ;
h = AV_RB16 ( src ) ;
src += 2 ;
enc = AV_RB32 ( src ) ;
src += 4 ;
outptr = c -> pic . data [ 0 ] + dx * c -> bpp2 + dy * c -> pic . linesize [ 0 ] ;
size_left = buf_size - ( src - buf ) ;
switch ( enc ) {
case MAGIC_WMVd : if ( size_left < 2 + w * h * c -> bpp2 * 2 ) {
av_log ( avctx , AV_LOG_ERROR , "Premature end of data! (need %i got %i)\n" , 2 + w * h * c -> bpp2 * 2 , size_left ) ;
return - 1 ;
}
src += 2 ;
c -> cur_w = w ;
c -> cur_h = h ;
c -> cur_hx = dx ;
c -> cur_hy = dy ;
if ( ( c -> cur_hx > c -> cur_w ) || ( c -> cur_hy > c -> cur_h ) ) {
av_log ( avctx , AV_LOG_ERROR , "Cursor hot spot is not in image: %ix%i of %ix%i cursor size\n" , c -> cur_hx , c -> cur_hy , c -> cur_w , c -> cur_h ) ;
c -> cur_hx = c -> cur_hy = 0 ;
}
c -> curbits = av_realloc ( c -> curbits , c -> cur_w * c -> cur_h * c -> bpp2 ) ;
c -> curmask = av_realloc ( c -> curmask , c -> cur_w * c -> cur_h * c -> bpp2 ) ;
c -> screendta = av_realloc ( c -> screendta , c -> cur_w * c -> cur_h * c -> bpp2 ) ;
load_cursor ( c , src ) ;
src += w * h * c -> bpp2 * 2 ;
break ;
case MAGIC_WMVe : src += 2 ;
break ;
case MAGIC_WMVf : c -> cur_x = dx - c -> cur_hx ;
c -> cur_y = dy - c -> cur_hy ;
break ;
case MAGIC_WMVg : src += 10 ;
break ;
case MAGIC_WMVh : src += 4 ;
break ;
case MAGIC_WMVi : c -> pic . key_frame = 1 ;
c -> pic . pict_type = AV_PICTURE_TYPE_I ;
depth = * src ++ ;
if ( depth != c -> bpp ) {
av_log ( avctx , AV_LOG_INFO , "Depth mismatch. Container %i bpp, Frame data: %i bpp\n" , c -> bpp , depth ) ;
}
src ++ ;
c -> bigendian = * src ++ ;
if ( c -> bigendian & ( ~ 1 ) ) {
av_log ( avctx , AV_LOG_INFO , "Invalid header: bigendian flag = %i\n" , c -> bigendian ) ;
return - 1 ;
}
src += 13 ;
break ;
case MAGIC_WMVj : src += 2 ;
break ;
case 0x00000000 : if ( ( dx + w > c -> width ) || ( dy + h > c -> height ) ) {
av_log ( avctx , AV_LOG_ERROR , "Incorrect frame size: %ix%i+%ix%i of %ix%i\n" , w , h , dx , dy , c -> width , c -> height ) ;
return - 1 ;
}
if ( size_left < w * h * c -> bpp2 ) {
av_log ( avctx , AV_LOG_ERROR , "Premature end of data! (need %i got %i)\n" , w * h * c -> bpp2 , size_left ) ;
return - 1 ;
}
paint_raw ( outptr , w , h , src , c -> bpp2 , c -> bigendian , c -> pic . linesize [ 0 ] ) ;
src += w * h * c -> bpp2 ;
break ;
case 0x00000005 : if ( ( dx + w > c -> width ) || ( dy + h > c -> height ) ) {
av_log ( avctx , AV_LOG_ERROR , "Incorrect frame size: %ix%i+%ix%i of %ix%i\n" , w , h , dx , dy , c -> width , c -> height ) ;
return - 1 ;
}
res = decode_hextile ( c , outptr , src , size_left , w , h , c -> pic . linesize [ 0 ] ) ;
if ( res < 0 ) return - 1 ;
src += res ;
break ;
default : av_log ( avctx , AV_LOG_ERROR , "Unsupported block type 0x%08X\n" , enc ) ;
chunks = 0 ;
}
}
if ( c -> screendta ) {
int i ;
w = c -> cur_w ;
if ( c -> width < c -> cur_x + w ) w = c -> width - c -> cur_x ;
h = c -> cur_h ;
if ( c -> height < c -> cur_y + h ) h = c -> height - c -> cur_y ;
dx = c -> cur_x ;
if ( dx < 0 ) {
w += dx ;
dx = 0 ;
}
dy = c -> cur_y ;
if ( dy < 0 ) {
h += dy ;
dy = 0 ;
}
if ( ( w > 0 ) && ( h > 0 ) ) {
outptr = c -> pic . data [ 0 ] + dx * c -> bpp2 + dy * c -> pic . linesize [ 0 ] ;
for ( i = 0 ;
i < h ;
i ++ ) {
memcpy ( c -> screendta + i * c -> cur_w * c -> bpp2 , outptr , w * c -> bpp2 ) ;
outptr += c -> pic . linesize [ 0 ] ;
}
outptr = c -> pic . data [ 0 ] ;
put_cursor ( outptr , c -> pic . linesize [ 0 ] , c , c -> cur_x , c -> cur_y ) ;
}
}
* got_frame = 1 ;
if ( ( ret = av_frame_ref ( data , & c -> pic ) ) < 0 ) return ret ;
return buf_size ;
} |
-2,323,311,514,228,246,000 | chrome | 69 | 0 | IN_PROC_BROWSER_TEST_F ( DownloadExtensionTest , DownloadExtensionTest_OnDeterminingFilename_Override ) {
GoOnTheRecord ( ) ;
LoadExtension ( "downloads_split" ) ;
AddFilenameDeterminer ( ) ;
ASSERT_TRUE ( StartEmbeddedTestServer ( ) ) ;
std : : string download_url = embedded_test_server ( ) -> GetURL ( "/slow?0" ) . spec ( ) ;
std : : unique_ptr < base : : Value > result ( RunFunctionAndReturnResult ( new DownloadsDownloadFunction ( ) , base : : StringPrintf ( "[{
\"url\": \"%s\"}
]" , download_url . c_str ( ) ) ) ) ;
ASSERT_TRUE ( result . get ( ) ) ;
int result_id = - 1 ;
ASSERT_TRUE ( result -> GetAsInteger ( & result_id ) ) ;
DownloadItem * item = GetCurrentManager ( ) -> GetDownload ( result_id ) ;
ASSERT_TRUE ( item ) ;
ScopedCancellingItem canceller ( item ) ;
ASSERT_EQ ( download_url , item -> GetOriginalUrl ( ) . spec ( ) ) ;
ASSERT_TRUE ( WaitFor ( downloads : : OnCreated : : kEventName , base : : StringPrintf ( "[{
\"danger\": \"safe\"," " \"incognito\": false," " \"id\": %d," " \"mime\": \"text/plain\"," " \"paused\": false," " \"url\": \"%s\"}
]" , result_id , download_url . c_str ( ) ) ) ) ;
ASSERT_TRUE ( WaitFor ( downloads : : OnDeterminingFilename : : kEventName , base : : StringPrintf ( "[{
\"id\": %d," " \"filename\":\"slow.txt\"}
]" , result_id ) ) ) ;
ASSERT_TRUE ( item -> GetTargetFilePath ( ) . empty ( ) ) ;
ASSERT_EQ ( DownloadItem : : IN_PROGRESS , item -> GetState ( ) ) ;
std : : string error ;
ASSERT_TRUE ( ExtensionDownloadsEventRouter : : DetermineFilename ( browser ( ) -> profile ( ) , false , GetExtensionId ( ) , result_id , base : : FilePath ( ) , downloads : : FILENAME_CONFLICT_ACTION_UNIQUIFY , & error ) ) ;
EXPECT_EQ ( "" , error ) ;
ASSERT_TRUE ( WaitFor ( downloads : : OnChanged : : kEventName , base : : StringPrintf ( "[{
\"id\": %d," " \"filename\": {
" " \"previous\": \"\"," " \"current\": \"%s\"}
}
]" , result_id , GetFilename ( "slow.txt" ) . c_str ( ) ) ) ) ;
ASSERT_TRUE ( WaitFor ( downloads : : OnChanged : : kEventName , base : : StringPrintf ( "[{
\"id\": %d," " \"state\": {
" " \"previous\": \"in_progress\"," " \"current\": \"complete\"}
}
]" , result_id ) ) ) ;
result . reset ( RunFunctionAndReturnResult ( new DownloadsDownloadFunction ( ) , base : : StringPrintf ( "[{
\"url\": \"%s\"}
]" , download_url . c_str ( ) ) ) ) ;
ASSERT_TRUE ( result . get ( ) ) ;
result_id = - 1 ;
ASSERT_TRUE ( result -> GetAsInteger ( & result_id ) ) ;
item = GetCurrentManager ( ) -> GetDownload ( result_id ) ;
ASSERT_TRUE ( item ) ;
ScopedCancellingItem canceller2 ( item ) ;
ASSERT_EQ ( download_url , item -> GetOriginalUrl ( ) . spec ( ) ) ;
ASSERT_TRUE ( WaitFor ( downloads : : OnCreated : : kEventName , base : : StringPrintf ( "[{
\"danger\": \"safe\"," " \"incognito\": false," " \"id\": %d," " \"mime\": \"text/plain\"," " \"paused\": false," " \"url\": \"%s\"}
]" , result_id , download_url . c_str ( ) ) ) ) ;
ASSERT_TRUE ( WaitFor ( downloads : : OnDeterminingFilename : : kEventName , base : : StringPrintf ( "[{
\"id\": %d," " \"filename\":\"slow.txt\"}
]" , result_id ) ) ) ;
ASSERT_TRUE ( item -> GetTargetFilePath ( ) . empty ( ) ) ;
ASSERT_EQ ( DownloadItem : : IN_PROGRESS , item -> GetState ( ) ) ;
error = "" ;
ASSERT_TRUE ( ExtensionDownloadsEventRouter : : DetermineFilename ( browser ( ) -> profile ( ) , false , GetExtensionId ( ) , result_id , base : : FilePath ( FILE_PATH_LITERAL ( "foo" ) ) , downloads : : FILENAME_CONFLICT_ACTION_OVERWRITE , & error ) ) ;
EXPECT_EQ ( "" , error ) ;
ASSERT_TRUE ( WaitFor ( downloads : : OnChanged : : kEventName , base : : StringPrintf ( "[{
\"id\": %d," " \"filename\": {
" " \"previous\": \"\"," " \"current\": \"%s\"}
}
]" , result_id , GetFilename ( "foo" ) . c_str ( ) ) ) ) ;
ASSERT_TRUE ( WaitFor ( downloads : : OnChanged : : kEventName , base : : StringPrintf ( "[{
\"id\": %d," " \"state\": {
" " \"previous\": \"in_progress\"," " \"current\": \"complete\"}
}
]" , result_id ) ) ) ;
} |
2,559,621,819,476,647,000 | debian | 19 | 0 | static int ilbc_decode_frame ( AVCodecContext * avctx , void * data , int * got_frame_ptr , AVPacket * avpkt ) {
const uint8_t * buf = avpkt -> data ;
int buf_size = avpkt -> size ;
ILBCDecContext * s = avctx -> priv_data ;
AVFrame * frame = data ;
int ret ;
if ( s -> decoder . no_of_bytes > buf_size ) {
av_log ( avctx , AV_LOG_ERROR , "iLBC frame too short (%u, should be %u)\n" , buf_size , s -> decoder . no_of_bytes ) ;
return AVERROR_INVALIDDATA ;
}
frame -> nb_samples = s -> decoder . blockl ;
if ( ( ret = ff_get_buffer ( avctx , frame , 0 ) ) < 0 ) {
av_log ( avctx , AV_LOG_ERROR , "get_buffer() failed\n" ) ;
return ret ;
}
WebRtcIlbcfix_DecodeImpl ( ( WebRtc_Word16 * ) frame -> data [ 0 ] , ( const WebRtc_UWord16 * ) buf , & s -> decoder , 1 ) ;
* got_frame_ptr = 1 ;
return s -> decoder . no_of_bytes ;
} |
1,864,017,524,114,663,000 | debian | 80 | 0 | static int decode_frame ( AVCodecContext * avctx , void * data , int * got_frame , AVPacket * avpkt ) {
AVFrame * frame = data ;
const uint8_t * buf = avpkt -> data ;
int buf_size = avpkt -> size ;
DxaDecContext * const c = avctx -> priv_data ;
uint8_t * outptr , * srcptr , * tmpptr ;
unsigned long dsize ;
int i , j , compr , ret ;
int stride ;
int orig_buf_size = buf_size ;
int pc = 0 ;
if ( buf [ 0 ] == 'C' && buf [ 1 ] == 'M' && buf [ 2 ] == 'A' && buf [ 3 ] == 'P' ) {
int r , g , b ;
buf += 4 ;
for ( i = 0 ;
i < 256 ;
i ++ ) {
r = * buf ++ ;
g = * buf ++ ;
b = * buf ++ ;
c -> pal [ i ] = ( r << 16 ) | ( g << 8 ) | b ;
}
pc = 1 ;
buf_size -= 768 + 4 ;
}
if ( ( ret = ff_get_buffer ( avctx , frame , AV_GET_BUFFER_FLAG_REF ) ) < 0 ) {
av_log ( avctx , AV_LOG_ERROR , "get_buffer() failed\n" ) ;
return ret ;
}
memcpy ( frame -> data [ 1 ] , c -> pal , AVPALETTE_SIZE ) ;
frame -> palette_has_changed = pc ;
outptr = frame -> data [ 0 ] ;
srcptr = c -> decomp_buf ;
tmpptr = c -> prev . data [ 0 ] ;
stride = frame -> linesize [ 0 ] ;
if ( buf [ 0 ] == 'N' && buf [ 1 ] == 'U' && buf [ 2 ] == 'L' && buf [ 3 ] == 'L' ) compr = - 1 ;
else compr = buf [ 4 ] ;
dsize = c -> dsize ;
if ( ( compr != 4 && compr != - 1 ) && uncompress ( c -> decomp_buf , & dsize , buf + 9 , buf_size - 9 ) != Z_OK ) {
av_log ( avctx , AV_LOG_ERROR , "Uncompress failed!\n" ) ;
return AVERROR_UNKNOWN ;
}
switch ( compr ) {
case - 1 : frame -> key_frame = 0 ;
frame -> pict_type = AV_PICTURE_TYPE_P ;
if ( c -> prev . data [ 0 ] ) memcpy ( frame -> data [ 0 ] , c -> prev . data [ 0 ] , frame -> linesize [ 0 ] * avctx -> height ) ;
else {
memset ( frame -> data [ 0 ] , 0 , frame -> linesize [ 0 ] * avctx -> height ) ;
frame -> key_frame = 1 ;
frame -> pict_type = AV_PICTURE_TYPE_I ;
}
break ;
case 2 : case 3 : case 4 : case 5 : frame -> key_frame = ! ( compr & 1 ) ;
frame -> pict_type = ( compr & 1 ) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I ;
for ( j = 0 ;
j < avctx -> height ;
j ++ ) {
if ( compr & 1 ) {
for ( i = 0 ;
i < avctx -> width ;
i ++ ) outptr [ i ] = srcptr [ i ] ^ tmpptr [ i ] ;
tmpptr += stride ;
}
else memcpy ( outptr , srcptr , avctx -> width ) ;
outptr += stride ;
srcptr += avctx -> width ;
}
break ;
case 12 : case 13 : frame -> key_frame = 0 ;
frame -> pict_type = AV_PICTURE_TYPE_P ;
decode_13 ( avctx , c , frame -> data [ 0 ] , frame -> linesize [ 0 ] , srcptr , c -> prev . data [ 0 ] ) ;
break ;
default : av_log ( avctx , AV_LOG_ERROR , "Unknown/unsupported compression type %d\n" , buf [ 4 ] ) ;
return AVERROR_INVALIDDATA ;
}
av_frame_unref ( & c -> prev ) ;
if ( ( ret = av_frame_ref ( & c -> prev , frame ) ) < 0 ) return ret ;
* got_frame = 1 ;
return orig_buf_size ;
} |
2,895,622,461,494,525,400 | debian | 20 | 0 | static void test_prepare_multi_statements ( ) {
MYSQL * mysql_local ;
MYSQL_STMT * stmt ;
char query [ MAX_TEST_QUERY_LENGTH ] ;
myheader ( "test_prepare_multi_statements" ) ;
if ( ! ( mysql_local = mysql_client_init ( NULL ) ) ) {
fprintf ( stderr , "\n mysql_client_init() failed" ) ;
exit ( 1 ) ;
}
if ( ! ( mysql_real_connect ( mysql_local , opt_host , opt_user , opt_password , current_db , opt_port , opt_unix_socket , CLIENT_MULTI_STATEMENTS ) ) ) {
fprintf ( stderr , "\n connection failed(%s)" , mysql_error ( mysql_local ) ) ;
exit ( 1 ) ;
}
mysql_local -> reconnect = 1 ;
strmov ( query , "select 1;
select 'another value'" ) ;
stmt = mysql_simple_prepare ( mysql_local , query ) ;
check_stmt_r ( stmt ) ;
mysql_close ( mysql_local ) ;
} |
5,347,874,611,477,979,000 | chrome | 5 | 0 | static void signal_cb_swp ( int sig , short event , void * arg ) {
called ++ ;
if ( called < 5 ) raise ( sig ) ;
else event_loopexit ( NULL ) ;
} |
7,092,216,800,726,730,000 | debian | 4 | 0 | static int dissect_h245_RoundTripDelayRequest ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h245_RoundTripDelayRequest , RoundTripDelayRequest_sequence ) ;
return offset ;
} |
-7,237,039,260,294,671,000 | debian | 18 | 0 | static int dissect_nlm_unlock ( tvbuff_t * tvb , int offset , packet_info * pinfo , proto_tree * tree , int version , rpc_call_info_value * rpc_call ) {
if ( nlm_match_msgres ) {
if ( rpc_call -> proc == 9 ) {
if ( ( ! pinfo -> fd -> flags . visited ) ) {
nlm_register_unmatched_msg ( pinfo , tvb , offset ) ;
}
else {
nlm_print_msgres_request ( pinfo , tree , tvb ) ;
}
if ( nfs_fhandle_reqrep_matching ) {
nlm_match_fhandle_request ( pinfo , tree ) ;
}
}
}
offset = dissect_rpc_data ( tvb , tree , hf_nlm_cookie , offset ) ;
offset = dissect_lock ( tvb , pinfo , tree , version , offset , rpc_call ) ;
return offset ;
} |
-3,559,021,711,340,555,000 | debian | 16 | 0 | static bool tlist_matches_coltypelist ( List * tlist , List * coltypelist ) {
ListCell * tlistitem ;
ListCell * clistitem ;
clistitem = list_head ( coltypelist ) ;
foreach ( tlistitem , tlist ) {
TargetEntry * tle = ( TargetEntry * ) lfirst ( tlistitem ) ;
Oid coltype ;
if ( tle -> resjunk ) continue ;
if ( clistitem == NULL ) return false ;
coltype = lfirst_oid ( clistitem ) ;
clistitem = lnext ( clistitem ) ;
if ( exprType ( ( Node * ) tle -> expr ) != coltype ) return false ;
}
if ( clistitem != NULL ) return false ;
return true ;
} |
-4,555,950,263,653,671,000 | debian | 44 | 0 | PyObject * PyString_Repr ( PyObject * obj , int smartquotes ) {
register PyStringObject * op = ( PyStringObject * ) obj ;
size_t newsize ;
PyObject * v ;
if ( Py_SIZE ( op ) > ( PY_SSIZE_T_MAX - 2 ) / 4 ) {
PyErr_SetString ( PyExc_OverflowError , "string is too large to make repr" ) ;
return NULL ;
}
newsize = 2 + 4 * Py_SIZE ( op ) ;
v = PyString_FromStringAndSize ( ( char * ) NULL , newsize ) ;
if ( v == NULL ) {
return NULL ;
}
else {
register Py_ssize_t i ;
register char c ;
register char * p ;
int quote ;
quote = '\'' ;
if ( smartquotes && memchr ( op -> ob_sval , '\'' , Py_SIZE ( op ) ) && ! memchr ( op -> ob_sval , '"' , Py_SIZE ( op ) ) ) quote = '"' ;
p = PyString_AS_STRING ( v ) ;
* p ++ = quote ;
for ( i = 0 ;
i < Py_SIZE ( op ) ;
i ++ ) {
assert ( newsize - ( p - PyString_AS_STRING ( v ) ) >= 5 ) ;
c = op -> ob_sval [ i ] ;
if ( c == quote || c == '\\' ) * p ++ = '\\' , * p ++ = c ;
else if ( c == '\t' ) * p ++ = '\\' , * p ++ = 't' ;
else if ( c == '\n' ) * p ++ = '\\' , * p ++ = 'n' ;
else if ( c == '\r' ) * p ++ = '\\' , * p ++ = 'r' ;
else if ( c < ' ' || c >= 0x7f ) {
sprintf ( p , "\\x%02x" , c & 0xff ) ;
p += 4 ;
}
else * p ++ = c ;
}
assert ( newsize - ( p - PyString_AS_STRING ( v ) ) >= 1 ) ;
* p ++ = quote ;
* p = '\0' ;
if ( _PyString_Resize ( & v , ( p - PyString_AS_STRING ( v ) ) ) ) return NULL ;
return v ;
}
} |
-8,958,254,313,220,733,000 | debian | 15 | 0 | static int virtio_pci_load_queue ( void * opaque , int n , QEMUFile * f ) {
VirtIOPCIProxy * proxy = opaque ;
uint16_t vector ;
if ( msix_present ( & proxy -> pci_dev ) ) {
qemu_get_be16s ( f , & vector ) ;
}
else {
vector = VIRTIO_NO_VECTOR ;
}
virtio_queue_set_vector ( proxy -> vdev , n , vector ) ;
if ( vector != VIRTIO_NO_VECTOR ) {
return msix_vector_use ( & proxy -> pci_dev , vector ) ;
}
return 0 ;
} |
9,176,142,195,250,516,000 | debian | 14 | 0 | static int purple_buddy_msg ( struct im_connection * ic , char * who , char * message , int flags ) {
PurpleConversation * conv ;
struct purple_data * pd = ic -> proto_data ;
if ( ! strncmp ( who , PURPLE_REQUEST_HANDLE , sizeof ( PURPLE_REQUEST_HANDLE ) - 1 ) ) {
guint request_id = atoi ( who + sizeof ( PURPLE_REQUEST_HANDLE ) ) ;
purple_request_input_callback ( request_id , ic , message , who ) ;
return 1 ;
}
if ( ( conv = purple_find_conversation_with_account ( PURPLE_CONV_TYPE_IM , who , pd -> account ) ) == NULL ) {
conv = purple_conversation_new ( PURPLE_CONV_TYPE_IM , pd -> account , who ) ;
}
purple_conv_im_send ( purple_conversation_get_im_data ( conv ) , message ) ;
return 1 ;
} |
2,930,500,905,204,315,600 | debian | 3 | 1 | static __always_inline __u64 __be64_to_cpup ( const __be64 * p ) {
return __swab64p ( ( __u64 * ) p ) ;
} |
3,616,225,660,295,849,500 | debian | 5 | 0 | int logcat_dump_can_write_encap ( int encap ) {
if ( encap == WTAP_ENCAP_PER_PACKET ) return WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED ;
if ( encap != WTAP_ENCAP_LOGCAT ) return WTAP_ERR_UNSUPPORTED_ENCAP ;
return 0 ;
} |
5,357,882,892,791,796,000 | debian | 9 | 0 | static void e1000e_calc_per_desc_buf_size ( E1000ECore * core ) {
int i ;
core -> rx_desc_buf_size = 0 ;
for ( i = 0 ;
i < ARRAY_SIZE ( core -> rxbuf_sizes ) ;
i ++ ) {
core -> rx_desc_buf_size += core -> rxbuf_sizes [ i ] ;
}
} |
-2,723,830,976,796,502,500 | chrome | 12 | 0 | static vpx_codec_err_t ctrl_get_reference ( vpx_codec_alg_priv_t * ctx , va_list args ) {
vp9_ref_frame_t * const frame = va_arg ( args , vp9_ref_frame_t * ) ;
if ( frame != NULL ) {
YV12_BUFFER_CONFIG * fb = get_ref_frame ( & ctx -> cpi -> common , frame -> idx ) ;
if ( fb == NULL ) return VPX_CODEC_ERROR ;
yuvconfig2image ( & frame -> img , fb , NULL ) ;
return VPX_CODEC_OK ;
}
else {
return VPX_CODEC_INVALID_PARAM ;
}
} |
-2,908,211,205,972,632,000 | debian | 26 | 0 | static int try_grow_lower ( MAIN_WINDOW_REC * window , int count ) {
MAIN_WINDOW_REC * grow_win ;
grow_win = mainwindows_find_lower ( window ) ;
if ( grow_win != NULL ) {
MAIN_WINDOW_REC * win ;
GSList * grow_list , * shrink_list , * tmp ;
grow_list = mainwindows_get_line ( grow_win ) ;
shrink_list = mainwindows_get_line ( window ) ;
for ( tmp = grow_list ;
tmp != NULL ;
tmp = tmp -> next ) {
win = tmp -> data ;
win -> first_line -= count ;
}
for ( tmp = shrink_list ;
tmp != NULL ;
tmp = tmp -> next ) {
win = tmp -> data ;
win -> last_line -= count ;
}
mainwindows_resize_two ( grow_list , shrink_list , count ) ;
g_slist_free ( shrink_list ) ;
g_slist_free ( grow_list ) ;
}
return grow_win != NULL ;
} |
4,876,100,961,671,883,000 | debian | 7 | 0 | static int dissect_pvfs2_seteattr_request ( tvbuff_t * tvb , proto_tree * tree , int offset , packet_info * pinfo ) {
offset = dissect_pvfs_fh ( tvb , offset , pinfo , tree , "handle" , NULL ) ;
offset = dissect_pvfs_fs_id ( tvb , tree , offset ) ;
offset += 4 ;
offset = dissect_ds_keyval_array ( tvb , tree , offset ) ;
return offset ;
} |
-9,197,960,073,880,366,000 | debian | 23 | 0 | static void read_graphic_control_extension ( Gif_Context * gfc , Gif_Image * gfi , Gif_Reader * grr ) {
uint8_t len ;
uint8_t crap [ GIF_MAX_BLOCK ] ;
len = gifgetbyte ( grr ) ;
if ( len == 4 ) {
uint8_t packed = gifgetbyte ( grr ) ;
gfi -> disposal = ( packed >> 2 ) & 0x07 ;
gfi -> delay = gifgetunsigned ( grr ) ;
gfi -> transparent = gifgetbyte ( grr ) ;
if ( ! ( packed & 0x01 ) ) gfi -> transparent = - 1 ;
len -= 4 ;
}
if ( len > 0 ) {
gif_read_error ( gfc , 1 , "bad graphic extension" ) ;
gifgetblock ( crap , len , grr ) ;
}
len = gifgetbyte ( grr ) ;
while ( len > 0 ) {
gif_read_error ( gfc , 1 , "bad graphic extension" ) ;
gifgetblock ( crap , len , grr ) ;
len = gifgetbyte ( grr ) ;
}
} |
-2,901,388,205,723,537,400 | debian | 62 | 0 | VALUE rb_dlhandle_sym ( VALUE self , VALUE sym ) {
void ( * func ) ( ) ;
struct dl_handle * dlhandle ;
void * handle ;
const char * name ;
const char * err ;
int i ;
# if defined ( HAVE_DLERROR ) # define CHECK_DLERROR if ( err = dlerror ( ) ) {
func = 0 ;
}
# else # define CHECK_DLERROR # endif rb_secure ( 2 ) ;
name = SafeStringValuePtr ( sym ) ;
Data_Get_Struct ( self , struct dl_handle , dlhandle ) ;
if ( ! dlhandle -> open ) {
rb_raise ( rb_eDLError , "closed handle" ) ;
}
handle = dlhandle -> ptr ;
func = dlsym ( handle , name ) ;
CHECK_DLERROR ;
# if defined ( FUNC_STDCALL ) if ( ! func ) {
int len = strlen ( name ) ;
char * name_n ;
# if defined ( __CYGWIN__ ) || defined ( _WIN32 ) || defined ( __MINGW32__ ) {
char * name_a = ( char * ) xmalloc ( len + 2 ) ;
strcpy ( name_a , name ) ;
name_n = name_a ;
name_a [ len ] = 'A' ;
name_a [ len + 1 ] = '\0' ;
func = dlsym ( handle , name_a ) ;
CHECK_DLERROR ;
if ( func ) goto found ;
name_n = xrealloc ( name_a , len + 6 ) ;
}
# else name_n = ( char * ) xmalloc ( len + 6 ) ;
# endif memcpy ( name_n , name , len ) ;
name_n [ len ++ ] = '@' ;
for ( i = 0 ;
i < 256 ;
i += 4 ) {
sprintf ( name_n + len , "%d" , i ) ;
func = dlsym ( handle , name_n ) ;
CHECK_DLERROR ;
if ( func ) break ;
}
if ( func ) goto found ;
name_n [ len - 1 ] = 'A' ;
name_n [ len ++ ] = '@' ;
for ( i = 0 ;
i < 256 ;
i += 4 ) {
sprintf ( name_n + len , "%d" , i ) ;
func = dlsym ( handle , name_n ) ;
CHECK_DLERROR ;
if ( func ) break ;
}
found : xfree ( name_n ) ;
}
# endif if ( ! func ) {
rb_raise ( rb_eDLError , "unknown symbol \"%s\"" , name ) ;
}
return PTR2NUM ( func ) ;
} |