instruction stringclasses 1
value | input stringlengths 7 89.9k | output stringlengths 1 20.9k |
|---|---|---|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-190 static size_t optsize ( lua_State * L , char opt , const char * * fmt ) { switch ( opt ) { case 'B' : case 'b' : return sizeof ( char ) ; case 'H' : case 'h' : return sizeof ( short ) ; case 'L' : case 'l' : return sizeof ( long ) ; case 'T' : return sizeof ( size_t ) ; case 'f' : return sizeof ( float ) ; case... | <FIXS> case 'c' : return getnum ( L , fmt , 1 ) ; <FIXE> <FIXS> int sz = getnum ( L , fmt , sizeof ( int ) ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-000 static int ext4_end_io_nolock ( ext4_io_end_t * io ) { struct inode * inode = io -> inode ; loff_t offset = io -> offset ; ssize_t size = io -> size ; int ret = 0 ; ext4_debug ( "ext4_end_io_nolock: io 0x%p from inode %lu,list->next 0x%p," "list->prev 0x%p\\n" , io , inode -> i_ino , io -> list . next , io -> l... | <FIXS> <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-119 static void mt_decode_macroblock ( VP8D_COMP * pbi , MACROBLOCKD * xd , unsigned int mb_idx ) { MB_PREDICTION_MODE mode ; int i ; # if CONFIG_ERROR_CONCEALMENT int corruption_detected = 0 ; <BUGS> <BUGE> # endif if ( xd -> mode_info_context -> mbmi . mb_skip_coeff ) { vp8_reset_mb_tokens_context ( xd ) ; } else... | <FIXS> # else ( void ) mb_idx ; <FIXE> <FIXS> memset ( xd -> qcoeff , 0 , sizeof ( xd -> qcoeff ) ) ; <FIXE> <FIXS> memset ( xd -> eobs , 0 , 25 ) ; <FIXE> <FIXS> memset ( xd -> eobs , 0 , 25 ) ; <FIXE> <FIXS> memset ( b -> qcoeff , 0 , 2 * sizeof ( b -> qcoeff [ 0 ] ) ) ; <FIXE> <FIXS> memset ( b -> qcoeff , 0 , 16 * ... |
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-125 void vtp_print ( netdissect_options * ndo , const u_char * pptr , u_int length ) { int type , len , tlv_len , tlv_value , mgmtd_len ; const u_char * tptr ; const struct vtp_vlan_ * vtp_vlan ; if ( length < VTP_HEADER_LEN ) goto trunc ; tptr = pptr ; ND_TCHECK2 ( * tptr , VTP_HEADER_LEN ) ; type = * ( tptr + 1 )... | <FIXS> ND_TCHECK_32BITS ( tptr ) ; <FIXE> <FIXS> ND_TCHECK_8BITS ( tptr ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-369 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 ; <BUGS> <BUGE> if ( psf -> virtual_io ) return psf -> vio . write ( ptr , bytes * items , psf -> vio_user_data ) / bytes ; items *= bytes ; if ( items <= 0 ) return 0 ; whi... | <FIXS> if ( bytes == 0 || items == 0 ) return 0 ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-125 static void handle_mlppp ( netdissect_options * ndo , const u_char * p , int length ) { if ( ! ndo -> ndo_eflag ) ND_PRINT ( ( ndo , "MLPPP, " ) ) ; <BUGS> <BUGE> ND_PRINT ( ( ndo , "seq 0x%03x, Flags [%s], length %u" , ( EXTRACT_16BITS ( p ) ) & 0x0fff , bittok2str ( ppp_ml_flag_values , "none" , * p & 0xc0 ) ... | <FIXS> if ( length < 2 ) { ND_PRINT ( ( ndo , "[|mlppp]" ) ) ; return ; } if ( ! ND_TTEST_16BITS ( p ) ) { ND_PRINT ( ( ndo , "[|mlppp]" ) ) ; return ; } <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-119 static int parse_codes ( struct archive_read * a ) { int i , j , val , n , r ; unsigned char bitlengths [ MAX_SYMBOLS ] , zerocount , ppmd_flags ; unsigned int maxorder ; struct huffman_code precode ; struct rar * rar = ( struct rar * ) ( a -> format -> data ) ; struct rar_br * br = & ( rar -> br ) ; free_codes... | <FIXS> if ( rar -> dictionary_size == 0 ) { archive_set_error ( & a -> archive , ARCHIVE_ERRNO_FILE_FORMAT , "Invalid zero dictionary size" ) ; return ( ARCHIVE_FATAL ) ; } <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-189 static int opl3_load_patch ( int dev , int format , const char __user * addr , <BUGS> int offs , int count , int pmgr_flag ) <BUGE> { struct sbi_instrument ins ; if ( count < sizeof ( ins ) ) { printk ( KERN_WARNING "FM Error: Patch record too short\\n" ) ; return - EINVAL ; } <BUGS> if ( copy_from_user ( & ( (... | <FIXS> int count , int pmgr_flag ) <FIXE> <FIXS> if ( copy_from_user ( & ins , addr , sizeof ( ins ) ) ) <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-476 static int ghash_update ( struct shash_desc * desc , const u8 * src , unsigned int srclen ) { struct ghash_desc_ctx * dctx = shash_desc_ctx ( desc ) ; struct ghash_ctx * ctx = crypto_shash_ctx ( desc -> tfm ) ; u8 * dst = dctx -> buffer ; <BUGS> <BUGE> if ( dctx -> bytes ) { int n = min ( srclen , dctx -> bytes... | <FIXS> if ( ! ctx -> gf128 ) return - ENOKEY ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-19 STATIC int xfs_attr3_leaf_add_work ( struct xfs_buf * bp , struct xfs_attr3_icleaf_hdr * ichdr , struct xfs_da_args * args , int mapindex ) { struct xfs_attr_leafblock * leaf ; struct xfs_attr_leaf_entry * entry ; struct xfs_attr_leaf_name_local * name_loc ; struct xfs_attr_leaf_name_remote * name_rmt ; struct x... | <FIXS> args -> rmtvaluelen = args -> valuelen ; } <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-264 static int cg_opendir ( const char * path , struct fuse_file_info * fi ) { struct fuse_context * fc = fuse_get_context ( ) ; const char * cgroup ; struct file_info * dir_info ; char * controller = NULL ; if ( ! fc ) return - EIO ; if ( strcmp ( path , "/cgroup" ) == 0 ) { cgroup = NULL ; controller = NULL ; } e... | <FIXS> if ( cgroup ) { if ( ! caller_may_see_dir ( fc -> pid , controller , cgroup ) ) return - ENOENT ; if ( ! fc_may_access ( fc , controller , cgroup , NULL , O_RDONLY ) ) <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-269 struct crypto_alg * crypto_larval_lookup ( const char * name , u32 type , u32 mask ) { struct crypto_alg * alg ; if ( ! name ) return ERR_PTR ( - ENOENT ) ; mask &= ~ ( CRYPTO_ALG_LARVAL | CRYPTO_ALG_DEAD ) ; type &= mask ; alg = crypto_alg_lookup ( name , type , mask ) ; if ( ! alg ) { <BUGS> request_module ( ... | <FIXS> request_module ( "crypto-%s" , name ) ; <FIXE> <FIXS> request_module ( "crypto-%s-all" , name ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-264 SYSCALL_DEFINE6 ( sendto , int , fd , void __user * , buff , size_t , len , unsigned int , flags , struct sockaddr __user * , addr , int , addr_len ) { struct socket * sock ; struct sockaddr_storage address ; int err ; struct msghdr msg ; struct iovec iov ; int fput_needed ; if ( len > INT_MAX ) len = INT_MAX ;... | <FIXS> if ( unlikely ( ! access_ok ( VERIFY_READ , buff , len ) ) ) return - EFAULT ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-125 static int isis_print_mt_capability_subtlv ( netdissect_options * ndo , const uint8_t * tptr , int len ) { int stlv_type , stlv_len , tmp ; while ( len > 2 ) { <BUGS> <BUGE> stlv_type = * ( tptr ++ ) ; stlv_len = * ( tptr ++ ) ; ND_PRINT ( ( ndo , "\\n\\t %s subTLV #%u, length: %u" , tok2str ( isis_mt_capabilit... | <FIXS> ND_TCHECK2 ( * tptr , 2 ) ; <FIXE> <FIXS> if ( len < stlv_len ) goto trunc ; ND_TCHECK2 ( * ( tptr ) , stlv_len ) ; <FIXE> <FIXS> if ( stlv_len < ISIS_SUBTLV_SPB_INSTANCE_MIN_LEN ) goto trunc ; <FIXE> <FIXS> stlv_len = stlv_len - ISIS_SUBTLV_SPB_INSTANCE_MIN_LEN ; <FIXE> <FIXS> if ( stlv_len < ISIS_SUBTLV_SPB_IN... |
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-000 static void dispatch_cmd ( conn c ) { int r , i , timeout = - 1 ; size_t z ; unsigned int count ; job j ; unsigned char type ; char * size_buf , * delay_buf , * ttr_buf , * pri_buf , * end_buf , * name ; unsigned int pri , body_size ; usec delay , ttr ; uint64_t id ; tube t = NULL ; c -> cmd [ c -> cmd_len - 2 ... | <FIXS> return skip ( c , body_size + 2 , MSG_JOB_TOO_BIG ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-254 static int follow_dotdot_rcu ( struct nameidata * nd ) { struct inode * inode = nd -> inode ; if ( ! nd -> root . mnt ) set_root_rcu ( nd ) ; while ( 1 ) { if ( path_equal ( & nd -> path , & nd -> root ) ) break ; if ( nd -> path . dentry != nd -> path . mnt -> mnt_root ) { struct dentry * old = nd -> path . de... | <FIXS> if ( unlikely ( ! path_connected ( & nd -> path ) ) ) return - ENOENT ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-400 static void perf_log_throttle ( struct perf_event * event , int enable ) { struct perf_output_handle handle ; struct perf_sample_data sample ; int ret ; struct { struct perf_event_header header ; u64 time ; u64 id ; u64 stream_id ; } throttle_event = { . header = { . type = PERF_RECORD_THROTTLE , . misc = 0 , .... | <FIXS> throttle_event . header . size , 0 ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-200 long dgnc_mgmt_ioctl ( struct file * file , unsigned int cmd , unsigned long arg ) { unsigned long flags ; void __user * uarg = ( void __user * ) arg ; switch ( cmd ) { case DIGI_GETDD : { struct digi_dinfo ddi ; spin_lock_irqsave ( & dgnc_global_lock , flags ) ; <BUGS> <BUGE> ddi . dinfo_nboards = dgnc_NumBoar... | <FIXS> memset ( & ddi , 0 , sizeof ( ddi ) ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-264 static int wrmsr_interception ( struct vcpu_svm * svm ) { struct msr_data msr ; u32 ecx = svm -> vcpu . arch . regs [ VCPU_REGS_RCX ] ; u64 data = ( svm -> vcpu . arch . regs [ VCPU_REGS_RAX ] & - 1u ) | ( ( u64 ) ( svm -> vcpu . arch . regs [ VCPU_REGS_RDX ] & - 1u ) << 32 ) ; msr . data = data ; msr . index =... | <FIXS> if ( kvm_set_msr ( & svm -> vcpu , & msr ) ) { <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-125 BOOL license_read_new_or_upgrade_license_packet ( rdpLicense * license , wStream * s ) { UINT32 os_major ; UINT32 os_minor ; UINT32 cbScope , cbCompanyName , cbProductId , cbLicenseInfo ; wStream * licenseStream = NULL ; BOOL ret = FALSE ; BYTE computedMac [ 16 ] ; LICENSE_BLOB * calBlob ; DEBUG_LICENSE ( "Rece... | <FIXS> if ( Stream_GetRemainingLength ( licenseStream ) < 8 ) goto out_free_stream ; <FIXE> <FIXS> if ( Stream_GetRemainingLength ( licenseStream ) < 4 ) goto out_free_stream ; <FIXE> <FIXS> if ( Stream_GetRemainingLength ( licenseStream ) < 4 ) goto out_free_stream ; <FIXE> <FIXS> if ( Stream_GetRemainingLength ( lice... |
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-125 static int mp_capable_print ( netdissect_options * ndo , const u_char * opt , u_int opt_len , u_char flags ) { const struct mp_capable * mpc = ( const struct mp_capable * ) opt ; <BUGS> if ( ! ( opt_len == 12 && flags & TH_SYN ) && <BUGE> ! ( opt_len == 20 && ( flags & ( TH_SYN | TH_ACK ) ) == TH_ACK ) ) return... | <FIXS> if ( ! ( opt_len == 12 && ( flags & TH_SYN ) ) && <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-285 int orangefs_set_acl ( struct inode * inode , struct posix_acl * acl , int type ) { struct orangefs_inode_s * orangefs_inode = ORANGEFS_I ( inode ) ; int error = 0 ; void * value = NULL ; size_t size = 0 ; const char * name = NULL ; switch ( type ) { case ACL_TYPE_ACCESS : name = XATTR_NAME_POSIX_ACL_ACCESS ; i... | <FIXS> umode_t mode ; error = posix_acl_update_mode ( inode , & mode , & acl ) ; if ( error ) { gossip_err ( "%s: posix_acl_update_mode err: %d\\n" , <FIXE> <FIXS> <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-264 static int attach_child_main ( void * data ) { struct attach_clone_payload * payload = ( struct attach_clone_payload * ) data ; int ipc_socket = payload -> ipc_socket ; <BUGS> int procfd = payload -> procfd ; <BUGE> lxc_attach_options_t * options = payload -> options ; struct lxc_proc_context_info * init_ctx = ... | <FIXS> <FIXE> <FIXS> int lsm_labelfd ; <FIXE> <FIXS> ERROR ( "Error using IPC to receive notification from initial process (0): %s." , strerror ( errno ) ) ; <FIXE> <FIXS> ERROR ( "Error using IPC to notify initial process for initialization (1): %s." , strerror ( errno ) ) ; <FIXE> <FIXS> ERROR ( "Error using IPC to r... |
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-120 SecureElementStatus_t SecureElementProcessJoinAccept ( JoinReqIdentifier_t joinReqType , uint8_t * joinEui , uint16_t devNonce , uint8_t * encJoinAccept , uint8_t encJoinAcceptSize , uint8_t * decJoinAccept , uint8_t * versionMinor ) { SecureElementStatus_t status = SECURE_ELEMENT_ERROR ; if ( ( encJoinAccept =... | <FIXS> } if ( encJoinAcceptSize > LORAMAC_JOIN_ACCEPT_FRAME_MAX_SIZE ) { return SECURE_ELEMENT_ERROR_BUF_SIZE ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-125 void __sock_recv_timestamp ( struct msghdr * msg , struct sock * sk , struct sk_buff * skb ) { int need_software_tstamp = sock_flag ( sk , SOCK_RCVTSTAMP ) ; struct scm_timestamping tss ; int empty = 1 ; struct skb_shared_hwtstamps * shhwtstamps = skb_hwtstamps ( skb ) ; if ( need_software_tstamp && skb -> tsta... | <FIXS> if ( skb_is_err_queue ( skb ) && skb -> len && ( sk -> sk_tsflags & SOF_TIMESTAMPING_OPT_STATS ) ) <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-399 static void do_free_upto ( BIO * f , BIO * upto ) { if ( upto ) { BIO * tbio ; do { tbio = BIO_pop ( f ) ; BIO_free ( f ) ; f = tbio ; } <BUGS> while ( f != upto ) ; <BUGE> } else BIO_free_all ( f ) ; }
| <FIXS> while ( f && f != upto ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-20 int main ( void ) { int fd , len , sock_opt ; int error ; struct cn_msg * message ; struct pollfd pfd ; struct nlmsghdr * incoming_msg ; struct cn_msg * incoming_cn_msg ; struct hv_kvp_msg * hv_msg ; char * p ; char * key_value ; char * key_name ; daemon ( 1 , 0 ) ; openlog ( "KVP" , 0 , LOG_USER ) ; syslog ( LO... | <FIXS> struct sockaddr * addr_p = ( struct sockaddr * ) & addr ; socklen_t addr_l = sizeof ( addr ) ; <FIXE> <FIXS> len = recvfrom ( fd , kvp_recv_buffer , sizeof ( kvp_recv_buffer ) , 0 , addr_p , & addr_l ) ; if ( len < 0 || addr . nl_pid ) { syslog ( LOG_ERR , "recvfrom failed; pid:%u error:%d %s" , addr . nl_pid , ... |
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-362 static void init_once ( void * foo ) { struct ext4_inode_info * ei = ( struct ext4_inode_info * ) foo ; INIT_LIST_HEAD ( & ei -> i_orphan ) ; init_rwsem ( & ei -> xattr_sem ) ; init_rwsem ( & ei -> i_data_sem ) ; <BUGS> <BUGE> inode_init_once ( & ei -> vfs_inode ) ; }
| <FIXS> init_rwsem ( & ei -> i_mmap_sem ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-119 int vp8dx_get_raw_frame ( VP8D_COMP * pbi , YV12_BUFFER_CONFIG * sd , int64_t * time_stamp , int64_t * time_end_stamp , vp8_ppflags_t * flags ) { int ret = - 1 ; if ( pbi -> ready_for_new_data == 1 ) return ret ; if ( pbi -> common . show_frame == 0 ) return ret ; pbi -> ready_for_new_data = 1 ; * time_stamp = ... | <FIXS> ( void ) flags ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-125 static Image * ReadVIFFImage ( const ImageInfo * image_info , ExceptionInfo * exception ) { # define VFF_CM_genericRGB 15 # define VFF_CM_ntscRGB 1 # define VFF_CM_NONE 0 # define VFF_DEP_DECORDER 0x4 # define VFF_DEP_NSORDER 0x8 # define VFF_DES_RAW 0 # define VFF_LOC_IMPLICIT 1 # define VFF_MAPTYP_NONE 0 # de... | <FIXS> pixels = ( unsigned char * ) AcquireQuantumMemory ( MagickMax ( number_pixels , max_packets ) , bytes_per_pixel * sizeof ( * pixels ) ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-400 int do_mathemu ( struct pt_regs * regs , struct fpustate * f ) { unsigned long pc = regs -> tpc ; unsigned long tstate = regs -> tstate ; u32 insn = 0 ; int type = 0 ; # define TYPE ( ftt , r , ru , b , bu , a , au ) type = ( au << 2 ) | ( a << 0 ) | ( bu << 5 ) | ( b << 3 ) | ( ru << 8 ) | ( r << 6 ) | ( ftt <... | <FIXS> perf_sw_event ( PERF_COUNT_SW_EMULATION_FAULTS , 1 , regs , 0 ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-399 void mono_reflection_create_dynamic_method ( MonoReflectionDynamicMethod * mb ) { <BUGS> <BUGE> ReflectionMethodBuilder rmb ; MonoMethodSignature * sig ; MonoClass * klass ; GSList * l ; int i ; <BUGS> <BUGE> sig = dynamic_method_to_signature ( mb ) ; reflection_methodbuilder_from_dynamic_method ( & rmb , mb ) ... | <FIXS> MonoReferenceQueue * queue ; MonoMethod * handle ; DynamicMethodReleaseData * release_data ; <FIXE> <FIXS> if ( mono_runtime_is_shutting_down ( ) ) mono_raise_exception ( mono_get_exception_invalid_operation ( "" ) ) ; if ( ! ( queue = dynamic_method_queue ) ) { mono_loader_lock ( ) ; if ( ! ( queue = dynamic_me... |
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-119 int vp9_rc_bits_per_mb ( FRAME_TYPE frame_type , int qindex , <BUGS> double correction_factor ) { const double q = vp9_convert_qindex_to_q ( qindex ) ; int enumerator = frame_type == KEY_FRAME ? 3300000 : 2250000 ; <BUGE> enumerator += ( int ) ( enumerator * q ) >> 12 ; <BUGS> return ( int ) ( 0.5 + ( enumerato... | <FIXS> double correction_factor , vpx_bit_depth_t bit_depth ) { const double q = vp9_convert_qindex_to_q ( qindex , bit_depth ) ; int enumerator = frame_type == KEY_FRAME ? 2700000 : 1800000 ; assert ( correction_factor <= MAX_BPB_FACTOR && correction_factor >= MIN_BPB_FACTOR ) ; <FIXE> <FIXS> return ( int ) ( enumerat... |
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-125 static int mobility_opt_print ( netdissect_options * ndo , const u_char * bp , const unsigned len ) { unsigned i , optlen ; for ( i = 0 ; i < len ; i += optlen ) { ND_TCHECK ( bp [ i ] ) ; if ( bp [ i ] == IP6MOPT_PAD1 ) optlen = 1 ; else { if ( i + 1 < len ) { ND_TCHECK ( bp [ i + 1 ] ) ; optlen = bp [ i + 1 ]... | <FIXS> ND_TCHECK_16BITS ( & bp [ i + 2 ] ) ; ND_TCHECK_16BITS ( & bp [ i + 4 ] ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-200 static int crypto_report_akcipher ( struct sk_buff * skb , struct crypto_alg * alg ) { struct crypto_report_akcipher rakcipher ; <BUGS> strlcpy ( rakcipher . type , "akcipher" , sizeof ( rakcipher . type ) ) ; <BUGE> if ( nla_put ( skb , CRYPTOCFGA_REPORT_AKCIPHER , sizeof ( struct crypto_report_akcipher ) , & ... | <FIXS> strncpy ( rakcipher . type , "akcipher" , sizeof ( rakcipher . type ) ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-17 int do_remount_sb ( struct super_block * sb , int flags , void * data , int force ) { int retval ; int remount_ro ; if ( sb -> s_writers . frozen != SB_UNFROZEN ) return - EBUSY ; # ifdef CONFIG_BLOCK if ( ! ( flags & MS_RDONLY ) && bdev_read_only ( sb -> s_bdev ) ) return - EACCES ; # endif if ( flags & MS_RDON... | <FIXS> sb -> s_readonly_remount = 1 ; smp_wmb ( ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-787 STREAM sec_recv ( RD_BOOL * is_fastpath ) { uint8 fastpath_hdr , fastpath_flags ; uint16 sec_flags ; uint16 channel ; STREAM s ; <BUGS> <BUGE> while ( ( s = mcs_recv ( & channel , is_fastpath , & fastpath_hdr ) ) != NULL ) { <BUGS> <BUGE> if ( * is_fastpath == True ) { fastpath_flags = ( fastpath_hdr & 0xC0 ) >... | <FIXS> struct stream packet ; <FIXE> <FIXS> packet = * s ; <FIXE> <FIXS> if ( ! s_check_rem ( s , 8 ) ) { rdp_protocol_error ( "sec_recv(), consume fastpath signature from stream would overrun" , & packet ) ; } <FIXE> <FIXS> if ( ! s_check_rem ( s , 8 ) ) { rdp_protocol_error ( "sec_recv(), consume encrypt signature fr... |
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-399 <BUGS> static void ip6_append_data_mtu ( int * mtu , <BUGE> int * maxfraglen , unsigned int fragheaderlen , struct sk_buff * skb , <BUGS> struct rt6_info * rt ) <BUGE> { if ( ! ( rt -> dst . flags & DST_XFRM_TUNNEL ) ) { if ( skb == NULL ) { * mtu = * mtu - rt -> dst . header_len ; } else { <BUGS> * mtu = dst_m... | <FIXS> static void ip6_append_data_mtu ( unsigned int * mtu , <FIXE> <FIXS> struct rt6_info * rt , bool pmtuprobe ) <FIXE> <FIXS> * mtu = min ( * mtu , pmtuprobe ? rt -> dst . dev -> mtu : dst_mtu ( rt -> dst . path ) ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-119 static void build_y_mask ( const loop_filter_info_n * const lfi_n , const MODE_INFO * mi , const int shift_y , LOOP_FILTER_MASK * lfm ) { const MB_MODE_INFO * mbmi = & mi -> mbmi ; const BLOCK_SIZE block_size = mbmi -> sb_type ; const TX_SIZE tx_size_y = mbmi -> tx_size ; const int filter_level = get_filter_lev... | <FIXS> memset ( & lfm -> lfl_y [ index ] , filter_level , w ) ; <FIXE> <FIXS> * int_4x4_y |= ( size_mask [ block_size ] & 0xffffffffffffffffULL ) << shift_y ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-77 <BUGS> void imap_quote_string ( char * dest , size_t dlen , const char * src ) <BUGE> { <BUGS> static const char quote [ ] = "\\"\\\\" ; <BUGE> char * pt = dest ; const char * s = src ; * pt ++ = \'"\' ; dlen -= 2 ; for ( ; * s && dlen ; s ++ ) { if ( strchr ( quote , * s ) ) { dlen -= 2 ; if ( dlen == 0 ) break... | <FIXS> void imap_quote_string ( char * dest , size_t dlen , const char * src , bool quote_backtick ) <FIXE> <FIXS> const char * quote = "`\\"\\\\" ; if ( ! quote_backtick ) quote ++ ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-200 static int rfcomm_sock_recvmsg ( struct kiocb * iocb , struct socket * sock , struct msghdr * msg , size_t size , int flags ) { struct sock * sk = sock -> sk ; struct rfcomm_dlc * d = rfcomm_pi ( sk ) -> dlc ; int len ; if ( test_and_clear_bit ( RFCOMM_DEFER_SETUP , & d -> flags ) ) { rfcomm_dlc_accept ( d ) ; ... | <FIXS> msg -> msg_namelen = 0 ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-000 static int http_rxchunk ( struct http * hp ) { char * q ; int l , i ; l = hp -> prxbuf ; do ( void ) http_rxchar ( hp , 1 , 0 ) ; while ( hp -> rxbuf [ hp -> prxbuf - 1 ] != '\\n' ) ; vtc_dump ( hp -> vl , 4 , "len" , hp -> rxbuf + l , - 1 ) ; i = strtoul ( hp -> rxbuf + l , & q , 16 ) ; bprintf ( hp -> chunkle... | <FIXS> if ( ! vct_iscrlf ( & hp -> rxbuf [ l ] ) ) <FIXE> <FIXS> if ( ! vct_iscrlf ( & hp -> rxbuf [ l + 1 ] ) ) <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-369 int ff_mov_write_packet ( AVFormatContext * s , AVPacket * pkt ) { MOVMuxContext * mov = s -> priv_data ; AVIOContext * pb = s -> pb ; MOVTrack * trk = & mov -> tracks [ pkt -> stream_index ] ; AVCodecParameters * par = trk -> par ; unsigned int samples_in_chunk = 0 ; int size = pkt -> size , ret = 0 ; uint8_t ... | <FIXS> if ( samples_in_chunk < 1 ) { av_log ( s , AV_LOG_ERROR , "fatal error, input packet contains no samples\\n" ) ; return AVERROR_PATCHWELCOME ; } <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-119 <BUGS> cJSON * cJSON_CreateBool ( int b ) { cJSON * item = cJSON_New_Item ( ) ; if ( item ) item -> type = b ? cJSON_True : cJSON_False ; return item ; } <BUGE>
| <FIXS> cJSON * cJSON_CreateBool ( int b ) { cJSON * item = cJSON_New_Item ( ) ; if ( item ) item -> type = b ? cJSON_True : cJSON_False ; return item ; } <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-125 static void print_trans ( netdissect_options * ndo , const u_char * words , const u_char * data1 , const u_char * buf , const u_char * maxbuf ) { u_int bcc ; const char * f1 , * f2 , * f3 , * f4 ; const u_char * data , * param ; const u_char * w = words + 1 ; int datalen , paramlen ; if ( request ) { ND_TCHECK2... | <FIXS> # define MAILSLOT_BROWSE_STR "\\\\MAILSLOT\\\\BROWSE" ND_TCHECK2 ( * ( data1 + 2 ) , strlen ( MAILSLOT_BROWSE_STR ) + 1 ) ; if ( strcmp ( ( const char * ) ( data1 + 2 ) , MAILSLOT_BROWSE_STR ) == 0 ) { <FIXE> <FIXS> # undef MAILSLOT_BROWSE_STR # define PIPE_LANMAN_STR "\\\\PIPE\\\\LANMAN" ND_TCHECK2 ( * ( data1 ... |
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-119 <BUGS> void open_input_file ( struct VpxInputContext * input ) { <BUGE> input -> file = strcmp ( input -> filename , "-" ) ? fopen ( input -> filename , "rb" ) : set_binary_mode ( stdin ) ; if ( ! input -> file ) fatal ( "Failed to open input file" ) ; if ( ! fseeko ( input -> file , 0 , SEEK_END ) ) { input ->... | <FIXS> static void open_input_file ( struct VpxInputContext * input ) { <FIXE> <FIXS> input -> pixel_aspect_ratio . numerator = 1 ; input -> pixel_aspect_ratio . denominator = 1 ; <FIXE> <FIXS> input -> pixel_aspect_ratio . numerator = input -> y4m . par_n ; input -> pixel_aspect_ratio . denominator = input -> y4m . pa... |
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-000 bgp_size_t bgp_packet_attribute ( struct bgp * bgp , struct peer * peer , struct stream * s , struct attr * attr , struct bpacket_attr_vec_arr * vecarr , struct prefix * p , afi_t afi , safi_t safi , struct peer * from , struct prefix_rd * prd , mpls_label_t * label , uint32_t num_labels , int addpath_encode , ... | <FIXS> # if ENABLE_BGP_VNC_ATTR <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-399 static int dcbnl_ieee_fill ( struct sk_buff * skb , struct net_device * netdev ) { struct nlattr * ieee , * app ; struct dcb_app_type * itr ; const struct dcbnl_rtnl_ops * ops = netdev -> dcbnl_ops ; int dcbx ; int err ; if ( nla_put_string ( skb , DCB_ATTR_IFNAME , netdev -> name ) ) return - EMSGSIZE ; ieee =... | <FIXS> memset ( & ets , 0 , sizeof ( ets ) ) ; <FIXE> <FIXS> memset ( & maxrate , 0 , sizeof ( maxrate ) ) ; <FIXE> <FIXS> memset ( & pfc , 0 , sizeof ( pfc ) ) ; <FIXE> <FIXS> memset ( & ets , 0 , sizeof ( ets ) ) ; <FIXE> <FIXS> memset ( & pfc , 0 , sizeof ( pfc ) ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-125 void cfm_print ( netdissect_options * ndo , register const u_char * pptr , register u_int length ) { const struct cfm_common_header_t * cfm_common_header ; const struct cfm_tlv_header_t * cfm_tlv_header ; const uint8_t * tptr , * tlv_ptr ; const uint8_t * namesp ; u_int names_data_remaining ; uint8_t md_namefor... | <FIXS> goto next_tlv ; <FIXE> <FIXS> goto next_tlv ; <FIXE> <FIXS> goto next_tlv ; <FIXE> <FIXS> if ( chassis_id_length != ETHER_ADDR_LEN ) { ND_PRINT ( ( ndo , " (invalid MAC address length)" ) ) ; hexdump = TRUE ; break ; } <FIXE> <FIXS> hexdump |= cfm_network_addr_print ( ndo , tptr + 1 , chassis_id_length ) ; <FIXE... |
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-119 <BUGS> void fadst4_sse2 ( __m128i * in ) { <BUGE> const __m128i k__sinpi_p01_p02 = pair_set_epi16 ( sinpi_1_9 , sinpi_2_9 ) ; const __m128i k__sinpi_p04_m01 = pair_set_epi16 ( sinpi_4_9 , - sinpi_1_9 ) ; const __m128i k__sinpi_p03_p04 = pair_set_epi16 ( sinpi_3_9 , sinpi_4_9 ) ; const __m128i k__sinpi_m03_p02 =... | <FIXS> static void fadst4_sse2 ( __m128i * in ) { <FIXE> <FIXS> const __m128i k__sinpi_p03_p03 = _mm_set1_epi16 ( ( int16_t ) sinpi_3_9 ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-125 static int ng_pkt ( git_pkt * * out , const char * line , size_t len ) { git_pkt_ng * pkt ; const char * ptr ; size_t alloclen ; pkt = git__malloc ( sizeof ( * pkt ) ) ; GITERR_CHECK_ALLOC ( pkt ) ; pkt -> ref = NULL ; pkt -> type = GIT_PKT_NG ; <BUGS> <BUGE> line += 3 ; <BUGS> if ( ! ( ptr = strchr ( line , ' ... | <FIXS> if ( len < 3 ) goto out_err ; <FIXE> <FIXS> len -= 3 ; if ( ! ( ptr = memchr ( line , ' ' , len ) ) ) <FIXE> <FIXS> if ( len < 1 ) goto out_err ; <FIXE> <FIXS> len -= 1 ; if ( ! ( ptr = memchr ( line , '\\n' , len ) ) ) <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-119 int main ( int argc , char * * argv ) { int frame_cnt = 0 ; FILE * outfile = NULL ; vpx_codec_ctx_t codec ; VpxVideoReader * reader = NULL ; const VpxInterface * decoder = NULL ; const VpxVideoInfo * info = NULL ; exec_name = argv [ 0 ] ; if ( argc != 3 ) die ( "Invalid number of arguments." ) ; reader = vpx_vi... | <FIXS> printf ( "Using %s\\n" , vpx_codec_iface_name ( decoder -> codec_interface ( ) ) ) ; if ( vpx_codec_dec_init ( & codec , decoder -> codec_interface ( ) , NULL , 0 ) ) <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-200 int vcc_recvmsg ( struct kiocb * iocb , struct socket * sock , struct msghdr * msg , size_t size , int flags ) { struct sock * sk = sock -> sk ; struct atm_vcc * vcc ; struct sk_buff * skb ; int copied , error = - EINVAL ; <BUGS> <BUGE> if ( sock -> state != SS_CONNECTED ) return - ENOTCONN ; if ( flags & ~ ( M... | <FIXS> msg -> msg_namelen = 0 ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-320 int sshkey_load_file ( int fd , struct sshbuf * blob ) { u_char buf [ 1024 ] ; size_t len ; struct stat st ; <BUGS> int r ; <BUGE> if ( fstat ( fd , & st ) < 0 ) return SSH_ERR_SYSTEM_ERROR ; if ( ( st . st_mode & ( S_IFSOCK | S_IFCHR | S_IFIFO ) ) == 0 && st . st_size > MAX_KEY_FILE_SIZE ) return SSH_ERR_INVAL... | <FIXS> int r , dontmax = 0 ; <FIXE> <FIXS> if ( ( st . st_mode & S_IFREG ) == 0 || st . st_size <= 0 ) { st . st_size = 64 * 1024 ; dontmax = 1 ; } if ( ( r = sshbuf_allocate ( blob , st . st_size ) ) != 0 || ( dontmax && ( r = sshbuf_set_max_size ( blob , st . st_size ) ) != 0 ) ) return r ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-119 static OPJ_BOOL bmp_read_info_header ( FILE * IN , OPJ_BITMAPINFOHEADER * header ) { memset ( header , 0 , sizeof ( * header ) ) ; header -> biSize = ( OPJ_UINT32 ) getc ( IN ) ; header -> biSize |= ( OPJ_UINT32 ) getc ( IN ) << 8 ; header -> biSize |= ( OPJ_UINT32 ) getc ( IN ) << 16 ; header -> biSize |= ( OP... | <FIXS> if ( header -> biBitCount == 0 ) { fprintf ( stderr , "Error, invalid biBitCount %d\\n" , 0 ) ; return OPJ_FALSE ; } <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-000 static void sas_discover_domain ( struct work_struct * work ) { struct domain_device * dev ; int error = 0 ; struct sas_discovery_event * ev = to_sas_discovery_event ( work ) ; struct asd_sas_port * port = ev -> port ; clear_bit ( DISCE_DISCOVER_DOMAIN , & port -> disc . pending ) ; if ( port -> port_dev ) retu... | <FIXS> sas_probe_devices ( port ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-000 static int snd_compress_check_input ( struct snd_compr_params * params ) { if ( params -> buffer . fragment_size == 0 || <BUGS> params -> buffer . fragments > SIZE_MAX / params -> buffer . fragment_size ) <BUGE> return - EINVAL ; if ( params -> codec . id == 0 || params -> codec . id > SND_AUDIOCODEC_MAX ) retu... | <FIXS> params -> buffer . fragments > INT_MAX / params -> buffer . fragment_size ) <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-22 static int target_xcopy_parse_target_descriptors ( struct se_cmd * se_cmd , struct xcopy_op * xop , unsigned char * p , unsigned short tdll , sense_reason_t * sense_ret ) { struct se_device * local_dev = se_cmd -> se_dev ; unsigned char * desc = p ; int offset = tdll % XCOPY_TARGET_DESC_LEN , rc ; unsigned short... | <FIXS> rc = target_xcopy_locate_se_dev_e4 ( se_cmd -> se_sess , xop -> dst_tid_wwn , & xop -> dst_dev , & xop -> remote_lun_ref ) ; <FIXE> <FIXS> rc = target_xcopy_locate_se_dev_e4 ( se_cmd -> se_sess , xop -> src_tid_wwn , & xop -> src_dev , & xop -> remote_lun_ref ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-415 static Image * ReadTGAImage ( const ImageInfo * image_info , ExceptionInfo * exception ) { Image * image ; MagickBooleanType status ; PixelInfo pixel ; Quantum index ; register Quantum * q ; register ssize_t i , x ; size_t base , flag , offset , real , skip ; ssize_t count , y ; TGAInfo tga_info ; unsigned char... | <FIXS> if ( image -> colors < tga_info . colormap_index ) image -> colors = tga_info . colormap_index ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-190 static int jas_iccgetuint32 ( jas_stream_t * in , jas_iccuint32_t * val ) { <BUGS> ulonglong tmp ; <BUGE> if ( jas_iccgetuint ( in , 4 , & tmp ) ) return - 1 ; * val = tmp ; return 0 ; }
| <FIXS> jas_ulonglong tmp ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-189 <BUGS> void ipc_rcu_getref ( void * ptr ) <BUGE> { <BUGS> container_of ( ptr , struct ipc_rcu_hdr , data ) -> refcount ++ ; <BUGE> }
| <FIXS> int ipc_rcu_getref ( void * ptr ) <FIXE> <FIXS> return atomic_inc_not_zero ( & container_of ( ptr , struct ipc_rcu_hdr , data ) -> refcount ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-399 static int wanxl_ioctl ( struct net_device * dev , struct ifreq * ifr , int cmd ) { const size_t size = sizeof ( sync_serial_settings ) ; sync_serial_settings line ; port_t * port = dev_to_port ( dev ) ; if ( cmd != SIOCWANDEV ) return hdlc_ioctl ( dev , ifr , cmd ) ; switch ( ifr -> ifr_settings . type ) { cas... | <FIXS> memset ( & line , 0 , sizeof ( line ) ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-264 int scsi_cmd_blk_ioctl ( struct block_device * bd , fmode_t mode , unsigned int cmd , void __user * arg ) { <BUGS> <BUGE> return scsi_cmd_ioctl ( bd -> bd_disk -> queue , bd -> bd_disk , mode , cmd , arg ) ; }
| <FIXS> int ret ; ret = scsi_verify_blk_ioctl ( bd , cmd ) ; if ( ret < 0 ) return ret ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-287 static int netlink_sendmsg ( struct kiocb * kiocb , struct socket * sock , struct msghdr * msg , size_t len ) { struct sock_iocb * siocb = kiocb_to_siocb ( kiocb ) ; struct sock * sk = sock -> sk ; struct netlink_sock * nlk = nlk_sk ( sk ) ; struct sockaddr_nl * addr = msg -> msg_name ; u32 dst_pid ; u32 dst_gr... | <FIXS> err = scm_send ( sock , msg , siocb -> scm , true ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-125 <BUGS> void nego_process_negotiation_request ( rdpNego * nego , wStream * s ) <BUGE> { BYTE flags ; UINT16 length ; <BUGS> <BUGE> Stream_Read_UINT8 ( s , flags ) ; Stream_Read_UINT16 ( s , length ) ; Stream_Read_UINT32 ( s , nego -> RequestedProtocols ) ; WLog_DBG ( TAG , "RDP_NEG_REQ: RequestedProtocol: 0x%08"... | <FIXS> BOOL nego_process_negotiation_request ( rdpNego * nego , wStream * s ) <FIXE> <FIXS> if ( Stream_GetRemainingLength ( s ) < 7 ) return FALSE ; <FIXE> <FIXS> return TRUE ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-125 static Image * ReadVIFFImage ( const ImageInfo * image_info , ExceptionInfo * exception ) { # define VFF_CM_genericRGB 15 # define VFF_CM_ntscRGB 1 # define VFF_CM_NONE 0 # define VFF_DEP_DECORDER 0x4 # define VFF_DEP_NSORDER 0x8 # define VFF_DES_RAW 0 # define VFF_LOC_IMPLICIT 1 # define VFF_MAPTYP_NONE 0 # de... | <FIXS> pixels = ( unsigned char * ) AcquireQuantumMemory ( MagickMax ( number_pixels , max_packets ) , bytes_per_pixel * sizeof ( * pixels ) ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-190 jas_image_t * jpg_decode ( jas_stream_t * in , char * optstr ) { struct jpeg_decompress_struct cinfo ; struct jpeg_error_mgr jerr ; FILE * input_file ; jpg_dest_t dest_mgr_buf ; jpg_dest_t * dest_mgr = & dest_mgr_buf ; JDIMENSION num_scanlines ; jas_image_t * image ; int ret ; jpg_dec_importopts_t opts ; <BUGS>... | <FIXS> size_t num_samples ; JAS_DBGLOG ( 100 , ( "jpg_decode(%p, \\"%s\\")\\n" , in , optstr ) ) ; <FIXE> <FIXS> if ( opts . max_samples > 0 ) { if ( ! jas_safe_size_mul3 ( cinfo . image_width , cinfo . image_height , cinfo . num_components , & num_samples ) ) { goto error ; } if ( num_samples > opts . max_samples ) { ... |
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-362 static int snd_timer_user_tselect ( struct file * file , struct snd_timer_select __user * _tselect ) { struct snd_timer_user * tu ; struct snd_timer_select tselect ; char str [ 32 ] ; int err = 0 ; tu = file -> private_data ; <BUGS> mutex_lock ( & tu -> tread_sem ) ; <BUGE> if ( tu -> timeri ) { snd_timer_close... | <FIXS> <FIXE> <FIXS> <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-476 static int compile_length_bag_node ( BagNode * node , regex_t * reg ) { int len ; int tlen ; if ( node -> type == BAG_OPTION ) return compile_length_option_node ( node , reg ) ; if ( NODE_BAG_BODY ( node ) ) { tlen = compile_length_tree ( NODE_BAG_BODY ( node ) , reg ) ; if ( tlen < 0 ) return tlen ; } else tle... | <FIXS> len += SIZE_OP_JUMP + SIZE_OP_ATOMIC_END ; <FIXE> <FIXS> <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-119 int qeth_snmp_command ( struct qeth_card * card , char __user * udata ) { struct qeth_cmd_buffer * iob ; struct qeth_ipa_cmd * cmd ; struct qeth_snmp_ureq * ureq ; <BUGS> int req_len ; <BUGE> struct qeth_arp_query_info qinfo = { 0 , } ; int rc = 0 ; QETH_CARD_TEXT ( card , 3 , "snmpcmd" ) ; if ( card -> info . ... | <FIXS> unsigned int req_len ; <FIXE> <FIXS> if ( req_len > ( QETH_BUFSIZE - IPA_PDU_HEADER_SIZE - sizeof ( struct qeth_ipacmd_hdr ) - sizeof ( struct qeth_ipacmd_setadpparms_hdr ) ) ) return - EINVAL ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-264 void vlan_setup ( struct net_device * dev ) { ether_setup ( dev ) ; dev -> priv_flags |= IFF_802_1Q_VLAN ; <BUGS> dev -> priv_flags &= ~ IFF_XMIT_DST_RELEASE ; <BUGE> dev -> tx_queue_len = 0 ; dev -> netdev_ops = & vlan_netdev_ops ; dev -> destructor = free_netdev ; dev -> ethtool_ops = & vlan_ethtool_ops ; mem... | <FIXS> dev -> priv_flags &= ~ ( IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-190 int jas_stream_pad ( jas_stream_t * stream , int n , int c ) { int m ; <BUGS> <BUGE> m = n ; for ( m = n ; m > 0 ; -- m ) { if ( jas_stream_putc ( stream , c ) == EOF ) return n - m ; } return n ; }
| <FIXS> if ( n < 0 ) { jas_deprecated ( "negative count for jas_stream_pad" ) ; } <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-125 static int snd_usb_create_streams ( struct snd_usb_audio * chip , int ctrlif ) { struct usb_device * dev = chip -> dev ; struct usb_host_interface * host_iface ; struct usb_interface_descriptor * altsd ; void * control_header ; int i , protocol ; <BUGS> <BUGE> host_iface = & usb_ifnum_to_if ( dev , ctrlif ) -> ... | <FIXS> int rest_bytes ; <FIXE> <FIXS> rest_bytes = ( void * ) ( host_iface -> extra + host_iface -> extralen ) - control_header ; if ( rest_bytes <= 0 ) { dev_err ( & dev -> dev , "invalid control header\\n" ) ; return - EINVAL ; } <FIXE> <FIXS> if ( rest_bytes < sizeof ( * h1 ) ) { dev_err ( & dev -> dev , "too short ... |
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-125 void qedi_dbg_info ( struct qedi_dbg_ctx * qedi , const char * func , u32 line , u32 level , const char * fmt , ... ) { va_list va ; struct va_format vaf ; <BUGS> char nfunc [ 32 ] ; memset ( nfunc , 0 , sizeof ( nfunc ) ) ; memcpy ( nfunc , func , sizeof ( nfunc ) - 1 ) ; <BUGE> va_start ( va , fmt ) ; vaf . f... | <FIXS> <FIXE> <FIXS> func , line , qedi -> host_no , & vaf ) ; <FIXE> <FIXS> pr_info ( "[0000:00:00.0]:[%s:%d]: %pV" , func , line , & vaf ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-787 static int track_header ( VividasDemuxContext * viv , AVFormatContext * s , uint8_t * buf , int size ) { int i , j , ret ; int64_t off ; int val_1 ; int num_video ; AVIOContext pb0 , * pb = & pb0 ; ffio_init_context ( pb , buf , size , 0 , NULL , NULL , NULL , NULL ) ; ffio_read_varlen ( pb ) ; avio_r8 ( pb ) ;... | <FIXS> int xd_size = 1 ; <FIXE> <FIXS> xd_size += len + 1 + len / 255 ; <FIXE> <FIXS> ret = ff_alloc_extradata ( st -> codecpar , xd_size ) ; <FIXE> <FIXS> av_assert0 ( delta <= xd_size - offset ) ; <FIXE> <FIXS> av_assert0 ( data_len [ j ] <= xd_size - offset ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-362 int sctp_rcv ( struct sk_buff * skb ) { struct sock * sk ; struct sctp_association * asoc ; struct sctp_endpoint * ep = NULL ; struct sctp_ep_common * rcvr ; struct sctp_transport * transport = NULL ; struct sctp_chunk * chunk ; struct sctphdr * sh ; union sctp_addr src ; union sctp_addr dest ; int family ; str... | <FIXS> if ( sk != rcvr -> sk ) { sctp_bh_unlock_sock ( sk ) ; sk = rcvr -> sk ; sctp_bh_lock_sock ( sk ) ; } <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-000 void Com_WriteConfig_f ( void ) { char filename [ MAX_QPATH ] ; if ( Cmd_Argc ( ) != 2 ) { Com_Printf ( "Usage: writeconfig <filename>\\n" ) ; <BUGS> <BUGE> return ; } Q_strncpyz ( filename , Cmd_Argv ( 1 ) , sizeof ( filename ) ) ; COM_DefaultExtension ( filename , sizeof ( filename ) , ".cfg" ) ; Com_Printf (... | <FIXS> return ; } if ( ! COM_CompareExtension ( filename , ".cfg" ) ) { Com_Printf ( "Com_WriteConfig_f: Only the \\".cfg\\" extension is supported by this command!\\n" ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-125 static int mxf_parse_structural_metadata ( MXFContext * mxf ) { MXFPackage * material_package = NULL ; int i , j , k , ret ; av_log ( mxf -> fc , AV_LOG_TRACE , "metadata sets count %d\\n" , mxf -> metadata_sets_count ) ; for ( i = 0 ; i < mxf -> packages_count ; i ++ ) { material_package = mxf_resolve_strong_r... | <FIXS> av_log ( mxf -> fc , AV_LOG_TRACE , "could not resolve essence container data strong ref\\n" ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-59 static int mount_entry_on_relative_rootfs ( struct mntent * mntent , const char * rootfs ) { char path [ MAXPATHLEN ] ; int ret ; ret = snprintf ( path , sizeof ( path ) , "%s/%s" , rootfs , mntent -> mnt_dir ) ; if ( ret >= sizeof ( path ) ) { ERROR ( "path name too long" ) ; return - 1 ; } <BUGS> return mount_... | <FIXS> return mount_entry_on_generic ( mntent , path , rootfs ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-119 <BUGS> static void <BUGE> horDiff32 ( TIFF * tif , uint8 * cp0 , tmsize_t cc ) { TIFFPredictorState * sp = PredictorState ( tif ) ; tmsize_t stride = sp -> stride ; uint32 * wp = ( uint32 * ) cp0 ; tmsize_t wc = cc / 4 ; <BUGS> assert ( ( cc % ( 4 * stride ) ) == 0 ) ; <BUGE> if ( wc > stride ) { wc -= stride ;... | <FIXS> static int <FIXE> <FIXS> if ( ( cc % ( 4 * stride ) ) != 0 ) { TIFFErrorExt ( tif -> tif_clientdata , "horDiff32" , "%s" , "(cc%(4*stride))!=0" ) ; return 0 ; } <FIXE> <FIXS> return 1 ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-125 struct r_bin_dyldcache_obj_t * r_bin_dyldcache_from_bytes_new ( const ut8 * buf , ut64 size ) { <BUGS> struct r_bin_dyldcache_obj_t * bin ; if ( ! ( bin = malloc ( sizeof ( struct r_bin_dyldcache_obj_t ) ) ) ) { <BUGE> return NULL ; } <BUGS> memset ( bin , 0 , sizeof ( struct r_bin_dyldcache_obj_t ) ) ; <BUGE> ... | <FIXS> struct r_bin_dyldcache_obj_t * bin = R_NEW0 ( struct r_bin_dyldcache_obj_t ) ; if ( ! bin ) { <FIXE> <FIXS> <FIXE> <FIXS> if ( ! bin -> b || ! r_buf_set_bytes ( bin -> b , buf , size ) ) { <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-787 char * enl_ipc_get ( const char * msg_data ) { static char * message = NULL ; <BUGS> static unsigned short len = 0 ; <BUGE> char buff [ 13 ] , * ret_msg = NULL ; register unsigned char i ; unsigned char blen ; if ( msg_data == IPC_TIMEOUT ) { return ( IPC_TIMEOUT ) ; } for ( i = 0 ; i < 12 ; i ++ ) { buff [ i ]... | <FIXS> static size_t len = 0 ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-787 <BUGS> static int shash_no_setkey ( struct crypto_shash * tfm , const u8 * key , <BUGE> unsigned int keylen ) { return - ENOSYS ; }
| <FIXS> int shash_no_setkey ( struct crypto_shash * tfm , const u8 * key , <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-119 void vp9_tile_init ( TileInfo * tile , const VP9_COMMON * cm , int row , int col ) { <BUGS> tile -> mi_row_start = get_tile_offset ( row , cm -> mi_rows , cm -> log2_tile_rows ) ; tile -> mi_row_end = get_tile_offset ( row + 1 , cm -> mi_rows , cm -> log2_tile_rows ) ; tile -> mi_col_start = get_tile_offset ( c... | <FIXS> vp9_tile_set_row ( tile , cm , row ) ; vp9_tile_set_col ( tile , cm , col ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-119 static double get_rate_correction_factor ( const VP9_COMP * cpi ) { <BUGS> <BUGE> if ( cpi -> common . frame_type == KEY_FRAME ) { <BUGS> return cpi -> rc . key_frame_rate_correction_factor ; <BUGE> } else { if ( ( cpi -> refresh_alt_ref_frame || cpi -> refresh_golden_frame ) && <BUGS> ! cpi -> rc . is_src_fram... | <FIXS> const RATE_CONTROL * const rc = & cpi -> rc ; double rcf ; <FIXE> <FIXS> rcf = rc -> rate_correction_factors [ KF_STD ] ; } else if ( cpi -> oxcf . pass == 2 ) { RATE_FACTOR_LEVEL rf_lvl = cpi -> twopass . gf_group . rf_level [ cpi -> twopass . gf_group . index ] ; rcf = rc -> rate_correction_factors [ rf_lvl ] ... |
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-119 int id3_skip ( SF_PRIVATE * psf ) { unsigned char buf [ 10 ] ; memset ( buf , 0 , sizeof ( buf ) ) ; psf_binheader_readf ( psf , "pb" , 0 , buf , 10 ) ; if ( buf [ 0 ] == 'I' && buf [ 1 ] == 'D' && buf [ 2 ] == '3' ) { int offset = buf [ 6 ] & 0x7f ; offset = ( offset << 7 ) | ( buf [ 7 ] & 0x7f ) ; offset = ( ... | <FIXS> if ( psf -> fileoffset < psf -> filelength ) { psf_binheader_readf ( psf , "p" , psf -> fileoffset ) ; <FIXE> <FIXS> } ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-119 static Image * ReadDCMImage ( const ImageInfo * image_info , ExceptionInfo * exception ) { <BUGS> # define ThrowDCMException ( exception , message ) { if ( info . scale != ( Quantum * ) NULL ) info . scale = ( Quantum * ) RelinquishMagickMemory ( info . scale ) ; if ( data != ( unsigned char * ) NULL ) data = (... | <FIXS> # define ThrowDCMException ( exception , message ) \\\n{ if ( info . scale != ( Quantum * ) NULL ) info . scale = ( Quantum * ) RelinquishMagickMemory ( info . scale ) ; if ( data != ( unsigned char * ) NULL ) data = ( unsigned char * ) RelinquishMagickMemory ( data ) ; if ( graymap != ( int * ) NULL ) graymap =... |
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-362 static int smb_send_rqst ( struct TCP_Server_Info * server , struct smb_rqst * rqst ) { int rc ; struct kvec * iov = rqst -> rq_iov ; int n_vec = rqst -> rq_nvec ; unsigned int smb_buf_length = get_rfc1002_length ( iov [ 0 ] . iov_base ) ; unsigned int i ; size_t total_len = 0 , sent ; struct socket * ssocket =... | <FIXS> if ( ssocket == NULL ) return - ENOTSOCK ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-354 static void recovery_abort ( void ) { if ( ! dry_run ) { storage_reset ( ) ; } <BUGS> <BUGE> awaiting_character = false ; memzero ( mnemonic , sizeof ( mnemonic ) ) ; memzero ( cipher , sizeof ( cipher ) ) ; }
| <FIXS> recovery_started = false ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-000 static int list_tables ( MYSQL * mysql , const char * db , const char * table ) { const char * header ; uint head_length , counter = 0 ; <BUGS> char query [ 255 ] , rows [ NAME_LEN ] , fields [ 16 ] ; <BUGE> MYSQL_FIELD * field ; MYSQL_RES * result ; MYSQL_ROW row , rrow ; if ( mysql_select_db ( mysql , db ) ) ... | <FIXS> char query [ NAME_LEN + 100 ] , rows [ NAME_LEN ] , fields [ 16 ] ; <FIXE> <FIXS> my_snprintf ( query , sizeof ( query ) , "SELECT COUNT(*) FROM `%s`" , row [ 0 ] ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-264 static int try_to_unmap_cluster ( unsigned long cursor , unsigned int * mapcount , struct vm_area_struct * vma , struct page * check_page ) { struct mm_struct * mm = vma -> vm_mm ; pmd_t * pmd ; pte_t * pte ; pte_t pteval ; spinlock_t * ptl ; struct page * page ; unsigned long address ; unsigned long mmun_start... | <FIXS> if ( page == check_page ) { <FIXE> <FIXS> <FIXE> <FIXS> } else if ( trylock_page ( page ) ) { mlock_vma_page ( page ) ; unlock_page ( page ) ; } <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-476 static int __rds_rdma_map ( struct rds_sock * rs , struct rds_get_mr_args * args , u64 * cookie_ret , struct rds_mr * * mr_ret ) { struct rds_mr * mr = NULL , * found ; unsigned int nr_pages ; struct page * * pages = NULL ; struct scatterlist * sg ; void * trans_private ; unsigned long flags ; rds_rdma_cookie_t... | <FIXS> if ( rs -> rs_bound_addr == 0 || ! rs -> rs_transport ) { <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-189 static void oz_usb_handle_ep_data ( struct oz_usb_ctx * usb_ctx , struct oz_usb_hdr * usb_hdr , int len ) { struct oz_data * data_hdr = ( struct oz_data * ) usb_hdr ; switch ( data_hdr -> format ) { case OZ_DATA_F_MULTIPLE_FIXED : { struct oz_multiple_fixed * body = ( struct oz_multiple_fixed * ) data_hdr ; u8 ... | <FIXS> int n ; if ( ! body -> unit_size ) break ; n = ( len - sizeof ( struct oz_multiple_fixed ) + 1 ) <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-125 static int juniper_parse_header ( netdissect_options * ndo , const u_char * p , const struct pcap_pkthdr * h , struct juniper_l2info_t * l2info ) { const struct juniper_cookie_table_t * lp = juniper_cookie_table ; u_int idx , jnx_ext_len , jnx_header_len = 0 ; uint8_t tlv_type , tlv_len ; uint32_t control_word ... | <FIXS> ND_TCHECK_16BITS ( p + l2info -> cookie_len ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-787 static char * get_object ( FILE * fp , int obj_id , const xref_t * xref , size_t * size , int * is_stream ) { static const int blk_sz = 256 ; int i , total_sz , read_sz , n_blks , search , stream ; size_t obj_sz ; char * c , * data ; long start ; const xref_entry_t * entry ; if ( size ) * size = 0 ; if ( is_str... | <FIXS> data = safe_calloc ( blk_sz * n_blks ) ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-119 <BUGS> int vp8_denoiser_filter_sse2 ( YV12_BUFFER_CONFIG * mc_running_avg , YV12_BUFFER_CONFIG * running_avg , MACROBLOCK * signal , unsigned int motion_magnitude , int y_offset , int uv_offset ) <BUGE> { <BUGS> unsigned char * sig = signal -> thismb ; int sig_stride = 16 ; unsigned char * mc_running_avg_y = mc... | <FIXS> int vp8_denoiser_filter_sse2 ( unsigned char * mc_running_avg_y , int mc_avg_y_stride , unsigned char * running_avg_y , int avg_y_stride , unsigned char * sig , int sig_stride , unsigned int motion_magnitude , int increase_denoising ) <FIXE> <FIXS> unsigned char * running_avg_y_start = running_avg_y ; unsigned c... |
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-787 static unsigned int ipv6_defrag ( void * priv , struct sk_buff * skb , const struct nf_hook_state * state ) { int err ; # if IS_ENABLED ( CONFIG_NF_CONNTRACK ) if ( skb -> nfct && ! nf_ct_is_template ( ( struct nf_conn * ) skb -> nfct ) ) return NF_ACCEPT ; # endif err = nf_ct_frag6_gather ( state -> net , skb ... | <FIXS> return err == 0 ? NF_ACCEPT : NF_DROP ; <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-20 static int __vcpu_run ( struct kvm_vcpu * vcpu ) { int r ; struct kvm * kvm = vcpu -> kvm ; vcpu -> srcu_idx = srcu_read_lock ( & kvm -> srcu ) ; <BUGS> r = vapic_enter ( vcpu ) ; if ( r ) { srcu_read_unlock ( & kvm -> srcu , vcpu -> srcu_idx ) ; return r ; } <BUGE> r = 1 ; while ( r > 0 ) { if ( vcpu -> arch . ... | <FIXS> <FIXE> <FIXS> <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-400 int __usb_get_extra_descriptor ( char * buffer , unsigned size , <BUGS> unsigned char type , void * * ptr ) <BUGE> { struct usb_descriptor_header * header ; while ( size >= sizeof ( struct usb_descriptor_header ) ) { header = ( struct usb_descriptor_header * ) buffer ; <BUGS> if ( header -> bLength < 2 ) { <BUG... | <FIXS> unsigned char type , void * * ptr , size_t minsize ) <FIXE> <FIXS> if ( header -> bLength < 2 || header -> bLength > size ) { <FIXE> <FIXS> if ( header -> bDescriptorType == type && header -> bLength >= minsize ) { <FIXE>
|
Example Vulnerable Function 1:
CWE-119 <BUGS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
Example Repair Patch 1:
<FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? ar... | CWE-200 static int xfrm_alloc_replay_state_esn ( struct xfrm_replay_state_esn * * replay_esn , struct xfrm_replay_state_esn * * preplay_esn , struct nlattr * rta ) { struct xfrm_replay_state_esn * p , * pp , * up ; <BUGS> <BUGE> if ( ! rta ) return 0 ; up = nla_data ( rta ) ; <BUGS> p = kmemdup ( up , xfrm_replay_state... | <FIXS> int klen , ulen ; <FIXE> <FIXS> klen = xfrm_replay_state_esn_len ( up ) ; ulen = nla_len ( rta ) >= klen ? klen : sizeof ( * up ) ; p = kzalloc ( klen , GFP_KERNEL ) ; <FIXE> <FIXS> pp = kzalloc ( klen , GFP_KERNEL ) ; <FIXE> <FIXS> memcpy ( p , up , ulen ) ; memcpy ( pp , up , ulen ) ; <FIXE>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.