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-119 bool initiate_stratum ( struct pool * pool ) { bool ret = false , recvd = false , noresume = false , sockd = false ; char s [ RBUFSIZE ] , * sret = NULL , * nonce1 , * sessionid ; json_t * val = NULL , * res_val , * err_val ; json_error_t err ; int n2size ; resend : if ( ! setup_stratum_socket ( pool ) ) { sock... | <FIXS> if ( ! valid_hex ( nonce1 ) ) { applog ( LOG_INFO , "Failed to get valid nonce1 in initiate_stratum" ) ; <FIXE> <FIXS> if ( n2size < 2 || n2size > 16 ) { applog ( LOG_INFO , "Failed to get valid n2size in initiate_stratum" ) ; <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 unix_release_sock ( struct sock * sk , int embrion ) { struct unix_sock * u = unix_sk ( sk ) ; struct path path ; struct sock * skpair ; struct sk_buff * skb ; int state ; unix_remove_socket ( sk ) ; unix_state_lock ( sk ) ; sock_orphan ( sk ) ; sk -> sk_shutdown = SHUTDOWN_MASK ; path = u -> path ;... | <FIXS> unix_dgram_peer_wake_disconnect ( sk , skpair ) ; <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 eap_print ( netdissect_options * ndo , register const u_char * cp , u_int length ) { const struct eap_frame_t * eap ; const u_char * tptr ; u_int tlen , type , subtype ; int count = 0 , len ; tptr = cp ; tlen = length ; eap = ( const struct eap_frame_t * ) cp ; ND_TCHECK ( * eap ) ; if ( ndo -> ndo_vflag <... | <FIXS> ND_TCHECK_8BITS ( tptr ) ; <FIXE> <FIXS> ND_TCHECK_16BITS ( tptr + 2 ) ; <FIXE> <FIXS> ND_TCHECK_8BITS ( tptr + 4 ) ; <FIXE> <FIXS> tok2str ( eap_type_values , "unknown" , subtype ) , subtype ) ) ; <FIXE> <FIXS> ND_TCHECK_8BITS ( tptr + count ) ; <FIXE> <FIXS> case EAP_TYPE_TLS : ND_TCHECK_8BITS ( tptr + 5 ) ; i... |
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 void snd_timer_user_tinterrupt ( struct snd_timer_instance * timeri , unsigned long resolution , unsigned long ticks ) { struct snd_timer_user * tu = timeri -> callback_data ; struct snd_timer_tread * r , r1 ; struct timespec tstamp ; int prev , append = 0 ; memset ( & tstamp , 0 , sizeof ( tstamp ) ) ; ... | <FIXS> memset ( & r1 , 0 , sizeof ( r1 ) ) ; <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 store_coding_context ( MACROBLOCK * x , PICK_MODE_CONTEXT * ctx , int mode_index , <BUGS> int_mv * ref_mv , int_mv * second_ref_mv , <BUGE> int64_t comp_pred_diff [ REFERENCE_MODES ] , <BUGS> int64_t tx_size_diff [ TX_MODES ] , int64_t best_filter_diff [ SWITCHABLE_FILTER_CONTEXTS ] ) { <BUGE> MACRO... | <FIXS> <FIXE> <FIXS> int64_t best_filter_diff [ SWITCHABLE_FILTER_CONTEXTS ] , int skippable ) { <FIXE> <FIXS> ctx -> skippable = skippable ; <FIXE> <FIXS> ctx -> mbmi_ext = * x -> mbmi_ext ; <FIXE> <FIXS> memcpy ( ctx -> best_filter_diff , best_filter_diff , <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_write_begin ( struct file * file , struct address_space * mapping , loff_t pos , unsigned len , unsigned flags , struct page * * pagep , void * * fsdata ) { struct inode * inode = mapping -> host ; int ret , needed_blocks ; handle_t * handle ; int retries = 0 ; struct page * page ; pgoff_t index... | <FIXS> if ( ext4_should_dioread_nolock ( inode ) ) ret = block_write_begin ( file , mapping , pos , len , flags , pagep , fsdata , ext4_get_block_write ) ; else ret = block_write_begin ( file , mapping , pos , len , flags , pagep , fsdata , ext4_get_block ) ; <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> int16_t vp9_ac_quant ( int qindex , int delta ) { <BUGE> return ac_qlookup [ clamp ( qindex + delta , 0 , MAXQ ) ] ; <BUGS> <BUGE> }
| <FIXS> int16_t vp9_ac_quant ( int qindex , int delta , vpx_bit_depth_t bit_depth ) { # if CONFIG_VP9_HIGHBITDEPTH switch ( bit_depth ) { case VPX_BITS_8 : <FIXE> <FIXS> case VPX_BITS_10 : return ac_qlookup_10 [ clamp ( qindex + delta , 0 , MAXQ ) ] ; case VPX_BITS_12 : return ac_qlookup_12 [ clamp ( qindex + delta , 0 ... |
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 int <BUGS> add_mibfile ( const char * tmpstr , const char * d_name , FILE * ip ) <BUGE> { FILE * fp ; char token [ MAXTOKEN ] , token2 [ MAXTOKEN ] ; if ( ( fp = fopen ( tmpstr , "r" ) ) == NULL ) { snmp_log_perror ( tmpstr ) ; return 1 ; } DEBUGMSGTL ( ( "parse-mibs" , "Checking file: %s...\\n" , tmpstr ) ) ; m... | <FIXS> add_mibfile ( const char * tmpstr , const char * d_name ) <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 fpm_stdio_init_child ( struct fpm_worker_pool_s * wp ) { # ifdef HAVE_SYSLOG_H if ( fpm_globals . error_log_fd == ZLOG_SYSLOG ) { closelog ( ) ; } else # endif if ( fpm_globals . error_log_fd > 0 ) { close ( fpm_globals . error_log_fd ) ; } fpm_globals . error_log_fd = - 1 ; zlog_set_fd ( - 1 ) ; <BUGS> if ... | <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-254 void test_parser ( void ) { <BUGS> int i , retval ; bzrtpPacket_t * zrtpPacket ; bzrtpContext_t * context87654321 = bzrtp_createBzrtpContext ( 0x87654321 ) ; bzrtpContext_t * context12345678 = bzrtp_createBzrtpContext ( 0x12345678 ) ; memcpy ( context12345678 -> channelContext [ 0 ] -> selfH [ 0 ] , H12345678 [... | <FIXS> test_parser_param ( 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-20 static enum try_read_result try_read_network ( conn * c ) { enum try_read_result gotdata = READ_NO_DATA_RECEIVED ; int res ; <BUGS> <BUGE> assert ( c != NULL ) ; if ( c -> rcurr != c -> rbuf ) { if ( c -> rbytes != 0 ) memmove ( c -> rbuf , c -> rcurr , c -> rbytes ) ; c -> rcurr = c -> rbuf ; } while ( 1 ) { if... | <FIXS> int num_allocs = 0 ; <FIXE> <FIXS> if ( num_allocs == 4 ) { return gotdata ; } ++ num_allocs ; <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 Image * ReadWPGImage ( const ImageInfo * image_info , ExceptionInfo * exception ) { typedef struct { size_t FileId ; MagickOffsetType DataOffset ; unsigned int ProductType ; unsigned int FileType ; unsigned char MajorVersion ; unsigned char MinorVersion ; unsigned int EncryptKey ; unsigned int Reserved ;... | <FIXS> if ( Rec . RecordLength > GetBlobSize ( image ) ) ThrowReaderException ( CorruptImageError , "ImproperImageHeader" ) ; <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 const u_char * ikev2_auth_print ( netdissect_options * ndo , u_char tpay , const struct isakmp_gen * ext , u_int item_len _U_ , const u_char * ep , uint32_t phase _U_ , uint32_t doi _U_ , uint32_t proto _U_ , int depth _U_ ) { struct ikev2_auth a ; const char * v2_auth [ ] = { "invalid" , "rsasig" , "sha... | <FIXS> ND_TCHECK2 ( * ext , sizeof ( a ) ) ; <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-401 int ath9k_wmi_cmd ( struct wmi * wmi , enum wmi_cmd_id cmd_id , u8 * cmd_buf , u32 cmd_len , u8 * rsp_buf , u32 rsp_len , u32 timeout ) { struct ath_hw * ah = wmi -> drv_priv -> ah ; struct ath_common * common = ath9k_hw_common ( ah ) ; u16 headroom = sizeof ( struct htc_frame_hdr ) + sizeof ( struct wmi_cmd_hd... | <FIXS> kfree_skb ( skb ) ; <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 int netlink_dump ( struct sock * sk ) { struct netlink_sock * nlk = nlk_sk ( sk ) ; struct netlink_callback * cb ; struct sk_buff * skb = NULL ; struct nlmsghdr * nlh ; <BUGS> <BUGE> int len , err = - ENOBUFS ; int alloc_min_size ; int alloc_size ; mutex_lock ( nlk -> cb_mutex ) ; if ( ! nlk -> cb_runnin... | <FIXS> struct module * module ; <FIXE> <FIXS> module = cb -> module ; skb = cb -> skb ; <FIXE> <FIXS> module_put ( module ) ; consume_skb ( skb ) ; <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 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... | <FIXS> s_alDriver = Cvar_Get ( "s_alDriver" , ALDRIVER_DEFAULT , CVAR_ARCHIVE | CVAR_LATCH | CVAR_PROTECTED ) ; <FIXE> <FIXS> if ( COM_CompareExtension ( s_alDriver -> string , ".pk3" ) ) { Com_Printf ( "Rejecting DLL named \\"%s\\"" , s_alDriver -> string ) ; return qfalse ; } <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 yam_ioctl ( struct net_device * dev , struct ifreq * ifr , int cmd ) { struct yam_port * yp = netdev_priv ( dev ) ; struct yamdrv_ioctl_cfg yi ; struct yamdrv_ioctl_mcs * ym ; int ioctl_cmd ; if ( copy_from_user ( & ioctl_cmd , ifr -> ifr_data , sizeof ( int ) ) ) return - EFAULT ; if ( yp -> magic !... | <FIXS> memset ( & yi , 0 , sizeof ( yi ) ) ; <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 struct sk_buff * udp6_ufo_fragment ( struct sk_buff * skb , netdev_features_t features ) { struct sk_buff * segs = ERR_PTR ( - EINVAL ) ; unsigned int mss ; unsigned int unfrag_ip6hlen , unfrag_len ; struct frag_hdr * fptr ; u8 * packet_start , * prevhdr ; u8 nexthdr ; u8 frag_hdr_sz = sizeof ( struct fr... | <FIXS> if ( skb -> mac_header < ( tnl_hlen + frag_hdr_sz ) ) { <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 HTMLtagproc1 ( struct parsed_tag * tag , struct html_feed_environ * h_env ) { char * p , * q , * r ; int i , w , x , y , z , count , width ; struct readbuffer * obuf = h_env -> obuf ; struct environment * envs = h_env -> envs ; Str tmp ; int hseq ; int cmd ; # ifdef ID_EXT char * id = NULL ; # endif cmd = ta... | <FIXS> if ( h_env -> envc == 0 || ( h_env -> envc_real < h_env -> nenv && envs [ h_env -> envc ] . env != HTML_DL && envs [ h_env -> envc ] . env != HTML_DL_COMPACT ) ) { PUSH_ENV ( HTML_DL ) ; } <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-78 static int r_core_cmd_subst_i ( RCore * core , char * cmd , char * colon , bool * tmpseek ) { RList * tmpenvs = r_list_newf ( tmpenvs_free ) ; const char * quotestr = "`" ; const char * tick = NULL ; char * ptr , * ptr2 , * str ; char * arroba = NULL ; char * grep = NULL ; RIODesc * tmpdesc = NULL ; int pamode =... | <FIXS> char op0 = 0 ; <FIXE> <FIXS> op0 = * q ; <FIXE> <FIXS> cmd = p ; <FIXE> <FIXS> * p = op0 ; <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 check_user_token ( const char * authfile , const char * username , const char * otp_id , int verbose , FILE * debug_file ) { char buf [ 1024 ] ; char * s_user , * s_token ; int retval = AUTH_ERROR ; int fd ; struct stat st ; FILE * opwfile ; fd = open ( authfile , O_RDONLY , 0 ) ; if ( fd < 0 ) { if ( verbo... | <FIXS> fclose ( opwfile ) ; <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 PARSER_FLAGS ( PyCompilerFlags * flags ) { int parser_flags = 0 ; if ( ! flags ) return 0 ; if ( flags -> cf_flags & PyCF_DONT_IMPLY_DEDENT ) parser_flags |= PyPARSE_DONT_IMPLY_DEDENT ; if ( flags -> cf_flags & PyCF_IGNORE_COOKIE ) parser_flags |= PyPARSE_IGNORE_COOKIE ; if ( flags -> cf_flags & CO_F... | <FIXS> if ( flags -> cf_flags & PyCF_TYPE_COMMENTS ) parser_flags |= PyPARSE_TYPE_COMMENTS ; <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-834 static int read_tfra ( MOVContext * mov , AVIOContext * f ) { MOVFragmentIndex * index = NULL ; int version , fieldlength , i , j ; int64_t pos = avio_tell ( f ) ; uint32_t size = avio_rb32 ( f ) ; void * tmp ; if ( avio_rb32 ( f ) != MKBETAG ( 't' , 'f' , 'r' , 'a' ) ) { return 1 ; } av_log ( mov -> fc , AV_LO... | <FIXS> if ( avio_feof ( f ) ) { index -> item_count = 0 ; av_freep ( & index -> items ) ; return AVERROR_INVALIDDATA ; } <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 bootp_print ( netdissect_options * ndo , register const u_char * cp , u_int length ) { register const struct bootp * bp ; static const u_char vm_cmu [ 4 ] = VM_CMU ; static const u_char vm_rfc1048 [ 4 ] = VM_RFC1048 ; bp = ( const struct bootp * ) cp ; ND_TCHECK ( bp -> bp_op ) ; ND_PRINT ( ( ndo , "BOOTP/... | <FIXS> ND_TCHECK ( bp -> bp_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-119 static struct se_portal_group * vhost_scsi_make_tpg ( struct se_wwn * wwn , struct config_group * group , const char * name ) { struct vhost_scsi_tport * tport = container_of ( wwn , struct vhost_scsi_tport , tport_wwn ) ; struct vhost_scsi_tpg * tpg ; <BUGS> unsigned long tpgt ; <BUGE> int ret ; if ( strstr ( ... | <FIXS> u16 tpgt ; <FIXE> <FIXS> if ( kstrtou16 ( name + 5 , 10 , & tpgt ) || tpgt >= VHOST_SCSI_MAX_TARGET ) <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-416 void CleanWriters ( GF_List * writers ) { while ( gf_list_count ( writers ) ) { TrackWriter * writer = ( TrackWriter * ) gf_list_get ( writers , 0 ) ; <BUGS> <BUGE> gf_isom_box_del ( writer -> stco ) ; gf_isom_box_del ( ( GF_Box * ) writer -> stsc ) ; gf_free ( writer ) ; gf_list_rem ( writers , 0 ) ; } }
| <FIXS> gf_list_del_item ( writer -> stbl -> child_boxes , writer -> stco ) ; gf_list_del_item ( writer -> stbl -> child_boxes , writer -> stsc ) ; <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 void kvm_lapic_sync_from_vapic ( struct kvm_vcpu * vcpu ) { u32 data ; <BUGS> void * vapic ; <BUGE> if ( test_bit ( KVM_APIC_PV_EOI_PENDING , & vcpu -> arch . apic_attention ) ) apic_sync_pv_eoi_from_guest ( vcpu , vcpu -> arch . apic ) ; if ( ! test_bit ( KVM_APIC_CHECK_VAPIC , & vcpu -> arch . apic_attention )... | <FIXS> <FIXE> <FIXS> kvm_read_guest_cached ( vcpu -> kvm , & vcpu -> arch . apic -> vapic_cache , & data , sizeof ( u32 ) ) ; <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 dnxhd_find_frame_end ( DNXHDParserContext * dctx , const uint8_t * buf , int buf_size ) { ParseContext * pc = & dctx -> pc ; uint64_t state = pc -> state64 ; int pic_found = pc -> frame_start_found ; int i = 0 ; int interlaced = dctx -> interlaced ; int cur_field = dctx -> cur_field ; if ( ! pic_foun... | <FIXS> int remaining ; <FIXE> <FIXS> remaining = avpriv_dnxhd_get_frame_size ( cid ) ; if ( remaining <= 0 ) { remaining = dnxhd_get_hr_frame_size ( cid , dctx -> w , dctx -> h ) ; if ( remaining <= 0 ) continue ; <FIXE> <FIXS> dctx -> remaining = remaining ; <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 grub_ssize_t grub_fshelp_read_file ( grub_disk_t disk , grub_fshelp_node_t node , void ( * read_hook ) ( grub_disk_addr_t sector , unsigned offset , unsigned length , void * closure ) , void * closure , int flags , grub_off_t pos , grub_size_t len , char * buf , grub_disk_addr_t ( * get_block ) ( grub_fshelp_no... | <FIXS> if ( len < 1 || len == 0xffffffff ) { 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-20 int arch_dup_task_struct ( struct task_struct * dst , struct task_struct * src ) { flush_fp_to_thread ( src ) ; flush_altivec_to_thread ( src ) ; flush_vsx_to_thread ( src ) ; flush_spe_to_thread ( src ) ; <BUGS> <BUGE> * dst = * src ; clear_task_ebb ( dst ) ; return 0 ; }
| <FIXS> __switch_to_tm ( src ) ; tm_recheckpoint_new_task ( src ) ; <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 int migrate_page_move_mapping ( struct address_space * mapping , struct page * newpage , struct page * page , struct buffer_head * head , enum migrate_mode mode , int extra_count ) { <BUGS> <BUGE> int expected_count = 1 + extra_count ; void * * pslot ; if ( ! mapping ) { if ( page_count ( page ) != expected_cou... | <FIXS> struct zone * oldzone , * newzone ; int dirty ; <FIXE> <FIXS> oldzone = page_zone ( page ) ; newzone = page_zone ( newpage ) ; <FIXE> <FIXS> dirty = PageDirty ( page ) ; if ( dirty ) { ClearPageDirty ( page ) ; SetPageDirty ( newpage ) ; } <FIXE> <FIXS> spin_unlock ( & mapping -> tree_lock ) ; if ( newzone != ol... |
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_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array -> child ; while ( c && item > 0 ) { -- item ; c = c -> next ; } return c ; } <BUGE>
| <FIXS> cJSON * cJSON_GetArrayItem ( cJSON * array , int item ) { cJSON * c = array ? array -> child : 0 ; while ( c && item > 0 ) item -- , c = c -> next ; return c ; } <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 ext3_fsblk_t get_sb_block ( void * * data , struct super_block * sb ) { ext3_fsblk_t sb_block ; char * options = ( char * ) * data ; if ( ! options || strncmp ( options , "sb=" , 3 ) != 0 ) return 1 ; options += 3 ; sb_block = simple_strtoul ( options , & options , 0 ) ; if ( * options && * options != ','... | <FIXS> ext3_msg ( sb , KERN_ERR , "error: invalid sb specification: %s" , <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 guint32 parse_wbxml_attribute_list_defined ( proto_tree * tree , tvbuff_t * tvb , guint32 offset , guint32 str_tbl , guint8 level , guint8 * codepage_attr , const wbxml_decoding * map ) { guint32 tvb_len = tvb_reported_length ( tvb ) ; <BUGS> guint32 off = offset ; <BUGE> guint32 len ; guint str_len ; gu... | <FIXS> guint32 off = offset , last_off ; <FIXE> <FIXS> last_off = off ; <FIXE> <FIXS> if ( off < last_off ) { THROW ( ReportedBoundsError ) ; } last_off = off ; <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_encode_frame ( VP9_COMP * cpi ) { VP9_COMMON * const cm = & cpi -> common ; if ( ! frame_is_intra_only ( cm ) ) { if ( ( cm -> ref_frame_sign_bias [ ALTREF_FRAME ] == cm -> ref_frame_sign_bias [ GOLDEN_FRAME ] ) || ( cm -> ref_frame_sign_bias [ ALTREF_FRAME ] == cm -> ref_frame_sign_bias [ LAST_FRAME ]... | <FIXS> cpi -> allow_comp_inter_inter = 0 ; <FIXE> <FIXS> cpi -> allow_comp_inter_inter = 1 ; <FIXE> <FIXS> RD_OPT * const rd_opt = & cpi -> rd ; FRAME_COUNTS * counts = cpi -> td . counts ; RD_COUNTS * const rdc = & cpi -> td . rd_counts ; <FIXE> <FIXS> int64_t * const mode_thrs = rd_opt -> prediction_type_threshes [ f... |
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 int input_set_keycode ( struct input_dev * dev , const struct input_keymap_entry * ke ) { unsigned long flags ; unsigned int old_keycode ; int retval ; if ( ke -> keycode > KEY_MAX ) return - EINVAL ; spin_lock_irqsave ( & dev -> event_lock , flags ) ; retval = dev -> setkeycode ( dev , ke , & old_keycode ) ; i... | <FIXS> if ( old_keycode > KEY_MAX ) { dev_warn ( dev -> dev . parent ? : & dev -> dev , "%s: got too big old keycode %#x\\n" , __func__ , old_keycode ) ; } else if ( test_bit ( EV_KEY , dev -> evbit ) && <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 struct sk_buff * udp6_ufo_fragment ( struct sk_buff * skb , u32 features ) { struct sk_buff * segs = ERR_PTR ( - EINVAL ) ; unsigned int mss ; unsigned int unfrag_ip6hlen , unfrag_len ; struct frag_hdr * fptr ; u8 * mac_start , * prevhdr ; u8 nexthdr ; u8 frag_hdr_sz = sizeof ( struct frag_hdr ) ; int of... | <FIXS> ipv6_select_ident ( fptr , ( struct rt6_info * ) skb_dst ( skb ) ) ; <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 BOOL license_read_scope_list ( wStream * s , SCOPE_LIST * scopeList ) { UINT32 i ; UINT32 scopeCount ; if ( Stream_GetRemainingLength ( s ) < 4 ) return FALSE ; Stream_Read_UINT32 ( s , scopeCount ) ; <BUGS> <BUGE> scopeList -> count = scopeCount ; scopeList -> array = ( LICENSE_BLOB * ) malloc ( sizeof ( LICEN... | <FIXS> if ( Stream_GetRemainingLength ( s ) / sizeof ( LICENSE_BLOB ) < scopeCount ) return 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-400 <BUGS> void __perf_sw_event ( u32 event_id , u64 nr , int nmi , struct pt_regs * regs , u64 addr ) <BUGE> { struct perf_sample_data data ; int rctx ; preempt_disable_notrace ( ) ; rctx = perf_swevent_get_recursion_context ( ) ; if ( rctx < 0 ) return ; perf_sample_data_init ( & data , addr ) ; <BUGS> do_perf_sw... | <FIXS> void __perf_sw_event ( u32 event_id , u64 nr , struct pt_regs * regs , u64 addr ) <FIXE> <FIXS> do_perf_sw_event ( PERF_TYPE_SOFTWARE , event_id , nr , & data , regs ) ; <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 struct posix_acl * xfs_acl_from_disk ( struct xfs_acl * aclp ) { struct posix_acl_entry * acl_e ; struct posix_acl * acl ; struct xfs_acl_entry * ace ; int count , i ; <BUGS> count = be32_to_cpu ( aclp -> acl_cnt ) ; <BUGE> acl = posix_acl_alloc ( count , GFP_KERNEL ) ; if ( ! acl ) return ERR_PTR ( - EN... | <FIXS> count = be32_to_cpu ( aclp -> acl_cnt ) ; if ( count > XFS_ACL_MAX_ENTRIES ) return ERR_PTR ( - EFSCORRUPTED <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 struct key * key_alloc ( struct key_type * type , const char * desc , kuid_t uid , kgid_t gid , const struct cred * cred , key_perm_t perm , unsigned long flags , struct key_restriction * restrict_link ) { struct key_user * user = NULL ; struct key * key ; size_t desclen , quotalen ; int ret ; key = ERR_PTR ( -... | <FIXS> if ( flags & KEY_ALLOC_UID_KEYRING ) key -> flags |= 1 << KEY_FLAG_UID_KEYRING ; <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 tls1_mac ( SSL * ssl , SSL3_RECORD * rec , unsigned char * md , int send ) { unsigned char * seq ; EVP_MD_CTX * hash ; size_t md_size ; int i ; EVP_MD_CTX * hmac = NULL , * mac_ctx ; unsigned char header [ 13 ] ; int stream_mac = ( send ? ( ssl -> mac_flags & SSL_MAC_FLAG_WRITE_MAC_STREAM ) : ( ssl -> mac_fl... | <FIXS> if ( ! send && ! SSL_READ_ETM ( ssl ) && <FIXE> <FIXS> if ( ! send && ! SSL_READ_ETM ( ssl ) && FIPS_mode ( ) ) <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-476 static GsfInfileTar * tar_directory_for_file ( GsfInfileTar * dir , const char * name , gboolean last ) { const char * s = name ; while ( 1 ) { const char * s0 = s ; char * dirname ; while ( 1 ) { if ( * s == 0 ) { if ( last && s != s0 ) break ; else return dir ; } if ( * s == '/' ) break ; s ++ ; } dirname = g... | <FIXS> dir = GSF_IS_INFILE_TAR ( subdir ) ? GSF_INFILE_TAR ( subdir ) : dir ; <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 grub_disk_addr_t grub_ext2_read_block ( grub_fshelp_node_t node , grub_disk_addr_t fileblock ) { struct grub_ext2_data * data = node -> data ; struct grub_ext2_inode * inode = & node -> inode ; int blknr = - 1 ; unsigned int blksz = EXT2_BLOCK_SIZE ( data ) ; int log2_blksz = LOG2_EXT2_BLOCK_SIZE ( data ... | <FIXS> <FIXE> <FIXS> if ( ! buf ) { return - 1 ; } <FIXE> <FIXS> free ( buf ) ; <FIXE> <FIXS> if ( fileblock >= grub_le_to_cpu16 ( ext [ i ] . len ) ) { free ( buf ) ; <FIXE> <FIXS> } else <FIXE> <FIXS> free ( buf ) ; <FIXE> <FIXS> free ( buf ) ; <FIXE> <FIXS> free ( buf ) ; <FIXE> <FIXS> if ( ! indir ) { <FIXE> <FIXS>... |
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 parse_cfg ( int flags , int argc , const char * * argv , cfg_t * cfg ) { <BUGS> <BUGE> int i ; memset ( cfg , 0 , sizeof ( cfg_t ) ) ; cfg -> debug_file = stderr ; for ( i = 0 ; i < argc ; i ++ ) { if ( strncmp ( argv [ i ] , "max_devices=" , 12 ) == 0 ) sscanf ( argv [ i ] , "max_devices=%u" , & cf... | <FIXS> struct stat st ; FILE * file = NULL ; int fd = - 1 ; <FIXE> <FIXS> fd = open ( filename , O_WRONLY | O_APPEND | O_CLOEXEC | O_NOFOLLOW | O_NOCTTY ) ; if ( fd >= 0 && ( fstat ( fd , & st ) == 0 ) && S_ISREG ( st . st_mode ) ) { file = fdopen ( fd , "a" ) ; <FIXE> <FIXS> cfg -> is_custom_debug_file = 1 ; file = NU... |
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 RList * r_bin_wasm_get_global_entries ( RBinWasmObj * bin , RBinWasmSection * sec ) { RList * ret = NULL ; RBinWasmGlobalEntry * ptr = NULL ; <BUGS> int buflen = bin -> buf -> length ; if ( sec -> payload_data + 32 > buflen ) { return NULL ; } <BUGE> if ( ! ( ret = r_list_newf ( ( RListFree ) free ) ) ) ... | <FIXS> <FIXE> <FIXS> int buflen = bin -> buf -> length - ( ut32 ) sec -> payload_data ; <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 fdct16 ( const int16_t in [ 16 ] , int16_t out [ 16 ] ) { int step1 [ 8 ] ; int step2 [ 8 ] ; int step3 [ 8 ] ; int input [ 8 ] ; int temp1 , temp2 ; <BUGE> input [ 0 ] = in [ 0 ] + in [ 15 ] ; input [ 1 ] = in [ 1 ] + in [ 14 ] ; input [ 2 ] = in [ 2 ] + in [ 13 ] ; input [ 3 ] = in [ 3 ] + ... | <FIXS> static void fdct16 ( const tran_low_t in [ 16 ] , tran_low_t out [ 16 ] ) { tran_high_t step1 [ 8 ] ; tran_high_t step2 [ 8 ] ; tran_high_t step3 [ 8 ] ; tran_high_t input [ 8 ] ; tran_high_t temp1 , temp2 ; <FIXE> <FIXS> tran_high_t s0 , s1 , s2 , s3 , s4 , s5 , s6 , s7 ; tran_high_t t0 , t1 , t2 , t3 ; tran_hi... |
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 bpf_check ( struct bpf_prog * * prog , union bpf_attr * attr ) { struct bpf_verifier_env * env ; struct bpf_verifer_log * log ; int ret = - EINVAL ; if ( ARRAY_SIZE ( bpf_verifier_ops ) == 0 ) return - EINVAL ; env = kzalloc ( sizeof ( struct bpf_verifier_env ) , GFP_KERNEL ) ; if ( ! env ) return - ENOMEM ;... | <FIXS> sanitize_dead_code ( env ) ; if ( ret == 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 static gdImagePtr gdImageScaleTwoPass ( const gdImagePtr src , const unsigned int new_width , const unsigned int new_height ) { const unsigned int src_width = src -> sx ; const unsigned int src_height = src -> sy ; gdImagePtr tmp_im = NULL ; gdImagePtr dst = NULL ; if ( src_width == new_width && src_height == n... | <FIXS> gdImageDestroy ( tmp_im ) ; <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 pn_recvmsg ( struct kiocb * iocb , struct sock * sk , struct msghdr * msg , size_t len , int noblock , int flags , int * addr_len ) { struct sk_buff * skb = NULL ; struct sockaddr_pn sa ; int rval = - EOPNOTSUPP ; int copylen ; if ( flags & ~ ( MSG_PEEK | MSG_TRUNC | MSG_DONTWAIT | MSG_NOSIGNAL | MSG... | <FIXS> <FIXE> <FIXS> if ( msg -> msg_name != NULL ) { memcpy ( msg -> msg_name , & sa , sizeof ( sa ) ) ; * addr_len = sizeof ( sa ) ; } <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 sctp_disposition_t sctp_sf_ootb ( struct net * net , const struct sctp_endpoint * ep , const struct sctp_association * asoc , const sctp_subtype_t type , void * arg , sctp_cmd_seq_t * commands ) { struct sctp_chunk * chunk = arg ; struct sk_buff * skb = chunk -> skb ; sctp_chunkhdr_t * ch ; sctp_errhdr_t * err ... | <FIXS> ch_end = ( ( __u8 * ) ch ) + SCTP_PAD4 ( ntohs ( ch -> length ) ) ; if ( ch_end > skb_tail_pointer ( skb ) ) return sctp_sf_violation_chunklen ( net , ep , asoc , type , arg , commands ) ; <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 vpx_codec_err_t ctrl_set_scale_mode ( vpx_codec_alg_priv_t * ctx , <BUGS> int ctr_id , va_list args ) { <BUGE> vpx_scaling_mode_t * const mode = va_arg ( args , vpx_scaling_mode_t * ) ; if ( mode ) { const int res = vp9_set_internal_size ( ctx -> cpi , ( VPX_SCALING ) mode -> h_scaling_mode , ( VPX_SCALI... | <FIXS> va_list args ) { <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 inline int l2cap_config_req ( struct l2cap_conn * conn , struct l2cap_cmd_hdr * cmd , u16 cmd_len , u8 * data ) { struct l2cap_conf_req * req = ( struct l2cap_conf_req * ) data ; u16 dcid , flags ; u8 rsp [ 64 ] ; struct sock * sk ; int len ; dcid = __le16_to_cpu ( req -> dcid ) ; flags = __le16_to_cpu (... | <FIXS> if ( len < 0 ) { struct l2cap_disconn_req req ; req . dcid = cpu_to_le16 ( l2cap_pi ( sk ) -> dcid ) ; req . scid = cpu_to_le16 ( l2cap_pi ( sk ) -> scid ) ; l2cap_send_cmd ( conn , l2cap_get_ident ( conn ) , L2CAP_DISCONN_REQ , sizeof ( req ) , & req ) ; <FIXE> <FIXS> } <FIXE> <FIXS> l2cap_pi ( sk ) -> num_conf... |
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 parse_rock_ridge_inode_internal ( struct iso_directory_record * de , <BUGS> struct inode * inode , int regard_xa ) <BUGE> { int symlink_len = 0 ; int cnt , sig ; <BUGS> <BUGE> struct inode * reloc ; struct rock_ridge * rr ; int rootflag ; struct rock_state rs ; int ret = 0 ; if ( ! ISOFS_SB ( inode ->... | <FIXS> struct inode * inode , int flags ) <FIXE> <FIXS> unsigned int reloc_block ; <FIXE> <FIXS> if ( flags & RR_REGARD_XA ) { <FIXE> <FIXS> if ( flags & RR_RELOC_DE ) { printk ( KERN_ERR "ISOFS: Recursive directory relocation " "is not supported\\n" ) ; goto eio ; } reloc_block = isonum_733 ( rr -> u . CL . location )... |
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 int csnmp_read_table ( host_definition_t * host , data_definition_t * data ) { struct snmp_pdu * req ; struct snmp_pdu * res = NULL ; struct variable_list * vb ; const data_set_t * ds ; size_t oid_list_len = data -> values_len + 1 ; oid_t oid_list [ oid_list_len ] ; _Bool oid_list_todo [ oid_list_len ] ;... | <FIXS> snmp_free_pdu ( req ) ; <FIXE> <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-119 CURLcode Curl_auth_create_plain_message ( struct Curl_easy * data , const char * userp , const char * passwdp , char * * outptr , size_t * outlen ) { CURLcode result ; char * plainauth ; size_t ulen ; size_t plen ; size_t plainlen ; * outlen = 0 ; * outptr = NULL ; ulen = strlen ( userp ) ; plen = strlen ( pass... | <FIXS> if ( ( ulen > SIZE_T_MAX / 4 ) || ( plen > ( SIZE_T_MAX / 2 - 2 ) ) ) <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 PHP_FUNCTION ( radius_get_vendor_attr ) { <BUGS> int res ; const void * data ; <BUGE> int len ; u_int32_t vendor ; <BUGS> if ( zend_parse_parameters ( ZEND_NUM_ARGS ( ) TSRMLS_CC , "s" , & data , & len ) == FAILURE ) { <BUGE> return ; } <BUGS> res = rad_get_vendor_attr ( & vendor , & data , ( size_t * ) & len )... | <FIXS> const void * data , * raw ; <FIXE> <FIXS> unsigned char type ; size_t data_len ; if ( zend_parse_parameters ( ZEND_NUM_ARGS ( ) TSRMLS_CC , "s" , & raw , & len ) == FAILURE ) { <FIXE> <FIXS> if ( rad_get_vendor_attr ( & vendor , & type , & data , & data_len , raw , len ) == - 1 ) { <FIXE> <FIXS> add_assoc_long (... |
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-835 int WavpackSetConfiguration64 ( WavpackContext * wpc , WavpackConfig * config , int64_t total_samples , const unsigned char * chan_ids ) { uint32_t flags , bps = 0 ; uint32_t chan_mask = config -> channel_mask ; int num_chans = config -> num_channels ; int i ; <BUGS> <BUGE> wpc -> stream_version = ( config -> f... | <FIXS> if ( ! config -> sample_rate ) { strcpy ( wpc -> error_message , "sample rate cannot be zero!" ) ; return 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-119 static int cdxl_decode_frame ( AVCodecContext * avctx , void * data , int * got_frame , AVPacket * pkt ) { CDXLVideoContext * c = avctx -> priv_data ; AVFrame * const p = data ; int ret , w , h , encoding , aligned_width , buf_size = pkt -> size ; const uint8_t * buf = pkt -> data ; if ( buf_size < 32 ) return ... | <FIXS> if ( ! encoding && c -> palette_size && c -> bpp <= 8 && c -> format != CHUNKY ) { <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 void httpClientParseQopParam ( const HttpParam * param , HttpWwwAuthenticateHeader * authHeader ) { # if ( HTTP_CLIENT_DIGEST_AUTH_SUPPORT == ENABLED ) size_t i ; size_t n ; authHeader -> qop = HTTP_AUTH_QOP_NONE ; for ( i = 0 ; i < param -> valueLen ; i += ( n + 1 ) ) { for ( n = 0 ; ( i + n ) < param -> valueL... | <FIXS> if ( osStrchr ( ", \\t" , param -> value [ i + n ] ) != NULL ) { <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-787 int sr_do_ioctl ( Scsi_CD * cd , struct packet_command * cgc ) { struct scsi_device * SDev ; struct scsi_sense_hdr sshdr ; int result , err = 0 , retries = 0 ; <BUGS> <BUGE> SDev = cd -> device ; <BUGS> <BUGE> retry : if ( ! scsi_block_when_processing_errors ( SDev ) ) { err = - ENODEV ; goto out ; } result = s... | <FIXS> unsigned char sense_buffer [ SCSI_SENSE_BUFFERSIZE ] , * senseptr = NULL ; <FIXE> <FIXS> if ( cgc -> sense ) senseptr = sense_buffer ; <FIXE> <FIXS> cgc -> buffer , cgc -> buflen , senseptr , & sshdr , <FIXE> <FIXS> if ( cgc -> sense ) memcpy ( cgc -> sense , sense_buffer , sizeof ( * cgc -> sense ) ) ; <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 CLASS parse_jpeg ( int offset ) { int len , save , hlen , mark ; fseek ( ifp , offset , SEEK_SET ) ; if ( fgetc ( ifp ) != 0xff || fgetc ( ifp ) != 0xd8 ) return 0 ; while ( fgetc ( ifp ) == 0xff && ( mark = fgetc ( ifp ) ) != 0xda ) { order = 0x4d4d ; len = get2 ( ) - 2 ; save = ftell ( ifp ) ; if ( mark =... | <FIXS> if ( get4 ( ) == 0x48454150 # ifdef LIBRAW_LIBRARY_BUILD && ( save + hlen ) >= 0 && ( save + hlen ) <= ifp -> size ( ) # endif ) <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 show_stream ( WriterContext * w , AVFormatContext * fmt_ctx , int stream_idx , InputStream * ist , int in_program ) { AVStream * stream = ist -> st ; AVCodecParameters * par ; AVCodecContext * dec_ctx ; char val_str [ 128 ] ; const char * s ; AVRational sar , dar ; AVBPrint pbuf ; const AVCodecDescri... | <FIXS> print_primaries ( w , par -> color_primaries ) ; <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 scm_fp_copy ( struct cmsghdr * cmsg , struct scm_fp_list * * fplp ) { int * fdp = ( int * ) CMSG_DATA ( cmsg ) ; struct scm_fp_list * fpl = * fplp ; struct file * * fpp ; int i , num ; num = ( cmsg -> cmsg_len - CMSG_ALIGN ( sizeof ( struct cmsghdr ) ) ) / sizeof ( int ) ; if ( num <= 0 ) return 0 ; ... | <FIXS> fpl -> user = NULL ; <FIXE> <FIXS> if ( ! fpl -> user ) fpl -> user = get_uid ( current_user ( ) ) ; <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 show_object ( struct object * object , struct strbuf * path , const char * last , void * data ) <BUGE> { struct bitmap * base = data ; bitmap_set ( base , find_object_pos ( object -> oid . hash ) ) ; mark_as_seen ( object ) ; }
| <FIXS> static void show_object ( struct object * object , const char * name , void * data ) <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 search_filter_level ( const YV12_BUFFER_CONFIG * sd , VP9_COMP * cpi , <BUGE> int partial_frame ) { <BUGS> VP9_COMMON * const cm = & cpi -> common ; struct loopfilter * const lf = & cm -> lf ; <BUGE> const int min_filter_level = 0 ; const int max_filter_level = get_max_filter_level ( cpi ) ; ... | <FIXS> static int search_filter_level ( const YV12_BUFFER_CONFIG * sd , VP9_COMP * cpi , <FIXE> <FIXS> const VP9_COMMON * const cm = & cpi -> common ; const struct loopfilter * const lf = & cm -> lf ; <FIXE> <FIXS> int filt_direction = 0 ; int64_t best_err ; <FIXE> <FIXS> <FIXE> <FIXS> int64_t ss_err [ MAX_LOOP_FILTER ... |
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 enum try_read_result try_read_network ( conn * c ) { enum try_read_result gotdata = READ_NO_DATA_RECEIVED ; int res ; <BUGS> <BUGE> assert ( c != NULL ) ; if ( c -> rcurr != c -> rbuf ) { if ( c -> rbytes != 0 ) memmove ( c -> rbuf , c -> rcurr , c -> rbytes ) ; c -> rcurr = c -> rbuf ; } while ( 1 ) { if... | <FIXS> int num_allocs = 0 ; <FIXE> <FIXS> if ( num_allocs == 4 ) { return gotdata ; } ++ num_allocs ; <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 Image * ReadCAPTIONImage ( const ImageInfo * image_info , ExceptionInfo * exception ) { char * caption , geometry [ MaxTextExtent ] , * property , * text ; const char * gravity , * option ; DrawInfo * draw_info ; Image * image ; MagickBooleanType split , status ; register ssize_t i ; size_t height , widt... | <FIXS> ( void ) CloneString ( & draw_info -> geometry , geometry ) ; <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 void fifo_open ( notify_fifo_t * fifo , int ( * script_exit ) ( thread_t * ) , const char * type ) { int ret ; int sav_errno ; if ( fifo -> name ) { sav_errno = 0 ; if ( ! ( ret = mkfifo ( fifo -> name , S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ) ) ) fifo -> created_fifo = true ; else { sav_errno = errno ; i... | <FIXS> if ( ( fifo -> fd = open ( fifo -> name , O_RDWR | O_CLOEXEC | O_NONBLOCK | O_NOFOLLOW ) ) == - 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-129 int snmp_helper ( void * context , size_t hdrlen , unsigned char tag , const void * data , size_t datalen ) { struct snmp_ctx * ctx = ( struct snmp_ctx * ) context ; <BUGS> __be32 * pdata = ( __be32 * ) data ; <BUGE> if ( * pdata == ctx -> from ) { pr_debug ( "%s: %pI4 to %pI4\\n" , __func__ , ( void * ) & ctx ... | <FIXS> __be32 * pdata ; if ( datalen != 4 ) return - EINVAL ; pdata = ( __be32 * ) data ; <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 int mp_unpack_full ( lua_State * L , int limit , int offset ) { size_t len ; const char * s ; mp_cur c ; int cnt ; int decode_all = ( ! limit && ! offset ) ; s = luaL_checklstring ( L , 1 , & len ) ; if ( offset < 0 || limit < 0 ) return luaL_error ( L , "Invalid request to unpack with offset of %d and limit of... | <FIXS> luaL_checkstack ( L , 1 , "in function mp_unpack_full" ) ; <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 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-835 int WavpackSetConfiguration64 ( WavpackContext * wpc , WavpackConfig * config , int64_t total_samples , const unsigned char * chan_ids ) { uint32_t flags , bps = 0 ; uint32_t chan_mask = config -> channel_mask ; int num_chans = config -> num_channels ; int i ; <BUGS> <BUGE> wpc -> stream_version = ( config -> f... | <FIXS> if ( ! config -> sample_rate ) { strcpy ( wpc -> error_message , "sample rate cannot be zero!" ) ; return 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-125 static stmt_ty ast_for_funcdef ( struct compiling * c , const node * n , asdl_seq * decorator_seq ) { return ast_for_funcdef_impl ( c , n , decorator_seq , <BUGS> 0 ) ; <BUGE> }
| <FIXS> 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-119 static void scsi_write_complete ( void * opaque , int ret ) { SCSIDiskReq * r = ( SCSIDiskReq * ) opaque ; SCSIDiskState * s = DO_UPCAST ( SCSIDiskState , qdev , r -> req . dev ) ; <BUGS> uint32_t len ; <BUGE> uint32_t n ; if ( r -> req . aiocb != NULL ) { r -> req . aiocb = NULL ; bdrv_acct_done ( s -> bs , & ... | <FIXS> <FIXE> <FIXS> n = r -> qiov . size / 512 ; <FIXE> <FIXS> scsi_init_iovec ( r ) ; DPRINTF ( "Write complete tag=0x%x more=%d\\n" , r -> req . tag , r -> qiov . size ) ; scsi_req_data ( & r -> req , r -> qiov . 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 <BUGS> static MagickPixelPacket * * AcquirePixelThreadSet ( const Image * image ) <BUGE> { <BUGS> <BUGE> MagickPixelPacket * * pixels ; register ssize_t i , j ; size_t <BUGS> <BUGE> number_threads ; number_threads = ( size_t ) GetMagickResourceLimit ( ThreadResource ) ; pixels = ( MagickPixelPacket * * ) Acquir... | <FIXS> static MagickPixelPacket * * AcquirePixelThreadSet ( const Image * images ) <FIXE> <FIXS> const Image * next ; <FIXE> <FIXS> columns , <FIXE> <FIXS> columns = images -> columns ; for ( next = images ; next != ( Image * ) NULL ; next = next -> next ) columns = MagickMax ( next -> columns , columns ) ; <FIXE> <FIX... |
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 vp8_create_common ( VP8_COMMON * oci ) { vp8_machine_specific_config ( oci ) ; vp8_init_mbmode_probs ( oci ) ; vp8_default_bmode_probs ( oci -> fc . bmode_prob ) ; oci -> mb_no_coeff_skip = 1 ; oci -> no_lpf = 0 ; oci -> filter_type = NORMAL_LOOPFILTER ; oci -> use_bilinear_mc_filter = 0 ; oci -> full_pixe... | <FIXS> memset ( oci -> ref_frame_sign_bias , 0 , sizeof ( oci -> ref_frame_sign_bias ) ) ; <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 icmp_print ( netdissect_options * ndo , const u_char * bp , u_int plen , const u_char * bp2 , int fragmented ) { char * cp ; const struct icmp * dp ; const struct icmp_ext_t * ext_dp ; const struct ip * ip ; const char * str , * fmt ; const struct ip * oip ; const struct udphdr * ouh ; const uint8_t * obj_... | <FIXS> if ( ! ext_dp -> icmp_length && ND_TTEST2 ( ext_dp -> icmp_ext_version_res , plen - ICMP_EXTD_MINLEN ) ) { <FIXE> <FIXS> if ( ND_TTEST2 ( ext_dp -> icmp_ext_version_res , hlen ) ) { <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 <BUGS> static void encode_mv_component ( vp9_writer * w , int comp , <BUGE> const nmv_component * mvcomp , int usehp ) { int offset ; const int sign = comp < 0 ; const int mag = sign ? - comp : comp ; const int mv_class = vp9_get_mv_class ( mag - 1 , & offset ) ; const int d = offset >> 3 ; const int fr = ( off... | <FIXS> static void encode_mv_component ( vpx_writer * w , int comp , <FIXE> <FIXS> vpx_write ( w , sign , mvcomp -> sign ) ; <FIXE> <FIXS> vpx_write ( w , ( d >> i ) & 1 , mvcomp -> bits [ i ] ) ; <FIXE> <FIXS> vpx_write ( w , hp , <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 unsigned int seedsize ( struct crypto_alg * alg ) { struct rng_alg * ralg = container_of ( alg , struct rng_alg , base ) ; <BUGS> return alg -> cra_rng . rng_make_random ? alg -> cra_rng . seedsize : ralg -> seedsize ; <BUGE> }
| <FIXS> return ralg -> seedsize ; <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 pptp_connect ( struct socket * sock , struct sockaddr * uservaddr , int sockaddr_len , int flags ) { struct sock * sk = sock -> sk ; struct sockaddr_pppox * sp = ( struct sockaddr_pppox * ) uservaddr ; struct pppox_sock * po = pppox_sk ( sk ) ; struct pptp_opt * opt = & po -> proto . pptp ; struct rt... | <FIXS> if ( sockaddr_len < sizeof ( struct sockaddr_pppox ) ) 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-189 void jiffies_to_timespec ( const unsigned long jiffies , struct timespec * value ) { <BUGS> u64 nsec = ( u64 ) jiffies * TICK_NSEC ; value -> tv_sec = div_long_long_rem ( nsec , NSEC_PER_SEC , & value -> tv_nsec ) ; <BUGE> }
| <FIXS> u32 rem ; value -> tv_sec = div_u64_rem ( ( u64 ) jiffies * TICK_NSEC , NSEC_PER_SEC , & rem ) ; value -> tv_nsec = rem ; <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 error_t coapClientSetRxBlockSize ( CoapClientRequest * request , uint_t blockSize ) { if ( request == NULL ) return ERROR_INVALID_PARAMETER ; osAcquireMutex ( & request -> context -> mutex ) ; if ( blockSize == 16 ) <BUGS> <BUGE> request -> rxBlockSzx = COAP_BLOCK_SIZE_16 ; <BUGS> <BUGE> else if ( blockSize == 3... | <FIXS> { <FIXE> <FIXS> } <FIXE> <FIXS> { <FIXE> <FIXS> } <FIXE> <FIXS> { <FIXE> <FIXS> } <FIXE> <FIXS> { <FIXE> <FIXS> } <FIXE> <FIXS> { <FIXE> <FIXS> } <FIXE> <FIXS> { <FIXE> <FIXS> } <FIXE> <FIXS> { <FIXE> <FIXS> } <FIXE> <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 int main ( int argc , char * * argv ) { int fmtid ; int id ; char * infile ; jas_stream_t * instream ; jas_image_t * image ; int width ; int height ; int depth ; int numcmpts ; int verbose ; char * fmtname ; <BUGS> <BUGE> if ( jas_init ( ) ) { abort ( ) ; } cmdname = argv [ 0 ] ; infile = 0 ; verbose = 0 ; <BUG... | <FIXS> int debug ; <FIXE> <FIXS> debug = 0 ; <FIXE> <FIXS> break ; case OPT_DEBUG : debug = atoi ( jas_optarg ) ; <FIXE> <FIXS> jas_setdbglevel ( debug ) ; <FIXE> <FIXS> jas_stream_close ( instream ) ; <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 void enc624j600UpdateMacConfig ( NetInterface * interface ) { uint16_t duplexMode ; <BUGS> duplexMode = enc624j600ReadReg ( interface , ENC624J600_REG_ESTAT ) & ESTAT_PHYDPX ; <BUGE> if ( duplexMode ) { <BUGS> enc624j600WriteReg ( interface , ENC624J600_REG_MACON2 , MACON2_DEFER | MACON2_PADCFG2 | MACON2_PADCFG0... | <FIXS> duplexMode = enc624j600ReadReg ( interface , ENC624J600_ESTAT ) & ENC624J600_ESTAT_PHYDPX ; <FIXE> <FIXS> enc624j600WriteReg ( interface , ENC624J600_MACON2 , ENC624J600_MACON2_DEFER | ENC624J600_MACON2_PADCFG_AUTO | ENC624J600_MACON2_TXCRCEN | ENC624J600_MACON2_R1_DEFAULT | ENC624J600_MACON2_FULDPX ) ; enc624j6... |
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 GF_Err adts_dmx_process ( GF_Filter * filter ) { GF_ADTSDmxCtx * ctx = gf_filter_get_udta ( filter ) ; GF_FilterPacket * pck , * dst_pck ; u8 * data , * output ; u8 * start ; u32 pck_size , remain , prev_pck_size ; u64 cts = GF_FILTER_NO_TS ; if ( ! ctx -> duration . num ) adts_dmx_check_dur ( filter , ctx ) ; ... | <FIXS> if ( ctx -> hdr . frame_size < ctx -> hdr . hdr_size ) { GF_LOG ( GF_LOG_WARNING , GF_LOG_PARSER , ( "[ADTSDmx] Corrupted ADTS frame header, resyncing\\n" ) ) ; ctx -> nb_frames = 0 ; goto drop_byte ; } <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 vp9_rc_update_rate_correction_factors ( VP9_COMP * cpi , int damp_var ) { <BUGE> const VP9_COMMON * const cm = & cpi -> common ; int correction_factor = 100 ; double rate_correction_factor = get_rate_correction_factor ( cpi ) ; double adjustment_limit ; int projected_size_based_on_q = 0 ; <BUGS> vp9... | <FIXS> void vp9_rc_update_rate_correction_factors ( VP9_COMP * cpi ) { <FIXE> <FIXS> if ( cpi -> rc . is_src_frame_alt_ref ) return ; vpx_clear_system_state ( ) ; if ( cpi -> oxcf . aq_mode == CYCLIC_REFRESH_AQ && cpi -> common . seg . enabled ) { projected_size_based_on_q = vp9_cyclic_refresh_estimate_bits_at_q ( cpi ... |
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-79 void interprete ( char * lbook , char * path ) { int status , i , j , n , message_id , inactive ; char list [ 1000 ] , section [ 256 ] , str [ NAME_LENGTH ] , str1 [ NAME_LENGTH ] , str2 [ NAME_LENGTH ] , edit_id [ 80 ] , file_name [ 256 ] , command [ 256 ] , enc_path [ 256 ] , dec_path [ 256 ] , uname [ 80 ] , ... | <FIXS> if ( isparam ( "value" ) && * getparam ( "value" ) ) { strencode2 ( str , getparam ( "value" ) , sizeof ( str ) ) ; rsputs ( loc ( str ) ) ; } <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 header_gets ( SF_PRIVATE * psf , char * ptr , int bufsize ) { int k ; <BUGS> <BUGE> for ( k = 0 ; k < bufsize - 1 ; k ++ ) <BUGS> { if ( psf -> headindex < psf -> headend ) { ptr [ k ] = psf -> header [ psf -> headindex ] ; psf -> headindex ++ ; <BUGE> } else <BUGS> { psf -> headend += psf_fread ( ps... | <FIXS> if ( psf -> header . indx + bufsize >= psf -> header . len && psf_bump_header_allocation ( psf , bufsize ) ) return 0 ; <FIXE> <FIXS> { if ( psf -> header . indx < psf -> header . end ) { ptr [ k ] = psf -> header . ptr [ psf -> header . indx ] ; psf -> header . indx ++ ; <FIXE> <FIXS> { psf -> header . end += p... |
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-78 static int compile_search ( struct Context * ctx , const struct Pattern * pat , struct Buffer * buf ) { if ( do_search ( pat , 0 ) == 0 ) return 0 ; if ( pat -> not ) mutt_buffer_addstr ( buf , "NOT " ) ; if ( pat -> child ) { int clauses ; clauses = do_search ( pat -> child , 1 ) ; if ( clauses > 0 ) { const st... | <FIXS> imap_quote_string ( term , sizeof ( term ) , pat -> p . str , false ) ; <FIXE> <FIXS> imap_quote_string ( term , sizeof ( term ) , delim , false ) ; <FIXE> <FIXS> imap_quote_string ( term , sizeof ( term ) , pat -> p . str , false ) ; <FIXE> <FIXS> imap_quote_string ( term , sizeof ( term ) , pat -> p . str , fa... |
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 asmlinkage void bad_mode ( struct pt_regs * regs , int reason , unsigned int esr ) <BUGS> { <BUGE> console_verbose ( ) ; pr_crit ( "Bad mode in %s handler detected, code 0x%08x\\n" , handler [ reason ] , esr ) ; <BUGS> die ( "Oops - bad mode" , regs , 0 ) ; <BUGE> local_irq_disable ( ) ; panic ( "bad mode" ) ; ... | <FIXS> { siginfo_t info ; void __user * pc = ( void __user * ) instruction_pointer ( regs ) ; <FIXE> <FIXS> die __show_regs ( regs ) ; info . si_signo = SIGILL ; info . si_errno = 0 ; info . si_code = ILL_ILLOPC ; info . si_addr = pc ; arm64_notify_die ( "Oops - bad mode" , 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-190 <BUGS> int jas_matrix_resize ( jas_matrix_t * matrix , int numrows , int numcols ) <BUGE> { <BUGS> int size ; int i ; <BUGE> size = numrows * numcols ; if ( size > matrix -> datasize_ || numrows > matrix -> maxrows_ ) { return - 1 ; } matrix -> numrows_ = numrows ; matrix -> numcols_ = numcols ; for ( i = 0 ; i... | <FIXS> int jas_matrix_resize ( jas_matrix_t * matrix , jas_matind_t numrows , jas_matind_t numcols ) <FIXE> <FIXS> jas_matind_t size ; jas_matind_t i ; <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 res_inverse ( vorbis_dsp_state * vd , vorbis_info_residue * info , ogg_int32_t * * in , int * nonzero , int ch ) { int i , j , k , s , used = 0 ; codec_setup_info * ci = ( codec_setup_info * ) vd -> vi -> codec_setup ; codebook * phrasebook = ci -> book_param + info -> groupbook ; int samples_per_partition =... | <FIXS> int idx = ( int ) partword [ j ] [ i ] ; if ( idx < info -> partitions && info -> stagemasks [ idx ] & ( 1 << s ) ) { <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-552 ssize_t oe_recvfrom ( int sockfd , void * buf , size_t len , int flags , <BUGS> const struct oe_sockaddr * src_addr , <BUGE> oe_socklen_t * addrlen ) { ssize_t ret = - 1 ; oe_fd_t * sock ; if ( ! ( sock = oe_fdtable_get ( sockfd , OE_FD_TYPE_SOCKET ) ) ) OE_RAISE_ERRNO ( oe_errno ) ; ret = sock -> ops . socket ... | <FIXS> struct oe_sockaddr * src_addr , <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 l2tp_ppp_discon_cc_print ( netdissect_options * ndo , const u_char * dat , u_int length ) { const uint16_t * ptr = ( const uint16_t * ) dat ; <BUGS> ND_PRINT ( ( ndo , "%04x, " , EXTRACT_16BITS ( ptr ) ) ) ; ptr ++ ; ND_PRINT ( ( ndo , "%04x " , EXTRACT_16BITS ( ptr ) ) ) ; ptr ++ ; <BUGE> ND_PRINT ... | <FIXS> if ( length < 5 ) { ND_PRINT ( ( ndo , "AVP too short" ) ) ; return ; } ND_PRINT ( ( ndo , "%04x, " , EXTRACT_16BITS ( dat ) ) ) ; dat += 2 ; length -= 2 ; ND_PRINT ( ( ndo , "%04x " , EXTRACT_16BITS ( dat ) ) ) ; dat += 2 ; length -= 2 ; <FIXE> <FIXS> "Direction-#%u" , EXTRACT_8BITS ( ptr ) ) ) ) ; ptr ++ ; len... |
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_cee_fill ( struct sk_buff * skb , struct net_device * netdev ) { struct nlattr * cee , * app ; struct dcb_app_type * itr ; const struct dcbnl_rtnl_ops * ops = netdev -> dcbnl_ops ; int dcbx , i , err = - EMSGSIZE ; u8 value ; if ( nla_put_string ( skb , DCB_ATTR_IFNAME , netdev -> name ) ) goto... | <FIXS> memset ( & pg , 0 , sizeof ( pg ) ) ; <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-119 static int complete_emulated_mmio ( struct kvm_vcpu * vcpu ) { struct kvm_run * run = vcpu -> run ; struct kvm_mmio_fragment * frag ; unsigned len ; BUG_ON ( ! vcpu -> mmio_needed ) ; frag = & vcpu -> mmio_fragments [ vcpu -> mmio_cur_fragment ] ; len = min ( 8u , frag -> len ) ; if ( ! vcpu -> mmio_is_write ) ... | <FIXS> if ( vcpu -> mmio_cur_fragment >= vcpu -> mmio_nr_fragments ) { <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-674 static krb5_error_code split_der ( asn1buf * buf , uint8_t * const * der , size_t len , taginfo * tag_out ) { krb5_error_code ret ; const uint8_t * contents , * remainder ; size_t clen , rlen ; <BUGS> ret = get_tag ( * der , len , tag_out , & contents , & clen , & remainder , & rlen ) ; <BUGE> if ( ret ) return... | <FIXS> ret = get_tag ( * der , len , tag_out , & contents , & clen , & remainder , & rlen , 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 int uas_switch_interface ( struct usb_device * udev , struct usb_interface * intf ) { <BUGS> int alt ; <BUGE> alt = uas_find_uas_alt_setting ( intf ) ; <BUGS> if ( alt < 0 ) return alt ; return usb_set_interface ( udev , intf -> altsetting [ 0 ] . desc . bInterfaceNumber , alt ) ; <BUGE> }
| <FIXS> struct usb_host_interface * alt ; <FIXE> <FIXS> if ( ! alt ) return - ENODEV ; return usb_set_interface ( udev , alt -> desc . bInterfaceNumber , alt -> desc . bAlternateSetting ) ; <FIXE>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.