instruction
stringclasses
1 value
input
stringlengths
31
235k
output
class label
2 classes
Categorize the following code snippet as vulnerable or not. True or False
int TSCacheHttpInfoVector ( TSCacheHttpInfo infop , void * data , int length ) { CacheHTTPInfo * info = ( CacheHTTPInfo * ) infop ; CacheHTTPInfoVector vector ; vector . insert ( info ) ; int size = vector . marshal_length ( ) ; if ( size > length ) { return 0 ; } return vector . marshal ( ( char * ) data , length ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
IN_PROC_BROWSER_TEST_F ( ChooserDialogViewTest , Cancel ) { EXPECT_CALL ( * mock_chooser_controller_ , Cancel ( ) ) . Times ( 1 ) ; chooser_dialog_view_ -> Cancel ( ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int bfi_decode_frame ( AVCodecContext * avctx , void * data , int * got_frame , AVPacket * avpkt ) { GetByteContext g ; int buf_size = avpkt -> size ; BFIContext * bfi = avctx -> priv_data ; uint8_t * dst = bfi -> dst ; uint8_t * src , * dst_offset , colour1 , colour2 ; uint8_t * frame_end = bfi -> dst + avctx -> width * avctx -> height ; uint32_t * pal ; int i , j , ret , height = avctx -> height ; if ( bfi -> frame . data [ 0 ] ) avctx -> release_buffer ( avctx , & bfi -> frame ) ; bfi -> frame . reference = 1 ; if ( ( ret = ff_get_buffer ( avctx , & bfi -> frame ) ) < 0 ) { av_log ( avctx , AV_LOG_ERROR , "get_buffer() failed\n" ) ; return ret ; } bytestream2_init ( & g , avpkt -> data , buf_size ) ; if ( ! avctx -> frame_number ) { bfi -> frame . pict_type = AV_PICTURE_TYPE_I ; bfi -> frame . key_frame = 1 ; if ( avctx -> extradata_size > 768 ) { av_log ( NULL , AV_LOG_ERROR , "Palette is too large.\n" ) ; return AVERROR_INVALIDDATA ; } pal = ( uint32_t * ) bfi -> frame . data [ 1 ] ; for ( i = 0 ; i < avctx -> extradata_size / 3 ; i ++ ) { int shift = 16 ; * pal = 0 ; for ( j = 0 ; j < 3 ; j ++ , shift -= 8 ) * pal += ( ( avctx -> extradata [ i * 3 + j ] << 2 ) | ( avctx -> extradata [ i * 3 + j ] >> 4 ) ) << shift ; pal ++ ; } bfi -> frame . palette_has_changed = 1 ; } else { bfi -> frame . pict_type = AV_PICTURE_TYPE_P ; bfi -> frame . key_frame = 0 ; } bytestream2_skip ( & g , 4 ) ; while ( dst != frame_end ) { static const uint8_t lentab [ 4 ] = { 0 , 2 , 0 , 1 } ; unsigned int byte = bytestream2_get_byte ( & g ) , av_uninit ( offset ) ; unsigned int code = byte >> 6 ; unsigned int length = byte & ~ 0xC0 ; if ( ! bytestream2_get_bytes_left ( & g ) ) { av_log ( avctx , AV_LOG_ERROR , "Input resolution larger than actual frame.\n" ) ; return AVERROR_INVALIDDATA ; } if ( length == 0 ) { if ( code == 1 ) { length = bytestream2_get_byte ( & g ) ; offset = bytestream2_get_le16 ( & g ) ; } else { length = bytestream2_get_le16 ( & g ) ; if ( code == 2 && length == 0 ) break ; } } else { if ( code == 1 ) offset = bytestream2_get_byte ( & g ) ; } if ( dst + ( length << lentab [ code ] ) > frame_end ) break ; switch ( code ) { case 0 : if ( length >= bytestream2_get_bytes_left ( & g ) ) { av_log ( avctx , AV_LOG_ERROR , "Frame larger than buffer.\n" ) ; return AVERROR_INVALIDDATA ; } bytestream2_get_buffer ( & g , dst , length ) ; dst += length ; break ; case 1 : dst_offset = dst - offset ; length *= 4 ; if ( dst_offset < bfi -> dst ) break ; while ( length -- ) * dst ++ = * dst_offset ++ ; break ; case 2 : dst += length ; break ; case 3 : colour1 = bytestream2_get_byte ( & g ) ; colour2 = bytestream2_get_byte ( & g ) ; while ( length -- ) { * dst ++ = colour1 ; * dst ++ = colour2 ; } break ; } } src = bfi -> dst ; dst = bfi -> frame . data [ 0 ] ; while ( height -- ) { memcpy ( dst , src , avctx -> width ) ; src += avctx -> width ; dst += bfi -> frame . linesize [ 0 ] ; } * got_frame = 1 ; * ( AVFrame * ) data = bfi -> frame ; return buf_size ; }
1True
Categorize the following code snippet as vulnerable or not. True or False
gcry_error_t gcry_pk_testkey ( gcry_sexp_t s_key ) { gcry_module_t module = NULL ; gcry_mpi_t * key = NULL ; gcry_err_code_t rc ; REGISTER_DEFAULT_PUBKEYS ; rc = sexp_to_key ( s_key , 1 , 0 , NULL , & key , & module , NULL ) ; if ( ! rc ) { rc = pubkey_check_secret_key ( module -> mod_id , key ) ; release_mpi_array ( key ) ; gcry_free ( key ) ; } return gcry_error ( rc ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static tmsize_t _tiffReadProc ( thandle_t fd , void * buf , tmsize_t size ) { fd_as_handle_union_t fdh ; const size_t bytes_total = ( size_t ) size ; size_t bytes_read ; tmsize_t count = - 1 ; if ( ( tmsize_t ) bytes_total != size ) { errno = EINVAL ; return ( tmsize_t ) - 1 ; } fdh . h = fd ; for ( bytes_read = 0 ; bytes_read < bytes_total ; bytes_read += count ) { char * buf_offset = ( char * ) buf + bytes_read ; size_t io_size = bytes_total - bytes_read ; if ( io_size > TIFF_IO_MAX ) io_size = TIFF_IO_MAX ; count = read ( fdh . fd , buf_offset , ( TIFFIOSize_t ) io_size ) ; if ( count <= 0 ) break ; } if ( count < 0 ) return ( tmsize_t ) - 1 ; return ( tmsize_t ) bytes_read ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_h225_NonStandardIdentifier ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) { # line 771 "./asn1/h225/h225.cnf" gint32 value ; nsiOID = "" ; h221NonStandard = 0 ; offset = dissect_per_choice ( tvb , offset , actx , tree , hf_index , ett_h225_NonStandardIdentifier , NonStandardIdentifier_choice , & value ) ; switch ( value ) { case 0 : nsp_handle = dissector_get_string_handle ( nsp_object_dissector_table , nsiOID ) ; break ; case 1 : nsp_handle = dissector_get_uint_handle ( nsp_h221_dissector_table , h221NonStandard ) ; break ; default : nsp_handle = NULL ; } return offset ; }
1True
Categorize the following code snippet as vulnerable or not. True or False
static int execstack2_continue ( i_ctx_t * i_ctx_p ) { os_ptr op = osp ; return do_execstack ( i_ctx_p , op -> value . boolval , op - 1 ) ; }
1True
Categorize the following code snippet as vulnerable or not. True or False
static int read_rgb24_component_line ( CLLCContext * ctx , GetBitContext * gb , int * top_left , VLC * vlc , uint8_t * outbuf ) { uint8_t * dst ; int pred , code ; int i ; OPEN_READER ( bits , gb ) ; dst = outbuf ; pred = * top_left ; for ( i = 0 ; i < ctx -> avctx -> width ; i ++ ) { UPDATE_CACHE ( bits , gb ) ; GET_VLC ( code , bits , gb , vlc -> table , 7 , 2 ) ; pred += code ; dst [ 0 ] = pred ; dst += 3 ; } CLOSE_READER ( bits , gb ) ; * top_left = dst [ - 3 * ctx -> avctx -> width ] ; return 0 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void test_select_show ( ) { MYSQL_STMT * stmt ; int rc ; char query [ MAX_TEST_QUERY_LENGTH ] ; myheader ( "test_select_show" ) ; mysql_autocommit ( mysql , TRUE ) ; rc = mysql_query ( mysql , "DROP TABLE IF EXISTS test_show" ) ; myquery ( rc ) ; rc = mysql_query ( mysql , "CREATE TABLE test_show(id int(4) NOT NULL primary " " key, name char(2))" ) ; myquery ( rc ) ; stmt = mysql_simple_prepare ( mysql , "show columns from test_show" ) ; check_stmt ( stmt ) ; verify_param_count ( stmt , 0 ) ; rc = mysql_stmt_execute ( stmt ) ; check_execute ( stmt , rc ) ; my_process_stmt_result ( stmt ) ; mysql_stmt_close ( stmt ) ; stmt = mysql_simple_prepare ( mysql , "show tables from mysql like ?" ) ; check_stmt_r ( stmt ) ; strxmov ( query , "show tables from " , current_db , " like \'test_show\'" , NullS ) ; stmt = mysql_simple_prepare ( mysql , query ) ; check_stmt ( stmt ) ; rc = mysql_stmt_execute ( stmt ) ; check_execute ( stmt , rc ) ; my_process_stmt_result ( stmt ) ; mysql_stmt_close ( stmt ) ; stmt = mysql_simple_prepare ( mysql , "describe test_show" ) ; check_stmt ( stmt ) ; rc = mysql_stmt_execute ( stmt ) ; check_execute ( stmt , rc ) ; my_process_stmt_result ( stmt ) ; mysql_stmt_close ( stmt ) ; stmt = mysql_simple_prepare ( mysql , "show keys from test_show" ) ; check_stmt ( stmt ) ; rc = mysql_stmt_execute ( stmt ) ; check_execute ( stmt , rc ) ; rc = my_process_stmt_result ( stmt ) ; DIE_UNLESS ( rc == 1 ) ; mysql_stmt_close ( stmt ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void interpolate_lsf ( float lsf_q [ 4 ] [ LP_FILTER_ORDER ] , float * lsf_new ) { int i ; for ( i = 0 ; i < 4 ; i ++ ) ff_weighted_vector_sumf ( lsf_q [ i ] , lsf_q [ 3 ] , lsf_new , 0.25 * ( 3 - i ) , 0.25 * ( i + 1 ) , LP_FILTER_ORDER ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void dissect_zcl_part_trasfpartframe ( tvbuff_t * tvb , proto_tree * tree , guint * offset ) { guint8 options ; guint16 u16len ; guint8 frame_len ; static const int * part_opt [ ] = { & hf_zbee_zcl_part_opt_first_block , & hf_zbee_zcl_part_opt_indic_len , & hf_zbee_zcl_part_opt_res , NULL } ; options = tvb_get_guint8 ( tvb , * offset ) ; proto_tree_add_bitmask ( tree , tvb , * offset , hf_zbee_zcl_part_opt , ett_zbee_zcl_part_fragm_options , part_opt , ENC_NA ) ; * offset += 1 ; if ( ( options & ZBEE_ZCL_PART_OPT_INDIC_LEN ) == 0 ) { u16len = ( guint16 ) tvb_get_guint8 ( tvb , * offset ) ; proto_tree_add_item ( tree , hf_zbee_zcl_part_part_indicator , tvb , * offset , 1 , ( u16len & 0xFF ) ) ; * offset += 1 ; } else { u16len = tvb_get_letohs ( tvb , * offset ) ; proto_tree_add_item ( tree , hf_zbee_zcl_part_part_indicator , tvb , * offset , 2 , u16len ) ; * offset += 2 ; } frame_len = tvb_get_guint8 ( tvb , * offset ) ; if ( frame_len == ZBEE_ZCL_INVALID_STR_LENGTH ) frame_len = 0 ; proto_tree_add_item ( tree , hf_zbee_zcl_part_part_frame_len , tvb , * offset , 1 , ENC_NA ) ; * offset += 1 ; proto_tree_add_item ( tree , hf_zbee_zcl_part_part_frame , tvb , * offset , frame_len , ENC_NA ) ; * offset += frame_len ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
PGconn * GetConnection ( void ) { PGconn * tmpconn ; int argcount = 7 ; int i ; const char * * keywords ; const char * * values ; const char * tmpparam ; bool need_password ; PQconninfoOption * conn_opts = NULL ; PQconninfoOption * conn_opt ; char * err_msg = NULL ; Assert ( dbname == NULL || connection_string == NULL ) ; i = 0 ; if ( connection_string ) { conn_opts = PQconninfoParse ( connection_string , & err_msg ) ; if ( conn_opts == NULL ) { fprintf ( stderr , "%s: %s" , progname , err_msg ) ; exit ( 1 ) ; } for ( conn_opt = conn_opts ; conn_opt -> keyword != NULL ; conn_opt ++ ) { if ( conn_opt -> val != NULL && conn_opt -> val [ 0 ] != '\0' && strcmp ( conn_opt -> keyword , "dbname" ) != 0 ) argcount ++ ; } keywords = pg_malloc0 ( ( argcount + 1 ) * sizeof ( * keywords ) ) ; values = pg_malloc0 ( ( argcount + 1 ) * sizeof ( * values ) ) ; for ( conn_opt = conn_opts ; conn_opt -> keyword != NULL ; conn_opt ++ ) { if ( conn_opt -> val != NULL && conn_opt -> val [ 0 ] != '\0' && strcmp ( conn_opt -> keyword , "dbname" ) != 0 ) { keywords [ i ] = conn_opt -> keyword ; values [ i ] = conn_opt -> val ; i ++ ; } } } else { keywords = pg_malloc0 ( ( argcount + 1 ) * sizeof ( * keywords ) ) ; values = pg_malloc0 ( ( argcount + 1 ) * sizeof ( * values ) ) ; } keywords [ i ] = "dbname" ; values [ i ] = dbname == NULL ? "replication" : dbname ; i ++ ; keywords [ i ] = "replication" ; values [ i ] = dbname == NULL ? "true" : "database" ; i ++ ; keywords [ i ] = "fallback_application_name" ; values [ i ] = progname ; i ++ ; if ( dbhost ) { keywords [ i ] = "host" ; values [ i ] = dbhost ; i ++ ; } if ( dbuser ) { keywords [ i ] = "user" ; values [ i ] = dbuser ; i ++ ; } if ( dbport ) { keywords [ i ] = "port" ; values [ i ] = dbport ; i ++ ; } need_password = ( dbgetpassword == 1 && dbpassword == NULL ) ; do { if ( need_password ) { if ( dbpassword ) free ( dbpassword ) ; dbpassword = simple_prompt ( _ ( "Password: " ) , 100 , false ) ; need_password = false ; } if ( dbpassword ) { keywords [ i ] = "password" ; values [ i ] = dbpassword ; } else { keywords [ i ] = NULL ; values [ i ] = NULL ; } tmpconn = PQconnectdbParams ( keywords , values , true ) ; if ( ! tmpconn ) { fprintf ( stderr , _ ( "%s: could not connect to server\n" ) , progname ) ; exit ( 1 ) ; } if ( PQstatus ( tmpconn ) == CONNECTION_BAD && PQconnectionNeedsPassword ( tmpconn ) && dbgetpassword != - 1 ) { PQfinish ( tmpconn ) ; need_password = true ; } } while ( need_password ) ; if ( PQstatus ( tmpconn ) != CONNECTION_OK ) { fprintf ( stderr , _ ( "%s: could not connect to server: %s" ) , progname , PQerrorMessage ( tmpconn ) ) ; PQfinish ( tmpconn ) ; free ( values ) ; free ( keywords ) ; if ( conn_opts ) PQconninfoFree ( conn_opts ) ; return NULL ; } free ( values ) ; free ( keywords ) ; if ( conn_opts ) PQconninfoFree ( conn_opts ) ; tmpparam = PQparameterStatus ( tmpconn , "integer_datetimes" ) ; if ( ! tmpparam ) { fprintf ( stderr , _ ( "%s: could not determine server setting for integer_datetimes\n" ) , progname ) ; PQfinish ( tmpconn ) ; exit ( 1 ) ; } # ifdef HAVE_INT64_TIMESTAMP if ( strcmp ( tmpparam , "on" ) != 0 ) # else if ( strcmp ( tmpparam , "off" ) != 0 ) # endif { fprintf ( stderr , _ ( "%s: integer_datetimes compile flag does not match server\n" ) , progname ) ; PQfinish ( tmpconn ) ; exit ( 1 ) ; } return tmpconn ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void file_list_cancel ( NautilusDirectory * directory ) { directory_load_cancel ( directory ) ; if ( directory -> details -> dequeue_pending_idle_id != 0 ) { g_source_remove ( directory -> details -> dequeue_pending_idle_id ) ; directory -> details -> dequeue_pending_idle_id = 0 ; } if ( directory -> details -> pending_file_info != NULL ) { g_list_free_full ( directory -> details -> pending_file_info , g_object_unref ) ; directory -> details -> pending_file_info = NULL ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
TSReturnCode TSTextLogObjectDestroy ( TSTextLogObject the_object ) { sdk_assert ( sdk_sanity_check_iocore_structure ( the_object ) == TS_SUCCESS ) ; if ( Log : : config -> log_object_manager . unmanage_api_object ( ( TextLogObject * ) the_object ) ) { return TS_SUCCESS ; } return TS_ERROR ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void fast_cmyk_to_bgr ( fz_context * ctx , fz_pixmap * dst , fz_pixmap * src , fz_colorspace * prf , const fz_default_colorspaces * default_cs , const fz_color_params * color_params , int copy_spots ) { unsigned char * s = src -> samples ; unsigned char * d = dst -> samples ; size_t w = src -> w ; int h = src -> h ; int sn = src -> n ; int ss = src -> s ; int sa = src -> alpha ; int dn = dst -> n ; int ds = dst -> s ; int da = dst -> alpha ; ptrdiff_t d_line_inc = dst -> stride - w * dn ; ptrdiff_t s_line_inc = src -> stride - w * sn ; unsigned int C , M , Y , K ; unsigned char r , g , b ; if ( ( copy_spots && ss != ds ) || ( ! da && sa ) ) { assert ( "This should never happen" == NULL ) ; fz_throw ( ctx , FZ_ERROR_GENERIC , "Cannot convert between incompatible pixmaps" ) ; } if ( ( int ) w < 0 || h < 0 ) return ; C = 0 ; M = 0 ; Y = 0 ; K = 0 ; r = 255 ; g = 255 ; b = 255 ; if ( d_line_inc == 0 && s_line_inc == 0 ) { w *= h ; h = 1 ; } if ( ss == 0 && ds == 0 ) { if ( da ) { if ( sa ) { while ( h -- ) { size_t ww = w ; while ( ww -- ) { cached_cmyk_conv ( & r , & g , & b , & C , & M , & Y , & K , s [ 0 ] , s [ 1 ] , s [ 2 ] , s [ 3 ] ) ; d [ 0 ] = b ; d [ 1 ] = g ; d [ 2 ] = r ; d [ 3 ] = s [ 4 ] ; s += 5 ; d += 4 ; } d += d_line_inc ; s += s_line_inc ; } } else { while ( h -- ) { size_t ww = w ; while ( ww -- ) { cached_cmyk_conv ( & r , & g , & b , & C , & M , & Y , & K , s [ 0 ] , s [ 1 ] , s [ 2 ] , s [ 3 ] ) ; d [ 0 ] = b ; d [ 1 ] = g ; d [ 2 ] = r ; d [ 3 ] = 255 ; s += 4 ; d += 4 ; } d += d_line_inc ; s += s_line_inc ; } } } else { assert ( src -> alpha == 0 ) ; while ( h -- ) { size_t ww = w ; while ( ww -- ) { cached_cmyk_conv ( & r , & g , & b , & C , & M , & Y , & K , s [ 0 ] , s [ 1 ] , s [ 2 ] , s [ 3 ] ) ; d [ 0 ] = b ; d [ 1 ] = g ; d [ 2 ] = r ; s += 4 ; d += 3 ; } d += d_line_inc ; s += s_line_inc ; } } } else if ( copy_spots ) { while ( h -- ) { int i ; size_t ww = w ; while ( ww -- ) { cached_cmyk_conv ( & r , & g , & b , & C , & M , & Y , & K , s [ 0 ] , s [ 1 ] , s [ 2 ] , s [ 3 ] ) ; d [ 0 ] = b ; d [ 1 ] = g ; d [ 2 ] = r ; s += 4 ; d += 3 ; for ( i = ss ; i > 0 ; i -- ) * d ++ = * s ++ ; if ( da ) * d ++ = sa ? * s ++ : 255 ; } d += d_line_inc ; s += s_line_inc ; } } else { while ( h -- ) { size_t ww = w ; while ( ww -- ) { cached_cmyk_conv ( & r , & g , & b , & C , & M , & Y , & K , s [ 0 ] , s [ 1 ] , s [ 2 ] , s [ 3 ] ) ; d [ 0 ] = b ; d [ 1 ] = g ; d [ 2 ] = r ; s += sn ; d += dn ; if ( da ) d [ - 1 ] = sa ? s [ - 1 ] : 255 ; } d += d_line_inc ; s += s_line_inc ; } } }
0False
Categorize the following code snippet as vulnerable or not. True or False
int test_compare_files ( const char * tgt , const char * rec ) { FILE * orig , * recons ; static uint8_t obuf [ TESTBUFSIZE ] , rbuf [ TESTBUFSIZE ] ; xoff_t offset = 0 ; size_t i ; size_t oc , rc ; xoff_t diffs = 0 ; if ( ( orig = fopen ( tgt , "r" ) ) == NULL ) { XPR ( NT "open %s failed\n" , tgt ) ; return get_errno ( ) ; } if ( ( recons = fopen ( rec , "r" ) ) == NULL ) { XPR ( NT "open %s failed\n" , rec ) ; return get_errno ( ) ; } for ( ; ; ) { oc = fread ( obuf , 1 , TESTBUFSIZE , orig ) ; rc = fread ( rbuf , 1 , TESTBUFSIZE , recons ) ; if ( oc != rc ) { return XD3_INTERNAL ; } if ( oc == 0 ) { break ; } for ( i = 0 ; i < oc ; i += 1 ) { if ( obuf [ i ] != rbuf [ i ] ) { XPR ( NT "byte %u (read %u @ %" Q "u) %d != %d\n" , ( int ) i , ( int ) oc , offset , obuf [ i ] , rbuf [ i ] ) ; diffs ++ ; return XD3_INTERNAL ; } } offset += oc ; } fclose ( orig ) ; fclose ( recons ) ; if ( diffs != 0 ) { return XD3_INTERNAL ; } return 0 ; }
1True
Categorize the following code snippet as vulnerable or not. True or False
static int SpoolssDeletePrinter_r ( tvbuff_t * tvb , int offset , packet_info * pinfo , proto_tree * tree , dcerpc_info * di , guint8 * drep _U_ ) { offset = dissect_nt_policy_hnd ( tvb , offset , pinfo , tree , di , drep , hf_hnd , NULL , NULL , FALSE , FALSE ) ; offset = dissect_doserror ( tvb , offset , pinfo , tree , di , drep , hf_rc , NULL ) ; return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
void _hb_graphite2_shaper_face_data_destroy ( hb_graphite2_shaper_face_data_t * data ) { hb_graphite2_tablelist_t * tlist = data -> tlist ; while ( tlist ) { hb_graphite2_tablelist_t * old = tlist ; hb_blob_destroy ( tlist -> blob ) ; tlist = tlist -> next ; free ( old ) ; } gr_face_destroy ( data -> grface ) ; free ( data ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
xsltDocumentPtr xsltNewStyleDocument ( xsltStylesheetPtr style , xmlDocPtr doc ) { xsltDocumentPtr cur ; cur = ( xsltDocumentPtr ) xmlMalloc ( sizeof ( xsltDocument ) ) ; if ( cur == NULL ) { xsltTransformError ( NULL , style , ( xmlNodePtr ) doc , "xsltNewStyleDocument : malloc failed\n" ) ; return ( NULL ) ; } memset ( cur , 0 , sizeof ( xsltDocument ) ) ; cur -> doc = doc ; if ( style != NULL ) { cur -> next = style -> docList ; style -> docList = cur ; } return ( cur ) ; }
1True
Categorize the following code snippet as vulnerable or not. True or False
static gboolean gst_asf_demux_handle_seek_event ( GstASFDemux * demux , GstEvent * event ) { GstClockTime idx_time ; GstSegment segment ; GstSeekFlags flags ; GstSeekType cur_type , stop_type ; GstFormat format ; gboolean only_need_update ; gboolean after , before , next ; gboolean flush ; gdouble rate ; gint64 cur , stop ; gint64 seek_time ; guint packet , speed_count = 1 ; gboolean eos ; guint32 seqnum ; GstEvent * fevent ; gint i ; gst_event_parse_seek ( event , & rate , & format , & flags , & cur_type , & cur , & stop_type , & stop ) ; if ( G_UNLIKELY ( format != GST_FORMAT_TIME ) ) { GST_LOG_OBJECT ( demux , "seeking is only supported in TIME format" ) ; return FALSE ; } if ( gst_pad_push_event ( demux -> sinkpad , gst_event_ref ( event ) ) ) return TRUE ; if ( G_UNLIKELY ( demux -> seekable == FALSE || demux -> packet_size == 0 || demux -> num_packets == 0 || demux -> play_time == 0 ) ) { GST_LOG_OBJECT ( demux , "stream is not seekable" ) ; return FALSE ; } if ( G_UNLIKELY ( ! demux -> activated_streams ) ) { GST_LOG_OBJECT ( demux , "streams not yet activated, ignoring seek" ) ; return FALSE ; } if ( G_UNLIKELY ( rate <= 0.0 ) ) { GST_LOG_OBJECT ( demux , "backward playback" ) ; demux -> seek_to_cur_pos = TRUE ; for ( i = 0 ; i < demux -> num_streams ; i ++ ) { demux -> stream [ i ] . reverse_kf_ready = FALSE ; } } seqnum = gst_event_get_seqnum ( event ) ; flush = ( ( flags & GST_SEEK_FLAG_FLUSH ) == GST_SEEK_FLAG_FLUSH ) ; demux -> accurate = ( ( flags & GST_SEEK_FLAG_ACCURATE ) == GST_SEEK_FLAG_ACCURATE ) ; demux -> keyunit_sync = ( ( flags & GST_SEEK_FLAG_KEY_UNIT ) == GST_SEEK_FLAG_KEY_UNIT ) ; after = ( ( flags & GST_SEEK_FLAG_SNAP_AFTER ) == GST_SEEK_FLAG_SNAP_AFTER ) ; before = ( ( flags & GST_SEEK_FLAG_SNAP_BEFORE ) == GST_SEEK_FLAG_SNAP_BEFORE ) ; next = after && ! before ; if ( G_UNLIKELY ( demux -> streaming ) ) { if ( ! flush ) { GST_LOG_OBJECT ( demux , "streaming; non-flushing seek not supported" ) ; return FALSE ; } if ( stop_type != GST_SEEK_TYPE_NONE && ( stop_type != GST_SEEK_TYPE_SET || GST_CLOCK_TIME_IS_VALID ( stop ) ) ) { GST_LOG_OBJECT ( demux , "streaming; end position must be NONE" ) ; return FALSE ; } return gst_asf_demux_handle_seek_push ( demux , event ) ; } if ( G_LIKELY ( flush ) ) { fevent = gst_event_new_flush_start ( ) ; gst_event_set_seqnum ( fevent , seqnum ) ; gst_pad_push_event ( demux -> sinkpad , gst_event_ref ( fevent ) ) ; gst_asf_demux_send_event_unlocked ( demux , fevent ) ; } else { gst_pad_pause_task ( demux -> sinkpad ) ; } GST_PAD_STREAM_LOCK ( demux -> sinkpad ) ; fevent = gst_event_new_flush_stop ( TRUE ) ; gst_event_set_seqnum ( fevent , seqnum ) ; gst_pad_push_event ( demux -> sinkpad , gst_event_ref ( fevent ) ) ; if ( G_LIKELY ( flush ) ) gst_asf_demux_send_event_unlocked ( demux , fevent ) ; else gst_event_unref ( fevent ) ; segment = demux -> segment ; if ( G_UNLIKELY ( demux -> segment_running && ! flush ) ) { GstSegment newsegment ; GstEvent * newseg ; gst_segment_copy_into ( & segment , & newsegment ) ; newseg = gst_event_new_segment ( & newsegment ) ; gst_event_set_seqnum ( newseg , seqnum ) ; gst_asf_demux_send_event_unlocked ( demux , newseg ) ; } gst_segment_do_seek ( & segment , rate , format , flags , cur_type , cur , stop_type , stop , & only_need_update ) ; GST_DEBUG_OBJECT ( demux , "seeking to time %" GST_TIME_FORMAT ", segment: " "%" GST_SEGMENT_FORMAT , GST_TIME_ARGS ( segment . start ) , & segment ) ; if ( cur_type != GST_SEEK_TYPE_SET ) seek_time = segment . start ; else seek_time = cur ; if ( G_UNLIKELY ( ! gst_asf_demux_seek_index_lookup ( demux , & packet , seek_time , & idx_time , & speed_count , next , & eos ) ) ) { gint64 offset ; if ( eos ) { demux -> packet = demux -> num_packets ; goto skip ; } if ( gst_pad_peer_query_convert ( demux -> sinkpad , GST_FORMAT_TIME , seek_time , GST_FORMAT_BYTES , & offset ) ) { packet = ( offset - demux -> data_offset ) / demux -> packet_size ; GST_LOG_OBJECT ( demux , "convert %" GST_TIME_FORMAT " to bytes query result: %" G_GINT64_FORMAT ", data_ofset: %" G_GINT64_FORMAT ", packet_size: %u," " resulting packet: %u\n" , GST_TIME_ARGS ( seek_time ) , offset , demux -> data_offset , demux -> packet_size , packet ) ; } else { if ( flush && ( demux -> accurate || ( demux -> keyunit_sync && ! next ) ) && demux -> num_video_streams > 0 ) { seek_time -= 5 * GST_SECOND ; if ( seek_time < 0 ) seek_time = 0 ; } packet = ( guint ) gst_util_uint64_scale ( demux -> num_packets , seek_time , demux -> play_time ) ; if ( packet > demux -> num_packets ) packet = demux -> num_packets ; } } else { if ( G_LIKELY ( demux -> keyunit_sync && ! demux -> accurate ) ) { GST_DEBUG_OBJECT ( demux , "key unit seek, adjust seek_time = %" GST_TIME_FORMAT " to index_time = %" GST_TIME_FORMAT , GST_TIME_ARGS ( seek_time ) , GST_TIME_ARGS ( idx_time ) ) ; segment . start = idx_time ; segment . position = idx_time ; segment . time = idx_time ; } } GST_DEBUG_OBJECT ( demux , "seeking to packet %u (%d)" , packet , speed_count ) ; GST_OBJECT_LOCK ( demux ) ; demux -> segment = segment ; if ( GST_ASF_DEMUX_IS_REVERSE_PLAYBACK ( demux -> segment ) ) { demux -> packet = ( gint64 ) gst_util_uint64_scale ( demux -> num_packets , stop , demux -> play_time ) ; } else { demux -> packet = packet ; } demux -> need_newsegment = TRUE ; demux -> segment_seqnum = seqnum ; demux -> speed_packets = GST_ASF_DEMUX_IS_REVERSE_PLAYBACK ( demux -> segment ) ? 1 : speed_count ; gst_asf_demux_reset_stream_state_after_discont ( demux ) ; GST_OBJECT_UNLOCK ( demux ) ; skip : gst_pad_start_task ( demux -> sinkpad , ( GstTaskFunction ) gst_asf_demux_loop , demux , NULL ) ; GST_PAD_STREAM_UNLOCK ( demux -> sinkpad ) ; return TRUE ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static inline void idct_put ( FourXContext * f , AVFrame * frame , int x , int y ) { int16_t ( * block ) [ 64 ] = f -> block ; int stride = frame -> linesize [ 0 ] >> 1 ; int i ; uint16_t * dst = ( ( uint16_t * ) frame -> data [ 0 ] ) + y * stride + x ; for ( i = 0 ; i < 4 ; i ++ ) { block [ i ] [ 0 ] += 0x80 * 8 * 8 ; idct ( block [ i ] ) ; } if ( ! ( f -> avctx -> flags & CODEC_FLAG_GRAY ) ) { for ( i = 4 ; i < 6 ; i ++ ) idct ( block [ i ] ) ; } for ( y = 0 ; y < 8 ; y ++ ) { for ( x = 0 ; x < 8 ; x ++ ) { int16_t * temp = block [ ( x >> 2 ) + 2 * ( y >> 2 ) ] + 2 * ( x & 3 ) + 2 * 8 * ( y & 3 ) ; int cb = block [ 4 ] [ x + 8 * y ] ; int cr = block [ 5 ] [ x + 8 * y ] ; int cg = ( cb + cr ) >> 1 ; int y ; cb += cb ; y = temp [ 0 ] ; dst [ 0 ] = ( ( y + cb ) >> 3 ) + ( ( ( y - cg ) & 0xFC ) << 3 ) + ( ( ( y + cr ) & 0xF8 ) << 8 ) ; y = temp [ 1 ] ; dst [ 1 ] = ( ( y + cb ) >> 3 ) + ( ( ( y - cg ) & 0xFC ) << 3 ) + ( ( ( y + cr ) & 0xF8 ) << 8 ) ; y = temp [ 8 ] ; dst [ stride ] = ( ( y + cb ) >> 3 ) + ( ( ( y - cg ) & 0xFC ) << 3 ) + ( ( ( y + cr ) & 0xF8 ) << 8 ) ; y = temp [ 9 ] ; dst [ 1 + stride ] = ( ( y + cb ) >> 3 ) + ( ( ( y - cg ) & 0xFC ) << 3 ) + ( ( ( y + cr ) & 0xF8 ) << 8 ) ; dst += 2 ; } dst += 2 * stride - 2 * 8 ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void dissect_q931_information_rate_ie ( tvbuff_t * tvb , packet_info * pinfo , int offset , int len , proto_tree * tree , proto_item * item ) { if ( len != 4 ) { expert_add_info_format ( pinfo , item , & ei_q931_invalid_length , "Information rate: length is %d, should be 4" , len ) ; return ; } proto_tree_add_item ( tree , hf_q931_information_rate_incoming , tvb , offset + 0 , 1 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( tree , hf_q931_information_rate_outgoing , tvb , offset + 1 , 1 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( tree , hf_q931_information_rate_minimum_incoming , tvb , offset + 2 , 1 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( tree , hf_q931_information_rate_minimum_outgoing , tvb , offset + 3 , 1 , ENC_BIG_ENDIAN ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
void evhttp_send_page ( struct evhttp_request * req , struct evbuffer * databuf ) { if ( ! req -> major || ! req -> minor ) { req -> major = 1 ; req -> minor = 1 ; } if ( req -> kind != EVHTTP_RESPONSE ) evhttp_response_code ( req , 200 , "OK" ) ; evhttp_clear_headers ( req -> output_headers ) ; evhttp_add_header ( req -> output_headers , "Content-Type" , "text/html" ) ; evhttp_add_header ( req -> output_headers , "Connection" , "close" ) ; evhttp_send ( req , databuf ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
int X509_REQ_add_extensions_nid ( X509_REQ * req , STACK_OF ( X509_EXTENSION ) * exts , int nid ) { ASN1_TYPE * at = NULL ; X509_ATTRIBUTE * attr = NULL ; if ( ! ( at = ASN1_TYPE_new ( ) ) || ! ( at -> value . sequence = ASN1_STRING_new ( ) ) ) goto err ; at -> type = V_ASN1_SEQUENCE ; at -> value . sequence -> length = ASN1_item_i2d ( ( ASN1_VALUE * ) exts , & at -> value . sequence -> data , ASN1_ITEM_rptr ( X509_EXTENSIONS ) ) ; if ( ! ( attr = X509_ATTRIBUTE_new ( ) ) ) goto err ; if ( ! ( attr -> value . set = sk_ASN1_TYPE_new_null ( ) ) ) goto err ; if ( ! sk_ASN1_TYPE_push ( attr -> value . set , at ) ) goto err ; at = NULL ; attr -> single = 0 ; attr -> object = OBJ_nid2obj ( nid ) ; if ( ! req -> req_info -> attributes ) { if ( ! ( req -> req_info -> attributes = sk_X509_ATTRIBUTE_new_null ( ) ) ) goto err ; } if ( ! sk_X509_ATTRIBUTE_push ( req -> req_info -> attributes , attr ) ) goto err ; return 1 ; err : X509_ATTRIBUTE_free ( attr ) ; ASN1_TYPE_free ( at ) ; return 0 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static const char * get_sep_media_type ( guint32 interface_id , guint32 adapter_id , guint32 chandle , guint32 direction , guint32 seid , guint32 frame_number ) { wmem_tree_key_t key [ 6 ] ; wmem_tree_t * subtree ; sep_entry_t * sep ; key [ 0 ] . length = 1 ; key [ 0 ] . key = & interface_id ; key [ 1 ] . length = 1 ; key [ 1 ] . key = & adapter_id ; key [ 2 ] . length = 1 ; key [ 2 ] . key = & chandle ; key [ 3 ] . length = 1 ; key [ 3 ] . key = & direction ; key [ 4 ] . length = 1 ; key [ 4 ] . key = & seid ; key [ 5 ] . length = 0 ; key [ 5 ] . key = NULL ; subtree = ( wmem_tree_t * ) wmem_tree_lookup32_array ( sep_list , key ) ; sep = ( subtree ) ? ( sep_entry_t * ) wmem_tree_lookup32_le ( subtree , frame_number ) : NULL ; if ( sep ) { return val_to_str_const ( sep -> media_type , media_type_vals , "unknown" ) ; } return "unknown" ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void qemu_spice_display_init_one ( QemuConsole * con ) { SimpleSpiceDisplay * ssd = g_new0 ( SimpleSpiceDisplay , 1 ) ; qemu_spice_display_init_common ( ssd ) ; ssd -> qxl . base . sif = & dpy_interface . base ; qemu_spice_add_display_interface ( & ssd -> qxl , con ) ; assert ( ssd -> worker ) ; qemu_spice_create_host_memslot ( ssd ) ; ssd -> dcl . ops = & display_listener_ops ; ssd -> dcl . con = con ; register_displaychangelistener ( & ssd -> dcl ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static inline void invalidate_cursor1 ( CirrusVGAState * s ) { if ( s -> last_hw_cursor_size ) { vga_invalidate_scanlines ( & s -> vga , s -> last_hw_cursor_y + s -> last_hw_cursor_y_start , s -> last_hw_cursor_y + s -> last_hw_cursor_y_end ) ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
TEST_F ( ProfileInfoCacheTest , AddStubProfile ) { EXPECT_EQ ( 0u , GetCache ( ) -> GetNumberOfProfiles ( ) ) ; const struct { const char * profile_path ; const char * profile_name ; } kTestCases [ ] = { { "path.test0" , "name_0" } , { "path_test1" , "name_1" } , { "path.test2" , "name_2" } , { "path_test3" , "name_3" } , } ; for ( size_t i = 0 ; i < arraysize ( kTestCases ) ; ++ i ) { base : : FilePath profile_path = GetProfilePath ( kTestCases [ i ] . profile_path ) ; base : : string16 profile_name = ASCIIToUTF16 ( kTestCases [ i ] . profile_name ) ; GetCache ( ) -> AddProfileToCache ( profile_path , profile_name , base : : string16 ( ) , i , "" ) ; EXPECT_EQ ( profile_path , GetCache ( ) -> GetPathOfProfileAtIndex ( i ) ) ; EXPECT_EQ ( profile_name , GetCache ( ) -> GetNameOfProfileAtIndex ( i ) ) ; } ASSERT_EQ ( 4U , GetCache ( ) -> GetNumberOfProfiles ( ) ) ; std : : vector < base : : string16 > names ; PrefService * local_state = g_browser_process -> local_state ( ) ; const base : : DictionaryValue * cache = local_state -> GetDictionary ( prefs : : kProfileInfoCache ) ; base : : string16 name ; for ( base : : DictionaryValue : : Iterator it ( * cache ) ; ! it . IsAtEnd ( ) ; it . Advance ( ) ) { const base : : DictionaryValue * info = NULL ; it . value ( ) . GetAsDictionary ( & info ) ; info -> GetString ( "name" , & name ) ; names . push_back ( name ) ; } for ( size_t i = 0 ; i < 4 ; i ++ ) ASSERT_FALSE ( names [ i ] . empty ( ) ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
REGRESSION_TEST ( SDK_API_TSConfig ) ( RegressionTest * test , int , int * pstatus ) { * pstatus = REGRESSION_TEST_INPROGRESS ; ConfigData * config = ( ConfigData * ) TSmalloc ( sizeof ( ConfigData ) ) ; config -> a = "unit" ; config -> b = "test" ; my_config_id = TSConfigSet ( 0 , config , config_destroy_func ) ; TSConfig test_config = nullptr ; test_config = TSConfigGet ( my_config_id ) ; if ( ! test_config ) { SDK_RPRINT ( test , "TSConfigSet" , "TestCase1" , TC_FAIL , "can't correctly set global config structure" ) ; SDK_RPRINT ( test , "TSConfigGet" , "TestCase1" , TC_FAIL , "can't correctly get global config structure" ) ; TSConfigRelease ( my_config_id , reinterpret_cast < TSConfig > ( config ) ) ; * pstatus = REGRESSION_TEST_FAILED ; return ; } if ( TSConfigDataGet ( test_config ) != config ) { SDK_RPRINT ( test , "TSConfigDataGet" , "TestCase1" , TC_FAIL , "failed to get config data" ) ; TSConfigRelease ( my_config_id , reinterpret_cast < TSConfig > ( config ) ) ; * pstatus = REGRESSION_TEST_FAILED ; return ; } SDK_RPRINT ( test , "TSConfigGet" , "TestCase1" , TC_PASS , "ok" ) ; SDK_RPRINT ( test , "TSConfigSet" , "TestCase1" , TC_PASS , "ok" ) ; SDK_RPRINT ( test , "TSConfigDataGet" , "TestCase1" , TC_PASS , "ok" ) ; TSConfigRelease ( my_config_id , reinterpret_cast < TSConfig > ( config ) ) ; * pstatus = REGRESSION_TEST_PASSED ; return ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static enum nss_status getanswer_r ( const querybuf * answer , int anslen , const char * qname , int qtype , struct hostent * result , char * buffer , size_t buflen , int * errnop , int * h_errnop , int map , int32_t * ttlp , char * * canonp ) { struct host_data { char * aliases [ MAX_NR_ALIASES ] ; unsigned char host_addr [ 16 ] ; char * h_addr_ptrs [ 0 ] ; } * host_data ; int linebuflen ; const HEADER * hp ; const u_char * end_of_message , * cp ; int n , ancount , qdcount ; int haveanswer , had_error ; char * bp , * * ap , * * hap ; char tbuf [ MAXDNAME ] ; const char * tname ; int ( * name_ok ) ( const char * ) ; u_char packtmp [ NS_MAXCDNAME ] ; int have_to_map = 0 ; uintptr_t pad = - ( uintptr_t ) buffer % __alignof__ ( struct host_data ) ; buffer += pad ; buflen = buflen > pad ? buflen - pad : 0 ; if ( __glibc_unlikely ( buflen < sizeof ( struct host_data ) ) ) { too_small : * errnop = ERANGE ; * h_errnop = NETDB_INTERNAL ; return NSS_STATUS_TRYAGAIN ; } host_data = ( struct host_data * ) buffer ; linebuflen = buflen - sizeof ( struct host_data ) ; if ( buflen - sizeof ( struct host_data ) != linebuflen ) linebuflen = INT_MAX ; tname = qname ; result -> h_name = NULL ; end_of_message = answer -> buf + anslen ; switch ( qtype ) { case T_A : case T_AAAA : name_ok = res_hnok ; break ; case T_PTR : name_ok = res_dnok ; break ; default : * errnop = ENOENT ; return NSS_STATUS_UNAVAIL ; } hp = & answer -> hdr ; ancount = ntohs ( hp -> ancount ) ; qdcount = ntohs ( hp -> qdcount ) ; cp = answer -> buf + HFIXEDSZ ; if ( __builtin_expect ( qdcount , 1 ) != 1 ) { * h_errnop = NO_RECOVERY ; return NSS_STATUS_UNAVAIL ; } if ( sizeof ( struct host_data ) + ( ancount + 1 ) * sizeof ( char * ) >= buflen ) goto too_small ; bp = ( char * ) & host_data -> h_addr_ptrs [ ancount + 1 ] ; linebuflen -= ( ancount + 1 ) * sizeof ( char * ) ; n = __ns_name_unpack ( answer -> buf , end_of_message , cp , packtmp , sizeof packtmp ) ; if ( n != - 1 && __ns_name_ntop ( packtmp , bp , linebuflen ) == - 1 ) { if ( __builtin_expect ( errno , 0 ) == EMSGSIZE ) goto too_small ; n = - 1 ; } if ( n > 0 && bp [ 0 ] == '.' ) bp [ 0 ] = '\0' ; if ( __builtin_expect ( n < 0 || ( ( * name_ok ) ( bp ) == 0 && ( errno = EBADMSG ) ) , 0 ) ) { * errnop = errno ; * h_errnop = NO_RECOVERY ; return NSS_STATUS_UNAVAIL ; } cp += n + QFIXEDSZ ; if ( qtype == T_A || qtype == T_AAAA ) { n = strlen ( bp ) + 1 ; if ( n >= MAXHOSTNAMELEN ) { * h_errnop = NO_RECOVERY ; * errnop = ENOENT ; return NSS_STATUS_TRYAGAIN ; } result -> h_name = bp ; bp += n ; linebuflen -= n ; if ( linebuflen < 0 ) goto too_small ; qname = result -> h_name ; } ap = host_data -> aliases ; * ap = NULL ; result -> h_aliases = host_data -> aliases ; hap = host_data -> h_addr_ptrs ; * hap = NULL ; result -> h_addr_list = host_data -> h_addr_ptrs ; haveanswer = 0 ; had_error = 0 ; while ( ancount -- > 0 && cp < end_of_message && had_error == 0 ) { int type , class ; n = __ns_name_unpack ( answer -> buf , end_of_message , cp , packtmp , sizeof packtmp ) ; if ( n != - 1 && __ns_name_ntop ( packtmp , bp , linebuflen ) == - 1 ) { if ( __builtin_expect ( errno , 0 ) == EMSGSIZE ) goto too_small ; n = - 1 ; } if ( __glibc_unlikely ( n < 0 || ( * name_ok ) ( bp ) == 0 ) ) { ++ had_error ; continue ; } cp += n ; if ( __glibc_unlikely ( cp + 10 > end_of_message ) ) { ++ had_error ; continue ; } type = __ns_get16 ( cp ) ; cp += INT16SZ ; class = __ns_get16 ( cp ) ; cp += INT16SZ ; int32_t ttl = __ns_get32 ( cp ) ; cp += INT32SZ ; n = __ns_get16 ( cp ) ; cp += INT16SZ ; if ( __glibc_unlikely ( class != C_IN ) ) { cp += n ; continue ; } if ( ( qtype == T_A || qtype == T_AAAA ) && type == T_CNAME ) { if ( ttlp != NULL && ttl < * ttlp ) * ttlp = ttl ; if ( ap >= & host_data -> aliases [ MAX_NR_ALIASES - 1 ] ) continue ; n = dn_expand ( answer -> buf , end_of_message , cp , tbuf , sizeof tbuf ) ; if ( __glibc_unlikely ( n < 0 || ( * name_ok ) ( tbuf ) == 0 ) ) { ++ had_error ; continue ; } cp += n ; * ap ++ = bp ; n = strlen ( bp ) + 1 ; if ( __builtin_expect ( n , 0 ) >= MAXHOSTNAMELEN ) { ++ had_error ; continue ; } bp += n ; linebuflen -= n ; n = strlen ( tbuf ) + 1 ; if ( __glibc_unlikely ( n > linebuflen ) ) goto too_small ; if ( __builtin_expect ( n , 0 ) >= MAXHOSTNAMELEN ) { ++ had_error ; continue ; } result -> h_name = bp ; bp = __mempcpy ( bp , tbuf , n ) ; linebuflen -= n ; continue ; } if ( qtype == T_PTR && type == T_CNAME ) { n = dn_expand ( answer -> buf , end_of_message , cp , tbuf , sizeof tbuf ) ; if ( __glibc_unlikely ( n < 0 || res_dnok ( tbuf ) == 0 ) ) { ++ had_error ; continue ; } cp += n ; n = strlen ( tbuf ) + 1 ; if ( __glibc_unlikely ( n > linebuflen ) ) goto too_small ; if ( __builtin_expect ( n , 0 ) >= MAXHOSTNAMELEN ) { ++ had_error ; continue ; } tname = bp ; bp = __mempcpy ( bp , tbuf , n ) ; linebuflen -= n ; continue ; } if ( type == T_A && qtype == T_AAAA && map ) have_to_map = 1 ; else if ( __glibc_unlikely ( type != qtype ) ) { if ( ( _res . options & RES_USE_DNSSEC ) == 0 ) syslog ( LOG_NOTICE | LOG_AUTH , "gethostby*.getanswer: asked for \"%s %s %s\", " "got type \"%s\"" , qname , p_class ( C_IN ) , p_type ( qtype ) , p_type ( type ) ) ; cp += n ; continue ; } switch ( type ) { case T_PTR : if ( __glibc_unlikely ( strcasecmp ( tname , bp ) != 0 ) ) { syslog ( LOG_NOTICE | LOG_AUTH , AskedForGot , qname , bp ) ; cp += n ; continue ; } n = __ns_name_unpack ( answer -> buf , end_of_message , cp , packtmp , sizeof packtmp ) ; if ( n != - 1 && __ns_name_ntop ( packtmp , bp , linebuflen ) == - 1 ) { if ( __builtin_expect ( errno , 0 ) == EMSGSIZE ) goto too_small ; n = - 1 ; } if ( __glibc_unlikely ( n < 0 || res_hnok ( bp ) == 0 ) ) { ++ had_error ; break ; } result -> h_name = bp ; if ( have_to_map ) { n = strlen ( bp ) + 1 ; if ( __glibc_unlikely ( n >= MAXHOSTNAMELEN ) ) { ++ had_error ; break ; } bp += n ; linebuflen -= n ; if ( map_v4v6_hostent ( result , & bp , & linebuflen ) ) goto too_small ; } * h_errnop = NETDB_SUCCESS ; return NSS_STATUS_SUCCESS ; case T_A : case T_AAAA : if ( __builtin_expect ( strcasecmp ( result -> h_name , bp ) , 0 ) != 0 ) { syslog ( LOG_NOTICE | LOG_AUTH , AskedForGot , result -> h_name , bp ) ; cp += n ; continue ; } if ( n != result -> h_length ) { cp += n ; continue ; } if ( ! haveanswer ) { int nn ; if ( ttlp != NULL && ttl < * ttlp ) * ttlp = ttl ; if ( canonp != NULL ) * canonp = bp ; result -> h_name = bp ; nn = strlen ( bp ) + 1 ; bp += nn ; linebuflen -= nn ; } linebuflen -= sizeof ( align ) - ( ( u_long ) bp % sizeof ( align ) ) ; bp += sizeof ( align ) - ( ( u_long ) bp % sizeof ( align ) ) ; if ( __glibc_unlikely ( n > linebuflen ) ) goto too_small ; bp = __mempcpy ( * hap ++ = bp , cp , n ) ; cp += n ; linebuflen -= n ; break ; default : abort ( ) ; } if ( had_error == 0 ) ++ haveanswer ; } if ( haveanswer > 0 ) { * ap = NULL ; * hap = NULL ; # if defined RESOLVSORT if ( _res . nsort && haveanswer > 1 && qtype == T_A ) addrsort ( host_data -> h_addr_ptrs , haveanswer ) ; # endif if ( result -> h_name == NULL ) { n = strlen ( qname ) + 1 ; if ( n > linebuflen ) goto too_small ; if ( n >= MAXHOSTNAMELEN ) goto no_recovery ; result -> h_name = bp ; bp = __mempcpy ( bp , qname , n ) ; linebuflen -= n ; } if ( have_to_map ) if ( map_v4v6_hostent ( result , & bp , & linebuflen ) ) goto too_small ; * h_errnop = NETDB_SUCCESS ; return NSS_STATUS_SUCCESS ; } no_recovery : * h_errnop = NO_RECOVERY ; * errnop = ENOENT ; return ( ( qtype == T_A || qtype == T_AAAA ) && ap != host_data -> aliases ? NSS_STATUS_NOTFOUND : NSS_STATUS_TRYAGAIN ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static CURLcode glob_set ( URLGlob * glob , char * * patternp , size_t * posp , unsigned long * amount , int globindex ) { URLPattern * pat ; bool done = FALSE ; char * buf = glob -> glob_buffer ; char * pattern = * patternp ; char * opattern = pattern ; size_t opos = * posp - 1 ; pat = & glob -> pattern [ glob -> size ] ; pat -> type = UPTSet ; pat -> content . Set . size = 0 ; pat -> content . Set . ptr_s = 0 ; pat -> content . Set . elements = NULL ; pat -> globindex = globindex ; while ( ! done ) { switch ( * pattern ) { case '\0' : return GLOBERROR ( "unmatched brace" , opos , CURLE_URL_MALFORMAT ) ; case '{ ' : case '[' : return GLOBERROR ( "nested brace" , * posp , CURLE_URL_MALFORMAT ) ; case '} ' : if ( opattern == pattern ) return GLOBERROR ( "empty string within braces" , * posp , CURLE_URL_MALFORMAT ) ; if ( multiply ( amount , pat -> content . Set . size + 1 ) ) return GLOBERROR ( "range overflow" , 0 , CURLE_URL_MALFORMAT ) ; case ',' : * buf = '\0' ; if ( pat -> content . Set . elements ) { char * * new_arr = realloc ( pat -> content . Set . elements , ( pat -> content . Set . size + 1 ) * sizeof ( char * ) ) ; if ( ! new_arr ) return GLOBERROR ( "out of memory" , 0 , CURLE_OUT_OF_MEMORY ) ; pat -> content . Set . elements = new_arr ; } else pat -> content . Set . elements = malloc ( sizeof ( char * ) ) ; if ( ! pat -> content . Set . elements ) return GLOBERROR ( "out of memory" , 0 , CURLE_OUT_OF_MEMORY ) ; pat -> content . Set . elements [ pat -> content . Set . size ] = strdup ( glob -> glob_buffer ) ; if ( ! pat -> content . Set . elements [ pat -> content . Set . size ] ) return GLOBERROR ( "out of memory" , 0 , CURLE_OUT_OF_MEMORY ) ; ++ pat -> content . Set . size ; if ( * pattern == '} ' ) { pattern ++ ; done = TRUE ; continue ; } buf = glob -> glob_buffer ; ++ pattern ; ++ ( * posp ) ; break ; case ']' : return GLOBERROR ( "unexpected close bracket" , * posp , CURLE_URL_MALFORMAT ) ; case '\\' : if ( pattern [ 1 ] ) { ++ pattern ; ++ ( * posp ) ; } default : * buf ++ = * pattern ++ ; ++ ( * posp ) ; } } * patternp = pattern ; return CURLE_OK ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static struct cvec * cclass ( struct vars * v , const chr * startp , const chr * endp , int cases ) { size_t len ; struct cvec * cv = NULL ; const char * const * namePtr ; int i , index ; static const char * const classNames [ ] = { "alnum" , "alpha" , "ascii" , "blank" , "cntrl" , "digit" , "graph" , "lower" , "print" , "punct" , "space" , "upper" , "xdigit" , NULL } ; enum classes { CC_ALNUM , CC_ALPHA , CC_ASCII , CC_BLANK , CC_CNTRL , CC_DIGIT , CC_GRAPH , CC_LOWER , CC_PRINT , CC_PUNCT , CC_SPACE , CC_UPPER , CC_XDIGIT } ; len = endp - startp ; index = - 1 ; for ( namePtr = classNames , i = 0 ; * namePtr != NULL ; namePtr ++ , i ++ ) { if ( strlen ( * namePtr ) == len && pg_char_and_wchar_strncmp ( * namePtr , startp , len ) == 0 ) { index = i ; break ; } } if ( index == - 1 ) { ERR ( REG_ECTYPE ) ; return NULL ; } if ( cases && ( ( enum classes ) index == CC_LOWER || ( enum classes ) index == CC_UPPER ) ) index = ( int ) CC_ALPHA ; switch ( ( enum classes ) index ) { case CC_PRINT : cv = pg_ctype_get_cache ( pg_wc_isprint ) ; break ; case CC_ALNUM : cv = pg_ctype_get_cache ( pg_wc_isalnum ) ; break ; case CC_ALPHA : cv = pg_ctype_get_cache ( pg_wc_isalpha ) ; break ; case CC_ASCII : cv = getcvec ( v , 0 , 1 ) ; if ( cv ) addrange ( cv , 0 , 0x7f ) ; break ; case CC_BLANK : cv = getcvec ( v , 2 , 0 ) ; addchr ( cv , '\t' ) ; addchr ( cv , ' ' ) ; break ; case CC_CNTRL : cv = getcvec ( v , 0 , 2 ) ; addrange ( cv , 0x0 , 0x1f ) ; addrange ( cv , 0x7f , 0x9f ) ; break ; case CC_DIGIT : cv = pg_ctype_get_cache ( pg_wc_isdigit ) ; break ; case CC_PUNCT : cv = pg_ctype_get_cache ( pg_wc_ispunct ) ; break ; case CC_XDIGIT : cv = getcvec ( v , 0 , 3 ) ; if ( cv ) { addrange ( cv , '0' , '9' ) ; addrange ( cv , 'a' , 'f' ) ; addrange ( cv , 'A' , 'F' ) ; } break ; case CC_SPACE : cv = pg_ctype_get_cache ( pg_wc_isspace ) ; break ; case CC_LOWER : cv = pg_ctype_get_cache ( pg_wc_islower ) ; break ; case CC_UPPER : cv = pg_ctype_get_cache ( pg_wc_isupper ) ; break ; case CC_GRAPH : cv = pg_ctype_get_cache ( pg_wc_isgraph ) ; break ; } if ( cv == NULL ) ERR ( REG_ESPACE ) ; return cv ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int get_nfd ( uint32_t * cp1 , uint32_t * cp2 , uint32_t uc ) { int t , b ; if ( ( uc >= 0x2000 && uc <= 0x2FFF ) || ( uc >= 0xF900 && uc <= 0xFAFF ) || ( uc >= 0x2F800 && uc <= 0x2FAFF ) ) return ( 0 ) ; if ( uc == 0x1109A || uc == 0x1109C || uc == 0x110AB ) return ( 0 ) ; t = 0 ; b = sizeof ( u_decomposition_table ) / sizeof ( u_decomposition_table [ 0 ] ) - 1 ; while ( b >= t ) { int m = ( t + b ) / 2 ; if ( u_decomposition_table [ m ] . nfc < uc ) t = m + 1 ; else if ( u_decomposition_table [ m ] . nfc > uc ) b = m - 1 ; else { * cp1 = u_decomposition_table [ m ] . cp1 ; * cp2 = u_decomposition_table [ m ] . cp2 ; return ( 1 ) ; } } return ( 0 ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static CURLFORMcode FormAdd ( struct curl_httppost * * httppost , struct curl_httppost * * last_post , va_list params ) { FormInfo * first_form , * current_form , * form = NULL ; CURLFORMcode return_value = CURL_FORMADD_OK ; const char * prevtype = NULL ; struct curl_httppost * post = NULL ; CURLformoption option ; struct curl_forms * forms = NULL ; char * array_value = NULL ; bool array_state = FALSE ; first_form = calloc ( 1 , sizeof ( struct FormInfo ) ) ; if ( ! first_form ) return CURL_FORMADD_MEMORY ; current_form = first_form ; while ( return_value == CURL_FORMADD_OK ) { if ( array_state && forms ) { option = forms -> option ; array_value = ( char * ) forms -> value ; forms ++ ; if ( CURLFORM_END == option ) { array_state = FALSE ; continue ; } } else { option = va_arg ( params , CURLformoption ) ; if ( CURLFORM_END == option ) break ; } switch ( option ) { case CURLFORM_ARRAY : if ( array_state ) return_value = CURL_FORMADD_ILLEGAL_ARRAY ; else { forms = va_arg ( params , struct curl_forms * ) ; if ( forms ) array_state = TRUE ; else return_value = CURL_FORMADD_NULL ; } break ; case CURLFORM_PTRNAME : # ifdef CURL_DOES_CONVERSIONS # else current_form -> flags |= HTTPPOST_PTRNAME ; # endif case CURLFORM_COPYNAME : if ( current_form -> name ) return_value = CURL_FORMADD_OPTION_TWICE ; else { char * name = array_state ? array_value : va_arg ( params , char * ) ; if ( name ) current_form -> name = name ; else return_value = CURL_FORMADD_NULL ; } break ; case CURLFORM_NAMELENGTH : if ( current_form -> namelength ) return_value = CURL_FORMADD_OPTION_TWICE ; else current_form -> namelength = array_state ? ( size_t ) array_value : ( size_t ) va_arg ( params , long ) ; break ; case CURLFORM_PTRCONTENTS : current_form -> flags |= HTTPPOST_PTRCONTENTS ; case CURLFORM_COPYCONTENTS : if ( current_form -> value ) return_value = CURL_FORMADD_OPTION_TWICE ; else { char * value = array_state ? array_value : va_arg ( params , char * ) ; if ( value ) current_form -> value = value ; else return_value = CURL_FORMADD_NULL ; } break ; case CURLFORM_CONTENTSLENGTH : if ( current_form -> contentslength ) return_value = CURL_FORMADD_OPTION_TWICE ; else current_form -> contentslength = array_state ? ( size_t ) array_value : ( size_t ) va_arg ( params , long ) ; break ; case CURLFORM_FILECONTENT : if ( current_form -> flags & ( HTTPPOST_PTRCONTENTS | HTTPPOST_READFILE ) ) return_value = CURL_FORMADD_OPTION_TWICE ; else { const char * filename = array_state ? array_value : va_arg ( params , char * ) ; if ( filename ) { current_form -> value = strdup ( filename ) ; if ( ! current_form -> value ) return_value = CURL_FORMADD_MEMORY ; else { current_form -> flags |= HTTPPOST_READFILE ; current_form -> value_alloc = TRUE ; } } else return_value = CURL_FORMADD_NULL ; } break ; case CURLFORM_FILE : { const char * filename = array_state ? array_value : va_arg ( params , char * ) ; if ( current_form -> value ) { if ( current_form -> flags & HTTPPOST_FILENAME ) { if ( filename ) { char * fname = strdup ( filename ) ; if ( ! fname ) return_value = CURL_FORMADD_MEMORY ; else { form = AddFormInfo ( fname , NULL , current_form ) ; if ( ! form ) { Curl_safefree ( fname ) ; return_value = CURL_FORMADD_MEMORY ; } else { form -> value_alloc = TRUE ; current_form = form ; form = NULL ; } } } else return_value = CURL_FORMADD_NULL ; } else return_value = CURL_FORMADD_OPTION_TWICE ; } else { if ( filename ) { current_form -> value = strdup ( filename ) ; if ( ! current_form -> value ) return_value = CURL_FORMADD_MEMORY ; else { current_form -> flags |= HTTPPOST_FILENAME ; current_form -> value_alloc = TRUE ; } } else return_value = CURL_FORMADD_NULL ; } break ; } case CURLFORM_BUFFERPTR : current_form -> flags |= HTTPPOST_PTRBUFFER | HTTPPOST_BUFFER ; if ( current_form -> buffer ) return_value = CURL_FORMADD_OPTION_TWICE ; else { char * buffer = array_state ? array_value : va_arg ( params , char * ) ; if ( buffer ) { current_form -> buffer = buffer ; current_form -> value = buffer ; } else return_value = CURL_FORMADD_NULL ; } break ; case CURLFORM_BUFFERLENGTH : if ( current_form -> bufferlength ) return_value = CURL_FORMADD_OPTION_TWICE ; else current_form -> bufferlength = array_state ? ( size_t ) array_value : ( size_t ) va_arg ( params , long ) ; break ; case CURLFORM_STREAM : current_form -> flags |= HTTPPOST_CALLBACK ; if ( current_form -> userp ) return_value = CURL_FORMADD_OPTION_TWICE ; else { char * userp = array_state ? array_value : va_arg ( params , char * ) ; if ( userp ) { current_form -> userp = userp ; current_form -> value = userp ; } else return_value = CURL_FORMADD_NULL ; } break ; case CURLFORM_CONTENTTYPE : { const char * contenttype = array_state ? array_value : va_arg ( params , char * ) ; if ( current_form -> contenttype ) { if ( current_form -> flags & HTTPPOST_FILENAME ) { if ( contenttype ) { char * type = strdup ( contenttype ) ; if ( ! type ) return_value = CURL_FORMADD_MEMORY ; else { form = AddFormInfo ( NULL , type , current_form ) ; if ( ! form ) { Curl_safefree ( type ) ; return_value = CURL_FORMADD_MEMORY ; } else { form -> contenttype_alloc = TRUE ; current_form = form ; form = NULL ; } } } else return_value = CURL_FORMADD_NULL ; } else return_value = CURL_FORMADD_OPTION_TWICE ; } else { if ( contenttype ) { current_form -> contenttype = strdup ( contenttype ) ; if ( ! current_form -> contenttype ) return_value = CURL_FORMADD_MEMORY ; else current_form -> contenttype_alloc = TRUE ; } else return_value = CURL_FORMADD_NULL ; } break ; } case CURLFORM_CONTENTHEADER : { struct curl_slist * list = array_state ? ( struct curl_slist * ) array_value : va_arg ( params , struct curl_slist * ) ; if ( current_form -> contentheader ) return_value = CURL_FORMADD_OPTION_TWICE ; else current_form -> contentheader = list ; break ; } case CURLFORM_FILENAME : case CURLFORM_BUFFER : { const char * filename = array_state ? array_value : va_arg ( params , char * ) ; if ( current_form -> showfilename ) return_value = CURL_FORMADD_OPTION_TWICE ; else { current_form -> showfilename = strdup ( filename ) ; if ( ! current_form -> showfilename ) return_value = CURL_FORMADD_MEMORY ; else current_form -> showfilename_alloc = TRUE ; } break ; } default : return_value = CURL_FORMADD_UNKNOWN_OPTION ; break ; } } if ( CURL_FORMADD_OK != return_value ) { FormInfo * ptr ; for ( ptr = first_form ; ptr != NULL ; ptr = ptr -> more ) { if ( ptr -> name_alloc ) { Curl_safefree ( ptr -> name ) ; ptr -> name_alloc = FALSE ; } if ( ptr -> value_alloc ) { Curl_safefree ( ptr -> value ) ; ptr -> value_alloc = FALSE ; } if ( ptr -> contenttype_alloc ) { Curl_safefree ( ptr -> contenttype ) ; ptr -> contenttype_alloc = FALSE ; } if ( ptr -> showfilename_alloc ) { Curl_safefree ( ptr -> showfilename ) ; ptr -> showfilename_alloc = FALSE ; } } } if ( CURL_FORMADD_OK == return_value ) { post = NULL ; for ( form = first_form ; form != NULL ; form = form -> more ) { if ( ( ( ! form -> name || ! form -> value ) && ! post ) || ( ( form -> contentslength ) && ( form -> flags & HTTPPOST_FILENAME ) ) || ( ( form -> flags & HTTPPOST_FILENAME ) && ( form -> flags & HTTPPOST_PTRCONTENTS ) ) || ( ( ! form -> buffer ) && ( form -> flags & HTTPPOST_BUFFER ) && ( form -> flags & HTTPPOST_PTRBUFFER ) ) || ( ( form -> flags & HTTPPOST_READFILE ) && ( form -> flags & HTTPPOST_PTRCONTENTS ) ) ) { return_value = CURL_FORMADD_INCOMPLETE ; break ; } else { if ( ( ( form -> flags & HTTPPOST_FILENAME ) || ( form -> flags & HTTPPOST_BUFFER ) ) && ! form -> contenttype ) { char * f = form -> flags & HTTPPOST_BUFFER ? form -> showfilename : form -> value ; form -> contenttype = strdup ( ContentTypeForFilename ( f , prevtype ) ) ; if ( ! form -> contenttype ) { return_value = CURL_FORMADD_MEMORY ; break ; } form -> contenttype_alloc = TRUE ; } if ( ! ( form -> flags & HTTPPOST_PTRNAME ) && ( form == first_form ) ) { if ( form -> name ) form -> name = memdup ( form -> name , form -> namelength ) ; if ( ! form -> name ) { return_value = CURL_FORMADD_MEMORY ; break ; } form -> name_alloc = TRUE ; } if ( ! ( form -> flags & ( HTTPPOST_FILENAME | HTTPPOST_READFILE | HTTPPOST_PTRCONTENTS | HTTPPOST_PTRBUFFER | HTTPPOST_CALLBACK ) ) && form -> value ) { form -> value = memdup ( form -> value , form -> contentslength ) ; if ( ! form -> value ) { return_value = CURL_FORMADD_MEMORY ; break ; } form -> value_alloc = TRUE ; } post = AddHttpPost ( form -> name , form -> namelength , form -> value , form -> contentslength , form -> buffer , form -> bufferlength , form -> contenttype , form -> flags , form -> contentheader , form -> showfilename , form -> userp , post , httppost , last_post ) ; if ( ! post ) { return_value = CURL_FORMADD_MEMORY ; break ; } if ( form -> contenttype ) prevtype = form -> contenttype ; } } if ( CURL_FORMADD_OK != return_value ) { FormInfo * ptr ; for ( ptr = form ; ptr != NULL ; ptr = ptr -> more ) { if ( ptr -> name_alloc ) { Curl_safefree ( ptr -> name ) ; ptr -> name_alloc = FALSE ; } if ( ptr -> value_alloc ) { Curl_safefree ( ptr -> value ) ; ptr -> value_alloc = FALSE ; } if ( ptr -> contenttype_alloc ) { Curl_safefree ( ptr -> contenttype ) ; ptr -> contenttype_alloc = FALSE ; } if ( ptr -> showfilename_alloc ) { Curl_safefree ( ptr -> showfilename ) ; ptr -> showfilename_alloc = FALSE ; } } } } while ( first_form ) { FormInfo * ptr = first_form -> more ; Curl_safefree ( first_form ) ; first_form = ptr ; } return return_value ; }
1True
Categorize the following code snippet as vulnerable or not. True or False
int ReconnectToServer ( ArchiveHandle * AH , const char * dbname , const char * username ) { PGconn * newConn ; const char * newdbname ; const char * newusername ; if ( ! dbname ) newdbname = PQdb ( AH -> connection ) ; else newdbname = dbname ; if ( ! username ) newusername = PQuser ( AH -> connection ) ; else newusername = username ; if ( strcmp ( newdbname , PQdb ( AH -> connection ) ) == 0 && strcmp ( newusername , PQuser ( AH -> connection ) ) == 0 ) return 1 ; newConn = _connectDB ( AH , newdbname , newusername ) ; set_archive_cancel_info ( AH , newConn ) ; PQfinish ( AH -> connection ) ; AH -> connection = newConn ; return 1 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void pdf_process_EMC ( fz_context * ctx , pdf_processor * proc , pdf_csi * csi ) { if ( proc -> op_EMC ) proc -> op_EMC ( ctx , proc ) ; if ( proc -> hidden > 0 ) -- proc -> hidden ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
unsigned int vp9_variance ## W ## x ## H ## _c ( const uint8_t * a , int a_stride , const uint8_t * b , int b_stride , unsigned int * sse ) { int sum ; variance ( a , a_stride , b , b_stride , W , H , sse , & sum ) ; return * sse - ( ( ( int64_t ) sum * sum ) / ( W * H ) ) ; \ } # define SUBPIX_VAR ( W , H ) unsigned int vp9_sub_pixel_variance ## W ## x ## H ## _c ( const uint8_t * src , int src_stride , int xoffset , int yoffset , const uint8_t * dst , int dst_stride , unsigned int * sse ) { uint16_t fdata3 [ ( H + 1 ) * W ] ; uint8_t temp2 [ H * W ] ; var_filter_block2d_bil_first_pass ( src , fdata3 , src_stride , 1 , H + 1 , W , BILINEAR_FILTERS_2TAP ( xoffset ) ) ; var_filter_block2d_bil_second_pass ( fdata3 , temp2 , W , W , H , W , BILINEAR_FILTERS_2TAP ( yoffset ) ) ; return vp9_variance ## W ## x ## H ## _c ( temp2 , W , dst , dst_stride , sse ) ; \ } # define SUBPIX_AVG_VAR ( W , H ) unsigned int vp9_sub_pixel_avg_variance ## W ## x ## H ## _c ( const uint8_t * src , int src_stride , int xoffset , int yoffset , const uint8_t * dst , int dst_stride , unsigned int * sse , const uint8_t * second_pred ) { uint16_t fdata3 [ ( H + 1 ) * W ] ; uint8_t temp2 [ H * W ] ; DECLARE_ALIGNED_ARRAY ( 16 , uint8_t , temp3 , H * W ) ; var_filter_block2d_bil_first_pass ( src , fdata3 , src_stride , 1 , H + 1 , W , BILINEAR_FILTERS_2TAP ( xoffset ) ) ; var_filter_block2d_bil_second_pass ( fdata3 , temp2 , W , W , H , W , BILINEAR_FILTERS_2TAP ( yoffset ) ) ; vp9_comp_avg_pred ( temp3 , second_pred , W , H , temp2 , W ) ; return vp9_variance ## W ## x ## H ## _c ( temp3 , W , dst , dst_stride , sse ) ; \ } void vp9_get16x16var_c ( const uint8_t * src_ptr , int source_stride , const uint8_t * ref_ptr , int ref_stride , unsigned int * sse , int * sum ) { variance ( src_ptr , source_stride , ref_ptr , ref_stride , 16 , 16 , sse , sum ) ; } void vp9_get8x8var_c ( const uint8_t * src_ptr , int source_stride , const uint8_t * ref_ptr , int ref_stride , unsigned int * sse , int * sum ) { variance ( src_ptr , source_stride , ref_ptr , ref_stride , 8 , 8 , sse , sum ) ; } unsigned int vp9_mse16x16_c ( const uint8_t * src , int src_stride , const uint8_t * ref , int ref_stride , unsigned int * sse ) { int sum ; variance ( src , src_stride , ref , ref_stride , 16 , 16 , sse , & sum ) ; return * sse ; } unsigned int vp9_mse16x8_c ( const uint8_t * src , int src_stride , const uint8_t * ref , int ref_stride , unsigned int * sse ) { int sum ; variance ( src , src_stride , ref , ref_stride , 16 , 8 , sse , & sum ) ; return * sse ; } unsigned int vp9_mse8x16_c ( const uint8_t * src , int src_stride , const uint8_t * ref , int ref_stride , unsigned int * sse ) { int sum ; variance ( src , src_stride , ref , ref_stride , 8 , 16 , sse , & sum ) ; return * sse ; } unsigned int vp9_mse8x8_c ( const uint8_t * src , int src_stride , const uint8_t * ref , int ref_stride , unsigned int * sse ) { int sum ; variance ( src , src_stride , ref , ref_stride , 8 , 8 , sse , & sum ) ; return * sse ; } VAR ( 4 , 4 )
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_h225_PrintableString ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) { offset = dissect_per_PrintableString ( tvb , offset , actx , tree , hf_index , NO_BOUND , NO_BOUND , FALSE ) ; return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void cancel_directory_count_for_file ( NautilusDirectory * directory , NautilusFile * file ) { if ( directory -> details -> count_in_progress != NULL && directory -> details -> count_in_progress -> count_file == file ) { directory_count_cancel ( directory ) ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void DupTagList ( struct _cmsContext_struct * ctx , const struct _cmsContext_struct * src ) { _cmsTagPluginChunkType newHead = { NULL } ; _cmsTagLinkedList * entry ; _cmsTagLinkedList * Anterior = NULL ; _cmsTagPluginChunkType * head = ( _cmsTagPluginChunkType * ) src -> chunks [ TagPlugin ] ; for ( entry = head -> Tag ; entry != NULL ; entry = entry -> Next ) { _cmsTagLinkedList * newEntry = ( _cmsTagLinkedList * ) _cmsSubAllocDup ( ctx -> MemPool , entry , sizeof ( _cmsTagLinkedList ) ) ; if ( newEntry == NULL ) return ; newEntry -> Next = NULL ; if ( Anterior ) Anterior -> Next = newEntry ; Anterior = newEntry ; if ( newHead . Tag == NULL ) newHead . Tag = newEntry ; } ctx -> chunks [ TagPlugin ] = _cmsSubAllocDup ( ctx -> MemPool , & newHead , sizeof ( _cmsTagPluginChunkType ) ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static gboolean delete_cb ( GtkDialog * dialog ) { gtk_dialog_response ( dialog , GTK_RESPONSE_DELETE_EVENT ) ; return TRUE ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
void setup_logfile ( const char * name ) { if ( NULL == syslog_fname && NULL != name ) { if ( - 1 == change_logfile ( name , TRUE ) ) msyslog ( LOG_ERR , "Cannot open log file %s, %m" , name ) ; return ; } if ( NULL == syslog_fname ) return ; if ( - 1 == change_logfile ( syslog_fname , FALSE ) ) msyslog ( LOG_ERR , "Cannot reopen log file %s, %m" , syslog_fname ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void _tiffUnmapProc ( thandle_t fd , void * base , toff_t size ) { ( void ) fd ; ( void ) base ; ( void ) size ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
int phar_open_or_create_tar ( char * fname , int fname_len , char * alias , int alias_len , int is_data , int options , phar_archive_data * * pphar , char * * error TSRMLS_DC ) { phar_archive_data * phar ; int ret = phar_create_or_parse_filename ( fname , fname_len , alias , alias_len , is_data , options , & phar , error TSRMLS_CC ) ; if ( FAILURE == ret ) { return FAILURE ; } if ( pphar ) { * pphar = phar ; } phar -> is_data = is_data ; if ( phar -> is_tar ) { return ret ; } if ( phar -> is_brandnew ) { phar -> is_tar = 1 ; phar -> is_zip = 0 ; phar -> internal_file_start = 0 ; return SUCCESS ; } if ( error ) { spprintf ( error , 4096 , "phar tar error: \"%s\" already exists as a regular phar and must be deleted from disk prior to creating as a tar-based phar" , fname ) ; } return FAILURE ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_h245_T_reverseLogicalChannelNumber ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) { offset = dissect_h245_LogicalChannelNumber ( tvb , offset , actx , tree , hf_index ) ; # line 288 "../../asn1/h245/h245.cnf" h223_rev_lc_num = h245_lc_temp ; return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void typhoon_set_isa_irq ( void * opaque , int irq , int level ) { typhoon_set_irq ( opaque , 55 , level ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_h245_SET_SIZE_1_256_OF_CapabilityDescriptor ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) { offset = dissect_per_constrained_set_of ( tvb , offset , actx , tree , hf_index , ett_h245_SET_SIZE_1_256_OF_CapabilityDescriptor , SET_SIZE_1_256_OF_CapabilityDescriptor_set_of , 1 , 256 , FALSE ) ; return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static gint check_diameter ( tvbuff_t * tvb ) { guint32 diam_len ; guint8 flags ; if ( tvb_captured_length ( tvb ) < 5 ) return NOT_ENOUGH_DATA ; if ( tvb_get_guint8 ( tvb , 0 ) != 1 ) return NOT_DIAMETER ; diam_len = tvb_get_ntoh24 ( tvb , 1 ) ; if ( diam_len > 65534 ) return NOT_DIAMETER ; if ( diam_len < 36 ) return NOT_DIAMETER ; flags = tvb_get_guint8 ( tvb , 4 ) ; if ( flags & 0x0f ) return NOT_DIAMETER ; if ( ( flags & DIAM_FLAGS_R ) && ( flags & DIAM_FLAGS_E ) ) return NOT_DIAMETER ; return IS_DIAMETER ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
TEST_F ( AutocompleteResultTest , SortAndCullWithMatchDups ) { TemplateURLData url_data ; url_data . SetShortName ( base : : ASCIIToUTF16 ( "unittest" ) ) ; url_data . SetKeyword ( base : : ASCIIToUTF16 ( "foo" ) ) ; url_data . SetURL ( "http://www.foo.com/s?q={ searchTerms} " ) ; template_url_service_ . get ( ) -> Add ( new TemplateURL ( url_data ) ) ; AutocompleteMatch dup_match ; dup_match . destination_url = GURL ( "http://www.foo.com/s?q=foo&oq=dup" ) ; std : : vector < AutocompleteMatch > dups ; dups . push_back ( dup_match ) ; TestData data [ ] = { { 0 , 1 , 1300 , true , dups } , { 1 , 1 , 1200 , true } , { 2 , 1 , 1100 , true } , { 3 , 1 , 1000 , true , dups } , { 4 , 2 , 900 , true } , { 5 , 1 , 800 , true } , } ; ACMatches matches ; PopulateAutocompleteMatches ( data , arraysize ( data ) , & matches ) ; matches [ 0 ] . destination_url = GURL ( "http://www.foo.com/s?q=foo" ) ; matches [ 1 ] . destination_url = GURL ( "http://www.foo.com/s?q=foo2" ) ; matches [ 2 ] . destination_url = GURL ( "http://www.foo.com/s?q=foo&oq=f" ) ; matches [ 3 ] . destination_url = GURL ( "http://www.foo.com/s?q=foo&aqs=0" ) ; matches [ 4 ] . destination_url = GURL ( "http://www.foo.com/" ) ; matches [ 5 ] . destination_url = GURL ( "http://www.foo.com/s?q=foo2&oq=f" ) ; AutocompleteInput input ( base : : string16 ( ) , base : : string16 : : npos , std : : string ( ) , GURL ( ) , OmniboxEventProto : : INVALID_SPEC , false , false , false , true , false , TestSchemeClassifier ( ) ) ; AutocompleteResult result ; result . AppendMatches ( input , matches ) ; result . SortAndCull ( input , template_url_service_ . get ( ) ) ; ASSERT_EQ ( 3U , result . size ( ) ) ; ASSERT_EQ ( 4U , result . match_at ( 0 ) -> duplicate_matches . size ( ) ) ; const AutocompleteMatch * first_match = result . match_at ( 0 ) ; EXPECT_EQ ( matches [ 2 ] . destination_url , first_match -> duplicate_matches . at ( 1 ) . destination_url ) ; EXPECT_EQ ( dup_match . destination_url , first_match -> duplicate_matches . at ( 2 ) . destination_url ) ; EXPECT_EQ ( matches [ 3 ] . destination_url , first_match -> duplicate_matches . at ( 3 ) . destination_url ) ; ASSERT_EQ ( 1U , result . match_at ( 1 ) -> duplicate_matches . size ( ) ) ; EXPECT_EQ ( matches [ 5 ] . destination_url , result . match_at ( 1 ) -> duplicate_matches . at ( 0 ) . destination_url ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int kvm_put_tscdeadline_msr ( X86CPU * cpu ) { CPUX86State * env = & cpu -> env ; int ret ; if ( ! has_msr_tsc_deadline ) { return 0 ; } ret = kvm_put_one_msr ( cpu , MSR_IA32_TSCDEADLINE , env -> tsc_deadline ) ; if ( ret < 0 ) { return ret ; } assert ( ret == 1 ) ; return 0 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
TEST_F ( WebFrameTest , GetCanonicalUrlForSharing ) { FrameTestHelpers : : WebViewHelper web_view_helper ; web_view_helper . Initialize ( ) ; WebLocalFrameImpl * frame = web_view_helper . LocalMainFrame ( ) ; FrameTestHelpers : : LoadHTMLString ( frame , R "( < head > < link rel = "canonical" href = "https://example.com/canonical.html" > < / head > ) ", ToKURL(" https : EXPECT_EQ ( WebURL ( ToKURL ( "https://example.com/canonical.html" ) ) , frame -> GetDocument ( ) . CanonicalUrlForSharing ( ) ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void http_chunked_request_done ( struct evhttp_request * req , void * arg ) { if ( req -> response_code != HTTP_OK ) { fprintf ( stderr , "FAILED\n" ) ; exit ( 1 ) ; } if ( evhttp_find_header ( req -> input_headers , "Transfer-Encoding" ) == NULL ) { fprintf ( stderr , "FAILED\n" ) ; exit ( 1 ) ; } if ( EVBUFFER_LENGTH ( req -> input_buffer ) != 13 + 18 + 8 ) { fprintf ( stderr , "FAILED\n" ) ; exit ( 1 ) ; } if ( strncmp ( ( char * ) EVBUFFER_DATA ( req -> input_buffer ) , "This is funnybut not hilarious.bwv 1052" , + 18 + 8 ) ) { fprintf ( stderr , "FAILED\n" ) ; exit ( 1 ) ; } test_ok = 1 ; event_loopexit ( NULL ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int pxa2xx_cppmnc_write ( CPUARMState * env , const ARMCPRegInfo * ri , uint64_t value ) { PXA2xxState * s = ( PXA2xxState * ) ri -> opaque ; s -> pmnc = value ; return 0 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
bool func_strict ( Oid funcid ) { HeapTuple tp ; bool result ; tp = SearchSysCache1 ( PROCOID , ObjectIdGetDatum ( funcid ) ) ; if ( ! HeapTupleIsValid ( tp ) ) elog ( ERROR , "cache lookup failed for function %u" , funcid ) ; result = ( ( Form_pg_proc ) GETSTRUCT ( tp ) ) -> proisstrict ; ReleaseSysCache ( tp ) ; return result ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void copy_block ( uint8_t * dest , int dest_stride , const uint8_t * src , int src_stride , BLOCK_SIZE bs ) { int r ; for ( r = 0 ; r < heights [ bs ] ; ++ r ) { vpx_memcpy ( dest , src , widths [ bs ] ) ; dest += dest_stride ; src += src_stride ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
static MagickBooleanType IsHDR ( const unsigned char * magick , const size_t length ) { if ( length < 10 ) return ( MagickFalse ) ; if ( LocaleNCompare ( ( const char * ) magick , "#?RADIANCE" , 10 ) == 0 ) return ( MagickTrue ) ; if ( LocaleNCompare ( ( const char * ) magick , "#?RGBE" , 6 ) == 0 ) return ( MagickTrue ) ; return ( MagickFalse ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
int i2d_ ## name ( type * a , unsigned char * * out ) ; DECLARE_ASN1_ITEM ( itname ) # define DECLARE_ASN1_ENCODE_FUNCTIONS_const ( type , name ) type * d2i_ ## name ( type * * a , const unsigned char * * in , long len ) ; int i2d_ ## name ( const type * a , unsigned char * * out ) ; DECLARE_ASN1_ITEM ( name ) # define DECLARE_ASN1_NDEF_FUNCTION ( name ) int i2d_ ## name ## _NDEF ( name * a , unsigned char * * out ) ; # define DECLARE_ASN1_FUNCTIONS_const ( name ) DECLARE_ASN1_ALLOC_FUNCTIONS ( name ) DECLARE_ASN1_ENCODE_FUNCTIONS_const ( name , name ) # define DECLARE_ASN1_ALLOC_FUNCTIONS_name ( type , name ) type * name ## _new ( void ) ; void name ## _free ( type * a ) ; # define DECLARE_ASN1_PRINT_FUNCTION ( stname ) DECLARE_ASN1_PRINT_FUNCTION_fname ( stname , stname ) # define DECLARE_ASN1_PRINT_FUNCTION_fname ( stname , fname ) int fname ## _print_ctx ( BIO * out , stname * x , int indent , const ASN1_PCTX * pctx ) ; # define D2I_OF ( type ) type * ( * ) ( type * * , const unsigned char * * , long ) # define I2D_OF ( type ) int ( * ) ( type * , unsigned char * * ) # define I2D_OF_const ( type ) int ( * ) ( const type * , unsigned char * * ) # define CHECKED_D2I_OF ( type , d2i ) ( ( d2i_of_void * ) ( 1 ? d2i : ( ( D2I_OF ( type ) ) 0 ) ) ) # define CHECKED_I2D_OF ( type , i2d ) ( ( i2d_of_void * ) ( 1 ? i2d : ( ( I2D_OF ( type ) ) 0 ) ) ) # define CHECKED_NEW_OF ( type , xnew ) ( ( void * ( * ) ( void ) ) ( 1 ? xnew : ( ( type * ( * ) ( void ) ) 0 ) ) ) # define CHECKED_PTR_OF ( type , p ) ( ( void * ) ( 1 ? p : ( type * ) 0 ) ) # define CHECKED_PPTR_OF ( type , p ) ( ( void * * ) ( 1 ? p : ( type * * ) 0 ) ) # define TYPEDEF_D2I_OF ( type ) typedef type * d2i_of_ ## type ( type * * , const unsigned char * * , long ) # define TYPEDEF_I2D_OF ( type ) typedef int i2d_of_ ## type ( type * , unsigned char * * ) # define TYPEDEF_D2I2D_OF ( type ) TYPEDEF_D2I_OF ( type ) ; TYPEDEF_I2D_OF ( type ) TYPEDEF_D2I2D_OF ( void ) ; # ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION typedef const ASN1_ITEM ASN1_ITEM_EXP ; # define ASN1_ITEM_ptr ( iptr ) ( iptr ) # define ASN1_ITEM_ref ( iptr ) ( & ( iptr ## _it ) ) # define ASN1_ITEM_rptr ( ref ) ( & ( ref ## _it ) ) # define DECLARE_ASN1_ITEM ( name ) OPENSSL_EXTERN const ASN1_ITEM name ## _it ; # else typedef const ASN1_ITEM * ASN1_ITEM_EXP ( void ) ; # define ASN1_ITEM_ptr ( iptr ) ( iptr ( ) ) # define ASN1_ITEM_ref ( iptr ) ( iptr ## _it ) # define ASN1_ITEM_rptr ( ref ) ( ref ## _it ( ) ) # define DECLARE_ASN1_ITEM ( name ) const ASN1_ITEM * name ## _it ( void ) ; # endif # define ASN1_STRFLGS_ESC_2253 1 # define ASN1_STRFLGS_ESC_CTRL 2 # define ASN1_STRFLGS_ESC_MSB 4 # define ASN1_STRFLGS_ESC_QUOTE 8 # define CHARTYPE_PRINTABLESTRING 0x10 # define CHARTYPE_FIRST_ESC_2253 0x20 # define CHARTYPE_LAST_ESC_2253 0x40 # define ASN1_STRFLGS_UTF8_CONVERT 0x10 # define ASN1_STRFLGS_IGNORE_TYPE 0x20 # define ASN1_STRFLGS_SHOW_TYPE 0x40 # define ASN1_STRFLGS_DUMP_ALL 0x80 # define ASN1_STRFLGS_DUMP_UNKNOWN 0x100 # define ASN1_STRFLGS_DUMP_DER 0x200 # define ASN1_STRFLGS_ESC_2254 0x400 # define ASN1_STRFLGS_RFC2253 ( ASN1_STRFLGS_ESC_2253 | ASN1_STRFLGS_ESC_CTRL | ASN1_STRFLGS_ESC_MSB | ASN1_STRFLGS_UTF8_CONVERT | ASN1_STRFLGS_DUMP_UNKNOWN | ASN1_STRFLGS_DUMP_DER ) DEFINE_STACK_OF ( ASN1_INTEGER ) DEFINE_STACK_OF ( ASN1_GENERALSTRING ) DEFINE_STACK_OF ( ASN1_UTF8STRING ) typedef struct asn1_type_st { int type ; union { char * ptr ; ASN1_BOOLEAN boolean ; ASN1_STRING * asn1_string ; ASN1_OBJECT * object ; ASN1_INTEGER * integer ; ASN1_ENUMERATED * enumerated ; ASN1_BIT_STRING * bit_string ; ASN1_OCTET_STRING * octet_string ; ASN1_PRINTABLESTRING * printablestring ; ASN1_T61STRING * t61string ; ASN1_IA5STRING * ia5string ; ASN1_GENERALSTRING * generalstring ; ASN1_BMPSTRING * bmpstring ; ASN1_UNIVERSALSTRING * universalstring ; ASN1_UTCTIME * utctime ; ASN1_GENERALIZEDTIME * generalizedtime ; ASN1_VISIBLESTRING * visiblestring ; ASN1_UTF8STRING * utf8string ; ASN1_STRING * set ; ASN1_STRING * sequence ; ASN1_VALUE * asn1_value ; } value ; } ASN1_TYPE ; DEFINE_STACK_OF ( ASN1_TYPE ) typedef STACK_OF ( ASN1_TYPE ) ASN1_SEQUENCE_ANY ; DECLARE_ASN1_ENCODE_FUNCTIONS_const ( ASN1_SEQUENCE_ANY , ASN1_SEQUENCE_ANY ) DECLARE_ASN1_ENCODE_FUNCTIONS_const ( ASN1_SEQUENCE_ANY , ASN1_SET_ANY ) typedef struct BIT_STRING_BITNAME_st { int bitnum ; const char * lname ; const char * sname ; } BIT_STRING_BITNAME ; # define B_ASN1_TIME B_ASN1_UTCTIME | B_ASN1_GENERALIZEDTIME # define B_ASN1_PRINTABLE B_ASN1_NUMERICSTRING | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING | B_ASN1_BIT_STRING | B_ASN1_UNIVERSALSTRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING | B_ASN1_SEQUENCE | B_ASN1_UNKNOWN # define B_ASN1_DIRECTORYSTRING B_ASN1_PRINTABLESTRING | B_ASN1_TELETEXSTRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING | B_ASN1_UTF8STRING # define B_ASN1_DISPLAYTEXT B_ASN1_IA5STRING | B_ASN1_VISIBLESTRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING DECLARE_ASN1_FUNCTIONS_fname ( ASN1_TYPE , ASN1_ANY , ASN1_TYPE ) int ASN1_TYPE_get ( const ASN1_TYPE * a ) ; void ASN1_TYPE_set ( ASN1_TYPE * a , int type , void * value ) ; int ASN1_TYPE_set1 ( ASN1_TYPE * a , int type , const void * value ) ; int ASN1_TYPE_cmp ( const ASN1_TYPE * a , const ASN1_TYPE * b ) ; ASN1_TYPE * ASN1_TYPE_pack_sequence ( const ASN1_ITEM * it , void * s , ASN1_TYPE * * t ) ; void * ASN1_TYPE_unpack_sequence ( const ASN1_ITEM * it , const ASN1_TYPE * t ) ; ASN1_OBJECT * ASN1_OBJECT_new ( void ) ; void ASN1_OBJECT_free ( ASN1_OBJECT * a ) ; int i2d_ASN1_OBJECT ( const ASN1_OBJECT * a , unsigned char * * pp ) ; ASN1_OBJECT * d2i_ASN1_OBJECT ( ASN1_OBJECT * * a , const unsigned char * * pp , long length ) ; DECLARE_ASN1_ITEM ( ASN1_OBJECT ) DEFINE_STACK_OF ( ASN1_OBJECT ) ASN1_STRING * ASN1_STRING_new ( void ) ; void ASN1_STRING_free ( ASN1_STRING * a ) ; void ASN1_STRING_clear_free ( ASN1_STRING * a ) ; int ASN1_STRING_copy ( ASN1_STRING * dst , const ASN1_STRING * str ) ; ASN1_STRING * ASN1_STRING_dup ( const ASN1_STRING * a ) ; ASN1_STRING * ASN1_STRING_type_new ( int type ) ; int ASN1_STRING_cmp ( const ASN1_STRING * a , const ASN1_STRING * b ) ; int ASN1_STRING_set ( ASN1_STRING * str , const void * data , int len ) ; void ASN1_STRING_set0 ( ASN1_STRING * str , void * data , int len ) ; int ASN1_STRING_length ( const ASN1_STRING * x ) ; void ASN1_STRING_length_set ( ASN1_STRING * x , int n ) ; int ASN1_STRING_type ( const ASN1_STRING * x ) ; DEPRECATEDIN_1_1_0 ( unsigned char * ASN1_STRING_data ( ASN1_STRING * x ) ) const unsigned char * ASN1_STRING_get0_data ( const ASN1_STRING * x ) ; DECLARE_ASN1_FUNCTIONS ( ASN1_BIT_STRING ) int ASN1_BIT_STRING_set ( ASN1_BIT_STRING * a , unsigned char * d , int length ) ; int ASN1_BIT_STRING_set_bit ( ASN1_BIT_STRING * a , int n , int value ) ; int ASN1_BIT_STRING_get_bit ( const ASN1_BIT_STRING * a , int n ) ; int ASN1_BIT_STRING_check ( const ASN1_BIT_STRING * a , const unsigned char * flags , int flags_len ) ; int ASN1_BIT_STRING_name_print ( BIO * out , ASN1_BIT_STRING * bs , BIT_STRING_BITNAME * tbl , int indent ) ; int ASN1_BIT_STRING_num_asc ( const char * name , BIT_STRING_BITNAME * tbl ) ; int ASN1_BIT_STRING_set_asc ( ASN1_BIT_STRING * bs , const char * name , int value , BIT_STRING_BITNAME * tbl ) ; DECLARE_ASN1_FUNCTIONS ( ASN1_INTEGER ) ASN1_INTEGER * d2i_ASN1_UINTEGER ( ASN1_INTEGER * * a , const unsigned char * * pp , long length ) ; ASN1_INTEGER * ASN1_INTEGER_dup ( const ASN1_INTEGER * x ) ; int ASN1_INTEGER_cmp ( const ASN1_INTEGER * x , const ASN1_INTEGER * y ) ; DECLARE_ASN1_FUNCTIONS ( ASN1_ENUMERATED ) int ASN1_UTCTIME_check ( const ASN1_UTCTIME * a ) ; ASN1_UTCTIME * ASN1_UTCTIME_set ( ASN1_UTCTIME * s , time_t t ) ; ASN1_UTCTIME * ASN1_UTCTIME_adj ( ASN1_UTCTIME * s , time_t t , int offset_day , long offset_sec ) ; int ASN1_UTCTIME_set_string ( ASN1_UTCTIME * s , const char * str ) ; int ASN1_UTCTIME_cmp_time_t ( const ASN1_UTCTIME * s , time_t t ) ; int ASN1_GENERALIZEDTIME_check ( const ASN1_GENERALIZEDTIME * a ) ; ASN1_GENERALIZEDTIME * ASN1_GENERALIZEDTIME_set ( ASN1_GENERALIZEDTIME * s , time_t t ) ; ASN1_GENERALIZEDTIME * ASN1_GENERALIZEDTIME_adj ( ASN1_GENERALIZEDTIME * s , time_t t , int offset_day , long offset_sec ) ; int ASN1_GENERALIZEDTIME_set_string ( ASN1_GENERALIZEDTIME * s , const char * str ) ; int ASN1_TIME_diff ( int * pday , int * psec , const ASN1_TIME * from , const ASN1_TIME * to ) ; DECLARE_ASN1_FUNCTIONS ( ASN1_OCTET_STRING ) ASN1_OCTET_STRING * ASN1_OCTET_STRING_dup ( const ASN1_OCTET_STRING * a ) ; int ASN1_OCTET_STRING_cmp ( const ASN1_OCTET_STRING * a , const ASN1_OCTET_STRING * b ) ; int ASN1_OCTET_STRING_set ( ASN1_OCTET_STRING * str , const unsigned char * data , int len ) ; DECLARE_ASN1_FUNCTIONS ( ASN1_VISIBLESTRING ) DECLARE_ASN1_FUNCTIONS ( ASN1_UNIVERSALSTRING )
0False
Categorize the following code snippet as vulnerable or not. True or False
static void mac_is_sdus_hash_destroy ( gpointer data ) { g_hash_table_destroy ( ( GHashTable * ) data ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
IN_PROC_BROWSER_TEST_F ( ProfileBrowserTest , URLFetcherUsingExtensionContextDuringIncognitoTeardown ) { Browser * incognito_browser = OpenURLOffTheRecord ( browser ( ) -> profile ( ) , GURL ( "about:blank" ) ) ; RunURLFetcherActiveDuringIncognitoTeardownTest ( incognito_browser , incognito_browser -> profile ( ) -> GetRequestContextForExtensions ( ) ) ; }
1True
Categorize the following code snippet as vulnerable or not. True or False
static int8_t getNextDynamicWindow ( SCSUData * scsu ) { int8_t window = scsu -> windowUse [ scsu -> nextWindowUseIndex ] ; if ( ++ scsu -> nextWindowUseIndex == 8 ) { scsu -> nextWindowUseIndex = 0 ; } return window ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void icmpmsg_put_line ( struct seq_file * seq , unsigned long * vals , unsigned short * type , int count ) { int j ; if ( count ) { seq_printf ( seq , "\nIcmpMsg:" ) ; for ( j = 0 ; j < count ; ++ j ) seq_printf ( seq , " %sType%u" , type [ j ] & 0x100 ? "Out" : "In" , type [ j ] & 0xff ) ; seq_printf ( seq , "\nIcmpMsg:" ) ; for ( j = 0 ; j < count ; ++ j ) seq_printf ( seq , " %lu" , vals [ j ] ) ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void row_dim_delete ( zval * object , zval * offset TSRMLS_DC ) { php_error_docref ( NULL TSRMLS_CC , E_WARNING , "Cannot delete properties from a PDORow" ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int _fix_java ( const char * in , char * out ) { int i , j ; for ( i = 0 , j = 7 ; i < j ; i ++ , j -- ) { out [ i ] = in [ j ] ; out [ j ] = in [ i ] ; } for ( i = 8 , j = 15 ; i < j ; i ++ , j -- ) { out [ i ] = in [ j ] ; out [ j ] = in [ i ] ; } return 0 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
void proto_reg_handoff_zbee_zcl_appl_ctrl ( void ) { dissector_handle_t appl_ctrl_handle ; appl_ctrl_handle = find_dissector ( ZBEE_PROTOABBREV_ZCL_APPLCTRL ) ; dissector_add_uint ( "zbee.zcl.cluster" , ZBEE_ZCL_CID_APPLIANCE_CONTROL , appl_ctrl_handle ) ; zbee_zcl_init_cluster ( proto_zbee_zcl_appl_ctrl , ett_zbee_zcl_appl_ctrl , ZBEE_ZCL_CID_APPLIANCE_CONTROL , hf_zbee_zcl_appl_ctrl_attr_id , hf_zbee_zcl_appl_ctrl_srv_rx_cmd_id , hf_zbee_zcl_appl_ctrl_srv_tx_cmd_id , ( zbee_zcl_fn_attr_data ) dissect_zcl_appl_ctrl_attr_data ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int sbr_hf_gen ( AACContext * ac , SpectralBandReplication * sbr , float X_high [ 64 ] [ 40 ] [ 2 ] , const float X_low [ 32 ] [ 40 ] [ 2 ] , const float ( * alpha0 ) [ 2 ] , const float ( * alpha1 ) [ 2 ] , const float bw_array [ 5 ] , const uint8_t * t_env , int bs_num_env ) { int j , x ; int g = 0 ; int k = sbr -> kx [ 1 ] ; for ( j = 0 ; j < sbr -> num_patches ; j ++ ) { for ( x = 0 ; x < sbr -> patch_num_subbands [ j ] ; x ++ , k ++ ) { const int p = sbr -> patch_start_subband [ j ] + x ; while ( g <= sbr -> n_q && k >= sbr -> f_tablenoise [ g ] ) g ++ ; g -- ; if ( g < 0 ) { av_log ( ac -> avctx , AV_LOG_ERROR , "ERROR : no subband found for frequency %d\n" , k ) ; return - 1 ; } sbr -> dsp . hf_gen ( X_high [ k ] + ENVELOPE_ADJUSTMENT_OFFSET , X_low [ p ] + ENVELOPE_ADJUSTMENT_OFFSET , alpha0 [ p ] , alpha1 [ p ] , bw_array [ g ] , * t_env [ 0 ] , 2 * t_env [ bs_num_env ] ) ; } } if ( k < sbr -> m [ 1 ] + sbr -> kx [ 1 ] ) memset ( X_high + k , 0 , ( sbr -> m [ 1 ] + sbr -> kx [ 1 ] - k ) * sizeof ( * X_high ) ) ; return 0 ; }
1True
Categorize the following code snippet as vulnerable or not. True or False
static void decode_transform_coeffs ( AC3DecodeContext * s , int blk ) { int ch , end ; int got_cplchan = 0 ; mant_groups m ; m . b1 = m . b2 = m . b4 = 0 ; for ( ch = 1 ; ch <= s -> channels ; ch ++ ) { decode_transform_coeffs_ch ( s , blk , ch , & m ) ; if ( s -> channel_in_cpl [ ch ] ) { if ( ! got_cplchan ) { decode_transform_coeffs_ch ( s , blk , CPL_CH , & m ) ; calc_transform_coeffs_cpl ( s ) ; got_cplchan = 1 ; } end = s -> end_freq [ CPL_CH ] ; } else { end = s -> end_freq [ ch ] ; } do s -> fixed_coeffs [ ch ] [ end ] = 0 ; while ( ++ end < 256 ) ; } remove_dithering ( s ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
bool virLogProbablyLogMessage ( const char * str ) { bool ret = false ; if ( ! virLogRegex ) return false ; if ( regexec ( virLogRegex , str , 0 , NULL , 0 ) == 0 ) ret = true ; return ret ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
IN_PROC_BROWSER_TEST_F ( FullscreenControllerTest , MouseLockOnFileURL ) { static const base : : FilePath : : CharType * kEmptyFile = FILE_PATH_LITERAL ( "empty.html" ) ; GURL file_url ( ui_test_utils : : GetTestUrl ( base : : FilePath ( base : : FilePath : : kCurrentDirectory ) , base : : FilePath ( kEmptyFile ) ) ) ; AddTabAtIndex ( 0 , file_url , PAGE_TRANSITION_TYPED ) ; RequestToLockMouse ( true , false ) ; ASSERT_TRUE ( IsFullscreenBubbleDisplayed ( ) ) ; ASSERT_TRUE ( IsFullscreenBubbleDisplayingButtons ( ) ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static char * alnumerize ( char * name ) { char * r = name ; char * w = name ; char c ; for ( ; ( c = * r ) ; r ++ ) { if ( g_ascii_isalnum ( c ) || c == '_' || c == '-' || c == '.' ) { * ( w ++ ) = c ; } } * w = '\0' ; return name ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void U_CALLCONV uprv_writeDirectUInt16 ( uint16_t * p , uint16_t x ) { * p = x ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void gx_ttfReader__Read ( ttfReader * self , void * p , int n ) { gx_ttfReader * r = ( gx_ttfReader * ) self ; const byte * q ; if ( ! r -> error ) { if ( r -> extra_glyph_index != - 1 ) { q = r -> glyph_data . bits . data + r -> pos ; r -> error = ( r -> glyph_data . bits . size - r -> pos < n ? gs_note_error ( gs_error_invalidfont ) : 0 ) ; if ( r -> error == 0 ) memcpy ( p , q , n ) ; } else { unsigned int cnt ; for ( cnt = 0 ; cnt < ( uint ) n ; cnt += r -> error ) { r -> error = r -> pfont -> data . string_proc ( r -> pfont , ( ulong ) r -> pos + cnt , ( ulong ) n - cnt , & q ) ; if ( r -> error < 0 ) break ; else if ( r -> error == 0 ) { memcpy ( ( char * ) p + cnt , q , n - cnt ) ; break ; } else { memcpy ( ( char * ) p + cnt , q , r -> error ) ; } } } } if ( r -> error ) { memset ( p , 0 , n ) ; return ; } r -> pos += n ; }
1True
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_pcp_message_instance ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , int offset ) { proto_item * pcp_instances_item ; proto_tree * pcp_instances_tree ; proto_item * pcp_instance_item ; proto_tree * pcp_instance_tree ; guint32 num_inst ; guint32 i ; guint32 name_len ; guint32 padding ; col_append_fstr ( pinfo -> cinfo , COL_INFO , "[%s]" , val_to_str ( PCP_PDU_INSTANCE , packettypenames , "Unknown Type:0x%02x" ) ) ; pcp_instances_item = proto_tree_add_item ( tree , hf_pcp_instances , tvb , offset , - 1 , ENC_NA ) ; pcp_instances_tree = proto_item_add_subtree ( pcp_instances_item , ett_pcp ) ; proto_tree_add_item ( pcp_instances_tree , hf_pcp_instance_indom , tvb , offset , 4 , ENC_BIG_ENDIAN ) ; offset += 4 ; proto_tree_add_item ( pcp_instances_tree , hf_pcp_instances_numinst , tvb , offset , 4 , ENC_BIG_ENDIAN ) ; num_inst = tvb_get_ntohl ( tvb , offset ) ; offset += 4 ; for ( i = 0 ; i < num_inst ; i ++ ) { name_len = tvb_get_ntohl ( tvb , offset + 4 ) ; pcp_instance_item = proto_tree_add_item ( pcp_instances_tree , hf_pcp_instance , tvb , offset , name_len + 8 , ENC_NA ) ; pcp_instance_tree = proto_item_add_subtree ( pcp_instance_item , ett_pcp ) ; proto_tree_add_item ( pcp_instance_tree , hf_pcp_pmid_inst , tvb , offset , 4 , ENC_BIG_ENDIAN ) ; offset += 4 ; proto_tree_add_item ( pcp_instance_tree , hf_pcp_instance_namelen , tvb , offset , 4 , ENC_BIG_ENDIAN ) ; offset += 4 ; if ( name_len > 0 ) { proto_tree_add_item ( pcp_instance_tree , hf_pcp_instance_name , tvb , offset , name_len , ENC_ASCII | ENC_NA ) ; offset += name_len ; } padding = name_len % 4 ; if ( padding != 0 ) { padding = 4 - padding ; proto_tree_add_item ( pcp_instance_tree , hf_pcp_pdu_padding , tvb , offset , padding , ENC_NA ) ; offset += padding ; } } return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void update_reference_frames ( VP8_COMP * cpi ) { VP8_COMMON * cm = & cpi -> common ; YV12_BUFFER_CONFIG * yv12_fb = cm -> yv12_fb ; if ( cm -> frame_type == KEY_FRAME ) { yv12_fb [ cm -> new_fb_idx ] . flags |= VP8_GOLD_FRAME | VP8_ALTR_FRAME ; yv12_fb [ cm -> gld_fb_idx ] . flags &= ~ VP8_GOLD_FRAME ; yv12_fb [ cm -> alt_fb_idx ] . flags &= ~ VP8_ALTR_FRAME ; cm -> alt_fb_idx = cm -> gld_fb_idx = cm -> new_fb_idx ; cpi -> current_ref_frames [ GOLDEN_FRAME ] = cm -> current_video_frame ; cpi -> current_ref_frames [ ALTREF_FRAME ] = cm -> current_video_frame ; } else { if ( cm -> refresh_alt_ref_frame ) { assert ( ! cm -> copy_buffer_to_arf ) ; cm -> yv12_fb [ cm -> new_fb_idx ] . flags |= VP8_ALTR_FRAME ; cm -> yv12_fb [ cm -> alt_fb_idx ] . flags &= ~ VP8_ALTR_FRAME ; cm -> alt_fb_idx = cm -> new_fb_idx ; cpi -> current_ref_frames [ ALTREF_FRAME ] = cm -> current_video_frame ; } else if ( cm -> copy_buffer_to_arf ) { assert ( ! ( cm -> copy_buffer_to_arf & ~ 0x3 ) ) ; if ( cm -> copy_buffer_to_arf == 1 ) { if ( cm -> alt_fb_idx != cm -> lst_fb_idx ) { yv12_fb [ cm -> lst_fb_idx ] . flags |= VP8_ALTR_FRAME ; yv12_fb [ cm -> alt_fb_idx ] . flags &= ~ VP8_ALTR_FRAME ; cm -> alt_fb_idx = cm -> lst_fb_idx ; cpi -> current_ref_frames [ ALTREF_FRAME ] = cpi -> current_ref_frames [ LAST_FRAME ] ; } } else { if ( cm -> alt_fb_idx != cm -> gld_fb_idx ) { yv12_fb [ cm -> gld_fb_idx ] . flags |= VP8_ALTR_FRAME ; yv12_fb [ cm -> alt_fb_idx ] . flags &= ~ VP8_ALTR_FRAME ; cm -> alt_fb_idx = cm -> gld_fb_idx ; cpi -> current_ref_frames [ ALTREF_FRAME ] = cpi -> current_ref_frames [ GOLDEN_FRAME ] ; } } } if ( cm -> refresh_golden_frame ) { assert ( ! cm -> copy_buffer_to_gf ) ; cm -> yv12_fb [ cm -> new_fb_idx ] . flags |= VP8_GOLD_FRAME ; cm -> yv12_fb [ cm -> gld_fb_idx ] . flags &= ~ VP8_GOLD_FRAME ; cm -> gld_fb_idx = cm -> new_fb_idx ; cpi -> current_ref_frames [ GOLDEN_FRAME ] = cm -> current_video_frame ; } else if ( cm -> copy_buffer_to_gf ) { assert ( ! ( cm -> copy_buffer_to_arf & ~ 0x3 ) ) ; if ( cm -> copy_buffer_to_gf == 1 ) { if ( cm -> gld_fb_idx != cm -> lst_fb_idx ) { yv12_fb [ cm -> lst_fb_idx ] . flags |= VP8_GOLD_FRAME ; yv12_fb [ cm -> gld_fb_idx ] . flags &= ~ VP8_GOLD_FRAME ; cm -> gld_fb_idx = cm -> lst_fb_idx ; cpi -> current_ref_frames [ GOLDEN_FRAME ] = cpi -> current_ref_frames [ LAST_FRAME ] ; } } else { if ( cm -> alt_fb_idx != cm -> gld_fb_idx ) { yv12_fb [ cm -> alt_fb_idx ] . flags |= VP8_GOLD_FRAME ; yv12_fb [ cm -> gld_fb_idx ] . flags &= ~ VP8_GOLD_FRAME ; cm -> gld_fb_idx = cm -> alt_fb_idx ; cpi -> current_ref_frames [ GOLDEN_FRAME ] = cpi -> current_ref_frames [ ALTREF_FRAME ] ; } } } } if ( cm -> refresh_last_frame ) { cm -> yv12_fb [ cm -> new_fb_idx ] . flags |= VP8_LAST_FRAME ; cm -> yv12_fb [ cm -> lst_fb_idx ] . flags &= ~ VP8_LAST_FRAME ; cm -> lst_fb_idx = cm -> new_fb_idx ; cpi -> current_ref_frames [ LAST_FRAME ] = cm -> current_video_frame ; } # if CONFIG_TEMPORAL_DENOISING if ( cpi -> oxcf . noise_sensitivity ) { if ( cm -> frame_type == KEY_FRAME ) { int i ; for ( i = LAST_FRAME ; i < MAX_REF_FRAMES ; ++ i ) vp8_yv12_copy_frame ( cpi -> Source , & cpi -> denoiser . yv12_running_avg [ i ] ) ; } else { vp8_yv12_extend_frame_borders ( & cpi -> denoiser . yv12_running_avg [ INTRA_FRAME ] ) ; if ( cm -> refresh_alt_ref_frame || cm -> copy_buffer_to_arf ) { vp8_yv12_copy_frame ( & cpi -> denoiser . yv12_running_avg [ INTRA_FRAME ] , & cpi -> denoiser . yv12_running_avg [ ALTREF_FRAME ] ) ; } if ( cm -> refresh_golden_frame || cm -> copy_buffer_to_gf ) { vp8_yv12_copy_frame ( & cpi -> denoiser . yv12_running_avg [ INTRA_FRAME ] , & cpi -> denoiser . yv12_running_avg [ GOLDEN_FRAME ] ) ; } if ( cm -> refresh_last_frame ) { vp8_yv12_copy_frame ( & cpi -> denoiser . yv12_running_avg [ INTRA_FRAME ] , & cpi -> denoiser . yv12_running_avg [ LAST_FRAME ] ) ; } } if ( cpi -> oxcf . noise_sensitivity == 4 ) vp8_yv12_copy_frame ( cpi -> Source , & cpi -> denoiser . yv12_last_source ) ; } # endif }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_h245_Cmd_errorCorrection ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) { offset = dissect_per_choice ( tvb , offset , actx , tree , hf_index , ett_h245_Cmd_errorCorrection , Cmd_errorCorrection_choice , NULL ) ; return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void dec_usb_memory_use_count ( struct usb_memory * usbm , int * count ) { struct usb_dev_state * ps = usbm -> ps ; unsigned long flags ; spin_lock_irqsave ( & ps -> lock , flags ) ; -- * count ; if ( usbm -> urb_use_count == 0 && usbm -> vma_use_count == 0 ) { list_del ( & usbm -> memlist ) ; spin_unlock_irqrestore ( & ps -> lock , flags ) ; usb_free_coherent ( ps -> dev , usbm -> size , usbm -> mem , usbm -> dma_handle ) ; usbfs_decrease_memory_usage ( usbm -> size + sizeof ( struct usb_memory ) ) ; kfree ( usbm ) ; } else { spin_unlock_irqrestore ( & ps -> lock , flags ) ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
static cmsBool ReadOneElem ( cmsIOHANDLER * io , _cmsDICelem * e , cmsUInt32Number i , cmsUInt32Number BaseOffset ) { if ( ! _cmsReadUInt32Number ( io , & e -> Offsets [ i ] ) ) return FALSE ; if ( ! _cmsReadUInt32Number ( io , & e -> Sizes [ i ] ) ) return FALSE ; if ( e -> Offsets [ i ] > 0 ) e -> Offsets [ i ] += BaseOffset ; return TRUE ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int lock_all ( KEYDB_HANDLE hd ) { int i , rc = 0 ; for ( i = 0 ; ! rc && i < hd -> used ; i ++ ) { switch ( hd -> active [ i ] . type ) { case KEYDB_RESOURCE_TYPE_NONE : break ; case KEYDB_RESOURCE_TYPE_KEYRING : rc = keyring_lock ( hd -> active [ i ] . u . kr , 1 ) ; break ; case KEYDB_RESOURCE_TYPE_KEYBOX : rc = keybox_lock ( hd -> active [ i ] . u . kb , 1 ) ; break ; } } if ( rc ) { for ( i -- ; i >= 0 ; i -- ) { switch ( hd -> active [ i ] . type ) { case KEYDB_RESOURCE_TYPE_NONE : break ; case KEYDB_RESOURCE_TYPE_KEYRING : keyring_lock ( hd -> active [ i ] . u . kr , 0 ) ; break ; case KEYDB_RESOURCE_TYPE_KEYBOX : rc = keybox_lock ( hd -> active [ i ] . u . kb , 0 ) ; break ; } } } else hd -> locked = 1 ; return rc ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_h225_Status_UUIE ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) { # line 388 "./asn1/h225/h225.cnf" h225_packet_info * h225_pi ; offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h225_Status_UUIE , Status_UUIE_sequence ) ; # line 392 "./asn1/h225/h225.cnf" h225_pi = ( h225_packet_info * ) p_get_proto_data ( wmem_packet_scope ( ) , actx -> pinfo , proto_h225 , 0 ) ; if ( h225_pi != NULL ) { h225_pi -> cs_type = H225_STATUS ; g_snprintf ( h225_pi -> frame_label , 50 , "%s" , val_to_str ( h225_pi -> cs_type , T_h323_message_body_vals , "<unknown>" ) ) ; } return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
void http_request_empty_done ( struct evhttp_request * req , void * arg ) { if ( req -> response_code != HTTP_OK ) { fprintf ( stderr , "FAILED\n" ) ; exit ( 1 ) ; } if ( evhttp_find_header ( req -> input_headers , "Date" ) == NULL ) { fprintf ( stderr , "FAILED\n" ) ; exit ( 1 ) ; } if ( evhttp_find_header ( req -> input_headers , "Content-Length" ) == NULL ) { fprintf ( stderr , "FAILED\n" ) ; exit ( 1 ) ; } if ( strcmp ( evhttp_find_header ( req -> input_headers , "Content-Length" ) , "0" ) ) { fprintf ( stderr , "FAILED\n" ) ; exit ( 1 ) ; } if ( EVBUFFER_LENGTH ( req -> input_buffer ) != 0 ) { fprintf ( stderr , "FAILED\n" ) ; exit ( 1 ) ; } test_ok = 1 ; event_loopexit ( NULL ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void dropTablespaces ( PGconn * conn ) { PGresult * res ; int i ; res = executeQuery ( conn , "SELECT spcname " "FROM pg_catalog.pg_tablespace " "WHERE spcname !~ '^pg_' " "ORDER BY 1" ) ; if ( PQntuples ( res ) > 0 ) fprintf ( OPF , "--\n-- Drop tablespaces\n--\n\n" ) ; for ( i = 0 ; i < PQntuples ( res ) ; i ++ ) { char * spcname = PQgetvalue ( res , i , 0 ) ; fprintf ( OPF , "DROP TABLESPACE %s%s; \n" , if_exists ? "IF EXISTS " : "" , fmtId ( spcname ) ) ; } PQclear ( res ) ; fprintf ( OPF , "\n\n" ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void scls_init ( QEMUMachineInitArgs * args ) { ram_addr_t RAM_size = args -> ram_size ; const char * cpu_model = args -> cpu_model ; const char * kernel_filename = args -> kernel_filename ; const char * kernel_cmdline = args -> kernel_cmdline ; const char * initrd_filename = args -> initrd_filename ; const char * boot_device = args -> boot_device ; sun4m_hw_init ( & sun4m_hwdefs [ 7 ] , RAM_size , boot_device , kernel_filename , kernel_cmdline , initrd_filename , cpu_model ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int x ( struct vcache * avc , int afun , struct vrequest * areq , \ struct afs_pdata * ain , struct afs_pdata * aout , \ afs_ucred_t * * acred ) DECL_PIOCTL ( PGetFID ) ; DECL_PIOCTL ( PSetAcl ) ; DECL_PIOCTL ( PStoreBehind ) ; DECL_PIOCTL ( PGCPAGs ) ; DECL_PIOCTL ( PGetAcl ) ; DECL_PIOCTL ( PNoop ) ; DECL_PIOCTL ( PBogus ) ; DECL_PIOCTL ( PGetFileCell ) ; DECL_PIOCTL ( PGetWSCell ) ; DECL_PIOCTL ( PGetUserCell ) ; DECL_PIOCTL ( PSetTokens ) ; DECL_PIOCTL ( PGetVolumeStatus ) ; DECL_PIOCTL ( PSetVolumeStatus ) ; DECL_PIOCTL ( PFlush ) ; DECL_PIOCTL ( PNewStatMount ) ; DECL_PIOCTL ( PGetTokens ) ; DECL_PIOCTL ( PUnlog ) ; DECL_PIOCTL ( PMariner ) ; DECL_PIOCTL ( PCheckServers ) ; DECL_PIOCTL ( PCheckVolNames ) ; DECL_PIOCTL ( PCheckAuth ) ; DECL_PIOCTL ( PFindVolume ) ; DECL_PIOCTL ( PViceAccess ) ; DECL_PIOCTL ( PSetCacheSize ) ; DECL_PIOCTL ( PGetCacheSize ) ; DECL_PIOCTL ( PRemoveCallBack ) ; DECL_PIOCTL ( PNewCell ) ; DECL_PIOCTL ( PNewAlias ) ; DECL_PIOCTL ( PListCells ) ; DECL_PIOCTL ( PListAliases ) ; DECL_PIOCTL ( PRemoveMount ) ; DECL_PIOCTL ( PGetCellStatus ) ; DECL_PIOCTL ( PSetCellStatus ) ; DECL_PIOCTL ( PFlushVolumeData ) ; DECL_PIOCTL ( PFlushAllVolumeData ) ; DECL_PIOCTL ( PGetVnodeXStatus ) ; DECL_PIOCTL ( PGetVnodeXStatus2 ) ; DECL_PIOCTL ( PSetSysName ) ; DECL_PIOCTL ( PSetSPrefs ) ; DECL_PIOCTL ( PSetSPrefs33 ) ; DECL_PIOCTL ( PGetSPrefs ) ; DECL_PIOCTL ( PExportAfs ) ; DECL_PIOCTL ( PGag ) ; DECL_PIOCTL ( PTwiddleRx ) ; DECL_PIOCTL ( PGetInitParams ) ; DECL_PIOCTL ( PGetRxkcrypt ) ; DECL_PIOCTL ( PSetRxkcrypt ) ; DECL_PIOCTL ( PGetCPrefs ) ; DECL_PIOCTL ( PSetCPrefs ) ; DECL_PIOCTL ( PFlushMount ) ; DECL_PIOCTL ( PRxStatProc ) ; DECL_PIOCTL ( PRxStatPeer ) ; DECL_PIOCTL ( PPrefetchFromTape ) ; DECL_PIOCTL ( PFsCmd ) ; DECL_PIOCTL ( PCallBackAddr ) ; DECL_PIOCTL ( PDiscon ) ; DECL_PIOCTL ( PNFSNukeCreds )
0False
Categorize the following code snippet as vulnerable or not. True or False
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 , int ( * restrict_link ) ( struct key * , const struct key_type * , const union key_payload * ) ) { struct key_user * user = NULL ; struct key * key ; size_t desclen , quotalen ; int ret ; key = ERR_PTR ( - EINVAL ) ; if ( ! desc || ! * desc ) goto error ; if ( type -> vet_description ) { ret = type -> vet_description ( desc ) ; if ( ret < 0 ) { key = ERR_PTR ( ret ) ; goto error ; } } desclen = strlen ( desc ) ; quotalen = desclen + 1 + type -> def_datalen ; user = key_user_lookup ( uid ) ; if ( ! user ) goto no_memory_1 ; if ( ! ( flags & KEY_ALLOC_NOT_IN_QUOTA ) ) { unsigned maxkeys = uid_eq ( uid , GLOBAL_ROOT_UID ) ? key_quota_root_maxkeys : key_quota_maxkeys ; unsigned maxbytes = uid_eq ( uid , GLOBAL_ROOT_UID ) ? key_quota_root_maxbytes : key_quota_maxbytes ; spin_lock ( & user -> lock ) ; if ( ! ( flags & KEY_ALLOC_QUOTA_OVERRUN ) ) { if ( user -> qnkeys + 1 >= maxkeys || user -> qnbytes + quotalen >= maxbytes || user -> qnbytes + quotalen < user -> qnbytes ) goto no_quota ; } user -> qnkeys ++ ; user -> qnbytes += quotalen ; spin_unlock ( & user -> lock ) ; } key = kmem_cache_zalloc ( key_jar , GFP_KERNEL ) ; if ( ! key ) goto no_memory_2 ; key -> index_key . desc_len = desclen ; key -> index_key . description = kmemdup ( desc , desclen + 1 , GFP_KERNEL ) ; if ( ! key -> index_key . description ) goto no_memory_3 ; atomic_set ( & key -> usage , 1 ) ; init_rwsem ( & key -> sem ) ; lockdep_set_class ( & key -> sem , & type -> lock_class ) ; key -> index_key . type = type ; key -> user = user ; key -> quotalen = quotalen ; key -> datalen = type -> def_datalen ; key -> uid = uid ; key -> gid = gid ; key -> perm = perm ; key -> restrict_link = restrict_link ; if ( ! ( flags & KEY_ALLOC_NOT_IN_QUOTA ) ) key -> flags |= 1 << KEY_FLAG_IN_QUOTA ; if ( flags & KEY_ALLOC_BUILT_IN ) key -> flags |= 1 << KEY_FLAG_BUILTIN ; # ifdef KEY_DEBUGGING key -> magic = KEY_DEBUG_MAGIC ; # endif ret = security_key_alloc ( key , cred , flags ) ; if ( ret < 0 ) goto security_error ; atomic_inc ( & user -> nkeys ) ; key_alloc_serial ( key ) ; error : return key ; security_error : kfree ( key -> description ) ; kmem_cache_free ( key_jar , key ) ; if ( ! ( flags & KEY_ALLOC_NOT_IN_QUOTA ) ) { spin_lock ( & user -> lock ) ; user -> qnkeys -- ; user -> qnbytes -= quotalen ; spin_unlock ( & user -> lock ) ; } key_user_put ( user ) ; key = ERR_PTR ( ret ) ; goto error ; no_memory_3 : kmem_cache_free ( key_jar , key ) ; no_memory_2 : if ( ! ( flags & KEY_ALLOC_NOT_IN_QUOTA ) ) { spin_lock ( & user -> lock ) ; user -> qnkeys -- ; user -> qnbytes -= quotalen ; spin_unlock ( & user -> lock ) ; } key_user_put ( user ) ; no_memory_1 : key = ERR_PTR ( - ENOMEM ) ; goto error ; no_quota : spin_unlock ( & user -> lock ) ; key_user_put ( user ) ; key = ERR_PTR ( - EDQUOT ) ; goto error ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_h225_Alerting_UUIE ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) { # line 507 "./asn1/h225/h225.cnf" h225_packet_info * h225_pi ; offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h225_Alerting_UUIE , Alerting_UUIE_sequence ) ; # line 511 "./asn1/h225/h225.cnf" h225_pi = ( h225_packet_info * ) p_get_proto_data ( wmem_packet_scope ( ) , actx -> pinfo , proto_h225 , 0 ) ; if ( h225_pi != NULL ) { h225_pi -> cs_type = H225_ALERTING ; if ( contains_faststart ) { char temp [ 50 ] ; g_snprintf ( temp , 50 , "%s OLC (%s)" , val_to_str ( h225_pi -> cs_type , T_h323_message_body_vals , "<unknown>" ) , h225_pi -> frame_label ) ; g_strlcpy ( h225_pi -> frame_label , temp , 50 ) ; } else g_snprintf ( h225_pi -> frame_label , 50 , "%s" , val_to_str ( h225_pi -> cs_type , T_h323_message_body_vals , "<unknown>" ) ) ; } return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
int gdev_mem_max_height ( const gx_device_memory * dev , int width , ulong size , bool page_uses_transparency ) { int height ; ulong max_height ; ulong data_size ; if ( page_uses_transparency ) { max_height = size / ( bitmap_raster_pad_align ( width * dev -> color_info . depth + ESTIMATED_PDF14_ROW_SPACE ( width , dev -> color_info . num_components ) , dev -> pad , dev -> log2_align_mod ) + sizeof ( byte * ) * ( dev -> is_planar ? dev -> color_info . num_components : 1 ) ) ; height = ( int ) min ( max_height , max_int ) ; } else { max_height = size / ( bitmap_raster_pad_align ( width * dev -> color_info . depth , dev -> pad , dev -> log2_align_mod ) + sizeof ( byte * ) * ( dev -> is_planar ? dev -> color_info . num_components : 1 ) ) ; height = ( int ) min ( max_height , max_int ) ; do { gdev_mem_data_size ( dev , width , height , & data_size ) ; if ( data_size <= size ) break ; -- height ; } while ( data_size > size ) ; } return height ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static VALUE cState_aref ( VALUE self , VALUE name ) { name = rb_funcall ( name , i_to_s , 0 ) ; if ( RTEST ( rb_funcall ( self , i_respond_to_p , 1 , name ) ) ) { return rb_funcall ( self , i_send , 1 , name ) ; } else { return rb_ivar_get ( self , rb_intern_str ( rb_str_concat ( rb_str_new2 ( "@" ) , name ) ) ) ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void build_tree_distribution ( VP9_COMP * cpi , TX_SIZE tx_size , vp9_coeff_stats * coef_branch_ct , vp9_coeff_probs_model * coef_probs ) { vp9_coeff_count * coef_counts = cpi -> coef_counts [ tx_size ] ; unsigned int ( * eob_branch_ct ) [ REF_TYPES ] [ COEF_BANDS ] [ COEFF_CONTEXTS ] = cpi -> common . counts . eob_branch [ tx_size ] ; int i , j , k , l , m ; for ( i = 0 ; i < PLANE_TYPES ; ++ i ) { for ( j = 0 ; j < REF_TYPES ; ++ j ) { for ( k = 0 ; k < COEF_BANDS ; ++ k ) { for ( l = 0 ; l < BAND_COEFF_CONTEXTS ( k ) ; ++ l ) { vp9_tree_probs_from_distribution ( vp9_coef_tree , coef_branch_ct [ i ] [ j ] [ k ] [ l ] , coef_counts [ i ] [ j ] [ k ] [ l ] ) ; coef_branch_ct [ i ] [ j ] [ k ] [ l ] [ 0 ] [ 1 ] = eob_branch_ct [ i ] [ j ] [ k ] [ l ] - coef_branch_ct [ i ] [ j ] [ k ] [ l ] [ 0 ] [ 0 ] ; for ( m = 0 ; m < UNCONSTRAINED_NODES ; ++ m ) coef_probs [ i ] [ j ] [ k ] [ l ] [ m ] = get_binary_prob ( coef_branch_ct [ i ] [ j ] [ k ] [ l ] [ m ] [ 0 ] , coef_branch_ct [ i ] [ j ] [ k ] [ l ] [ m ] [ 1 ] ) ; } } } } }
0False
Categorize the following code snippet as vulnerable or not. True or False
int ff_wmv2_decode_picture_header ( MpegEncContext * s ) { Wmv2Context * const w = ( Wmv2Context * ) s ; int code ; if ( s -> picture_number == 0 ) decode_ext_header ( w ) ; s -> pict_type = get_bits1 ( & s -> gb ) + 1 ; if ( s -> pict_type == AV_PICTURE_TYPE_I ) { code = get_bits ( & s -> gb , 7 ) ; av_log ( s -> avctx , AV_LOG_DEBUG , "I7:%X/\n" , code ) ; } s -> chroma_qscale = s -> qscale = get_bits ( & s -> gb , 5 ) ; if ( s -> qscale <= 0 ) return - 1 ; return 0 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static enum message_read_status evhttp_handle_chunked_read ( struct evhttp_request * req , struct evbuffer * buf ) { int len ; while ( ( len = EVBUFFER_LENGTH ( buf ) ) > 0 ) { if ( req -> ntoread < 0 ) { ev_int64_t ntoread ; char * p = evbuffer_readline ( buf ) ; char * endp ; int error ; if ( p == NULL ) break ; if ( strlen ( p ) == 0 ) { free ( p ) ; continue ; } ntoread = evutil_strtoll ( p , & endp , 16 ) ; error = ( * p == '\0' || ( * endp != '\0' && * endp != ' ' ) || ntoread < 0 ) ; free ( p ) ; if ( error ) { return ( DATA_CORRUPTED ) ; } req -> ntoread = ntoread ; if ( req -> ntoread == 0 ) { return ( ALL_DATA_READ ) ; } continue ; } if ( len < req -> ntoread ) return ( MORE_DATA_EXPECTED ) ; evbuffer_add ( req -> input_buffer , EVBUFFER_DATA ( buf ) , ( size_t ) req -> ntoread ) ; evbuffer_drain ( buf , ( size_t ) req -> ntoread ) ; req -> ntoread = - 1 ; if ( req -> chunk_cb != NULL ) { ( * req -> chunk_cb ) ( req , req -> cb_arg ) ; evbuffer_drain ( req -> input_buffer , EVBUFFER_LENGTH ( req -> input_buffer ) ) ; } } return ( MORE_DATA_EXPECTED ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
int phar_tar_setmetadata ( zval * metadata , phar_entry_info * entry , char * * error TSRMLS_DC ) { php_serialize_data_t metadata_hash ; if ( entry -> metadata_str . c ) { smart_str_free ( & entry -> metadata_str ) ; } entry -> metadata_str . c = 0 ; entry -> metadata_str . len = 0 ; PHP_VAR_SERIALIZE_INIT ( metadata_hash ) ; php_var_serialize ( & entry -> metadata_str , & metadata , & metadata_hash TSRMLS_CC ) ; PHP_VAR_SERIALIZE_DESTROY ( metadata_hash ) ; entry -> uncompressed_filesize = entry -> compressed_filesize = entry -> metadata_str . len ; if ( entry -> fp && entry -> fp_type == PHAR_MOD ) { php_stream_close ( entry -> fp ) ; } entry -> fp_type = PHAR_MOD ; entry -> is_modified = 1 ; entry -> fp = php_stream_fopen_tmpfile ( ) ; entry -> offset = entry -> offset_abs = 0 ; if ( entry -> fp == NULL ) { spprintf ( error , 0 , "phar error: unable to create temporary file" ) ; return - 1 ; } if ( entry -> metadata_str . len != php_stream_write ( entry -> fp , entry -> metadata_str . c , entry -> metadata_str . len ) ) { spprintf ( error , 0 , "phar tar error: unable to write metadata to magic metadata file \"%s\"" , entry -> filename ) ; zend_hash_del ( & ( entry -> phar -> manifest ) , entry -> filename , entry -> filename_len ) ; return ZEND_HASH_APPLY_STOP ; } return ZEND_HASH_APPLY_KEEP ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int SpoolssSetPrinter_r ( tvbuff_t * tvb , int offset , packet_info * pinfo , proto_tree * tree , dcerpc_info * di , guint8 * drep _U_ ) { offset = dissect_doserror ( tvb , offset , pinfo , tree , di , drep , hf_rc , NULL ) ; return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
int jbig2_decode_generic_mmr ( Jbig2Ctx * ctx , Jbig2Segment * segment , const Jbig2GenericRegionParams * params , const byte * data , size_t size , Jbig2Image * image ) { Jbig2MmrCtx mmr ; const uint32_t rowstride = image -> stride ; byte * dst = image -> data ; byte * ref = NULL ; uint32_t y ; int code = 0 ; jbig2_decode_mmr_init ( & mmr , image -> width , image -> height , data , size ) ; for ( y = 0 ; y < image -> height ; y ++ ) { memset ( dst , 0 , rowstride ) ; code = jbig2_decode_mmr_line ( & mmr , ref , dst ) ; if ( code < 0 ) return code ; ref = dst ; dst += rowstride ; } return code ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int cli_scanfile ( const char * filename , cli_ctx * ctx ) { int fd , ret ; fd = safe_open ( filename , O_RDONLY | O_BINARY ) ; if ( fd < 0 ) return CL_EOPEN ; ret = cli_magic_scandesc ( fd , ctx ) ; close ( fd ) ; return ret ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void test_store_result1 ( ) { MYSQL_STMT * stmt ; int rc ; myheader ( "test_store_result1" ) ; rc = mysql_query ( mysql , "DROP TABLE IF EXISTS test_store_result" ) ; myquery ( rc ) ; rc = mysql_query ( mysql , "CREATE TABLE test_store_result(col1 int , col2 varchar(50))" ) ; myquery ( rc ) ; rc = mysql_query ( mysql , "INSERT INTO test_store_result VALUES(10, 'venu'), (20, 'mysql')" ) ; myquery ( rc ) ; rc = mysql_query ( mysql , "INSERT INTO test_store_result(col2) VALUES('monty')" ) ; myquery ( rc ) ; rc = mysql_commit ( mysql ) ; myquery ( rc ) ; stmt = mysql_simple_prepare ( mysql , "SELECT * FROM test_store_result" ) ; check_stmt ( stmt ) ; rc = mysql_stmt_execute ( stmt ) ; check_execute ( stmt , rc ) ; rc = mysql_stmt_store_result ( stmt ) ; check_execute ( stmt , rc ) ; rc = 0 ; while ( mysql_stmt_fetch ( stmt ) != MYSQL_NO_DATA ) rc ++ ; if ( ! opt_silent ) fprintf ( stdout , "\n total rows: %d" , rc ) ; DIE_UNLESS ( rc == 3 ) ; rc = mysql_stmt_execute ( stmt ) ; check_execute ( stmt , rc ) ; rc = mysql_stmt_store_result ( stmt ) ; check_execute ( stmt , rc ) ; rc = 0 ; while ( mysql_stmt_fetch ( stmt ) != MYSQL_NO_DATA ) rc ++ ; if ( ! opt_silent ) fprintf ( stdout , "\n total rows: %d" , rc ) ; DIE_UNLESS ( rc == 3 ) ; mysql_stmt_close ( stmt ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static MaltaFPGAState * malta_fpga_init ( MemoryRegion * address_space , hwaddr base , qemu_irq uart_irq , CharDriverState * uart_chr ) { MaltaFPGAState * s ; s = ( MaltaFPGAState * ) g_malloc0 ( sizeof ( MaltaFPGAState ) ) ; memory_region_init_io ( & s -> iomem , NULL , & malta_fpga_ops , s , "malta-fpga" , 0x100000 ) ; memory_region_init_alias ( & s -> iomem_lo , NULL , "malta-fpga" , & s -> iomem , 0 , 0x900 ) ; memory_region_init_alias ( & s -> iomem_hi , NULL , "malta-fpga" , & s -> iomem , 0xa00 , 0x10000 - 0xa00 ) ; memory_region_add_subregion ( address_space , base , & s -> iomem_lo ) ; memory_region_add_subregion ( address_space , base + 0xa00 , & s -> iomem_hi ) ; s -> display = qemu_chr_new ( "fpga" , "vc:320x200" , malta_fpga_led_init ) ; s -> uart = serial_mm_init ( address_space , base + 0x900 , 3 , uart_irq , 230400 , uart_chr , DEVICE_NATIVE_ENDIAN ) ; malta_fpga_reset ( s ) ; qemu_register_reset ( malta_fpga_reset , s ) ; return s ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void test_bug54041 ( ) { enable_query_logs ( 0 ) ; test_bug54041_impl ( ) ; disable_query_logs ( ) ; test_bug54041_impl ( ) ; restore_query_logs ( ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void dtap_bcc_term_rej ( tvbuff_t * tvb , proto_tree * tree , packet_info * pinfo _U_ , guint32 offset , guint len ) { guint32 curr_offset ; guint32 consumed ; guint curr_len ; curr_offset = offset ; curr_len = len ; ELEM_MAND_LV ( GSM_A_PDU_TYPE_DTAP , DE_BCC_CAUSE , "(Reject Cause)" ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void read_frame_reference_mode_probs ( VP9_COMMON * cm , vp9_reader * r ) { FRAME_CONTEXT * const fc = & cm -> fc ; int i ; if ( cm -> reference_mode == REFERENCE_MODE_SELECT ) for ( i = 0 ; i < COMP_INTER_CONTEXTS ; ++ i ) vp9_diff_update_prob ( r , & fc -> comp_inter_prob [ i ] ) ; if ( cm -> reference_mode != COMPOUND_REFERENCE ) for ( i = 0 ; i < REF_CONTEXTS ; ++ i ) { vp9_diff_update_prob ( r , & fc -> single_ref_prob [ i ] [ 0 ] ) ; vp9_diff_update_prob ( r , & fc -> single_ref_prob [ i ] [ 1 ] ) ; } if ( cm -> reference_mode != SINGLE_REFERENCE ) for ( i = 0 ; i < REF_CONTEXTS ; ++ i ) vp9_diff_update_prob ( r , & fc -> comp_ref_prob [ i ] ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
void vp9_xform_quant_dc ( MACROBLOCK * x , int plane , int block , BLOCK_SIZE plane_bsize , TX_SIZE tx_size ) { MACROBLOCKD * const xd = & x -> e_mbd ; const struct macroblock_plane * const p = & x -> plane [ plane ] ; const struct macroblockd_plane * const pd = & xd -> plane [ plane ] ; int16_t * const coeff = BLOCK_OFFSET ( p -> coeff , block ) ; int16_t * const qcoeff = BLOCK_OFFSET ( p -> qcoeff , block ) ; int16_t * const dqcoeff = BLOCK_OFFSET ( pd -> dqcoeff , block ) ; uint16_t * const eob = & p -> eobs [ block ] ; const int diff_stride = 4 * num_4x4_blocks_wide_lookup [ plane_bsize ] ; int i , j ; const int16_t * src_diff ; txfrm_block_to_raster_xy ( plane_bsize , tx_size , block , & i , & j ) ; src_diff = & p -> src_diff [ 4 * ( j * diff_stride + i ) ] ; switch ( tx_size ) { case TX_32X32 : vp9_fdct32x32_1 ( src_diff , coeff , diff_stride ) ; vp9_quantize_dc_32x32 ( coeff , x -> skip_block , p -> round , p -> quant_fp [ 0 ] , qcoeff , dqcoeff , pd -> dequant [ 0 ] , eob ) ; break ; case TX_16X16 : vp9_fdct16x16_1 ( src_diff , coeff , diff_stride ) ; vp9_quantize_dc ( coeff , x -> skip_block , p -> round , p -> quant_fp [ 0 ] , qcoeff , dqcoeff , pd -> dequant [ 0 ] , eob ) ; break ; case TX_8X8 : vp9_fdct8x8_1 ( src_diff , coeff , diff_stride ) ; vp9_quantize_dc ( coeff , x -> skip_block , p -> round , p -> quant_fp [ 0 ] , qcoeff , dqcoeff , pd -> dequant [ 0 ] , eob ) ; break ; case TX_4X4 : x -> fwd_txm4x4 ( src_diff , coeff , diff_stride ) ; vp9_quantize_dc ( coeff , x -> skip_block , p -> round , p -> quant_fp [ 0 ] , qcoeff , dqcoeff , pd -> dequant [ 0 ] , eob ) ; break ; default : assert ( 0 ) ; break ; } }
1True
Categorize the following code snippet as vulnerable or not. True or False
size_t get_alloc_limit ( ) { return alloc_limit ; }
0False