Dataset Viewer
Auto-converted to Parquet Duplicate
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>
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
3