Unnamed: 0
int64
0
3.91k
source
stringlengths
77
51.3k
target
stringlengths
52
46.1k
0
CWE-362 int cipso_v4_sock_getattr ( struct sock * sk , struct netlbl_lsm_secattr * secattr ) { <vul-start> struct ip_options * opt ; opt = inet_sk ( sk ) -> opt ; if ( opt == NULL || opt -> cipso == 0 ) return - ENOMSG ; return cipso_v4_getattr ( opt -> __data + opt -> cipso - sizeof ( struct iphdr ) , <vul-end> secatt...
int cipso_v4_sock_getattr ( struct sock * sk , struct netlbl_lsm_secattr * secattr ) { struct ip_options_rcu * opt ; int res = - ENOMSG ; rcu_read_lock ( ) ; opt = rcu_dereference ( inet_sk ( sk ) -> inet_opt ) ; if ( opt && opt -> opt . cipso ) res = cipso_v4_getattr ( opt -> opt . __data + opt -> opt . cipso - sizeof...
1
CWE-284 int sock_send_all ( int sock_fd , const uint8_t * buf , int len ) { int s = len ; int ret ; while ( s ) { <vul-start> do ret = send ( sock_fd , buf , s , 0 ) ; <vul-end> while ( ret < 0 && errno == EINTR ) ; if ( ret <= 0 ) { BTIF_TRACE_ERROR ( "sock fd:%d send errno:%d, ret:%d" , sock_fd , errno , ret ) ; retu...
int sock_send_all ( int sock_fd , const uint8_t * buf , int len ) { int s = len ; int ret ; while ( s ) { do ret = TEMP_FAILURE_RETRY ( send ( sock_fd , buf , s , 0 ) ) ; while ( ret < 0 && errno == EINTR ) ; if ( ret <= 0 ) { BTIF_TRACE_ERROR ( "sock fd:%d send errno:%d, ret:%d" , sock_fd , errno , ret ) ; return - 1 ...
2
CWE-59 void netsnmp_init_mib ( void ) { const char * prefix ; char * env_var , * entry ; PrefixListPtr pp = & mib_prefixes [ 0 ] ; char * st = NULL ; if ( Mib ) return ; netsnmp_init_mib_internals ( ) ; netsnmp_fixup_mib_directory ( ) ; env_var = strdup ( netsnmp_get_mib_directory ( ) ) ; if ( ! env_var ) return ; <vul...
void netsnmp_init_mib ( void ) { const char * prefix ; char * env_var , * entry ; PrefixListPtr pp = & mib_prefixes [ 0 ] ; char * st = NULL ; if ( Mib ) return ; netsnmp_init_mib_internals ( ) ; netsnmp_fixup_mib_directory ( ) ; env_var = strdup ( netsnmp_get_mib_directory ( ) ) ; if ( ! env_var ) return ; DEBUGMSGTL ...
3
CWE-119 static int send_results ( struct iperf_test * test ) { int r = 0 ; cJSON * j ; cJSON * j_streams ; struct iperf_stream * sp ; cJSON * j_stream ; int sender_has_retransmits ; iperf_size_t bytes_transferred ; int retransmits ; j = cJSON_CreateObject ( ) ; if ( j == NULL ) { i_errno = IEPACKAGERESULTS ; r = - 1 ; ...
static int send_results ( struct iperf_test * test ) { int r = 0 ; cJSON * j ; cJSON * j_streams ; struct iperf_stream * sp ; cJSON * j_stream ; int sender_has_retransmits ; iperf_size_t bytes_transferred ; int retransmits ; j = cJSON_CreateObject ( ) ; if ( j == NULL ) { i_errno = IEPACKAGERESULTS ; r = - 1 ; } else {...
4
CWE-787 if ( PPEEK_IS ( '{' ) && IS_SYNTAX_OP ( syn , ONIG_SYN_OP_ESC_X_BRACE_HEX8 ) ) { PINC ; num = scan_unsigned_hexadecimal_number ( & p , end , 8 , enc ) ; if ( num < 0 ) return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE ; if ( ! PEND ) { c2 = PPEEK ; if ( ONIGENC_IS_CODE_XDIGIT ( enc , c2 ) ) return ONIGERR_TOO_LONG_WIDE_CH...
if ( PPEEK_IS ( '{' ) && IS_SYNTAX_OP ( syn , ONIG_SYN_OP_ESC_X_BRACE_HEX8 ) ) { PINC ; num = scan_unsigned_hexadecimal_number ( & p , end , 8 , enc ) ; if ( num < 0 ) return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE ; if ( ! PEND ) { c2 = PPEEK ; if ( ONIGENC_IS_CODE_XDIGIT ( enc , c2 ) ) return ONIGERR_TOO_LONG_WIDE_CHAR_VALUE...
5
CWE-19 static int ext4_xattr_block_get ( struct inode * inode , int name_index , const char * name , void * buffer , size_t buffer_size ) { struct buffer_head * bh = NULL ; struct ext4_xattr_entry * entry ; size_t size ; int error ; <vul-start> struct mb_cache * ext4_mb_cache = EXT4_GET_MB_CACHE ( inode ) ; <vul-end> e...
static int ext4_xattr_block_get ( struct inode * inode , int name_index , const char * name , void * buffer , size_t buffer_size ) { struct buffer_head * bh = NULL ; struct ext4_xattr_entry * entry ; size_t size ; int error ; struct mb2_cache * ext4_mb_cache = EXT4_GET_MB_CACHE ( inode ) ; ea_idebug ( inode , "name=%d....
6
CWE-476 jas_image_t * bmp_decode ( jas_stream_t * in , char * optstr ) { jas_image_t * image ; bmp_hdr_t hdr ; bmp_info_t * info ; uint_fast16_t cmptno ; jas_image_cmptparm_t cmptparms [ 3 ] ; jas_image_cmptparm_t * cmptparm ; uint_fast16_t numcmpts ; long n ; <vul-start> <vul-end> if ( optstr ) { jas_eprintf ( "warnin...
jas_image_t * bmp_decode ( jas_stream_t * in , char * optstr ) { jas_image_t * image ; bmp_hdr_t hdr ; bmp_info_t * info ; uint_fast16_t cmptno ; jas_image_cmptparm_t cmptparms [ 3 ] ; jas_image_cmptparm_t * cmptparm ; uint_fast16_t numcmpts ; long n ; image = 0 ; info = 0 ; if ( optstr ) { jas_eprintf ( "warning: igno...
7
CWE-125 void skb_complete_tx_timestamp ( struct sk_buff * skb , struct skb_shared_hwtstamps * hwtstamps ) { struct sock * sk = skb -> sk ; if ( ! skb_may_tx_timestamp ( sk , false ) ) return ; if ( likely ( atomic_inc_not_zero ( & sk -> sk_refcnt ) ) ) { * skb_hwtstamps ( skb ) = * hwtstamps ; <vul-start> __skb_complet...
void skb_complete_tx_timestamp ( struct sk_buff * skb , struct skb_shared_hwtstamps * hwtstamps ) { struct sock * sk = skb -> sk ; if ( ! skb_may_tx_timestamp ( sk , false ) ) return ; if ( likely ( atomic_inc_not_zero ( & sk -> sk_refcnt ) ) ) { * skb_hwtstamps ( skb ) = * hwtstamps ; __skb_complete_tx_timestamp ( skb...
8
CWE-119 <vul-start> void vp9_first_pass ( VP9_COMP * cpi ) { <vul-end> int mb_row , mb_col ; <vul-start> MACROBLOCK * const x = & cpi -> mb ; <vul-end> VP9_COMMON * const cm = & cpi -> common ; MACROBLOCKD * const xd = & x -> e_mbd ; TileInfo tile ; struct macroblock_plane * const p = x -> plane ; struct macroblockd_pl...
void vp9_first_pass ( VP9_COMP * cpi , const struct lookahead_entry * source ) { int mb_row , mb_col ; MACROBLOCK * const x = & cpi -> td . mb ; VP9_COMMON * const cm = & cpi -> common ; MACROBLOCKD * const xd = & x -> e_mbd ; TileInfo tile ; struct macroblock_plane * const p = x -> plane ; struct macroblockd_plane * c...
9
CWE-772 else { quantum = 0 ; length = 0 ; } } if ( image_info -> verbose != MagickFalse ) { if ( use_explicit == MagickFalse ) explicit_vr [ 0 ] = '\\0' ; for ( i = 0 ; dicom_info [ i ] . description != ( char * ) NULL ; i ++ ) if ( ( group == dicom_info [ i ] . group ) && ( element == dicom_info [ i ] . element ) ) br...
else { quantum = 0 ; length = 0 ; } } if ( image_info -> verbose != MagickFalse ) { if ( use_explicit == MagickFalse ) explicit_vr [ 0 ] = '\\0' ; for ( i = 0 ; dicom_info [ i ] . description != ( char * ) NULL ; i ++ ) if ( ( group == dicom_info [ i ] . group ) && ( element == dicom_info [ i ] . element ) ) break ; ( ...
10
NVD-CWE-Other OM_uint32 kg_unseal_iov ( OM_uint32 * minor_status , gss_ctx_id_t context_handle , int * conf_state , gss_qop_t * qop_state , gss_iov_buffer_desc * iov , int iov_count , int toktype ) { krb5_gss_ctx_id_rec * ctx ; OM_uint32 code ; ctx = ( krb5_gss_ctx_id_rec * ) context_handle ; <vul-start> if ( ! ctx -> ...
OM_uint32 kg_unseal_iov ( OM_uint32 * minor_status , gss_ctx_id_t context_handle , int * conf_state , gss_qop_t * qop_state , gss_iov_buffer_desc * iov , int iov_count , int toktype ) { krb5_gss_ctx_id_rec * ctx ; OM_uint32 code ; ctx = ( krb5_gss_ctx_id_rec * ) context_handle ; if ( ctx -> terminated || ! ctx -> estab...
11
CWE-59 <vul-start> static int fsmVerify ( const char * path , rpmfi fi ) <vul-end> { int rc ; int saveerrno = errno ; struct stat dsb ; mode_t mode = rpmfiFMode ( fi ) ; rc = fsmStat ( path , 1 , & dsb ) ; if ( rc ) return rc ; if ( S_ISREG ( mode ) ) { char * rmpath = rstrscat ( NULL , path , "-RPMDELETE" , NULL ) ; r...
static int fsmVerify ( const char * path , rpmfi fi , const struct stat * fsb ) { int rc ; int saveerrno = errno ; struct stat dsb ; mode_t mode = rpmfiFMode ( fi ) ; rc = fsmStat ( path , 1 , & dsb ) ; if ( rc ) return rc ; if ( S_ISREG ( mode ) ) { char * rmpath = rstrscat ( NULL , path , "-RPMDELETE" , NULL ) ; rc =...
12
CWE-362 static int <vul-start> mptctl_eventreport ( unsigned long arg ) <vul-end> { struct mpt_ioctl_eventreport __user * uarg = ( void __user * ) arg ; struct mpt_ioctl_eventreport karg ; <vul-start> MPT_ADAPTER * ioc ; int iocnum ; <vul-end> int numBytes , maxEvents , max ; if ( copy_from_user ( & karg , uarg , sizeo...
static int mptctl_eventreport ( MPT_ADAPTER * ioc , unsigned long arg ) { struct mpt_ioctl_eventreport __user * uarg = ( void __user * ) arg ; struct mpt_ioctl_eventreport karg ; int numBytes , maxEvents , max ; if ( copy_from_user ( & karg , uarg , sizeof ( struct mpt_ioctl_eventreport ) ) ) { printk ( KERN_ERR MYNAM ...
13
CWE-787 FLOAT32 * buffer = ptr_hbe_txposer -> synth_buf ; for ( idx = 0 ; idx < num_columns ; idx ++ ) { FLOAT32 loc_qmf_buf [ 64 ] ; FLOAT32 * synth_buf_r = loc_qmf_buf ; FLOAT32 * out_buf = ptr_hbe_txposer -> ptr_input_buf + ( idx + 1 ) * ptr_hbe_txposer -> synth_size ; FLOAT32 * synth_cos_tab = ptr_hbe_txposer -> sy...
FLOAT32 * buffer = ptr_hbe_txposer -> synth_buf ; for ( idx = 0 ; idx < num_columns ; idx ++ ) { FLOAT32 loc_qmf_buf [ 64 ] ; FLOAT32 * synth_buf_r = loc_qmf_buf ; FLOAT32 * out_buf = ptr_hbe_txposer -> ptr_input_buf + ( idx + 1 ) * ptr_hbe_txposer -> synth_size ; FLOAT32 * synth_cos_tab = ptr_hbe_txposer -> synth_cos_...
14
CWE-264 rc = segmented_read ( ctxt , ctxt -> src2 . addr . mem , & ctxt -> src2 . val , ctxt -> src2 . bytes ) ; if ( rc != X86EMUL_CONTINUE ) goto done ; } if ( ( ctxt -> d & DstMask ) == ImplicitOps ) goto special_insn ; if ( ( ctxt -> dst . type == OP_MEM ) && ! ( ctxt -> d & Mov ) ) { rc = segmented_read ( ctxt , c...
rc = segmented_read ( ctxt , ctxt -> src2 . addr . mem , & ctxt -> src2 . val , ctxt -> src2 . bytes ) ; if ( rc != X86EMUL_CONTINUE ) goto done ; } if ( ( ctxt -> d & DstMask ) == ImplicitOps ) goto special_insn ; if ( ( ctxt -> dst . type == OP_MEM ) && ! ( ctxt -> d & Mov ) ) { rc = segmented_read ( ctxt , ctxt -> d...
15
CWE-119 <vul-start> static void write_intra_mode ( vp9_writer * w , MB_PREDICTION_MODE mode , const vp9_prob * probs ) { <vul-end> vp9_write_token ( w , vp9_intra_mode_tree , probs , & intra_mode_encodings [ mode ] ) ; }
static void write_intra_mode ( vpx_writer * w , PREDICTION_MODE mode , const vpx_prob * probs ) { vp9_write_token ( w , vp9_intra_mode_tree , probs , & intra_mode_encodings [ mode ] ) ; }
16
CWE-119 int vp9_get_qindex ( const struct segmentation * seg , int segment_id , int base_qindex ) { <vul-start> if ( vp9_segfeature_active ( seg , segment_id , SEG_LVL_ALT_Q ) ) { const int data = vp9_get_segdata ( seg , segment_id , SEG_LVL_ALT_Q ) ; <vul-end> const int seg_qindex = seg -> abs_delta == SEGMENT_ABSDATA...
int vp9_get_qindex ( const struct segmentation * seg , int segment_id , int base_qindex ) { if ( segfeature_active ( seg , segment_id , SEG_LVL_ALT_Q ) ) { const int data = get_segdata ( seg , segment_id , SEG_LVL_ALT_Q ) ; const int seg_qindex = seg -> abs_delta == SEGMENT_ABSDATA ? data : base_qindex + data ; return ...
17
CWE-706 ull = strtoull ( cp , & cp , 10 ) ; if ( ! cp || * cp ++ != ' ' ) SCREWUP ( "mtime.sec not delimited" ) ; if ( TYPE_OVERFLOW ( time_t , ull ) ) setimes = 0 ; mtime . tv_sec = ull ; mtime . tv_usec = strtol ( cp , & cp , 10 ) ; if ( ! cp || * cp ++ != ' ' || mtime . tv_usec < 0 || mtime . tv_usec > 999999 ) SCRE...
ull = strtoull ( cp , & cp , 10 ) ; if ( ! cp || * cp ++ != ' ' ) SCREWUP ( "mtime.sec not delimited" ) ; if ( TYPE_OVERFLOW ( time_t , ull ) ) setimes = 0 ; mtime . tv_sec = ull ; mtime . tv_usec = strtol ( cp , & cp , 10 ) ; if ( ! cp || * cp ++ != ' ' || mtime . tv_usec < 0 || mtime . tv_usec > 999999 ) SCREWUP ( "m...
18
CWE-310 json_t * json_object ( void ) { json_object_t * object = jsonp_malloc ( sizeof ( json_object_t ) ) ; if ( ! object ) return NULL ; <vul-start> <vul-end> json_init ( & object -> json , JSON_OBJECT ) ; if ( hashtable_init ( & object -> hashtable ) ) { jsonp_free ( object ) ; return NULL ; } object -> serial = 0 ;...
json_t * json_object ( void ) { json_object_t * object = jsonp_malloc ( sizeof ( json_object_t ) ) ; if ( ! object ) return NULL ; if ( ! hashtable_seed ) { json_object_seed ( 0 ) ; } json_init ( & object -> json , JSON_OBJECT ) ; if ( hashtable_init ( & object -> hashtable ) ) { jsonp_free ( object ) ; return NULL ; }...
19
CWE-264 void perf_event_disable ( struct perf_event * event ) { <vul-start> struct perf_event_context * ctx = event -> ctx ; struct task_struct * task = ctx -> task ; if ( ! task ) { cpu_function_call ( event -> cpu , __perf_event_disable , event ) ; return ; } retry : if ( ! task_function_call ( task , __perf_event_di...
void perf_event_disable ( struct perf_event * event ) { struct perf_event_context * ctx ; ctx = perf_event_ctx_lock ( event ) ; _perf_event_disable ( event ) ; perf_event_ctx_unlock ( event , ctx ) ; }
20
CWE-416 ExifMnoteDataPentax * n = ( ExifMnoteDataPentax * ) en ; size_t i , tcount , o , datao , base = 0 ; ExifShort c ; if ( ! n || ! buf || ! buf_size ) { exif_log ( en -> log , EXIF_LOG_CODE_CORRUPT_DATA , "ExifMnoteDataPentax" , "Short MakerNote" ) ; return ; } datao = 6 + n -> offset ; if ( CHECKOVERFLOW ( datao ...
ExifMnoteDataPentax * n = ( ExifMnoteDataPentax * ) en ; size_t i , tcount , o , datao , base = 0 ; ExifShort c ; if ( ! n || ! buf || ! buf_size ) { exif_log ( en -> log , EXIF_LOG_CODE_CORRUPT_DATA , "ExifMnoteDataPentax" , "Short MakerNote" ) ; return ; } datao = 6 + n -> offset ; if ( CHECKOVERFLOW ( datao , buf_si...
21
CWE-284 int vfs_open ( const struct path * path , struct file * file , const struct cred * cred ) { <vul-start> struct dentry * dentry = path -> dentry ; struct inode * inode = dentry -> d_inode ; file -> f_path = * path ; if ( dentry -> d_flags & DCACHE_OP_SELECT_INODE ) { inode = dentry -> d_op -> d_select_inode ( de...
int vfs_open ( const struct path * path , struct file * file , const struct cred * cred ) { struct inode * inode = vfs_select_inode ( path -> dentry , file -> f_flags ) ; if ( IS_ERR ( inode ) ) return PTR_ERR ( inode ) ; file -> f_path = * path ; return do_dentry_open ( file , inode , NULL , cred ) ; }
22
CWE-399 static int do_tkill ( pid_t tgid , pid_t pid , int sig ) { <vul-start> struct siginfo info ; <vul-end> info . si_signo = sig ; info . si_errno = 0 ; info . si_code = SI_TKILL ; info . si_pid = task_tgid_vnr ( current ) ; info . si_uid = from_kuid_munged ( current_user_ns ( ) , current_uid ( ) ) ; return do_send...
static int do_tkill ( pid_t tgid , pid_t pid , int sig ) { struct siginfo info = { } ; info . si_signo = sig ; info . si_errno = 0 ; info . si_code = SI_TKILL ; info . si_pid = task_tgid_vnr ( current ) ; info . si_uid = from_kuid_munged ( current_user_ns ( ) , current_uid ( ) ) ; return do_send_specific ( tgid , pid ,...
23
CWE-362 fm_mgr_config_errno_t fm_mgr_config_mgr_connect ( fm_config_conx_hdl * hdl , fm_mgr_type_t mgr ) { char s_path [ 256 ] ; char c_path [ 256 ] ; char * mgr_prefix ; p_hsm_com_client_hdl_t * mgr_hdl ; <vul-start> pid_t pid ; <vul-end> memset ( s_path , 0 , sizeof ( s_path ) ) ; memset ( c_path , 0 , sizeof ( c_pat...
fm_mgr_config_errno_t fm_mgr_config_mgr_connect ( fm_config_conx_hdl * hdl , fm_mgr_type_t mgr ) { char s_path [ 256 ] ; char c_path [ 256 ] ; char * mgr_prefix ; p_hsm_com_client_hdl_t * mgr_hdl ; memset ( s_path , 0 , sizeof ( s_path ) ) ; memset ( c_path , 0 , sizeof ( c_path ) ) ; switch ( mgr ) { case FM_MGR_SM : ...
24
NVD-CWE-Other static int ext4_get_block_write ( struct inode * inode , sector_t iblock , struct buffer_head * bh_result , int create ) { <vul-start> handle_t * handle = NULL ; <vul-end> int ret = 0 ; unsigned max_blocks = bh_result -> b_size >> inode -> i_blkbits ; int dio_credits ; <vul-start> <vul-end> ext4_debug ( "...
static int ext4_get_block_write ( struct inode * inode , sector_t iblock , struct buffer_head * bh_result , int create ) { handle_t * handle = ext4_journal_current_handle ( ) ; int ret = 0 ; unsigned max_blocks = bh_result -> b_size >> inode -> i_blkbits ; int dio_credits ; int started = 0 ; ext4_debug ( "ext4_get_bloc...
25
CWE-20 int oidc_handle_redirect_uri_request ( request_rec * r , oidc_cfg * c , oidc_session_t * session ) { if ( oidc_proto_is_redirect_authorization_response ( r , c ) ) { return oidc_handle_redirect_authorization_response ( r , c , session ) ; } else if ( oidc_proto_is_post_authorization_response ( r , c ) ) { return...
int oidc_handle_redirect_uri_request ( request_rec * r , oidc_cfg * c , oidc_session_t * session ) { if ( oidc_proto_is_redirect_authorization_response ( r , c ) ) { return oidc_handle_redirect_authorization_response ( r , c , session ) ; } else if ( oidc_proto_is_post_authorization_response ( r , c ) ) { return oidc_h...
26
CWE-119 int vp8_decode_frame ( VP8D_COMP * pbi ) { vp8_reader * const bc = & pbi -> mbc [ 8 ] ; VP8_COMMON * const pc = & pbi -> common ; MACROBLOCKD * const xd = & pbi -> mb ; const unsigned char * data = pbi -> fragments . ptrs [ 0 ] ; const unsigned char * data_end = data + pbi -> fragments . sizes [ 0 ] ; ptrdiff_t...
int vp8_decode_frame ( VP8D_COMP * pbi ) { vp8_reader * const bc = & pbi -> mbc [ 8 ] ; VP8_COMMON * const pc = & pbi -> common ; MACROBLOCKD * const xd = & pbi -> mb ; const unsigned char * data = pbi -> fragments . ptrs [ 0 ] ; const unsigned char * data_end = data + pbi -> fragments . sizes [ 0 ] ; ptrdiff_t first_p...
27
CWE-476 static int ghash_final ( struct shash_desc * desc , u8 * dst ) { struct ghash_desc_ctx * dctx = shash_desc_ctx ( desc ) ; struct ghash_ctx * ctx = crypto_shash_ctx ( desc -> tfm ) ; u8 * buf = dctx -> buffer ; <vul-start> <vul-end> ghash_flush ( ctx , dctx ) ; memcpy ( dst , buf , GHASH_BLOCK_SIZE ) ; return 0 ...
static int ghash_final ( struct shash_desc * desc , u8 * dst ) { struct ghash_desc_ctx * dctx = shash_desc_ctx ( desc ) ; struct ghash_ctx * ctx = crypto_shash_ctx ( desc -> tfm ) ; u8 * buf = dctx -> buffer ; if ( ! ctx -> gf128 ) return - ENOKEY ; ghash_flush ( ctx , dctx ) ; memcpy ( dst , buf , GHASH_BLOCK_SIZE ) ;...
28
CWE-401 goto out_controller_put ; } } controller -> cs_gpios = fsl_lpspi -> chipselect ; controller -> prepare_message = fsl_lpspi_prepare_message ; } controller -> bits_per_word_mask = SPI_BPW_RANGE_MASK ( 8 , 32 ) ; controller -> transfer_one = fsl_lpspi_transfer_one ; controller -> prepare_transfer_hardware = lpspi_...
goto out_controller_put ; } } controller -> cs_gpios = fsl_lpspi -> chipselect ; controller -> prepare_message = fsl_lpspi_prepare_message ; } controller -> bits_per_word_mask = SPI_BPW_RANGE_MASK ( 8 , 32 ) ; controller -> transfer_one = fsl_lpspi_transfer_one ; controller -> prepare_transfer_hardware = lpspi_prepare_...
29
CWE-119 vpx_codec_err_t vp9_copy_reference_dec ( VP9Decoder * pbi , VP9_REFFRAME ref_frame_flag , YV12_BUFFER_CONFIG * sd ) { VP9_COMMON * cm = & pbi -> common ; if ( ref_frame_flag == VP9_LAST_FLAG ) { <vul-start> const YV12_BUFFER_CONFIG * const cfg = & cm -> frame_bufs [ cm -> ref_frame_map [ 0 ] ] . buf ; <vul-end>...
vpx_codec_err_t vp9_copy_reference_dec ( VP9Decoder * pbi , VP9_REFFRAME ref_frame_flag , YV12_BUFFER_CONFIG * sd ) { VP9_COMMON * cm = & pbi -> common ; if ( ref_frame_flag == VP9_LAST_FLAG ) { const YV12_BUFFER_CONFIG * const cfg = get_ref_frame ( cm , 0 ) ; if ( cfg == NULL ) { vpx_internal_error ( & cm -> error , V...
30
NVD-CWE-noinfo static inline int xfrm_replay_verify_len ( struct xfrm_replay_state_esn * replay_esn , struct nlattr * rp ) { struct xfrm_replay_state_esn * up ; int ulen ; if ( ! replay_esn || ! rp ) return 0 ; up = nla_data ( rp ) ; ulen = xfrm_replay_state_esn_len ( up ) ; if ( nla_len ( rp ) < ulen || xfrm_replay_st...
static inline int xfrm_replay_verify_len ( struct xfrm_replay_state_esn * replay_esn , struct nlattr * rp ) { struct xfrm_replay_state_esn * up ; int ulen ; if ( ! replay_esn || ! rp ) return 0 ; up = nla_data ( rp ) ; ulen = xfrm_replay_state_esn_len ( up ) ; if ( nla_len ( rp ) < ulen || xfrm_replay_state_esn_len ( r...
31
CWE-119 static VALUE cState_object_nl_set ( VALUE self , VALUE object_nl ) { unsigned long len ; GET_STATE ( self ) ; Check_Type ( object_nl , T_STRING ) ; len = RSTRING_LEN ( object_nl ) ; if ( len == 0 ) { if ( state -> object_nl ) { ruby_xfree ( state -> object_nl ) ; state -> object_nl = NULL ; } } else { if ( stat...
static VALUE cState_object_nl_set ( VALUE self , VALUE object_nl ) { unsigned long len ; GET_STATE ( self ) ; Check_Type ( object_nl , T_STRING ) ; len = RSTRING_LEN ( object_nl ) ; if ( len == 0 ) { if ( state -> object_nl ) { ruby_xfree ( state -> object_nl ) ; state -> object_nl = NULL ; } } else { if ( state -> obj...
32
CWE-476 static VTermState * vterm_state_new ( VTerm * vt ) { VTermState * state = vterm_allocator_malloc ( vt , sizeof ( VTermState ) ) ; <vul-start> <vul-end> state -> vt = vt ; state -> rows = vt -> rows ; state -> cols = vt -> cols ; state -> mouse_col = 0 ; state -> mouse_row = 0 ; state -> mouse_buttons = 0 ; stat...
static VTermState * vterm_state_new ( VTerm * vt ) { VTermState * state = vterm_allocator_malloc ( vt , sizeof ( VTermState ) ) ; if ( state == NULL ) return NULL ; state -> vt = vt ; state -> rows = vt -> rows ; state -> cols = vt -> cols ; state -> mouse_col = 0 ; state -> mouse_row = 0 ; state -> mouse_buttons = 0 ;...
33
CWE-125 void CLASS xtrans_interpolate ( int passes ) { int c , d , f , g , h , i , v , ng , row , col , top , left , mrow , mcol ; # ifdef LIBRAW_LIBRARY_BUILD int cstat [ 4 ] = { 0 , 0 , 0 , 0 } ; # endif int val , ndir , pass , hm [ 8 ] , avg [ 4 ] , color [ 3 ] [ 8 ] ; static const short orth [ 12 ] = { 1 , 0 , 0 , ...
void CLASS xtrans_interpolate ( int passes ) { int c , d , f , g , h , i , v , ng , row , col , top , left , mrow , mcol ; # ifdef LIBRAW_LIBRARY_BUILD int cstat [ 4 ] = { 0 , 0 , 0 , 0 } ; # endif int val , ndir , pass , hm [ 8 ] , avg [ 4 ] , color [ 3 ] [ 8 ] ; static const short orth [ 12 ] = { 1 , 0 , 0 , 1 , - 1 ...
34
CWE-119 static int psf_close ( SF_PRIVATE * psf ) { uint32_t k ; int error = 0 ; if ( psf -> codec_close ) { error = psf -> codec_close ( psf ) ; psf -> codec_close = NULL ; } ; if ( psf -> container_close ) error = psf -> container_close ( psf ) ; error = psf_fclose ( psf ) ; psf_close_rsrc ( psf ) ; <vul-start> <vul-...
static int psf_close ( SF_PRIVATE * psf ) { uint32_t k ; int error = 0 ; if ( psf -> codec_close ) { error = psf -> codec_close ( psf ) ; psf -> codec_close = NULL ; } ; if ( psf -> container_close ) error = psf -> container_close ( psf ) ; error = psf_fclose ( psf ) ; psf_close_rsrc ( psf ) ; free ( psf -> header . pt...
35
CWE-399 static ssize_t fuse_fill_write_pages ( struct fuse_req * req , struct address_space * mapping , struct iov_iter * ii , loff_t pos ) { struct fuse_conn * fc = get_fuse_conn ( mapping -> host ) ; unsigned offset = pos & ( PAGE_CACHE_SIZE - 1 ) ; size_t count = 0 ; int err ; req -> in . argpages = 1 ; req -> page_...
static ssize_t fuse_fill_write_pages ( struct fuse_req * req , struct address_space * mapping , struct iov_iter * ii , loff_t pos ) { struct fuse_conn * fc = get_fuse_conn ( mapping -> host ) ; unsigned offset = pos & ( PAGE_CACHE_SIZE - 1 ) ; size_t count = 0 ; int err ; req -> in . argpages = 1 ; req -> page_descs [ ...
36
CWE-125 default : value = 1.0 * viff_colormap [ i ] ; break ; } if ( i < ( ssize_t ) image -> colors ) { image -> colormap [ i ] . red = ScaleCharToQuantum ( ( unsigned char ) value ) ; image -> colormap [ i ] . green = ScaleCharToQuantum ( ( unsigned char ) value ) ; image -> colormap [ i ] . blue = ScaleCharToQuantum...
default : value = 1.0 * viff_colormap [ i ] ; break ; } if ( i < ( ssize_t ) image -> colors ) { image -> colormap [ i ] . red = ScaleCharToQuantum ( ( unsigned char ) value ) ; image -> colormap [ i ] . green = ScaleCharToQuantum ( ( unsigned char ) value ) ; image -> colormap [ i ] . blue = ScaleCharToQuantum ( ( uns...
37
CWE-119 static vpx_codec_err_t vp8e_use_reference ( vpx_codec_alg_priv_t * ctx , <vul-start> int ctr_id , <vul-end> va_list args ) { int reference_flag = va_arg ( args , int ) ; vp8_use_as_reference ( ctx -> cpi , reference_flag ) ; return VPX_CODEC_OK ; }
static vpx_codec_err_t vp8e_use_reference ( vpx_codec_alg_priv_t * ctx , va_list args ) { int reference_flag = va_arg ( args , int ) ; vp8_use_as_reference ( ctx -> cpi , reference_flag ) ; return VPX_CODEC_OK ; }
38
CWE-358 int udp_recvmsg ( struct sock * sk , struct msghdr * msg , size_t len , int noblock , int flags , int * addr_len ) { struct inet_sock * inet = inet_sk ( sk ) ; DECLARE_SOCKADDR ( struct sockaddr_in * , sin , msg -> msg_name ) ; struct sk_buff * skb ; unsigned int ulen , copied ; int peeked , off = 0 ; int err ;...
int udp_recvmsg ( struct sock * sk , struct msghdr * msg , size_t len , int noblock , int flags , int * addr_len ) { struct inet_sock * inet = inet_sk ( sk ) ; DECLARE_SOCKADDR ( struct sockaddr_in * , sin , msg -> msg_name ) ; struct sk_buff * skb ; unsigned int ulen , copied ; int peeked , off = 0 ; int err ; int is_...
39
NVD-CWE-noinfo "Magic Mismatch, valid(0x%x) - read(0x%x)" , F2FS_SUPER_MAGIC , le32_to_cpu ( raw_super -> magic ) ) ; return 1 ; } if ( F2FS_BLKSIZE != PAGE_SIZE ) { f2fs_msg ( sb , KERN_INFO , "Invalid page_cache_size (%lu), supports only 4KB\\n" , PAGE_SIZE ) ; return 1 ; } blocksize = 1 << le32_to_cpu ( raw_super ->...
"Magic Mismatch, valid(0x%x) - read(0x%x)" , F2FS_SUPER_MAGIC , le32_to_cpu ( raw_super -> magic ) ) ; return 1 ; } if ( F2FS_BLKSIZE != PAGE_SIZE ) { f2fs_msg ( sb , KERN_INFO , "Invalid page_cache_size (%lu), supports only 4KB\\n" , PAGE_SIZE ) ; return 1 ; } blocksize = 1 << le32_to_cpu ( raw_super -> log_blocksize ...
40
CWE-119 static const ut8 * r_bin_dwarf_parse_comp_unit ( Sdb * s , const ut8 * obuf , RBinDwarfCompUnit * cu , const RBinDwarfDebugAbbrev * da , size_t offset , const ut8 * debug_str , size_t debug_str_len ) { const ut8 * buf = obuf , * buf_end = obuf + ( cu -> hdr . length - 7 ) ; ut64 abbr_code ; size_t i ; if ( cu -...
static const ut8 * r_bin_dwarf_parse_comp_unit ( Sdb * s , const ut8 * obuf , RBinDwarfCompUnit * cu , const RBinDwarfDebugAbbrev * da , size_t offset , const ut8 * debug_str , size_t debug_str_len ) { const ut8 * buf = obuf , * buf_end = obuf + ( cu -> hdr . length - 7 ) ; ut64 abbr_code ; size_t i ; if ( cu -> hdr . ...
41
CWE-20 void ftpServerProcessList ( FtpClientConnection * connection , char_t * param ) { error_t error ; uint_t perm ; if ( ! connection -> userLoggedIn ) { osStrcpy ( connection -> response , "530 Not logged in\\r\\n" ) ; return ; } while ( * param == '-' ) { while ( * param != ' ' && * param != '\\0' ) <vul-start> <v...
void ftpServerProcessList ( FtpClientConnection * connection , char_t * param ) { error_t error ; uint_t perm ; if ( ! connection -> userLoggedIn ) { osStrcpy ( connection -> response , "530 Not logged in\\r\\n" ) ; return ; } while ( * param == '-' ) { while ( * param != ' ' && * param != '\\0' ) { param ++ ; } while ...
42
CWE-284 btif_dm_ssp_key_notif_evt ( & p_data -> key_notif ) ; break ; case BTA_DM_DEV_UNPAIRED_EVT : bdcpy ( bd_addr . address , p_data -> link_down . bd_addr ) ; btm_set_bond_type_dev ( p_data -> link_down . bd_addr , BOND_TYPE_UNKNOWN ) ; # if ( defined ( BTA_HH_INCLUDED ) && ( BTA_HH_INCLUDED == TRUE ) ) btif_hh_rem...
btif_dm_ssp_key_notif_evt ( & p_data -> key_notif ) ; break ; case BTA_DM_DEV_UNPAIRED_EVT : bdcpy ( bd_addr . address , p_data -> link_down . bd_addr ) ; btm_set_bond_type_dev ( p_data -> link_down . bd_addr , BOND_TYPE_UNKNOWN ) ; # if ( defined ( BTA_HH_INCLUDED ) && ( BTA_HH_INCLUDED == TRUE ) ) btif_hh_remove_devi...
43
CWE-264 static FILE * pw_tmpfile ( int lockfd ) { FILE * fd ; char * tmpname = NULL ; <vul-start> char * dir = "/etc" ; if ( ( fd = xfmkstemp ( & tmpname , dir ) ) == NULL ) { <vul-end> ulckpwdf ( ) ; err ( EXIT_FAILURE , _ ( "can\'t open temporary file" ) ) ; } copyfile ( lockfd , fileno ( fd ) ) ; tmp_file = tmpname ...
static FILE * pw_tmpfile ( int lockfd ) { FILE * fd ; char * tmpname = NULL ; if ( ( fd = xfmkstemp ( & tmpname , "/etc" , ".vipw" ) ) == NULL ) { ulckpwdf ( ) ; err ( EXIT_FAILURE , _ ( "can\'t open temporary file" ) ) ; } copyfile ( lockfd , fileno ( fd ) ) ; tmp_file = tmpname ; return fd ; }
44
CWE-763 static int spk_ttyio_ldisc_open ( struct tty_struct * tty ) { struct spk_ldisc_data * ldisc_data ; if ( ! tty -> ops -> write ) return - EOPNOTSUPP ; <vul-start> <vul-end> speakup_tty = tty ; ldisc_data = kmalloc ( sizeof ( * ldisc_data ) , GFP_KERNEL ) ; <vul-start> if ( ! ldisc_data ) <vul-end> return - ENOME...
static int spk_ttyio_ldisc_open ( struct tty_struct * tty ) { struct spk_ldisc_data * ldisc_data ; if ( ! tty -> ops -> write ) return - EOPNOTSUPP ; mutex_lock ( & speakup_tty_mutex ) ; if ( speakup_tty ) { mutex_unlock ( & speakup_tty_mutex ) ; return - EBUSY ; } speakup_tty = tty ; ldisc_data = kmalloc ( sizeof ( * ...
45
CWE-20 int wait_for_key_construction ( struct key * key , bool intr ) { int ret ; ret = wait_on_bit ( & key -> flags , KEY_FLAG_USER_CONSTRUCT , intr ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE ) ; if ( ret ) return - ERESTARTSYS ; <vul-start> if ( test_bit ( KEY_FLAG_NEGATIVE , & key -> flags ) ) { smp_rmb ( ) ; retur...
int wait_for_key_construction ( struct key * key , bool intr ) { int ret ; ret = wait_on_bit ( & key -> flags , KEY_FLAG_USER_CONSTRUCT , intr ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE ) ; if ( ret ) return - ERESTARTSYS ; ret = key_read_state ( key ) ; if ( ret < 0 ) return ret ; return key_validate ( key ) ; }
46
CWE-476 jp2_box_t * jp2_box_get ( jas_stream_t * in ) { jp2_box_t * box ; jp2_boxinfo_t * boxinfo ; jas_stream_t * tmpstream ; uint_fast32_t len ; uint_fast64_t extlen ; bool dataflag ; box = 0 ; tmpstream = 0 ; if ( ! ( box = jas_malloc ( sizeof ( jp2_box_t ) ) ) ) { goto error ; } box -> ops = & jp2_boxinfo_unk . ops...
jp2_box_t * jp2_box_get ( jas_stream_t * in ) { jp2_box_t * box ; jp2_boxinfo_t * boxinfo ; jas_stream_t * tmpstream ; uint_fast32_t len ; uint_fast64_t extlen ; bool dataflag ; box = 0 ; tmpstream = 0 ; if ( ! ( box = jas_malloc ( sizeof ( jp2_box_t ) ) ) ) { goto error ; } box -> ops = & jp2_boxinfo_unk . ops ; if ( ...
47
CWE-20 static int daemon_msg_findallif_req ( uint8 ver , struct daemon_slpars * pars , uint32 plen ) { char errbuf [ PCAP_ERRBUF_SIZE ] ; char errmsgbuf [ PCAP_ERRBUF_SIZE ] ; char sendbuf [ RPCAP_NETBUF_SIZE ] ; int sendbufidx = 0 ; pcap_if_t * alldevs = NULL ; pcap_if_t * d ; struct pcap_addr * address ; struct rpcap...
static int daemon_msg_findallif_req ( uint8 ver , struct daemon_slpars * pars , uint32 plen ) { char errbuf [ PCAP_ERRBUF_SIZE ] ; char errmsgbuf [ PCAP_ERRBUF_SIZE ] ; char sendbuf [ RPCAP_NETBUF_SIZE ] ; int sendbufidx = 0 ; pcap_if_t * alldevs = NULL ; pcap_if_t * d ; struct pcap_addr * address ; struct rpcap_findal...
48
CWE-125 static int lmp_print_data_link_subobjs ( netdissect_options * ndo , const u_char * obj_tptr , int total_subobj_len , int offset ) { int hexdump = FALSE ; int subobj_type , subobj_len ; union { float f ; uint32_t i ; } bw ; while ( total_subobj_len > 0 && hexdump == FALSE ) { subobj_type = EXTRACT_8BITS ( obj_tp...
static int lmp_print_data_link_subobjs ( netdissect_options * ndo , const u_char * obj_tptr , int total_subobj_len , int offset ) { int hexdump = FALSE ; int subobj_type , subobj_len ; union { float f ; uint32_t i ; } bw ; while ( total_subobj_len > 0 && hexdump == FALSE ) { subobj_type = EXTRACT_8BITS ( obj_tptr + off...
49
CWE-119 static void update_sharpness ( loop_filter_info_n * lfi , int sharpness_lvl ) { int lvl ; for ( lvl = 0 ; lvl <= MAX_LOOP_FILTER ; lvl ++ ) { int block_inside_limit = lvl >> ( ( sharpness_lvl > 0 ) + ( sharpness_lvl > 4 ) ) ; if ( sharpness_lvl > 0 ) { if ( block_inside_limit > ( 9 - sharpness_lvl ) ) block_ins...
static void update_sharpness ( loop_filter_info_n * lfi , int sharpness_lvl ) { int lvl ; for ( lvl = 0 ; lvl <= MAX_LOOP_FILTER ; lvl ++ ) { int block_inside_limit = lvl >> ( ( sharpness_lvl > 0 ) + ( sharpness_lvl > 4 ) ) ; if ( sharpness_lvl > 0 ) { if ( block_inside_limit > ( 9 - sharpness_lvl ) ) block_inside_limi...
50
CWE-835 xmlGenericError ( xmlGenericErrorContext , "PEReference: %s\\n" , name ) ; if ( RAW != ';' ) { xmlFatalErr ( ctxt , XML_ERR_PEREF_SEMICOL_MISSING , NULL ) ; return ; } NEXT ; ctxt -> nbentities ++ ; if ( ( ctxt -> sax != NULL ) && ( ctxt -> sax -> getParameterEntity != NULL ) ) entity = ctxt -> sax -> getParame...
xmlGenericError ( xmlGenericErrorContext , "PEReference: %s\\n" , name ) ; if ( RAW != ';' ) { xmlFatalErr ( ctxt , XML_ERR_PEREF_SEMICOL_MISSING , NULL ) ; return ; } NEXT ; ctxt -> nbentities ++ ; if ( ( ctxt -> sax != NULL ) && ( ctxt -> sax -> getParameterEntity != NULL ) ) entity = ctxt -> sax -> getParameterEntit...
51
CWE-401 int iwl_pcie_ctxt_info_gen3_init ( struct iwl_trans * trans , const struct fw_img * fw ) { struct iwl_trans_pcie * trans_pcie = IWL_TRANS_GET_PCIE_TRANS ( trans ) ; struct iwl_context_info_gen3 * ctxt_info_gen3 ; struct iwl_prph_scratch * prph_scratch ; struct iwl_prph_scratch_ctrl_cfg * prph_sc_ctrl ; struct i...
int iwl_pcie_ctxt_info_gen3_init ( struct iwl_trans * trans , const struct fw_img * fw ) { struct iwl_trans_pcie * trans_pcie = IWL_TRANS_GET_PCIE_TRANS ( trans ) ; struct iwl_context_info_gen3 * ctxt_info_gen3 ; struct iwl_prph_scratch * prph_scratch ; struct iwl_prph_scratch_ctrl_cfg * prph_sc_ctrl ; struct iwl_prph_...
52
CWE-772 generic_ret * chpass_principal_2_svc ( chpass_arg * arg , struct svc_req * rqstp ) { static generic_ret ret ; char * prime_arg ; <vul-start> gss_buffer_desc client_name , service_name ; <vul-end> OM_uint32 minor_stat ; kadm5_server_handle_t handle ; const char * errmsg = NULL ; xdr_free ( xdr_generic_ret , & re...
generic_ret * chpass_principal_2_svc ( chpass_arg * arg , struct svc_req * rqstp ) { static generic_ret ret ; char * prime_arg ; gss_buffer_desc client_name = GSS_C_EMPTY_BUFFER ; gss_buffer_desc service_name = GSS_C_EMPTY_BUFFER ; OM_uint32 minor_stat ; kadm5_server_handle_t handle ; const char * errmsg = NULL ; xdr_f...
53
CWE-401 static int htc_setup_complete ( struct htc_target * target ) { struct sk_buff * skb ; struct htc_comp_msg * comp_msg ; int ret = 0 ; unsigned long time_left ; skb = alloc_skb ( 50 + sizeof ( struct htc_frame_hdr ) , GFP_ATOMIC ) ; if ( ! skb ) { dev_err ( target -> dev , "failed to allocate send buffer\\n" ) ; ...
static int htc_setup_complete ( struct htc_target * target ) { struct sk_buff * skb ; struct htc_comp_msg * comp_msg ; int ret = 0 ; unsigned long time_left ; skb = alloc_skb ( 50 + sizeof ( struct htc_frame_hdr ) , GFP_ATOMIC ) ; if ( ! skb ) { dev_err ( target -> dev , "failed to allocate send buffer\\n" ) ; return -...
54
CWE-189 sf_count_t psf_fwrite ( const void * ptr , sf_count_t bytes , sf_count_t items , SF_PRIVATE * psf ) { sf_count_t total = 0 ; ssize_t count ; <vul-start> <vul-end> if ( psf -> virtual_io ) return psf -> vio . write ( ptr , bytes * items , psf -> vio_user_data ) / bytes ; items *= bytes ; if ( items <= 0 ) return...
sf_count_t psf_fwrite ( const void * ptr , sf_count_t bytes , sf_count_t items , SF_PRIVATE * psf ) { sf_count_t total = 0 ; ssize_t count ; if ( bytes == 0 || items == 0 ) return 0 ; if ( psf -> virtual_io ) return psf -> vio . write ( ptr , bytes * items , psf -> vio_user_data ) / bytes ; items *= bytes ; if ( items ...
55
CWE-119 static int http_connect ( URLContext * h , const char * path , const char * local_path , const char * hoststr , const char * auth , const char * proxyauth , int * new_location ) { HTTPContext * s = h -> priv_data ; int post , err ; char headers [ HTTP_HEADERS_SIZE ] = "" ; char * authstr = NULL , * proxyauthstr...
static int http_connect ( URLContext * h , const char * path , const char * local_path , const char * hoststr , const char * auth , const char * proxyauth , int * new_location ) { HTTPContext * s = h -> priv_data ; int post , err ; char headers [ HTTP_HEADERS_SIZE ] = "" ; char * authstr = NULL , * proxyauthstr = NULL ...
56
CWE-78 int check_restricted ( void ) { if ( restricted ) { <vul-start> emsg ( _ ( "E145: Shell commands not allowed in rvim" ) ) ; <vul-end> return TRUE ; } return FALSE ; }
int check_restricted ( void ) { if ( restricted ) { emsg ( _ ( "E145: Shell commands and some functionality not allowed in rvim" ) ) ; return TRUE ; } return FALSE ; }
57
CWE-269 qboolean S_AL_Init ( soundInterface_t * si ) { # ifdef USE_OPENAL const char * device = NULL ; const char * inputdevice = NULL ; int i ; if ( ! si ) { return qfalse ; } for ( i = 0 ; i < MAX_RAW_STREAMS ; i ++ ) { streamSourceHandles [ i ] = - 1 ; streamPlaying [ i ] = qfalse ; streamSources [ i ] = 0 ; streamN...
qboolean S_AL_Init ( soundInterface_t * si ) { # ifdef USE_OPENAL const char * device = NULL ; const char * inputdevice = NULL ; int i ; if ( ! si ) { return qfalse ; } for ( i = 0 ; i < MAX_RAW_STREAMS ; i ++ ) { streamSourceHandles [ i ] = - 1 ; streamPlaying [ i ] = qfalse ; streamSources [ i ] = 0 ; streamNumBuffer...
58
CWE-190 static int growVTrans ( sqlite3 * db ) { const int ARRAY_INCR = 5 ; if ( ( db -> nVTrans % ARRAY_INCR ) == 0 ) { VTable * * aVTrans ; <vul-start> int nBytes = sizeof ( sqlite3_vtab * ) * ( db -> nVTrans + ARRAY_INCR ) ; <vul-end> aVTrans = sqlite3DbRealloc ( db , ( void * ) db -> aVTrans , nBytes ) ; if ( ! aVT...
static int growVTrans ( sqlite3 * db ) { const int ARRAY_INCR = 5 ; if ( ( db -> nVTrans % ARRAY_INCR ) == 0 ) { VTable * * aVTrans ; sqlite3_int64 nBytes = sizeof ( sqlite3_vtab * ) * ( ( sqlite3_int64 ) db -> nVTrans + ARRAY_INCR ) ; aVTrans = sqlite3DbRealloc ( db , ( void * ) db -> aVTrans , nBytes ) ; if ( ! aVTra...
59
CWE-284 static bool msr_mtrr_valid ( unsigned msr ) { switch ( msr ) { case 0x200 ... 0x200 + 2 * KVM_NR_VAR_MTRR - 1 : case MSR_MTRRfix64K_00000 : case MSR_MTRRfix16K_80000 : case MSR_MTRRfix16K_A0000 : case MSR_MTRRfix4K_C0000 : case MSR_MTRRfix4K_C8000 : case MSR_MTRRfix4K_D0000 : case MSR_MTRRfix4K_D8000 : case MSR...
static bool msr_mtrr_valid ( unsigned msr ) { switch ( msr ) { case 0x200 ... 0x200 + 2 * KVM_NR_VAR_MTRR - 1 : case MSR_MTRRfix64K_00000 : case MSR_MTRRfix16K_80000 : case MSR_MTRRfix16K_A0000 : case MSR_MTRRfix4K_C0000 : case MSR_MTRRfix4K_C8000 : case MSR_MTRRfix4K_D0000 : case MSR_MTRRfix4K_D8000 : case MSR_MTRRfix...
60
CWE-772 generic_ret * setkey_principal_2_svc ( setkey_arg * arg , struct svc_req * rqstp ) { static generic_ret ret ; char * prime_arg ; <vul-start> gss_buffer_desc client_name , service_name ; <vul-end> OM_uint32 minor_stat ; kadm5_server_handle_t handle ; const char * errmsg = NULL ; xdr_free ( xdr_generic_ret , & re...
generic_ret * setkey_principal_2_svc ( setkey_arg * arg , struct svc_req * rqstp ) { static generic_ret ret ; char * prime_arg ; gss_buffer_desc client_name = GSS_C_EMPTY_BUFFER ; gss_buffer_desc service_name = GSS_C_EMPTY_BUFFER ; OM_uint32 minor_stat ; kadm5_server_handle_t handle ; const char * errmsg = NULL ; xdr_f...
61
CWE-20 static int tomoyo_mount_acl ( struct tomoyo_request_info * r , char * dev_name , struct path * dir , char * type , unsigned long flags ) { struct path path ; struct file_system_type * fstype = NULL ; const char * requested_type = NULL ; const char * requested_dir_name = NULL ; const char * requested_dev_name = N...
static int tomoyo_mount_acl ( struct tomoyo_request_info * r , char * dev_name , struct path * dir , char * type , unsigned long flags ) { struct path path ; struct file_system_type * fstype = NULL ; const char * requested_type = NULL ; const char * requested_dir_name = NULL ; const char * requested_dev_name = NULL ; s...
62
CWE-119 <vul-start> VP9Decoder * vp9_decoder_create ( const VP9D_CONFIG * oxcf ) { VP9Decoder * const pbi = vpx_memalign ( 32 , sizeof ( * pbi ) ) ; VP9_COMMON * const cm = pbi ? & pbi -> common : NULL ; <vul-end> if ( ! cm ) return NULL ; vp9_zero ( * pbi ) ; if ( setjmp ( cm -> error . jmp ) ) { cm -> error . setjmp ...
VP9Decoder * vp9_decoder_create ( BufferPool * const pool ) { VP9Decoder * volatile const pbi = vpx_memalign ( 32 , sizeof ( * pbi ) ) ; VP9_COMMON * volatile const cm = pbi ? & pbi -> common : NULL ; if ( ! cm ) return NULL ; vp9_zero ( * pbi ) ; if ( setjmp ( cm -> error . jmp ) ) { cm -> error . setjmp = 0 ; vp9_dec...
63
CWE-125 static PyObject * parsenumber ( struct compiling * c , const char * s ) { char * dup , * end ; PyObject * res = NULL ; assert ( s != NULL ) ; if ( strchr ( s , '_' ) == NULL ) { return parsenumber_raw ( c , s ) ; } dup = PyMem_Malloc ( strlen ( s ) + 1 ) ; <vul-start> <vul-end> end = dup ; for ( ; * s ; s ++ ) ...
static PyObject * parsenumber ( struct compiling * c , const char * s ) { char * dup , * end ; PyObject * res = NULL ; assert ( s != NULL ) ; if ( strchr ( s , '_' ) == NULL ) { return parsenumber_raw ( c , s ) ; } dup = PyMem_Malloc ( strlen ( s ) + 1 ) ; if ( dup == NULL ) { return PyErr_NoMemory ( ) ; } end = dup ; ...
64
CWE-125 ( i + 2 == NCH ( n ) && ( TYPE ( CHILD ( n , i + 1 ) ) == COMMA || TYPE ( CHILD ( n , i + 1 ) ) == TYPE_COMMENT ) ) ) { ast_error ( c , CHILD ( n , i ) , "named arguments must follow bare *" ) ; return NULL ; } ch = CHILD ( n , i + 1 ) ; if ( TYPE ( ch ) == COMMA ) { int res = 0 ; i += 2 ; if ( i < NCH ( n ) &&...
( i + 2 == NCH ( n ) && ( TYPE ( CHILD ( n , i + 1 ) ) == COMMA || TYPE ( CHILD ( n , i + 1 ) ) == TYPE_COMMENT ) ) ) { ast_error ( c , CHILD ( n , i ) , "named arguments must follow bare *" ) ; return NULL ; } ch = CHILD ( n , i + 1 ) ; if ( TYPE ( ch ) == COMMA ) { int res = 0 ; i += 2 ; if ( i < NCH ( n ) && TYPE ( ...
65
CWE-119 static void * load_bytes ( RBinFile * arch , const ut8 * buf , ut64 sz , ut64 loaddr , Sdb * sdb ) { if ( ! buf || ! sz || sz == UT64_MAX ) { return NULL ; } RBuffer * tbuf = r_buf_new ( ) ; <vul-start> <vul-end> r_buf_set_bytes ( tbuf , buf , sz ) ; struct r_bin_bflt_obj * res = r_bin_bflt_new_buf ( tbuf ) ; r...
static void * load_bytes ( RBinFile * arch , const ut8 * buf , ut64 sz , ut64 loaddr , Sdb * sdb ) { if ( ! buf || ! sz || sz == UT64_MAX ) { return NULL ; } RBuffer * tbuf = r_buf_new ( ) ; if ( ! tbuf ) { return NULL ; } r_buf_set_bytes ( tbuf , buf , sz ) ; struct r_bin_bflt_obj * res = r_bin_bflt_new_buf ( tbuf ) ;...
66
CWE-200 static int rfcomm_sock_getsockopt ( struct socket * sock , int level , int optname , char __user * optval , int __user * optlen ) { struct sock * sk = sock -> sk ; struct bt_security sec ; int len , err = 0 ; BT_DBG ( "sk %p" , sk ) ; if ( level == SOL_RFCOMM ) return rfcomm_sock_getsockopt_old ( sock , optname...
static int rfcomm_sock_getsockopt ( struct socket * sock , int level , int optname , char __user * optval , int __user * optlen ) { struct sock * sk = sock -> sk ; struct bt_security sec ; int len , err = 0 ; BT_DBG ( "sk %p" , sk ) ; if ( level == SOL_RFCOMM ) return rfcomm_sock_getsockopt_old ( sock , optname , optva...
67
CWE-200 static void * __dma_alloc_coherent ( struct device * dev , size_t size , dma_addr_t * dma_handle , gfp_t flags , struct dma_attrs * attrs ) { if ( dev == NULL ) { WARN_ONCE ( 1 , "Use an actual device structure for DMA allocation\\n" ) ; return NULL ; } if ( IS_ENABLED ( CONFIG_ZONE_DMA ) && dev -> coherent_dma...
static void * __dma_alloc_coherent ( struct device * dev , size_t size , dma_addr_t * dma_handle , gfp_t flags , struct dma_attrs * attrs ) { if ( dev == NULL ) { WARN_ONCE ( 1 , "Use an actual device structure for DMA allocation\\n" ) ; return NULL ; } if ( IS_ENABLED ( CONFIG_ZONE_DMA ) && dev -> coherent_dma_mask <=...
68
CWE-119 void oz_usb_rx ( struct oz_pd * pd , struct oz_elt * elt ) { struct oz_usb_hdr * usb_hdr = ( struct oz_usb_hdr * ) ( elt + 1 ) ; struct oz_usb_ctx * usb_ctx ; spin_lock_bh ( & pd -> app_lock [ OZ_APPID_USB ] ) ; usb_ctx = ( struct oz_usb_ctx * ) pd -> app_ctx [ OZ_APPID_USB ] ; if ( usb_ctx ) oz_usb_get ( usb_c...
void oz_usb_rx ( struct oz_pd * pd , struct oz_elt * elt ) { struct oz_usb_hdr * usb_hdr = ( struct oz_usb_hdr * ) ( elt + 1 ) ; struct oz_usb_ctx * usb_ctx ; spin_lock_bh ( & pd -> app_lock [ OZ_APPID_USB ] ) ; usb_ctx = ( struct oz_usb_ctx * ) pd -> app_ctx [ OZ_APPID_USB ] ; if ( usb_ctx ) oz_usb_get ( usb_ctx ) ; s...
69
CWE-119 static void update_reference_frames ( VP8_COMP * cpi ) { VP8_COMMON * cm = & cpi -> common ; YV12_BUFFER_CONFIG * yv12_fb = cm -> yv12_fb ; if ( cm -> frame_type == KEY_FRAME ) { yv12_fb [ cm -> new_fb_idx ] . flags |= VP8_GOLD_FRAME | VP8_ALTR_FRAME ; yv12_fb [ cm -> gld_fb_idx ] . flags &= ~ VP8_GOLD_FRAME ; ...
static void update_reference_frames ( VP8_COMP * cpi ) { VP8_COMMON * cm = & cpi -> common ; YV12_BUFFER_CONFIG * yv12_fb = cm -> yv12_fb ; if ( cm -> frame_type == KEY_FRAME ) { yv12_fb [ cm -> new_fb_idx ] . flags |= VP8_GOLD_FRAME | VP8_ALTR_FRAME ; yv12_fb [ cm -> gld_fb_idx ] . flags &= ~ VP8_GOLD_FRAME ; yv12_fb ...
70
CWE-416 static void nodeDestruct ( struct SaveNode * node ) { <vul-start> if ( node -> v == & node -> sorted ) <vul-end> { <vul-start> tr_free ( node -> sorted . val . l . vals ) ; <vul-end> } }
static void nodeDestruct ( struct SaveNode * node ) { TR_ASSERT ( node != NULL ) ; if ( node -> sorted != NULL ) { tr_free ( node -> sorted -> val . l . vals ) ; tr_free ( node -> sorted ) ; } }
71
CWE-772 static Image * ReadMATImage ( const ImageInfo * image_info , ExceptionInfo * exception ) { Image * image , * image2 = NULL , * rotated_image ; register Quantum * q ; unsigned int status ; MATHeader MATLAB_HDR ; size_t size ; size_t CellType ; QuantumInfo * quantum_info ; ImageInfo * clone_info ; int i ; ssize_t...
static Image * ReadMATImage ( const ImageInfo * image_info , ExceptionInfo * exception ) { Image * image , * image2 = NULL , * rotated_image ; register Quantum * q ; unsigned int status ; MATHeader MATLAB_HDR ; size_t size ; size_t CellType ; QuantumInfo * quantum_info ; ImageInfo * clone_info ; int i ; ssize_t ldblk ;...
72
CWE-190 int read_xattrs_from_disk ( int fd , struct squashfs_super_block * sBlk , int flag , long long * table_start ) { <vul-start> int res , bytes , i , indexes , index_bytes , ids ; <vul-end> long long * index , start , end ; struct squashfs_xattr_table id_table ; TRACE ( "read_xattrs_from_disk\\n" ) ; if ( sBlk -> ...
int read_xattrs_from_disk ( int fd , struct squashfs_super_block * sBlk , int flag , long long * table_start ) { int res , i , indexes , index_bytes ; unsigned int ids ; long long bytes ; long long * index , start , end ; struct squashfs_xattr_table id_table ; TRACE ( "read_xattrs_from_disk\\n" ) ; if ( sBlk -> xattr_i...
73
CWE-399 static void alpha_perf_event_irq_handler ( unsigned long la_ptr , struct pt_regs * regs ) { struct cpu_hw_events * cpuc ; struct perf_sample_data data ; struct perf_event * event ; struct hw_perf_event * hwc ; int idx , j ; __get_cpu_var ( irq_pmi_count ) ++ ; cpuc = & __get_cpu_var ( cpu_hw_events ) ; wrperfmo...
static void alpha_perf_event_irq_handler ( unsigned long la_ptr , struct pt_regs * regs ) { struct cpu_hw_events * cpuc ; struct perf_sample_data data ; struct perf_event * event ; struct hw_perf_event * hwc ; int idx , j ; __get_cpu_var ( irq_pmi_count ) ++ ; cpuc = & __get_cpu_var ( cpu_hw_events ) ; wrperfmon ( PERF...
74
CWE-20 static int sco_sock_recvmsg ( struct kiocb * iocb , struct socket * sock , struct msghdr * msg , size_t len , int flags ) { struct sock * sk = sock -> sk ; struct sco_pinfo * pi = sco_pi ( sk ) ; lock_sock ( sk ) ; if ( sk -> sk_state == BT_CONNECT2 && test_bit ( BT_SK_DEFER_SETUP , & bt_sk ( sk ) -> flags ) ) {...
static int sco_sock_recvmsg ( struct kiocb * iocb , struct socket * sock , struct msghdr * msg , size_t len , int flags ) { struct sock * sk = sock -> sk ; struct sco_pinfo * pi = sco_pi ( sk ) ; lock_sock ( sk ) ; if ( sk -> sk_state == BT_CONNECT2 && test_bit ( BT_SK_DEFER_SETUP , & bt_sk ( sk ) -> flags ) ) { sco_co...
75
CWE-295 InfCertificateChain * chain , gpointer user_data ) { InfGtkCertificateManager * manager ; InfGtkCertificateManagerPrivate * priv ; InfGtkCertificateDialogFlags flags ; gnutls_x509_crt_t presented_cert ; gnutls_x509_crt_t known_cert ; gchar * hostname ; gboolean match_hostname ; gboolean issuer_known ; gnutls_x5...
InfCertificateChain * chain , gpointer user_data ) { InfGtkCertificateManager * manager ; InfGtkCertificateManagerPrivate * priv ; InfGtkCertificateDialogFlags flags ; gnutls_x509_crt_t presented_cert ; gnutls_x509_crt_t known_cert ; gchar * hostname ; gboolean match_hostname ; gboolean issuer_known ; gnutls_x509_crt_t...
76
CWE-119 static void dump_boot ( DOS_FS * fs , struct boot_sector * b , unsigned lss ) { unsigned short sectors ; printf ( "Boot sector contents:\\n" ) ; if ( ! atari_format ) { char id [ 9 ] ; strncpy ( id , ( const char * ) b -> system_id , 8 ) ; id [ 8 ] = 0 ; printf ( "System ID \\"%s\\"\\n" , id ) ; } else { printf...
static void dump_boot ( DOS_FS * fs , struct boot_sector * b , unsigned lss ) { unsigned short sectors ; printf ( "Boot sector contents:\\n" ) ; if ( ! atari_format ) { char id [ 9 ] ; strncpy ( id , ( const char * ) b -> system_id , 8 ) ; id [ 8 ] = 0 ; printf ( "System ID \\"%s\\"\\n" , id ) ; } else { printf ( "Seri...
77
CWE-20 static int irda_recvmsg_stream ( struct kiocb * iocb , struct socket * sock , struct msghdr * msg , size_t size , int flags ) { struct sock * sk = sock -> sk ; struct irda_sock * self = irda_sk ( sk ) ; int noblock = flags & MSG_DONTWAIT ; size_t copied = 0 ; int target , err ; long timeo ; IRDA_DEBUG ( 3 , "%s(...
static int irda_recvmsg_stream ( struct kiocb * iocb , struct socket * sock , struct msghdr * msg , size_t size , int flags ) { struct sock * sk = sock -> sk ; struct irda_sock * self = irda_sk ( sk ) ; int noblock = flags & MSG_DONTWAIT ; size_t copied = 0 ; int target , err ; long timeo ; IRDA_DEBUG ( 3 , "%s()\\n" ,...
78
CWE-20 int tls1_setup_key_block ( SSL * s ) { unsigned char * p ; const EVP_CIPHER * c ; const EVP_MD * hash ; int num ; SSL_COMP * comp ; int mac_type = NID_undef , mac_secret_size = 0 ; int ret = 0 ; if ( s -> s3 -> tmp . key_block_length != 0 ) return ( 1 ) ; <vul-start> if ( ! ssl_cipher_get_evp ( s -> session , & ...
int tls1_setup_key_block ( SSL * s ) { unsigned char * p ; const EVP_CIPHER * c ; const EVP_MD * hash ; int num ; SSL_COMP * comp ; int mac_type = NID_undef , mac_secret_size = 0 ; int ret = 0 ; if ( s -> s3 -> tmp . key_block_length != 0 ) return ( 1 ) ; if ( ! ssl_cipher_get_evp ( s -> session , & c , & hash , & mac_...
79
CWE-362 int mi_repair_by_sort ( MI_CHECK * param , register MI_INFO * info , <vul-start> const char * name , int rep_quick ) <vul-end> { int got_error ; uint i ; ulong length ; ha_rows start_records ; my_off_t new_header_length , del ; File new_file ; MI_SORT_PARAM sort_param ; MYISAM_SHARE * share = info -> s ; HA_KEY...
int mi_repair_by_sort ( MI_CHECK * param , register MI_INFO * info , const char * name , int rep_quick , my_bool no_copy_stat ) { int got_error ; uint i ; ulong length ; ha_rows start_records ; my_off_t new_header_length , del ; File new_file ; MI_SORT_PARAM sort_param ; MYISAM_SHARE * share = info -> s ; HA_KEYSEG * k...
80
CWE-476 BOOL transport_connect_nla ( rdpTransport * transport ) { freerdp * instance ; rdpSettings * settings ; if ( transport -> layer == TRANSPORT_LAYER_TSG ) return TRUE ; if ( ! transport_connect_tls ( transport ) ) return FALSE ; if ( transport -> settings -> Authentication != TRUE ) return TRUE ; settings = trans...
BOOL transport_connect_nla ( rdpTransport * transport ) { freerdp * instance ; rdpSettings * settings ; if ( transport -> layer == TRANSPORT_LAYER_TSG ) return TRUE ; if ( ! transport_connect_tls ( transport ) ) return FALSE ; if ( transport -> settings -> Authentication != TRUE ) return TRUE ; settings = transport -> ...
81
CWE-119 void mp_encode_lua_table_as_map ( lua_State * L , mp_buf * buf , int level ) { size_t len = 0 ; <vul-start> <vul-end> lua_pushnil ( L ) ; while ( lua_next ( L , - 2 ) ) { lua_pop ( L , 1 ) ; len ++ ; } mp_encode_map ( L , buf , len ) ; lua_pushnil ( L ) ; while ( lua_next ( L , - 2 ) ) { lua_pushvalue ( L , - 2...
void mp_encode_lua_table_as_map ( lua_State * L , mp_buf * buf , int level ) { size_t len = 0 ; luaL_checkstack ( L , 3 , "in function mp_encode_lua_table_as_map" ) ; lua_pushnil ( L ) ; while ( lua_next ( L , - 2 ) ) { lua_pop ( L , 1 ) ; len ++ ; } mp_encode_map ( L , buf , len ) ; lua_pushnil ( L ) ; while ( lua_nex...
82
CWE-200 static int tipc_nl_compat_link_dump ( struct tipc_nl_compat_msg * msg , struct nlattr * * attrs ) { struct nlattr * link [ TIPC_NLA_LINK_MAX + 1 ] ; struct tipc_link_info link_info ; int err ; if ( ! attrs [ TIPC_NLA_LINK ] ) return - EINVAL ; err = nla_parse_nested ( link , TIPC_NLA_LINK_MAX , attrs [ TIPC_NLA...
static int tipc_nl_compat_link_dump ( struct tipc_nl_compat_msg * msg , struct nlattr * * attrs ) { struct nlattr * link [ TIPC_NLA_LINK_MAX + 1 ] ; struct tipc_link_info link_info ; int err ; if ( ! attrs [ TIPC_NLA_LINK ] ) return - EINVAL ; err = nla_parse_nested ( link , TIPC_NLA_LINK_MAX , attrs [ TIPC_NLA_LINK ] ...
83
CWE-200 static int load_misc_binary ( struct linux_binprm * bprm ) { Node * fmt ; struct file * interp_file = NULL ; char iname [ BINPRM_BUF_SIZE ] ; const char * iname_addr = iname ; int retval ; int fd_binary = - 1 ; retval = - ENOEXEC ; if ( ! enabled ) goto _ret ; read_lock ( & entries_lock ) ; fmt = check_file ( b...
static int load_misc_binary ( struct linux_binprm * bprm ) { Node * fmt ; struct file * interp_file = NULL ; char iname [ BINPRM_BUF_SIZE ] ; const char * iname_addr = iname ; int retval ; int fd_binary = - 1 ; retval = - ENOEXEC ; if ( ! enabled ) goto _ret ; read_lock ( & entries_lock ) ; fmt = check_file ( bprm ) ; ...
84
CWE-125 void <vul-start> isoclns_print ( netdissect_options * ndo , const uint8_t * p , u_int length , u_int caplen ) <vul-end> { <vul-start> if ( caplen <= 1 ) { <vul-end> ND_PRINT ( ( ndo , "|OSI" ) ) ; return ; } if ( ndo -> ndo_eflag ) ND_PRINT ( ( ndo , "OSI NLPID %s (0x%02x): " , tok2str ( nlpid_values , "Unknown...
void isoclns_print ( netdissect_options * ndo , const uint8_t * p , u_int length ) { if ( ! ND_TTEST ( * p ) ) { ND_PRINT ( ( ndo , "|OSI" ) ) ; return ; } if ( ndo -> ndo_eflag ) ND_PRINT ( ( ndo , "OSI NLPID %s (0x%02x): " , tok2str ( nlpid_values , "Unknown" , * p ) , * p ) ) ; switch ( * p ) { case NLPID_CLNP : if ...
85
CWE-190 void * jas_malloc ( size_t size ) { void * result ; <vul-start> JAS_DBGLOG ( 101 , ( "jas_malloc called with %zu\\n" , size ) ) ; <vul-end> result = malloc ( size ) ; JAS_DBGLOG ( 100 , ( "jas_malloc(%zu) -> %p\\n" , size , result ) ) ; return result ; }
void * jas_malloc ( size_t size ) { void * result ; JAS_DBGLOG ( 101 , ( "jas_malloc(%zu)\\n" , size ) ) ; result = malloc ( size ) ; JAS_DBGLOG ( 100 , ( "jas_malloc(%zu) -> %p\\n" , size , result ) ) ; return result ; }
86
CWE-119 <vul-start> static void set_rt_speed_feature ( VP9_COMMON * cm , SPEED_FEATURES * sf , int speed ) { <vul-end> sf -> static_segmentation = 0 ; sf -> adaptive_rd_thresh = 1 ; <vul-start> sf -> encode_breakout_thresh = 1 ; <vul-end> sf -> use_fast_coef_costing = 1 ; <vul-start> if ( speed == 1 ) { <vul-end> sf ->...
static void set_rt_speed_feature ( VP9_COMP * cpi , SPEED_FEATURES * sf , int speed , vp9e_tune_content content ) { VP9_COMMON * const cm = & cpi -> common ; const int is_keyframe = cm -> frame_type == KEY_FRAME ; const int frames_since_key = is_keyframe ? 0 : cpi -> rc . frames_since_key ; sf -> static_segmentation = ...
87
CWE-400 struct mnt_namespace * copy_mnt_ns ( unsigned long flags , struct mnt_namespace * ns , struct user_namespace * user_ns , struct fs_struct * new_fs ) { struct mnt_namespace * new_ns ; struct vfsmount * rootmnt = NULL , * pwdmnt = NULL ; struct mount * p , * q ; struct mount * old ; struct mount * new ; int copy_...
struct mnt_namespace * copy_mnt_ns ( unsigned long flags , struct mnt_namespace * ns , struct user_namespace * user_ns , struct fs_struct * new_fs ) { struct mnt_namespace * new_ns ; struct vfsmount * rootmnt = NULL , * pwdmnt = NULL ; struct mount * p , * q ; struct mount * old ; struct mount * new ; int copy_flags ; ...
88
CWE-476 static void process_lru_command ( conn * c , token_t * tokens , const size_t ntokens ) { uint32_t pct_hot ; uint32_t pct_warm ; double hot_factor ; int32_t ttl ; double factor ; set_noreply_maybe ( c , tokens , ntokens ) ; if ( strcmp ( tokens [ 1 ] . value , "tune" ) == 0 && ntokens >= 7 ) { if ( ! safe_strtou...
static void process_lru_command ( conn * c , token_t * tokens , const size_t ntokens ) { uint32_t pct_hot ; uint32_t pct_warm ; double hot_factor ; int32_t ttl ; double factor ; set_noreply_maybe ( c , tokens , ntokens ) ; if ( strcmp ( tokens [ 1 ] . value , "tune" ) == 0 && ntokens >= 7 ) { if ( ! safe_strtoul ( toke...
89
CWE-617 static int flv_write_packet ( AVFormatContext * s , AVPacket * pkt ) { AVIOContext * pb = s -> pb ; AVCodecParameters * par = s -> streams [ pkt -> stream_index ] -> codecpar ; FLVContext * flv = s -> priv_data ; FLVStreamContext * sc = s -> streams [ pkt -> stream_index ] -> priv_data ; unsigned ts ; int size ...
static int flv_write_packet ( AVFormatContext * s , AVPacket * pkt ) { AVIOContext * pb = s -> pb ; AVCodecParameters * par = s -> streams [ pkt -> stream_index ] -> codecpar ; FLVContext * flv = s -> priv_data ; FLVStreamContext * sc = s -> streams [ pkt -> stream_index ] -> priv_data ; unsigned ts ; int size = pkt ->...
90
CWE-787 <vul-start> static int shash_no_setkey ( struct crypto_shash * tfm , const u8 * key , <vul-end> unsigned int keylen ) { return - ENOSYS ; }
int shash_no_setkey ( struct crypto_shash * tfm , const u8 * key , unsigned int keylen ) { return - ENOSYS ; }
91
CWE-125 static int print_prefix ( netdissect_options * ndo , const u_char * prefix , u_int max_length ) { int plenbytes ; char buf [ sizeof ( "xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx::/128" ) ] ; if ( prefix [ 0 ] >= 96 && max_length >= IPV4_MAPPED_HEADING_LEN + 1 && is_ipv4_mapped_address ( & prefix [ 1 ] ) ) { struct...
static int print_prefix ( netdissect_options * ndo , const u_char * prefix , u_int max_length ) { int plenbytes ; char buf [ sizeof ( "xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx::/128" ) ] ; if ( prefix [ 0 ] >= 96 && max_length >= IPV4_MAPPED_HEADING_LEN + 1 && is_ipv4_mapped_address ( & prefix [ 1 ] ) ) { struct in_addr...
92
NVD-CWE-Other static ssize_t aio_run_iocb ( struct kiocb * req , unsigned opcode , char __user * buf , size_t len , bool compat ) { struct file * file = req -> ki_filp ; ssize_t ret ; unsigned long nr_segs ; int rw ; fmode_t mode ; aio_rw_op * rw_op ; rw_iter_op * iter_op ; struct iovec inline_vecs [ UIO_FASTIOV ] , * ...
static ssize_t aio_run_iocb ( struct kiocb * req , unsigned opcode , char __user * buf , size_t len , bool compat ) { struct file * file = req -> ki_filp ; ssize_t ret ; unsigned long nr_segs ; int rw ; fmode_t mode ; aio_rw_op * rw_op ; rw_iter_op * iter_op ; struct iovec inline_vecs [ UIO_FASTIOV ] , * iovec = inline...
93
CWE-119 int main ( int argc , char * * argv ) { FILE * infile = NULL ; vpx_codec_ctx_t codec ; vpx_codec_enc_cfg_t cfg ; int frame_count = 0 ; vpx_image_t raw ; vpx_codec_err_t res ; VpxVideoInfo info = { 0 } ; VpxVideoWriter * writer = NULL ; const VpxInterface * encoder = NULL ; const int fps = 30 ; const int bitrate...
int main ( int argc , char * * argv ) { FILE * infile = NULL ; vpx_codec_ctx_t codec ; vpx_codec_enc_cfg_t cfg ; int frame_count = 0 ; vpx_image_t raw ; vpx_codec_err_t res ; VpxVideoInfo info = { 0 } ; VpxVideoWriter * writer = NULL ; const VpxInterface * encoder = NULL ; const int fps = 30 ; const int bitrate = 200 ;...
94
CWE-125 <vul-start> void ntlm_write_message_fields_buffer ( wStream * s , NTLM_MESSAGE_FIELDS * fields ) <vul-end> { if ( fields -> Len > 0 ) { Stream_SetPosition ( s , fields -> BufferOffset ) ; Stream_Write ( s , fields -> Buffer , fields -> Len ) ; } }
static void ntlm_write_message_fields_buffer ( wStream * s , NTLM_MESSAGE_FIELDS * fields ) { if ( fields -> Len > 0 ) { Stream_SetPosition ( s , fields -> BufferOffset ) ; Stream_Write ( s , fields -> Buffer , fields -> Len ) ; } }
95
CWE-125 break ; ND_PRINT ( ( ndo , "\\n\\t\\tInterface Parameter: %s (0x%02x), len %u" , tok2str ( ldp_fec_martini_ifparm_values , "Unknown" , vc_info_tlv_type ) , vc_info_tlv_type , vc_info_tlv_len ) ) ; switch ( vc_info_tlv_type ) { case LDP_FEC_MARTINI_IFPARM_MTU : ND_PRINT ( ( ndo , ": %u" , EXTRACT_16BITS ( tptr +...
break ; ND_PRINT ( ( ndo , "\\n\\t\\tInterface Parameter: %s (0x%02x), len %u" , tok2str ( ldp_fec_martini_ifparm_values , "Unknown" , vc_info_tlv_type ) , vc_info_tlv_type , vc_info_tlv_len ) ) ; switch ( vc_info_tlv_type ) { case LDP_FEC_MARTINI_IFPARM_MTU : ND_PRINT ( ( ndo , ": %u" , EXTRACT_16BITS ( tptr + 2 ) ) )...
96
CWE-119 static size_t write_compressed_header ( VP9_COMP * cpi , uint8_t * data ) { VP9_COMMON * const cm = & cpi -> common ; <vul-start> MACROBLOCKD * const xd = & cpi -> mb . e_mbd ; FRAME_CONTEXT * const fc = & cm -> fc ; vp9_writer header_bc ; vp9_start_encode ( & header_bc , data ) ; <vul-end> if ( xd -> lossless ...
static size_t write_compressed_header ( VP9_COMP * cpi , uint8_t * data ) { VP9_COMMON * const cm = & cpi -> common ; MACROBLOCKD * const xd = & cpi -> td . mb . e_mbd ; FRAME_CONTEXT * const fc = cm -> fc ; FRAME_COUNTS * counts = cpi -> td . counts ; vpx_writer header_bc ; vpx_start_encode ( & header_bc , data ) ; if...
97
CWE-834 static Image * ReadXBMImage ( const ImageInfo * image_info , ExceptionInfo * exception ) { char buffer [ MaxTextExtent ] , name [ MaxTextExtent ] ; Image * image ; <vul-start> <vul-end> MagickBooleanType status ; register IndexPacket * indexes ; register ssize_t i , x ; register PixelPacket * q ; register unsig...
static Image * ReadXBMImage ( const ImageInfo * image_info , ExceptionInfo * exception ) { char buffer [ MaxTextExtent ] , name [ MaxTextExtent ] ; Image * image ; int c ; MagickBooleanType status ; register IndexPacket * indexes ; register ssize_t i , x ; register PixelPacket * q ; register unsigned char * p ; short i...
98
CWE-119 int vp9_block_energy ( VP9_COMP * cpi , MACROBLOCK * x , BLOCK_SIZE bs ) { double energy ; <vul-start> unsigned int var = block_variance ( cpi , x , bs ) ; vp9_clear_system_state ( ) ; energy = 0.9 * ( log ( var + 1.0 ) - 10.0 ) ; <vul-end> return clamp ( ( int ) round ( energy ) , ENERGY_MIN , ENERGY_MAX ) ; }
int vp9_block_energy ( VP9_COMP * cpi , MACROBLOCK * x , BLOCK_SIZE bs ) { double energy ; double energy_midpoint ; vpx_clear_system_state ( ) ; energy_midpoint = ( cpi -> oxcf . pass == 2 ) ? cpi -> twopass . mb_av_energy : DEFAULT_E_MIDPOINT ; energy = vp9_log_block_var ( cpi , x , bs ) - energy_midpoint ; return cla...
99
CWE-119 int drop_mark75 = drop_mark * 2 / 3 ; int drop_mark50 = drop_mark / 4 ; int drop_mark25 = drop_mark / 8 ; vp8_clear_system_state ( ) ; # if CONFIG_MULTITHREAD if ( cpi -> b_lpf_running ) { sem_wait ( & cpi -> h_event_end_lpf ) ; cpi -> b_lpf_running = 0 ; } # endif if ( cpi -> force_next_frame_intra ) { cm -> f...
int drop_mark75 = drop_mark * 2 / 3 ; int drop_mark50 = drop_mark / 4 ; int drop_mark25 = drop_mark / 8 ; vp8_clear_system_state ( ) ; # if CONFIG_MULTITHREAD if ( cpi -> b_lpf_running ) { sem_wait ( & cpi -> h_event_end_lpf ) ; cpi -> b_lpf_running = 0 ; } # endif if ( cpi -> force_next_frame_intra ) { cm -> frame_typ...