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
static jas_image_cmpt_t * jas_image_cmpt_copy ( jas_image_cmpt_t * cmpt ) { jas_image_cmpt_t * newcmpt ; if ( ! ( newcmpt = jas_image_cmpt_create0 ( ) ) ) { return 0 ; } newcmpt -> tlx_ = cmpt -> tlx_ ; newcmpt -> tly_ = cmpt -> tly_ ; newcmpt -> hstep_ = cmpt -> hstep_ ; newcmpt -> vstep_ = cmpt -> vstep_ ; newcmpt -> width_ = cmpt -> width_ ; newcmpt -> height_ = cmpt -> height_ ; newcmpt -> prec_ = cmpt -> prec_ ; newcmpt -> sgnd_ = cmpt -> sgnd_ ; newcmpt -> cps_ = cmpt -> cps_ ; newcmpt -> type_ = cmpt -> type_ ; if ( ! ( newcmpt -> stream_ = jas_stream_memopen ( 0 , 0 ) ) ) { return 0 ; } if ( jas_stream_seek ( cmpt -> stream_ , 0 , SEEK_SET ) ) { return 0 ; } if ( jas_stream_copy ( newcmpt -> stream_ , cmpt -> stream_ , - 1 ) ) { return 0 ; } if ( jas_stream_seek ( newcmpt -> stream_ , 0 , SEEK_SET ) ) { return 0 ; } return newcmpt ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
int ff_h264_decode_extradata ( H264Context * h , const uint8_t * buf , int size ) { AVCodecContext * avctx = h -> avctx ; int ret ; if ( ! buf || size <= 0 ) return - 1 ; if ( buf [ 0 ] == 1 ) { int i , cnt , nalsize ; const unsigned char * p = buf ; h -> is_avc = 1 ; if ( size < 7 ) { av_log ( avctx , AV_LOG_ERROR , "avcC too short\n" ) ; return AVERROR_INVALIDDATA ; } h -> nal_length_size = 2 ; cnt = * ( p + 5 ) & 0x1f ; p += 6 ; for ( i = 0 ; i < cnt ; i ++ ) { nalsize = AV_RB16 ( p ) + 2 ; if ( nalsize > size - ( p - buf ) ) return AVERROR_INVALIDDATA ; ret = decode_nal_units ( h , p , nalsize , 1 ) ; if ( ret < 0 ) { av_log ( avctx , AV_LOG_ERROR , "Decoding sps %d from avcC failed\n" , i ) ; return ret ; } p += nalsize ; } cnt = * ( p ++ ) ; for ( i = 0 ; i < cnt ; i ++ ) { nalsize = AV_RB16 ( p ) + 2 ; if ( nalsize > size - ( p - buf ) ) return AVERROR_INVALIDDATA ; ret = decode_nal_units ( h , p , nalsize , 1 ) ; if ( ret < 0 ) { av_log ( avctx , AV_LOG_ERROR , "Decoding pps %d from avcC failed\n" , i ) ; return ret ; } p += nalsize ; } h -> nal_length_size = ( buf [ 4 ] & 0x03 ) + 1 ; } else { h -> is_avc = 0 ; ret = decode_nal_units ( h , buf , size , 1 ) ; if ( ret < 0 ) return ret ; } return size ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_h225_CallCapacityInfo ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) { offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h225_CallCapacityInfo , CallCapacityInfo_sequence ) ; return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_h245_MultiplexedStreamParameter ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) { offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h245_MultiplexedStreamParameter , MultiplexedStreamParameter_sequence ) ; return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void i_free_all ( gs_memory_t * mem , uint free_mask , client_name_t cname ) { gs_ref_memory_t * imem = ( gs_ref_memory_t * ) mem ; struct free_data fd ; fd . imem = imem ; fd . allocator = NULL ; if ( free_mask & FREE_ALL_DATA && imem -> root != NULL ) { clump_splay_app ( imem -> root , imem , free_all_not_allocator , & fd ) ; imem -> root = fd . allocator ; if ( fd . allocator ) fd . allocator -> parent = fd . allocator -> left = fd . allocator -> right = NULL ; } if ( free_mask & FREE_ALL_ALLOCATOR ) { clump_splay_app ( imem -> root , imem , free_all_allocator , & fd ) ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
TEST_F ( NativeBackendLibsecretTest , PSLMatchingPositive ) { PasswordForm result ; const GURL kMobileURL ( "http://m.facebook.com/" ) ; EXPECT_TRUE ( CheckCredentialAvailability ( form_facebook_ , kMobileURL , PasswordForm : : SCHEME_HTML , & result ) ) ; EXPECT_EQ ( form_facebook_ . origin , result . origin ) ; EXPECT_EQ ( form_facebook_ . signon_realm , result . signon_realm ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
int qemuMonitorTextCreateSnapshot ( qemuMonitorPtr mon , const char * name ) { char * cmd = NULL ; char * reply = NULL ; int ret = - 1 ; char * safename ; if ( ! ( safename = qemuMonitorEscapeArg ( name ) ) || virAsprintf ( & cmd , "savevm \"%s\"" , safename ) < 0 ) { virReportOOMError ( ) ; goto cleanup ; } if ( qemuMonitorHMPCommand ( mon , cmd , & reply ) ) { qemuReportError ( VIR_ERR_OPERATION_FAILED , _ ( "failed to take snapshot using command '%s'" ) , cmd ) ; goto cleanup ; } if ( strstr ( reply , "Error while creating snapshot" ) != NULL ) { qemuReportError ( VIR_ERR_OPERATION_FAILED , _ ( "Failed to take snapshot: %s" ) , reply ) ; goto cleanup ; } else if ( strstr ( reply , "No block device can accept snapshots" ) != NULL ) { qemuReportError ( VIR_ERR_OPERATION_INVALID , "%s" , _ ( "this domain does not have a device to take snapshots" ) ) ; goto cleanup ; } else if ( strstr ( reply , "Could not open VM state file" ) != NULL ) { qemuReportError ( VIR_ERR_OPERATION_FAILED , "%s" , reply ) ; goto cleanup ; } else if ( strstr ( reply , "Error" ) != NULL && strstr ( reply , "while writing VM" ) != NULL ) { qemuReportError ( VIR_ERR_OPERATION_FAILED , "%s" , reply ) ; goto cleanup ; } ret = 0 ; cleanup : VIR_FREE ( safename ) ; VIR_FREE ( cmd ) ; VIR_FREE ( reply ) ; return ret ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
int i2d_PKCS8_PRIV_KEY_INFO_bio ( BIO * bp , PKCS8_PRIV_KEY_INFO * p8inf ) { return ASN1_i2d_bio_of ( PKCS8_PRIV_KEY_INFO , i2d_PKCS8_PRIV_KEY_INFO , bp , p8inf ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
void ff_h263_show_pict_info ( MpegEncContext * s ) { if ( s -> avctx -> debug & FF_DEBUG_PICT_INFO ) { av_log ( s -> avctx , AV_LOG_DEBUG , "qp:%d %c size:%d rnd:%d%s%s%s%s%s%s%s%s%s %d/%d\n" , s -> qscale , av_get_picture_type_char ( s -> pict_type ) , s -> gb . size_in_bits , 1 - s -> no_rounding , s -> obmc ? " AP" : "" , s -> umvplus ? " UMV" : "" , s -> h263_long_vectors ? " LONG" : "" , s -> h263_plus ? " +" : "" , s -> h263_aic ? " AIC" : "" , s -> alt_inter_vlc ? " AIV" : "" , s -> modified_quant ? " MQ" : "" , s -> loop_filter ? " LOOP" : "" , s -> h263_slice_structured ? " SS" : "" , s -> avctx -> time_base . den , s -> avctx -> time_base . num ) ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void h245_free_labels ( guint32 new_frame_num ) { gint8 n ; if ( new_frame_num == h245_labels . frame_num ) return ; for ( n = 0 ; n < h245_labels . labels_count ; n ++ ) { g_free ( h245_labels . labels [ n ] . frame_label ) ; h245_labels . labels [ n ] . frame_label = NULL ; g_free ( h245_labels . labels [ n ] . comment ) ; h245_labels . labels [ n ] . comment = NULL ; } h245_labels . frame_num = 0 ; h245_labels . labels_count = 0 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
void do_info_qdm ( Monitor * mon ) { DeviceInfo * info ; char msg [ 256 ] ; for ( info = device_info_list ; info != NULL ; info = info -> next ) { qdev_print_devinfo ( info , msg , sizeof ( msg ) ) ; monitor_printf ( mon , "%s\n" , msg ) ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
const char * irc_ctcp_get_default_reply ( const char * ctcp ) { int i ; for ( i = 0 ; irc_ctcp_default_reply [ i ] . name ; i ++ ) { if ( weechat_strcasecmp ( irc_ctcp_default_reply [ i ] . name , ctcp ) == 0 ) return irc_ctcp_default_reply [ i ] . reply ; } return NULL ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void * i_alloc_struct_array ( gs_memory_t * mem , uint num_elements , gs_memory_type_ptr_t pstype , client_name_t cname ) { gs_ref_memory_t * const imem = ( gs_ref_memory_t * ) mem ; obj_header_t * obj ; # ifdef MEMENTO if ( Memento_failThisEvent ( ) ) return NULL ; # endif ALLOC_CHECK_SIZE ( mem , pstype ) ; # ifdef DEBUG if ( pstype -> enum_ptrs == basic_enum_ptrs ) { dmprintf2 ( mem , " i_alloc_struct_array: called with incorrect structure type (not element), struct='%s', client='%s'\n" , pstype -> sname , cname ) ; return NULL ; } # endif obj = alloc_obj ( imem , ( ulong ) num_elements * pstype -> ssize , pstype , ALLOC_DIRECT , cname ) ; if_debug7m ( 'A' , mem , "[a%d:+<.]%s %s*(%lu=%u*%u) = 0x%lx\n" , alloc_trace_space ( imem ) , client_name_string ( cname ) , struct_type_name_string ( pstype ) , ( ulong ) num_elements * pstype -> ssize , num_elements , pstype -> ssize , ( ulong ) obj ) ; return ( char * ) obj ; }
1True
Categorize the following code snippet as vulnerable or not. True or False
static int testit ( struct test_case_struct * tc ) { int retval ; wordexp_t we , sav_we ; char * dummy ; int bzzzt = 0 ; int start_offs = 0 ; int i ; if ( tc -> env ) setenv ( "var" , tc -> env , 1 ) ; else unsetenv ( "var" ) ; if ( tc -> ifs ) setenv ( "IFS" , tc -> ifs , 1 ) ; else unsetenv ( "IFS" ) ; sav_we . we_wordc = 99 ; sav_we . we_wordv = & dummy ; sav_we . we_offs = 3 ; we = sav_we ; printf ( "Test %d (%s): " , ++ tests , tc -> words ) ; if ( tc -> flags & WRDE_APPEND ) { if ( wordexp ( "pre1 pre2" , & we , tc -> flags & ~ WRDE_APPEND ) != 0 ) { printf ( "FAILED setup\n" ) ; return 1 ; } } retval = wordexp ( tc -> words , & we , tc -> flags ) ; if ( tc -> flags & WRDE_DOOFFS ) start_offs = sav_we . we_offs ; if ( retval != tc -> retval || ( retval == 0 && we . we_wordc != tc -> wordc ) ) bzzzt = 1 ; else if ( retval == 0 ) { for ( i = 0 ; i < start_offs ; ++ i ) if ( we . we_wordv [ i ] != NULL ) { bzzzt = 1 ; break ; } for ( i = 0 ; i < we . we_wordc ; ++ i ) if ( we . we_wordv [ i + start_offs ] == NULL || strcmp ( tc -> wordv [ i ] , we . we_wordv [ i + start_offs ] ) != 0 ) { bzzzt = 1 ; break ; } } if ( bzzzt ) { printf ( "FAILED\n" ) ; printf ( "Test words: <%s>, need retval %d, wordc %Zd\n" , tc -> words , tc -> retval , tc -> wordc ) ; if ( start_offs != 0 ) printf ( "(preceded by %d NULLs)\n" , start_offs ) ; printf ( "Got retval %d, wordc %Zd: " , retval , we . we_wordc ) ; if ( retval == 0 || retval == WRDE_NOSPACE ) { for ( i = 0 ; i < we . we_wordc + start_offs ; ++ i ) if ( we . we_wordv [ i ] == NULL ) printf ( "NULL " ) ; else printf ( "<%s> " , we . we_wordv [ i ] ) ; } printf ( "\n" ) ; } else if ( retval != 0 && retval != WRDE_NOSPACE && ( we . we_wordc != sav_we . we_wordc || we . we_wordv != sav_we . we_wordv || we . we_offs != sav_we . we_offs ) ) { bzzzt = 1 ; printf ( "FAILED to restore wordexp_t members\n" ) ; } else printf ( "OK\n" ) ; if ( retval == 0 || retval == WRDE_NOSPACE ) wordfree ( & we ) ; return bzzzt ; }
1True
Categorize the following code snippet as vulnerable or not. True or False
static void s_aos_reset ( stream * s ) { s -> position = 0 ; s -> srptr = s -> srlimit = s -> cbuf - 1 ; s -> end_status = 0 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void fill_scaling_lists ( struct dxva_context * ctx , const H264Context * h , DXVA_Qmatrix_H264 * qm ) { unsigned i , j ; memset ( qm , 0 , sizeof ( * qm ) ) ; if ( ctx -> workaround & FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG ) { for ( i = 0 ; i < 6 ; i ++ ) for ( j = 0 ; j < 16 ; j ++ ) qm -> bScalingLists4x4 [ i ] [ j ] = h -> pps . scaling_matrix4 [ i ] [ j ] ; for ( i = 0 ; i < 64 ; i ++ ) { qm -> bScalingLists8x8 [ 0 ] [ i ] = h -> pps . scaling_matrix8 [ 0 ] [ i ] ; qm -> bScalingLists8x8 [ 1 ] [ i ] = h -> pps . scaling_matrix8 [ 3 ] [ i ] ; } } else { for ( i = 0 ; i < 6 ; i ++ ) for ( j = 0 ; j < 16 ; j ++ ) qm -> bScalingLists4x4 [ i ] [ j ] = h -> pps . scaling_matrix4 [ i ] [ zigzag_scan [ j ] ] ; for ( i = 0 ; i < 64 ; i ++ ) { qm -> bScalingLists8x8 [ 0 ] [ i ] = h -> pps . scaling_matrix8 [ 0 ] [ ff_zigzag_direct [ i ] ] ; qm -> bScalingLists8x8 [ 1 ] [ i ] = h -> pps . scaling_matrix8 [ 3 ] [ ff_zigzag_direct [ i ] ] ; } } }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void sethead ( struct head * head , SplineFont * sf , struct alltabs * at , enum fontformat format , int32 * bsizes ) { int i , lr , rl , indic_rearrange , arabic ; ASM * sm ; struct ttflangname * useng ; float vn ; if ( at -> gi . xmin == 15000 ) at -> gi . xmin = 0 ; if ( at -> gi . ymin == 15000 ) at -> gi . ymin = 0 ; if ( bsizes != NULL && format == ff_none ) { if ( sf -> ascent > at -> gi . ymax ) at -> gi . ymax = sf -> ascent ; if ( - sf -> descent < at -> gi . ymin ) at -> gi . ymin = - sf -> descent ; } head -> xmin = at -> gi . xmin ; head -> ymin = at -> gi . ymin ; head -> xmax = at -> gi . xmax ; head -> ymax = at -> gi . ymax ; lr = rl = arabic = 0 ; for ( i = 0 ; i < at -> gi . gcnt ; ++ i ) if ( at -> gi . bygid [ i ] != - 1 ) { SplineChar * sc = sf -> glyphs [ at -> gi . bygid [ i ] ] ; int uni = sc -> unicodeenc ; if ( SCRightToLeft ( sc ) ) rl = 1 ; else if ( ( uni != - 1 && uni < 0x10000 && islefttoright ( uni ) ) || ( uni >= 0x10300 && uni < 0x107ff ) ) lr = 1 ; if ( SCScriptFromUnicode ( sc ) == CHR ( 'a' , 'r' , 'a' , 'b' ) ) arabic = 1 ; } head -> version = 0x00010000 ; head -> revision = sf -> sfntRevision ; if ( sf -> sfntRevision == sfntRevisionUnset ) { head -> revision = 0x00010000 ; for ( useng = sf -> names ; useng != NULL ; useng = useng -> next ) if ( useng -> lang == 0x409 ) break ; if ( useng != NULL && useng -> names [ ttf_version ] != NULL && sscanf ( useng -> names [ ttf_version ] , "Version %f" , & vn ) == 1 ) { head -> revision = vn * 65536 ; } else if ( sf -> subfontcnt != 0 ) { int val , mant ; val = floor ( sf -> cidversion ) ; mant = floor ( 65536. * ( ( double ) sf -> cidversion - val ) ) ; head -> revision = ( val << 16 ) | mant ; } else if ( sf -> version != NULL ) { char * pt = sf -> version ; double dval ; int val , mant ; while ( * pt && ! isdigit ( * pt ) && * pt != '.' ) ++ pt ; if ( * pt ) { dval = strtod ( pt , NULL ) ; val = floor ( dval ) ; mant = floor ( 65536. * ( dval - val ) ) ; head -> revision = ( val << 16 ) | mant ; } } } head -> checksumAdj = 0 ; head -> magicNum = 0x5f0f3cf5 ; head -> flags = 8 | 2 | 1 ; if ( format >= ff_ttf && format <= ff_ttfdfont ) { if ( AnyInstructions ( sf ) ) head -> flags = 0x10 | 8 | 4 | 2 | 1 ; else if ( AnyMisleadingBitmapAdvances ( sf , bsizes ) ) head -> flags = 0x10 | 8 | 2 | 1 ; } if ( sf -> hasvmetrics ) head -> flags |= ( 1 << 5 ) ; if ( arabic ) head -> flags |= ( 1 << 7 ) ; if ( sf -> sm ) head -> flags |= ( 1 << 8 ) ; if ( rl ) head -> flags |= ( 1 << 9 ) ; indic_rearrange = 0 ; for ( sm = sf -> sm ; sm != NULL ; sm = sm -> next ) if ( sm -> type == asm_indic ) indic_rearrange = true ; if ( indic_rearrange ) head -> flags |= ( 1 << 10 ) ; if ( sf -> head_optimized_for_cleartype ) head -> flags |= ( 1 << 13 ) ; head -> emunits = sf -> ascent + sf -> descent ; head -> macstyle = MacStyleCode ( sf , NULL ) ; head -> lowestreadable = 8 ; head -> locais32 = 1 ; if ( at -> gi . glyph_len < 0x20000 ) head -> locais32 = 0 ; if ( lr && rl ) head -> dirhint = 0 ; else if ( rl ) head -> dirhint = - 2 ; else head -> dirhint = 2 ; if ( rl ) head -> flags |= ( 1 << 9 ) ; cvt_unix_to_1904 ( sf -> creationtime , head -> createtime ) ; cvt_unix_to_1904 ( sf -> modificationtime , head -> modtime ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void hb_shape_plan_plan ( hb_shape_plan_t * shape_plan , const hb_feature_t * user_features , unsigned int num_user_features , const char * const * shaper_list ) { DEBUG_MSG_FUNC ( SHAPE_PLAN , shape_plan , "num_features=%d shaper_list=%p" , num_user_features , shaper_list ) ; const hb_shaper_pair_t * shapers = _hb_shapers_get ( ) ; # define HB_SHAPER_PLAN ( shaper ) HB_STMT_START { if ( hb_ ## shaper ## _shaper_face_data_ensure ( shape_plan -> face_unsafe ) ) { HB_SHAPER_DATA ( shaper , shape_plan ) = HB_SHAPER_DATA_CREATE_FUNC ( shaper , shape_plan ) ( shape_plan , user_features , num_user_features ) ; shape_plan -> shaper_func = _hb_ ## shaper ## _shape ; shape_plan -> shaper_name = # shaper ; return ; } } HB_STMT_END if ( likely ( ! shaper_list ) ) { for ( unsigned int i = 0 ; i < HB_SHAPERS_COUNT ; i ++ ) if ( 0 ) ; # define HB_SHAPER_IMPLEMENT ( shaper ) else if ( shapers [ i ] . func == _hb_ ## shaper ## _shape ) HB_SHAPER_PLAN ( shaper ) ; # include "hb-shaper-list.hh" # undef HB_SHAPER_IMPLEMENT } else { for ( ; * shaper_list ; shaper_list ++ ) if ( 0 ) ; # define HB_SHAPER_IMPLEMENT ( shaper ) else if ( 0 == strcmp ( * shaper_list , # shaper ) ) HB_SHAPER_PLAN ( shaper ) ; # include "hb-shaper-list.hh" # undef HB_SHAPER_IMPLEMENT } # undef HB_SHAPER_PLAN }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int forgetstack ( struct psstack * stack , int forgets , int sp ) { int i ; for ( i = 0 ; i < forgets ; ++ i ) { if ( stack [ i ] . type == ps_string || stack [ i ] . type == ps_instr || stack [ i ] . type == ps_lit ) free ( stack [ i ] . u . str ) ; else if ( stack [ i ] . type == ps_array || stack [ i ] . type == ps_dict ) dictfree ( & stack [ i ] . u . dict ) ; } for ( i = forgets ; i < sp ; ++ i ) stack [ i - forgets ] = stack [ i ] ; return ( sp - forgets ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_dns_tcp_pdu ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * data _U_ ) { col_set_str ( pinfo -> cinfo , COL_PROTOCOL , "DNS" ) ; dissect_dns_common ( tvb , pinfo , tree , TRUE , FALSE , FALSE ) ; return tvb_reported_length ( tvb ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int parse_ipsecrequests ( struct xfrm_policy * xp , struct sadb_x_policy * pol ) { int err ; int len = pol -> sadb_x_policy_len * 8 - sizeof ( struct sadb_x_policy ) ; struct sadb_x_ipsecrequest * rq = ( void * ) ( pol + 1 ) ; if ( pol -> sadb_x_policy_len * 8 < sizeof ( struct sadb_x_policy ) ) return - EINVAL ; while ( len >= sizeof ( struct sadb_x_ipsecrequest ) ) { if ( ( err = parse_ipsecrequest ( xp , rq ) ) < 0 ) return err ; len -= rq -> sadb_x_ipsecrequest_len ; rq = ( void * ) ( ( u8 * ) rq + rq -> sadb_x_ipsecrequest_len ) ; } return 0 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void test_bug4172 ( ) { MYSQL_STMT * stmt ; MYSQL_BIND my_bind [ 3 ] ; const char * stmt_text ; MYSQL_RES * res ; MYSQL_ROW row ; int rc ; char f [ 100 ] , d [ 100 ] , e [ 100 ] ; ulong f_len , d_len , e_len ; myheader ( "test_bug4172" ) ; mysql_query ( mysql , "DROP TABLE IF EXISTS t1" ) ; mysql_query ( mysql , "CREATE TABLE t1 (f float, d double, e decimal(10,4))" ) ; mysql_query ( mysql , "INSERT INTO t1 VALUES (12345.1234, 123456.123456, " "123456.1234)" ) ; stmt = mysql_stmt_init ( mysql ) ; stmt_text = "SELECT f, d, e FROM t1" ; rc = mysql_stmt_prepare ( stmt , stmt_text , strlen ( stmt_text ) ) ; check_execute ( stmt , rc ) ; rc = mysql_stmt_execute ( stmt ) ; check_execute ( stmt , rc ) ; memset ( my_bind , 0 , sizeof ( my_bind ) ) ; my_bind [ 0 ] . buffer_type = MYSQL_TYPE_STRING ; my_bind [ 0 ] . buffer = f ; my_bind [ 0 ] . buffer_length = sizeof ( f ) ; my_bind [ 0 ] . length = & f_len ; my_bind [ 1 ] . buffer_type = MYSQL_TYPE_STRING ; my_bind [ 1 ] . buffer = d ; my_bind [ 1 ] . buffer_length = sizeof ( d ) ; my_bind [ 1 ] . length = & d_len ; my_bind [ 2 ] . buffer_type = MYSQL_TYPE_STRING ; my_bind [ 2 ] . buffer = e ; my_bind [ 2 ] . buffer_length = sizeof ( e ) ; my_bind [ 2 ] . length = & e_len ; mysql_stmt_bind_result ( stmt , my_bind ) ; mysql_stmt_store_result ( stmt ) ; rc = mysql_stmt_fetch ( stmt ) ; check_execute ( stmt , rc ) ; rc = mysql_real_query ( mysql , stmt_text , strlen ( stmt_text ) ) ; myquery ( rc ) ; res = mysql_store_result ( mysql ) ; row = mysql_fetch_row ( res ) ; if ( ! opt_silent ) { printf ( "Binary protocol: float=%s, double=%s, decimal(10,4)=%s\n" , f , d , e ) ; printf ( "Text protocol: float=%s, double=%s, decimal(10,4)=%s\n" , row [ 0 ] , row [ 1 ] , row [ 2 ] ) ; } DIE_UNLESS ( ! strcmp ( f , row [ 0 ] ) && ! strcmp ( d , row [ 1 ] ) && ! strcmp ( e , row [ 2 ] ) ) ; mysql_free_result ( res ) ; mysql_stmt_close ( stmt ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_pvfs2_chdirent_request ( tvbuff_t * tvb , proto_tree * tree , int offset , packet_info * pinfo ) { offset = dissect_pvfs_string ( tvb , tree , hf_pvfs_path , offset , NULL ) ; offset = dissect_pvfs_fh ( tvb , offset , pinfo , tree , "new directory handle" , NULL ) ; offset = dissect_pvfs_fh ( tvb , offset , pinfo , tree , "parent handle" , NULL ) ; offset = dissect_pvfs_fs_id ( tvb , tree , offset ) ; offset = dissect_pvfs_time ( tvb , tree , offset , hf_pvfs_parent_atime , hf_pvfs_parent_atime_sec , hf_pvfs_parent_atime_nsec ) ; offset = dissect_pvfs_time ( tvb , tree , offset , hf_pvfs_parent_mtime , hf_pvfs_parent_mtime_sec , hf_pvfs_parent_mtime_nsec ) ; offset = dissect_pvfs_time ( tvb , tree , offset , hf_pvfs_parent_ctime , hf_pvfs_parent_ctime_sec , hf_pvfs_parent_ctime_nsec ) ; return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
int get_ber_identifier ( tvbuff_t * tvb , int offset , gint8 * ber_class , gboolean * pc , gint32 * tag ) { guint8 id , t ; gint8 tmp_class ; gboolean tmp_pc ; gint32 tmp_tag ; id = tvb_get_guint8 ( tvb , offset ) ; offset += 1 ; # ifdef DEBUG_BER printf ( "BER ID=%02x" , id ) ; # endif tmp_class = ( id >> 6 ) & 0x03 ; tmp_pc = ( id >> 5 ) & 0x01 ; tmp_tag = id & 0x1F ; if ( tmp_tag == 0x1F ) { tmp_tag = 0 ; while ( tvb_reported_length_remaining ( tvb , offset ) > 0 ) { t = tvb_get_guint8 ( tvb , offset ) ; # ifdef DEBUG_BER printf ( " %02x" , t ) ; # endif offset += 1 ; tmp_tag <<= 7 ; tmp_tag |= t & 0x7F ; if ( ! ( t & 0x80 ) ) break ; } } # ifdef DEBUG_BER printf ( "\n" ) ; # endif if ( ber_class ) * ber_class = tmp_class ; if ( pc ) * pc = tmp_pc ; if ( tag ) * tag = tmp_tag ; last_class = tmp_class ; last_pc = tmp_pc ; last_tag = tmp_tag ; return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
int vp9_full_pixel_search ( VP9_COMP * cpi , MACROBLOCK * x , BLOCK_SIZE bsize , MV * mvp_full , int step_param , int error_per_bit , int * sad_list , const MV * ref_mv , MV * tmp_mv , int var_max , int rd ) { const SPEED_FEATURES * const sf = & cpi -> sf ; const SEARCH_METHODS method = sf -> mv . search_method ; vp9_variance_fn_ptr_t * fn_ptr = & cpi -> fn_ptr [ bsize ] ; int var = 0 ; if ( sad_list ) { sad_list [ 0 ] = INT_MAX ; sad_list [ 1 ] = INT_MAX ; sad_list [ 2 ] = INT_MAX ; sad_list [ 3 ] = INT_MAX ; sad_list [ 4 ] = INT_MAX ; } switch ( method ) { case FAST_DIAMOND : var = vp9_fast_dia_search ( x , mvp_full , step_param , error_per_bit , 0 , sad_list , fn_ptr , 1 , ref_mv , tmp_mv ) ; break ; case FAST_HEX : var = vp9_fast_hex_search ( x , mvp_full , step_param , error_per_bit , 0 , sad_list , fn_ptr , 1 , ref_mv , tmp_mv ) ; break ; case HEX : var = vp9_hex_search ( x , mvp_full , step_param , error_per_bit , 1 , sad_list , fn_ptr , 1 , ref_mv , tmp_mv ) ; break ; case SQUARE : var = vp9_square_search ( x , mvp_full , step_param , error_per_bit , 1 , sad_list , fn_ptr , 1 , ref_mv , tmp_mv ) ; break ; case BIGDIA : var = vp9_bigdia_search ( x , mvp_full , step_param , error_per_bit , 1 , sad_list , fn_ptr , 1 , ref_mv , tmp_mv ) ; break ; case NSTEP : var = vp9_full_pixel_diamond ( cpi , x , mvp_full , step_param , error_per_bit , MAX_MVSEARCH_STEPS - 1 - step_param , 1 , fn_ptr , ref_mv , tmp_mv ) ; break ; default : assert ( ! "Invalid search method." ) ; } if ( method != NSTEP && rd && var < var_max ) var = vp9_get_mvpred_var ( x , tmp_mv , ref_mv , fn_ptr , 1 ) ; return var ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static __inline__ __u64 ethtool_get_flow_spec_ring_vf ( __u64 ring_cookie ) { return ( ETHTOOL_RX_FLOW_SPEC_RING_VF & ring_cookie ) >> ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
void appendPsqlMetaConnect ( PQExpBuffer buf , const char * dbname ) { const char * s ; bool complex ; complex = false ; for ( s = dbname ; * s ; s ++ ) { if ( * s == '\n' || * s == '\r' ) { fprintf ( stderr , _ ( "database name contains a newline or carriage return: \"%s\"\n" ) , dbname ) ; exit ( EXIT_FAILURE ) ; } if ( ! ( ( * s >= 'a' && * s <= 'z' ) || ( * s >= 'A' && * s <= 'Z' ) || ( * s >= '0' && * s <= '9' ) || * s == '_' || * s == '.' ) ) { complex = true ; } } appendPQExpBufferStr ( buf , "\\connect " ) ; if ( complex ) { PQExpBufferData connstr ; initPQExpBuffer ( & connstr ) ; appendPQExpBuffer ( & connstr , "dbname=" ) ; appendConnStrVal ( & connstr , dbname ) ; appendPQExpBuffer ( buf , "-reuse-previous=on " ) ; appendPQExpBufferStr ( buf , fmtId ( connstr . data ) ) ; termPQExpBuffer ( & connstr ) ; } else appendPQExpBufferStr ( buf , fmtId ( dbname ) ) ; appendPQExpBufferChar ( buf , '\n' ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
int set_wep_key ( char * string ) { int bit = 0 ; char * p , type ; char * tok ; char s [ strlen ( string ) + 1 ] ; u_char tmp_wkey [ 512 ] ; size_t tmp_wkey_len ; char tmp [ 128 ] ; memset ( GBL_WIFI -> wkey , 0 , sizeof ( GBL_WIFI -> wkey ) ) ; GBL_WIFI -> wkey_len = 0 ; strcpy ( s , string ) ; p = ec_strtok ( s , ":" , & tok ) ; if ( p == NULL ) SEMIFATAL_ERROR ( "Invalid parsing of the WEP key" ) ; bit = atoi ( p ) ; if ( bit <= 0 ) SEMIFATAL_ERROR ( "Unsupported WEP key length" ) ; tmp_wkey_len = bit / 8 - WEP_IV_LEN ; if ( bit != 64 && bit != 128 ) SEMIFATAL_ERROR ( "Unsupported WEP key length" ) ; p = ec_strtok ( NULL , ":" , & tok ) ; if ( p == NULL ) SEMIFATAL_ERROR ( "Invalid parsing of the WEP key" ) ; type = * p ; p = ec_strtok ( NULL , ":" , & tok ) ; if ( p == NULL ) SEMIFATAL_ERROR ( "Invalid parsing of the WEP key" ) ; if ( type == 's' ) { if ( strescape ( ( char * ) tmp_wkey , p , strlen ( tmp_wkey ) + 1 ) != ( int ) tmp_wkey_len ) SEMIFATAL_ERROR ( "Specified WEP key length does not match the given string" ) ; } else if ( type == 'p' ) { if ( bit == 64 ) make_key_64 ( ( u_char * ) p , tmp_wkey ) ; else if ( bit == 128 ) make_key_128 ( ( u_char * ) p , tmp_wkey ) ; } else { SEMIFATAL_ERROR ( "Invalid parsing of the WEP key" ) ; } USER_MSG ( "Using WEP key: %s\n" , str_tohex ( tmp_wkey , tmp_wkey_len , tmp , sizeof ( tmp ) ) ) ; memcpy ( GBL_WIFI -> wkey , tmp_wkey , sizeof ( GBL_WIFI -> wkey ) ) ; GBL_WIFI -> wkey_len = tmp_wkey_len ; return E_SUCCESS ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static uint32_t vmport_cmd_ram_size ( void * opaque , uint32_t addr ) { CPUX86State * env = cpu_single_env ; env -> regs [ R_EBX ] = 0x1177 ; return ram_size ; }
1True
Categorize the following code snippet as vulnerable or not. True or False
int main ( int argc , char * * argv ) { extern char * __progname ; char * listen_ip ; char * errormsg ; # ifndef WINDOWS32 struct passwd * pw ; # endif int foreground ; char * username ; char * newroot ; char * context ; char * device ; char * pidfile ; int dnsd_fd ; int tun_fd ; int bind_fd ; int bind_enable ; int choice ; int port ; int mtu ; int skipipconfig ; char * netsize ; int ns_get_externalip ; int retval ; int max_idle_time = 0 ; struct sockaddr_storage dnsaddr ; int dnsaddr_len ; # ifdef HAVE_SYSTEMD int nb_fds ; # endif # ifndef WINDOWS32 pw = NULL ; # endif errormsg = NULL ; username = NULL ; newroot = NULL ; context = NULL ; device = NULL ; foreground = 0 ; bind_enable = 0 ; bind_fd = 0 ; mtu = 1130 ; listen_ip = NULL ; port = 53 ; ns_ip = INADDR_ANY ; ns_get_externalip = 0 ; check_ip = 1 ; skipipconfig = 0 ; debug = 0 ; netmask = 27 ; pidfile = NULL ; b32 = get_base32_encoder ( ) ; b64 = get_base64_encoder ( ) ; b64u = get_base64u_encoder ( ) ; b128 = get_base128_encoder ( ) ; retval = 0 ; # ifdef WINDOWS32 WSAStartup ( req_version , & wsa_data ) ; # endif # if ! defined ( BSD ) && ! defined ( __GLIBC__ ) __progname = strrchr ( argv [ 0 ] , '/' ) ; if ( __progname == NULL ) __progname = argv [ 0 ] ; else __progname ++ ; # endif memset ( password , 0 , sizeof ( password ) ) ; srand ( time ( NULL ) ) ; fw_query_init ( ) ; while ( ( choice = getopt ( argc , argv , "vcsfhDu:t:d:m:l:p:n:b:P:z:F:i:" ) ) != - 1 ) { switch ( choice ) { case 'v' : version ( ) ; break ; case 'c' : check_ip = 0 ; break ; case 's' : skipipconfig = 1 ; break ; case 'f' : foreground = 1 ; break ; case 'h' : help ( ) ; break ; case 'D' : debug ++ ; break ; case 'u' : username = optarg ; break ; case 't' : newroot = optarg ; break ; case 'd' : device = optarg ; break ; case 'm' : mtu = atoi ( optarg ) ; break ; case 'l' : listen_ip = optarg ; break ; case 'p' : port = atoi ( optarg ) ; break ; case 'n' : if ( optarg && strcmp ( "auto" , optarg ) == 0 ) { ns_get_externalip = 1 ; } else { ns_ip = inet_addr ( optarg ) ; } break ; case 'b' : bind_enable = 1 ; bind_port = atoi ( optarg ) ; break ; case 'F' : pidfile = optarg ; break ; case 'i' : max_idle_time = atoi ( optarg ) ; break ; case 'P' : strncpy ( password , optarg , sizeof ( password ) ) ; password [ sizeof ( password ) - 1 ] = 0 ; memset ( optarg , 0 , strlen ( optarg ) ) ; break ; case 'z' : context = optarg ; break ; default : usage ( ) ; break ; } } argc -= optind ; argv += optind ; check_superuser ( usage ) ; if ( argc != 2 ) usage ( ) ; netsize = strchr ( argv [ 0 ] , '/' ) ; if ( netsize ) { * netsize = 0 ; netsize ++ ; netmask = atoi ( netsize ) ; } my_ip = inet_addr ( argv [ 0 ] ) ; if ( my_ip == INADDR_NONE ) { warnx ( "Bad IP address to use inside tunnel." ) ; usage ( ) ; } topdomain = strdup ( argv [ 1 ] ) ; if ( check_topdomain ( topdomain , & errormsg ) ) { warnx ( "Invalid topdomain: %s" , errormsg ) ; usage ( ) ; } if ( username != NULL ) { # ifndef WINDOWS32 if ( ( pw = getpwnam ( username ) ) == NULL ) { warnx ( "User %s does not exist!" , username ) ; usage ( ) ; } # endif } if ( mtu <= 0 ) { warnx ( "Bad MTU given." ) ; usage ( ) ; } if ( port < 1 || port > 65535 ) { warnx ( "Bad port number given." ) ; usage ( ) ; } if ( port != 53 ) { fprintf ( stderr , "ALERT! Other dns servers expect you to run on port 53.\n" ) ; fprintf ( stderr , "You must manually forward port 53 to port %d for things to work.\n" , port ) ; } if ( debug ) { fprintf ( stderr , "Debug level %d enabled, will stay in foreground.\n" , debug ) ; fprintf ( stderr , "Add more -D switches to set higher debug level.\n" ) ; foreground = 1 ; } dnsaddr_len = get_addr ( listen_ip , port , AF_INET , AI_PASSIVE | AI_NUMERICHOST , & dnsaddr ) ; if ( dnsaddr_len < 0 ) { warnx ( "Bad IP address to listen on." ) ; usage ( ) ; } if ( bind_enable ) { in_addr_t dns_ip = ( ( struct sockaddr_in * ) & dnsaddr ) -> sin_addr . s_addr ; if ( bind_port < 1 || bind_port > 65535 ) { warnx ( "Bad DNS server port number given." ) ; usage ( ) ; } if ( bind_port == port && ( dns_ip == INADDR_ANY || dns_ip == htonl ( 0x7f000001L ) ) ) { warnx ( "Forward port is same as listen port (%d), will create a loop!" , bind_port ) ; fprintf ( stderr , "Use -l to set listen ip to avoid this.\n" ) ; usage ( ) ; } fprintf ( stderr , "Requests for domains outside of %s will be forwarded to port %d\n" , topdomain , bind_port ) ; } if ( ns_get_externalip ) { struct in_addr extip ; int res = get_external_ip ( & extip ) ; if ( res ) { fprintf ( stderr , "Failed to get external IP via web service.\n" ) ; exit ( 3 ) ; } ns_ip = extip . s_addr ; fprintf ( stderr , "Using %s as external IP.\n" , inet_ntoa ( extip ) ) ; } if ( ns_ip == INADDR_NONE ) { warnx ( "Bad IP address to return as nameserver." ) ; usage ( ) ; } if ( netmask > 30 || netmask < 8 ) { warnx ( "Bad netmask (%d bits). Use 8-30 bits." , netmask ) ; usage ( ) ; } if ( strlen ( password ) == 0 ) { if ( NULL != getenv ( PASSWORD_ENV_VAR ) ) snprintf ( password , sizeof ( password ) , "%s" , getenv ( PASSWORD_ENV_VAR ) ) ; else read_password ( password , sizeof ( password ) ) ; } created_users = init_users ( my_ip , netmask ) ; if ( ( tun_fd = open_tun ( device ) ) == - 1 ) { retval = 1 ; goto cleanup0 ; } if ( ! skipipconfig ) { const char * other_ip = users_get_first_ip ( ) ; if ( tun_setip ( argv [ 0 ] , other_ip , netmask ) != 0 || tun_setmtu ( mtu ) != 0 ) { retval = 1 ; free ( ( void * ) other_ip ) ; goto cleanup1 ; } free ( ( void * ) other_ip ) ; } # ifdef HAVE_SYSTEMD nb_fds = sd_listen_fds ( 0 ) ; if ( nb_fds > 1 ) { retval = 1 ; warnx ( "Too many file descriptors received!\n" ) ; goto cleanup1 ; } else if ( nb_fds == 1 ) { dnsd_fd = SD_LISTEN_FDS_START ; } else { # endif if ( ( dnsd_fd = open_dns ( & dnsaddr , dnsaddr_len ) ) < 0 ) { retval = 1 ; goto cleanup2 ; } # ifdef HAVE_SYSTEMD } # endif if ( bind_enable ) { if ( ( bind_fd = open_dns_from_host ( NULL , 0 , AF_INET , 0 ) ) < 0 ) { retval = 1 ; goto cleanup3 ; } } my_mtu = mtu ; if ( created_users < USERS ) { fprintf ( stderr , "Limiting to %d simultaneous users because of netmask /%d\n" , created_users , netmask ) ; } fprintf ( stderr , "Listening to dns for domain %s\n" , topdomain ) ; if ( foreground == 0 ) do_detach ( ) ; if ( pidfile != NULL ) do_pidfile ( pidfile ) ; # ifdef FREEBSD tzsetwall ( ) ; # endif # ifndef WINDOWS32 openlog ( __progname , LOG_NDELAY , LOG_DAEMON ) ; # endif if ( newroot != NULL ) do_chroot ( newroot ) ; signal ( SIGINT , sigint ) ; if ( username != NULL ) { # ifndef WINDOWS32 gid_t gids [ 1 ] ; gids [ 0 ] = pw -> pw_gid ; if ( setgroups ( 1 , gids ) < 0 || setgid ( pw -> pw_gid ) < 0 || setuid ( pw -> pw_uid ) < 0 ) { warnx ( "Could not switch to user %s!\n" , username ) ; usage ( ) ; } # endif } if ( context != NULL ) do_setcon ( context ) ; syslog ( LOG_INFO , "started, listening on port %d" , port ) ; tunnel ( tun_fd , dnsd_fd , bind_fd , max_idle_time ) ; syslog ( LOG_INFO , "stopping" ) ; cleanup3 : close_dns ( bind_fd ) ; cleanup2 : close_dns ( dnsd_fd ) ; cleanup1 : close_tun ( tun_fd ) ; cleanup0 : return retval ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void x8_get_ac_rlf ( IntraX8Context * const w , const int mode , int * const run , int * const level , int * const final ) { MpegEncContext * const s = w -> s ; int i , e ; i = get_vlc2 ( & s -> gb , w -> j_ac_vlc [ mode ] -> table , AC_VLC_BITS , AC_VLC_MTD ) ; if ( i < 46 ) { int t , l ; if ( i < 0 ) { ( * level ) = ( * final ) = ( * run ) = 64 ; return ; } ( * final ) = t = ( i > 22 ) ; i -= 23 * t ; l = ( 0xE50000 >> ( i & ( 0x1E ) ) ) & 3 ; t = ( 0x01030F >> ( l << 3 ) ) ; ( * run ) = i & t ; ( * level ) = l ; } else if ( i < 73 ) { uint32_t sm ; uint32_t mask ; i -= 46 ; sm = ac_decode_table [ i ] ; e = get_bits ( & s -> gb , sm & 0xF ) ; sm >>= 8 ; mask = sm & 0xff ; sm >>= 8 ; ( * run ) = ( sm & 0xff ) + ( e & ( mask ) ) ; ( * level ) = ( sm >> 8 ) + ( e & ( ~ mask ) ) ; ( * final ) = i > ( 58 - 46 ) ; } else if ( i < 75 ) { static const uint8_t crazy_mix_runlevel [ 32 ] = { 0x22 , 0x32 , 0x33 , 0x53 , 0x23 , 0x42 , 0x43 , 0x63 , 0x24 , 0x52 , 0x34 , 0x73 , 0x25 , 0x62 , 0x44 , 0x83 , 0x26 , 0x72 , 0x35 , 0x54 , 0x27 , 0x82 , 0x45 , 0x64 , 0x28 , 0x92 , 0x36 , 0x74 , 0x29 , 0xa2 , 0x46 , 0x84 } ; ( * final ) = ! ( i & 1 ) ; e = get_bits ( & s -> gb , 5 ) ; ( * run ) = crazy_mix_runlevel [ e ] >> 4 ; ( * level ) = crazy_mix_runlevel [ e ] & 0x0F ; } else { ( * level ) = get_bits ( & s -> gb , 7 - 3 * ( i & 1 ) ) ; ( * run ) = get_bits ( & s -> gb , 6 ) ; ( * final ) = get_bits1 ( & s -> gb ) ; } return ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
TEST_F ( BrowsingDataRemoverImplTest , RemoveCookiesDomainBlacklist ) { std : : unique_ptr < BrowsingDataFilterBuilder > filter ( BrowsingDataFilterBuilder : : Create ( BrowsingDataFilterBuilder : : BLACKLIST ) ) ; filter -> AddRegisterableDomain ( kTestRegisterableDomain1 ) ; filter -> AddRegisterableDomain ( kTestRegisterableDomain3 ) ; BlockUntilOriginDataRemoved ( AnHourAgo ( ) , base : : Time : : Max ( ) , BrowsingDataRemover : : REMOVE_COOKIES , std : : move ( filter ) ) ; EXPECT_EQ ( BrowsingDataRemover : : REMOVE_COOKIES , GetRemovalMask ( ) ) ; EXPECT_EQ ( BrowsingDataHelper : : UNPROTECTED_WEB , GetOriginTypeMask ( ) ) ; StoragePartitionRemovalData removal_data = GetStoragePartitionRemovalData ( ) ; EXPECT_EQ ( removal_data . remove_mask , StoragePartition : : REMOVE_DATA_MASK_COOKIES ) ; EXPECT_EQ ( removal_data . quota_storage_remove_mask , ~ StoragePartition : : QUOTA_MANAGED_STORAGE_MASK_PERSISTENT ) ; EXPECT_EQ ( removal_data . remove_begin , GetBeginTime ( ) ) ; EXPECT_FALSE ( removal_data . origin_matcher . Run ( kOrigin1 , mock_policy ( ) ) ) ; EXPECT_TRUE ( removal_data . origin_matcher . Run ( kOrigin2 , mock_policy ( ) ) ) ; EXPECT_FALSE ( removal_data . origin_matcher . Run ( kOrigin3 , mock_policy ( ) ) ) ; EXPECT_FALSE ( removal_data . origin_matcher . Run ( kOrigin4 , mock_policy ( ) ) ) ; EXPECT_FALSE ( removal_data . cookie_matcher . Run ( CreateCookieWithHost ( kOrigin1 ) ) ) ; EXPECT_TRUE ( removal_data . cookie_matcher . Run ( CreateCookieWithHost ( kOrigin2 ) ) ) ; EXPECT_FALSE ( removal_data . cookie_matcher . Run ( CreateCookieWithHost ( kOrigin3 ) ) ) ; EXPECT_FALSE ( removal_data . cookie_matcher . Run ( CreateCookieWithHost ( kOrigin4 ) ) ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int test_recode_command2 ( xd3_stream * stream , int has_source , int variant , int change ) { int has_adler32 = ( variant & 0x1 ) != 0 ; int has_apphead = ( variant & 0x2 ) != 0 ; int has_secondary = ( variant & 0x4 ) != 0 ; int change_adler32 = ( change & 0x1 ) != 0 ; int change_apphead = ( change & 0x2 ) != 0 ; int change_secondary = ( change & 0x4 ) != 0 ; int recoded_adler32 = change_adler32 ? ! has_adler32 : has_adler32 ; int recoded_apphead = change_apphead ? ! has_apphead : has_apphead ; int recoded_secondary = change_secondary ? ! has_secondary : has_secondary ; char ecmd [ TESTBUFSIZE ] , recmd [ TESTBUFSIZE ] , dcmd [ TESTBUFSIZE ] ; xoff_t tsize , ssize ; int ret ; test_setup ( ) ; if ( ( ret = test_make_inputs ( stream , has_source ? & ssize : NULL , & tsize ) ) ) { return ret ; } snprintf_func ( ecmd , TESTBUFSIZE , "%s %s -f %s %s %s %s %s %s %s" , program_name , test_softcfg_str , has_adler32 ? "" : "-n " , has_apphead ? "-A=encode_apphead " : "-A= " , has_secondary ? "-S djw " : "-S none " , has_source ? "-s " : "" , has_source ? TEST_SOURCE_FILE : "" , TEST_TARGET_FILE , TEST_DELTA_FILE ) ; if ( ( ret = system ( ecmd ) ) != 0 ) { XPR ( NT "encode command: %s\n" , ecmd ) ; stream -> msg = "encode cmd failed" ; return XD3_INTERNAL ; } snprintf_func ( recmd , TESTBUFSIZE , "%s recode %s -f %s %s %s %s %s" , program_name , test_softcfg_str , recoded_adler32 ? "" : "-n " , ! change_apphead ? "" : ( recoded_apphead ? "-A=recode_apphead " : "-A= " ) , recoded_secondary ? "-S djw " : "-S none " , TEST_DELTA_FILE , TEST_COPY_FILE ) ; if ( ( ret = system ( recmd ) ) != 0 ) { XPR ( NT "recode command: %s\n" , recmd ) ; stream -> msg = "recode cmd failed" ; return XD3_INTERNAL ; } if ( ( ret = check_vcdiff_header ( stream , TEST_COPY_FILE , "VCDIFF window indicator" , "VCD_SOURCE" , has_source ) ) ) { return ret ; } if ( ( ret = check_vcdiff_header ( stream , TEST_COPY_FILE , "VCDIFF header indicator" , "VCD_SECONDARY" , recoded_secondary ) ) ) { return ret ; } if ( ( ret = check_vcdiff_header ( stream , TEST_COPY_FILE , "VCDIFF window indicator" , "VCD_ADLER32" , has_adler32 && recoded_adler32 ) ) ) { return ret ; } if ( ! change_apphead ) { if ( ( ret = check_vcdiff_header ( stream , TEST_COPY_FILE , "VCDIFF header indicator" , "VCD_APPHEADER" , has_apphead ) ) ) { return ret ; } if ( ( ret = check_vcdiff_header ( stream , TEST_COPY_FILE , "VCDIFF application header" , "encode_apphead" , has_apphead ) ) ) { return ret ; } } else { if ( ( ret = check_vcdiff_header ( stream , TEST_COPY_FILE , "VCDIFF header indicator" , "VCD_APPHEADER" , recoded_apphead ) ) ) { return ret ; } if ( recoded_apphead && ( ret = check_vcdiff_header ( stream , TEST_COPY_FILE , "VCDIFF application header" , "recode_apphead" , 1 ) ) ) { return ret ; } } snprintf_func ( dcmd , TESTBUFSIZE , "%s -fd %s %s %s %s " , program_name , has_source ? "-s " : "" , has_source ? TEST_SOURCE_FILE : "" , TEST_COPY_FILE , TEST_RECON_FILE ) ; if ( ( ret = system ( dcmd ) ) != 0 ) { XPR ( NT "decode command: %s\n" , dcmd ) ; stream -> msg = "decode cmd failed" ; return XD3_INTERNAL ; } if ( ( ret = test_compare_files ( TEST_TARGET_FILE , TEST_RECON_FILE ) ) ) { return ret ; } return 0 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int selinux_socket_unix_stream_connect ( struct sock * sock , struct sock * other , struct sock * newsk ) { struct sk_security_struct * sksec_sock = sock -> sk_security ; struct sk_security_struct * sksec_other = other -> sk_security ; struct sk_security_struct * sksec_new = newsk -> sk_security ; struct common_audit_data ad ; struct lsm_network_audit net = { 0 , } ; int err ; ad . type = LSM_AUDIT_DATA_NET ; ad . u . net = & net ; ad . u . net -> sk = other ; err = avc_has_perm ( sksec_sock -> sid , sksec_other -> sid , sksec_other -> sclass , UNIX_STREAM_SOCKET__CONNECTTO , & ad ) ; if ( err ) return err ; sksec_new -> peer_sid = sksec_sock -> sid ; err = security_sid_mls_copy ( sksec_other -> sid , sksec_sock -> sid , & sksec_new -> sid ) ; if ( err ) return err ; sksec_sock -> peer_sid = sksec_new -> sid ; return 0 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
struct login_settings * login_settings_read ( pool_t pool , const struct ip_addr * local_ip , const struct ip_addr * remote_ip , const char * local_name , const struct master_service_ssl_settings * * ssl_set_r , void * * * other_settings_r ) { struct master_service_settings_input input ; const char * error ; const struct setting_parser_context * parser ; void * const * cache_sets ; void * * sets ; unsigned int i , count ; i_zero ( & input ) ; input . roots = login_set_roots ; input . module = login_binary -> process_name ; input . service = login_binary -> protocol ; input . local_name = local_name ; if ( local_ip != NULL ) input . local_ip = * local_ip ; if ( remote_ip != NULL ) input . remote_ip = * remote_ip ; if ( set_cache == NULL ) { set_cache = master_service_settings_cache_init ( master_service , input . module , input . service ) ; } if ( master_service_settings_cache_read ( set_cache , & input , NULL , & parser , & error ) < 0 ) i_fatal ( "Error reading configuration: %s" , error ) ; cache_sets = master_service_settings_parser_get_others ( master_service , parser ) ; for ( count = 0 ; input . roots [ count ] != NULL ; count ++ ) ; i_assert ( cache_sets [ count ] == NULL ) ; sets = p_new ( pool , void * , count + 1 ) ; for ( i = 0 ; i < count ; i ++ ) sets [ i ] = login_setting_dup ( pool , input . roots [ i ] , cache_sets [ i ] ) ; settings_var_expand ( & login_setting_parser_info , sets [ 0 ] , pool , login_set_var_expand_table ( & input ) ) ; * ssl_set_r = login_setting_dup ( pool , & master_service_ssl_setting_parser_info , settings_parser_get_list ( parser ) [ 1 ] ) ; * other_settings_r = sets + 1 ; return sets [ 0 ] ; }
1True
Categorize the following code snippet as vulnerable or not. True or False
BusState * qdev_get_child_bus ( DeviceState * dev , const char * name ) { BusState * bus ; QLIST_FOREACH ( bus , & dev -> child_bus , sibling ) { if ( strcmp ( name , bus -> name ) == 0 ) { return bus ; } } return NULL ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
void proto_register_dcerpc_spoolss ( void ) { static hf_register_info hf [ ] = { { & hf_clientmajorversion , { "Client major version" , "spoolss.clientmajorversion" , FT_UINT32 , BASE_DEC , NULL , 0x0 , "Client printer driver major version" , HFILL } } , { & hf_clientminorversion , { "Client minor version" , "spoolss.clientminorversion" , FT_UINT32 , BASE_DEC , NULL , 0x0 , "Client printer driver minor version" , HFILL } } , { & hf_servermajorversion , { "Server major version" , "spoolss.servermajorversion" , FT_UINT32 , BASE_DEC , NULL , 0x0 , "Server printer driver major version" , HFILL } } , { & hf_serverminorversion , { "Server minor version" , "spoolss.serverminorversion" , FT_UINT32 , BASE_DEC , NULL , 0x0 , "Server printer driver minor version" , HFILL } } , { & hf_driverpath , { "Driver path" , "spoolss.driverpath" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_datafile , { "Data file" , "spoolss.datafile" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_configfile , { "Config file" , "spoolss.configfile" , FT_STRING , BASE_NONE , NULL , 0 , "Printer name" , HFILL } } , { & hf_helpfile , { "Help file" , "spoolss.helpfile" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_monitorname , { "Monitor name" , "spoolss.monitorname" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_defaultdatatype , { "Default data type" , "spoolss.defaultdatatype" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_driverinfo_cversion , { "Driver version" , "spoolss.driverversion" , FT_UINT32 , BASE_DEC , VALS ( driverinfo_cversion_vals ) , 0 , "Printer name" , HFILL } } , { & hf_dependentfiles , { "Dependent files" , "spoolss.dependentfiles" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_printer_status , { "Status" , "spoolss.printer_status" , FT_UINT32 , BASE_DEC | BASE_EXT_STRING , & printer_status_vals_ext , 0 , NULL , HFILL } } , { & hf_previousdrivernames , { "Previous Driver Names" , "spoolss.previousdrivernames" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_driverdate , { "Driver Date" , "spoolss.driverdate" , FT_ABSOLUTE_TIME , ABSOLUTE_TIME_LOCAL , NULL , 0 , "Date of driver creation" , HFILL } } , { & hf_padding , { "Padding" , "spoolss.padding" , FT_UINT32 , BASE_HEX , NULL , 0 , "Some padding - conveys no semantic information" , HFILL } } , { & hf_driver_version_low , { "Minor Driver Version" , "spoolss.minordriverversion" , FT_UINT32 , BASE_DEC , NULL , 0 , "Driver Version Low" , HFILL } } , { & hf_driver_version_high , { "Major Driver Version" , "spoolss.majordriverversion" , FT_UINT32 , BASE_DEC , NULL , 0 , "Driver Version High" , HFILL } } , { & hf_mfgname , { "Mfgname" , "spoolss.mfgname" , FT_STRING , BASE_NONE , NULL , 0 , "Manufacturer Name" , HFILL } } , { & hf_oemurl , { "OEM URL" , "spoolss.oemrul" , FT_STRING , BASE_NONE , NULL , 0 , "OEM URL - Website of Vendor" , HFILL } } , { & hf_hardwareid , { "Hardware ID" , "spoolss.hardwareid" , FT_STRING , BASE_NONE , NULL , 0 , "Hardware Identification Information" , HFILL } } , { & hf_provider , { "Provider" , "spoolss.provider" , FT_STRING , BASE_NONE , NULL , 0 , "Provider of Driver" , HFILL } } , { & hf_setprinter_cmd , { "Command" , "spoolss.setprinter_cmd" , FT_UINT32 , BASE_DEC , VALS ( setprinter_cmd_vals ) , 0 , NULL , HFILL } } , { & hf_enumprinters_flags , { "Flags" , "spoolss.enumprinters.flags" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL } } , { & hf_enumprinters_flags_local , { "Enum local" , "spoolss.enumprinters.flags.enum_local" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , PRINTER_ENUM_LOCAL , NULL , HFILL } } , { & hf_enumprinters_flags_name , { "Enum name" , "spoolss.enumprinters.flags.enum_name" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , PRINTER_ENUM_NAME , NULL , HFILL } } , { & hf_enumprinters_flags_shared , { "Enum shared" , "spoolss.enumprinters.flags.enum_shared" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , PRINTER_ENUM_SHARED , NULL , HFILL } } , { & hf_enumprinters_flags_default , { "Enum default" , "spoolss.enumprinters.flags.enum_default" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , PRINTER_ENUM_DEFAULT , NULL , HFILL } } , { & hf_enumprinters_flags_connections , { "Enum connections" , "spoolss.enumprinters.flags.enum_connections" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , PRINTER_ENUM_CONNECTIONS , NULL , HFILL } } , { & hf_enumprinters_flags_network , { "Enum network" , "spoolss.enumprinters.flags.enum_network" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , PRINTER_ENUM_NETWORK , NULL , HFILL } } , { & hf_enumprinters_flags_remote , { "Enum remote" , "spoolss.enumprinters.flags.enum_remote" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , PRINTER_ENUM_REMOTE , NULL , HFILL } } , { & hf_start_time , { "Start time" , "spoolss.start_time" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_end_time , { "End time" , "spoolss.end_time" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_elapsed_time , { "Elapsed time" , "spoolss.elapsed_time" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_opnum , { "Operation" , "spoolss.opnum" , FT_UINT16 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_hnd , { "Context handle" , "spoolss.hnd" , FT_BYTES , BASE_NONE , NULL , 0x0 , "SPOOLSS policy handle" , HFILL } } , { & hf_rc , { "Return code" , "spoolss.rc" , FT_UINT32 , BASE_HEX | BASE_EXT_STRING , & DOS_errors_ext , 0x0 , "SPOOLSS return code" , HFILL } } , { & hf_offered , { "Offered" , "spoolss.offered" , FT_UINT32 , BASE_DEC , NULL , 0x0 , "Size of buffer offered in this request" , HFILL } } , { & hf_needed , { "Needed" , "spoolss.needed" , FT_UINT32 , BASE_DEC , NULL , 0x0 , "Size of buffer required for request" , HFILL } } , { & hf_returned , { "Returned" , "spoolss.returned" , FT_UINT32 , BASE_DEC , NULL , 0x0 , "Number of items returned" , HFILL } } , { & hf_buffer_size , { "Buffer size" , "spoolss.buffer.size" , FT_UINT32 , BASE_DEC , NULL , 0x0 , "Size of buffer" , HFILL } } , { & hf_buffer_data , { "Buffer data" , "spoolss.buffer.data" , FT_BYTES , BASE_NONE , NULL , 0x0 , "Contents of buffer" , HFILL } } , { & hf_string_parm_size , { "String buffer size" , "spoolss.string.buffersize" , FT_UINT32 , BASE_DEC , NULL , 0x0 , "Size of string buffer" , HFILL } } , { & hf_string_parm_data , { "String data" , "spoolss.string.data" , FT_STRINGZ , BASE_NONE , NULL , 0x0 , "Contents of string" , HFILL } } , { & hf_offset , { "Offset" , "spoolss.offset" , FT_UINT32 , BASE_DEC , NULL , 0x0 , "Offset of data" , HFILL } } , { & hf_level , { "Info level" , "spoolss.enumjobs.level" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_printername , { "Printer name" , "spoolss.printername" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_machinename , { "Machine name" , "spoolss.machinename" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_notifyname , { "Notify name" , "spoolss.notifyname" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_printerdesc , { "Printer description" , "spoolss.printerdesc" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_printercomment , { "Printer comment" , "spoolss.printercomment" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_servername , { "Server name" , "spoolss.servername" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_sharename , { "Share name" , "spoolss.sharename" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_portname , { "Port name" , "spoolss.portname" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_printerlocation , { "Printer location" , "spoolss.printerlocation" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_environment , { "Environment name" , "spoolss.environment" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_drivername , { "Driver name" , "spoolss.drivername" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_username , { "User name" , "spoolss.username" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_documentname , { "Document name" , "spoolss.document" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_outputfile , { "Output file" , "spoolss.outputfile" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_datatype , { "Datatype" , "spoolss.datatype" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_textstatus , { "Text status" , "spoolss.textstatus" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_sepfile , { "Separator file" , "spoolss.setpfile" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_parameters , { "Parameters" , "spoolss.parameters" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_printprocessor , { "Print processor" , "spoolss.printprocessor" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_printerdata , { "Data" , "spoolss.printerdata" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL } } , { & hf_printerdata_key , { "Key" , "spoolss.printerdata.key" , FT_STRING , BASE_NONE , NULL , 0 , "Printer data key" , HFILL } } , { & hf_printerdata_value , { "Value" , "spoolss.printerdata.value" , FT_STRING , BASE_NONE , NULL , 0 , "Printer data value" , HFILL } } , { & hf_printerdata_type , { "Type" , "spoolss.printerdata.type" , FT_UINT32 , BASE_DEC | BASE_EXT_STRING , & reg_datatypes_ext , 0 , "Printer data type" , HFILL } } , { & hf_printerdata_size , { "Size" , "spoolss.printerdata.size" , FT_UINT32 , BASE_DEC , NULL , 0 , "Printer data size" , HFILL } } , { & hf_printerdata_data , { "Data" , "spoolss.printerdata.data" , FT_BYTES , BASE_NONE , NULL , 0x0 , "Printer data" , HFILL } } , { & hf_printerdata_data_dword , { "DWORD data" , "spoolss.printerdata.data.dword" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL } } , { & hf_printerdata_data_sz , { "String data" , "spoolss.printerdata.data.sz" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_devmodectr_size , { "Devicemode ctr size" , "spoolss.devicemodectr.size" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_devmode , { "Devicemode" , "spoolss.devmode" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL } } , { & hf_devmode_size , { "Size" , "spoolss.devmode.size" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_devmode_spec_version , { "Spec version" , "spoolss.devmode.spec_version" , FT_UINT16 , BASE_DEC , VALS ( devmode_specversion_vals ) , 0 , NULL , HFILL } } , { & hf_devmode_driver_version , { "Driver version" , "spoolss.devmode.driver_version" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_devmode_size2 , { "Size2" , "spoolss.devmode.size2" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_devmode_fields , { "Fields" , "spoolss.devmode.fields" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL } } , { & hf_devmode_orientation , { "Orientation" , "spoolss.devmode.orientation" , FT_UINT16 , BASE_DEC , VALS ( devmode_orientation_vals ) , 0 , NULL , HFILL } } , { & hf_devmode_paper_size , { "Paper size" , "spoolss.devmode.paper_size" , FT_UINT16 , BASE_DEC | BASE_EXT_STRING , & devmode_papersize_vals_ext , 0 , NULL , HFILL } } , { & hf_devmode_paper_width , { "Paper width" , "spoolss.devmode.paper_width" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_devmode_paper_length , { "Paper length" , "spoolss.devmode.paper_length" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_devmode_scale , { "Scale" , "spoolss.devmode.scale" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_devmode_copies , { "Copies" , "spoolss.devmode.copies" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_devmode_default_source , { "Default source" , "spoolss.devmode.default_source" , FT_UINT16 , BASE_DEC | BASE_EXT_STRING , & devmode_papersource_vals_ext , 0 , NULL , HFILL } } , { & hf_devmode_print_quality , { "Print quality" , "spoolss.devmode.print_quality" , FT_UINT16 , BASE_DEC , VALS ( devmode_printquality_vals ) , 0 , NULL , HFILL } } , { & hf_devmode_color , { "Color" , "spoolss.devmode.color" , FT_UINT16 , BASE_DEC , VALS ( devmode_colour_vals ) , 0 , NULL , HFILL } } , { & hf_devmode_duplex , { "Duplex" , "spoolss.devmode.duplex" , FT_UINT16 , BASE_DEC , VALS ( devmode_duplex_vals ) , 0 , NULL , HFILL } } , { & hf_devmode_y_resolution , { "Y resolution" , "spoolss.devmode.y_resolution" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_devmode_tt_option , { "TT option" , "spoolss.devmode.tt_option" , FT_UINT16 , BASE_DEC , VALS ( devmode_ttoption_vals ) , 0 , NULL , HFILL } } , { & hf_devmode_collate , { "Collate" , "spoolss.devmode.collate" , FT_UINT16 , BASE_DEC , VALS ( devmode_collate_vals ) , 0 , NULL , HFILL } } , { & hf_devmode_log_pixels , { "Log pixels" , "spoolss.devmode.log_pixels" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_devmode_bits_per_pel , { "Bits per pel" , "spoolss.devmode.bits_per_pel" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_devmode_pels_width , { "Pels width" , "spoolss.devmode.pels_width" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_devmode_pels_height , { "Pels height" , "spoolss.devmode.pels_height" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_devmode_display_flags , { "Display flags" , "spoolss.devmode.display_flags" , FT_UINT32 , BASE_DEC , VALS ( devmode_displayflags_vals ) , 0 , NULL , HFILL } } , { & hf_devmode_display_freq , { "Display frequency" , "spoolss.devmode.display_freq" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_devmode_icm_method , { "ICM method" , "spoolss.devmode.icm_method" , FT_UINT32 , BASE_DEC , VALS ( devmode_icmmethod_vals ) , 0 , NULL , HFILL } } , { & hf_devmode_icm_intent , { "ICM intent" , "spoolss.devmode.icm_intent" , FT_UINT32 , BASE_DEC , VALS ( devmode_icmintent_vals ) , 0 , NULL , HFILL } } , { & hf_devmode_media_type , { "Media type" , "spoolss.devmode.media_type" , FT_UINT32 , BASE_DEC , VALS ( devmode_mediatype_vals ) , 0 , NULL , HFILL } } , { & hf_devmode_dither_type , { "Dither type" , "spoolss.devmode.dither_type" , FT_UINT32 , BASE_DEC , VALS ( devmode_dithertype_vals ) , 0 , NULL , HFILL } } , { & hf_devmode_reserved1 , { "Reserved1" , "spoolss.devmode.reserved1" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_devmode_reserved2 , { "Reserved2" , "spoolss.devmode.reserved2" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_devmode_panning_width , { "Panning width" , "spoolss.devmode.panning_width" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_devmode_panning_height , { "Panning height" , "spoolss.devmode.panning_height" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_devmode_driver_extra_len , { "Driver extra length" , "spoolss.devmode.driver_extra_len" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_devmode_driver_extra , { "Driver extra" , "spoolss.devmode.driver_extra" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_devmode_fields_orientation , { "Orientation" , "spoolss.devmode.fields.orientation" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_ORIENTATION , NULL , HFILL } } , { & hf_devmode_fields_papersize , { "Paper size" , "spoolss.devmode.fields.paper_size" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_PAPERSIZE , NULL , HFILL } } , { & hf_devmode_fields_paperlength , { "Paper length" , "spoolss.devmode.fields.paper_length" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_PAPERLENGTH , NULL , HFILL } } , { & hf_devmode_fields_paperwidth , { "Paper width" , "spoolss.devmode.fields.paper_width" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_PAPERWIDTH , NULL , HFILL } } , { & hf_devmode_fields_scale , { "Scale" , "spoolss.devmode.fields.scale" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_SCALE , NULL , HFILL } } , { & hf_devmode_fields_position , { "Position" , "spoolss.devmode.fields.position" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_POSITION , NULL , HFILL } } , { & hf_devmode_fields_nup , { "N-up" , "spoolss.devmode.fields.nup" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_NUP , NULL , HFILL } } , { & hf_devmode_fields_copies , { "Copies" , "spoolss.devmode.fields.copies" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_COPIES , NULL , HFILL } } , { & hf_devmode_fields_defaultsource , { "Default source" , "spoolss.devmode.fields.default_source" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_DEFAULTSOURCE , NULL , HFILL } } , { & hf_devmode_fields_printquality , { "Print quality" , "spoolss.devmode.fields.print_quality" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_PRINTQUALITY , NULL , HFILL } } , { & hf_devmode_fields_color , { "Color" , "spoolss.devmode.fields.color" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_COLOR , NULL , HFILL } } , { & hf_devmode_fields_duplex , { "Duplex" , "spoolss.devmode.fields.duplex" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_DUPLEX , NULL , HFILL } } , { & hf_devmode_fields_yresolution , { "Y resolution" , "spoolss.devmode.fields.y_resolution" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_YRESOLUTION , NULL , HFILL } } , { & hf_devmode_fields_ttoption , { "TT option" , "spoolss.devmode.fields.tt_option" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_TTOPTION , NULL , HFILL } } , { & hf_devmode_fields_collate , { "Collate" , "spoolss.devmode.fields.collate" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_COLLATE , NULL , HFILL } } , { & hf_devmode_fields_formname , { "Form name" , "spoolss.devmode.fields.form_name" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_FORMNAME , NULL , HFILL } } , { & hf_devmode_fields_logpixels , { "Log pixels" , "spoolss.devmode.fields.log_pixels" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_LOGPIXELS , NULL , HFILL } } , { & hf_devmode_fields_bitsperpel , { "Bits per pel" , "spoolss.devmode.fields.bits_per_pel" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_BITSPERPEL , NULL , HFILL } } , { & hf_devmode_fields_pelswidth , { "Pels width" , "spoolss.devmode.fields.pels_width" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_PELSWIDTH , NULL , HFILL } } , { & hf_devmode_fields_pelsheight , { "Pels height" , "spoolss.devmode.fields.pels_height" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_PELSHEIGHT , NULL , HFILL } } , { & hf_devmode_fields_displayflags , { "Display flags" , "spoolss.devmode.fields.display_flags" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_DISPLAYFLAGS , NULL , HFILL } } , { & hf_devmode_fields_displayfrequency , { "Display frequency" , "spoolss.devmode.fields.display_frequency" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_DISPLAYFREQUENCY , NULL , HFILL } } , { & hf_devmode_fields_icmmethod , { "ICM method" , "spoolss.devmode.fields.icm_method" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_ICMMETHOD , NULL , HFILL } } , { & hf_devmode_fields_icmintent , { "ICM intent" , "spoolss.devmode.fields.icm_intent" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_ICMINTENT , NULL , HFILL } } , { & hf_devmode_fields_mediatype , { "Media type" , "spoolss.devmode.fields.media_type" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_MEDIATYPE , NULL , HFILL } } , { & hf_devmode_fields_dithertype , { "Dither type" , "spoolss.devmode.fields.dither_type" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_DITHERTYPE , NULL , HFILL } } , { & hf_devmode_fields_panningwidth , { "Panning width" , "spoolss.devmode.fields.panning_width" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_PANNINGWIDTH , NULL , HFILL } } , { & hf_devmode_fields_panningheight , { "Panning height" , "spoolss.devmode.fields.panning_height" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , DEVMODE_PANNINGHEIGHT , NULL , HFILL } } , { & hf_enumprinterdata_enumindex , { "Enum index" , "spoolss.enumprinterdata.enumindex" , FT_UINT32 , BASE_DEC , NULL , 0x0 , "Index for start of enumeration" , HFILL } } , { & hf_enumprinterdata_value_offered , { "Value size offered" , "spoolss.enumprinterdata.value_offered" , FT_UINT32 , BASE_DEC , NULL , 0x0 , "Buffer size offered for printerdata value" , HFILL } } , { & hf_enumprinterdata_data_offered , { "Data size offered" , "spoolss.enumprinterdata.data_offered" , FT_UINT32 , BASE_DEC , NULL , 0x0 , "Buffer size offered for printerdata data" , HFILL } } , { & hf_enumprinterdata_value_len , { "Value length" , "spoolss.enumprinterdata.value_len" , FT_UINT32 , BASE_DEC , NULL , 0x0 , "Size of printerdata value" , HFILL } } , { & hf_enumprinterdata_value_needed , { "Value size needed" , "spoolss.enumprinterdata.value_needed" , FT_UINT32 , BASE_DEC , NULL , 0x0 , "Buffer size needed for printerdata value" , HFILL } } , { & hf_enumprinterdata_data_needed , { "Data size needed" , "spoolss.enumprinterdata.data_needed" , FT_UINT32 , BASE_DEC , NULL , 0x0 , "Buffer size needed for printerdata data" , HFILL } } , { & hf_job_id , { "Job ID" , "spoolss.job.id" , FT_UINT32 , BASE_DEC , NULL , 0x0 , "Job identification number" , HFILL } } , { & hf_job_status , { "Job status" , "spoolss.job.status" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_job_status_paused , { "Paused" , "spoolss.job.status.paused" , FT_BOOLEAN , 32 , TFS ( & tfs_job_status_paused ) , JOB_STATUS_PAUSED , NULL , HFILL } } , { & hf_job_status_error , { "Error" , "spoolss.job.status.error" , FT_BOOLEAN , 32 , TFS ( & tfs_job_status_error ) , JOB_STATUS_ERROR , NULL , HFILL } } , { & hf_job_status_deleting , { "Deleting" , "spoolss.job.status.deleting" , FT_BOOLEAN , 32 , TFS ( & tfs_job_status_deleting ) , JOB_STATUS_DELETING , NULL , HFILL } } , { & hf_job_status_spooling , { "Spooling" , "spoolss.job.status.spooling" , FT_BOOLEAN , 32 , TFS ( & tfs_job_status_spooling ) , JOB_STATUS_SPOOLING , NULL , HFILL } } , { & hf_job_status_printing , { "Printing" , "spoolss.job.status.printing" , FT_BOOLEAN , 32 , TFS ( & tfs_job_status_printing ) , JOB_STATUS_PRINTING , NULL , HFILL } } , { & hf_job_status_offline , { "Offline" , "spoolss.job.status.offline" , FT_BOOLEAN , 32 , TFS ( & tfs_job_status_offline ) , JOB_STATUS_OFFLINE , NULL , HFILL } } , { & hf_job_status_paperout , { "Paperout" , "spoolss.job.status.paperout" , FT_BOOLEAN , 32 , TFS ( & tfs_job_status_paperout ) , JOB_STATUS_PAPEROUT , NULL , HFILL } } , { & hf_job_status_printed , { "Printed" , "spoolss.job.status.printed" , FT_BOOLEAN , 32 , TFS ( & tfs_job_status_printed ) , JOB_STATUS_PRINTED , NULL , HFILL } } , { & hf_job_status_deleted , { "Deleted" , "spoolss.job.status.deleted" , FT_BOOLEAN , 32 , TFS ( & tfs_job_status_deleted ) , JOB_STATUS_DELETED , NULL , HFILL } } , { & hf_job_status_blocked , { "Blocked" , "spoolss.job.status.blocked" , FT_BOOLEAN , 32 , TFS ( & tfs_job_status_blocked ) , JOB_STATUS_BLOCKED , NULL , HFILL } } , { & hf_job_status_user_intervention , { "User intervention" , "spoolss.job.status.user_intervention" , FT_BOOLEAN , 32 , TFS ( & tfs_job_status_user_intervention ) , JOB_STATUS_USER_INTERVENTION , NULL , HFILL } } , { & hf_job_priority , { "Job priority" , "spoolss.job.priority" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_job_position , { "Job position" , "spoolss.job.position" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_job_totalpages , { "Job total pages" , "spoolss.job.totalpages" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_job_totalbytes , { "Job total bytes" , "spoolss.job.totalbytes" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_job_bytesprinted , { "Job bytes printed" , "spoolss.job.bytesprinted" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_job_pagesprinted , { "Job pages printed" , "spoolss.job.pagesprinted" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_job_size , { "Job size" , "spoolss.job.size" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_form , { "Data" , "spoolss.form" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL } } , { & hf_form_level , { "Level" , "spoolss.form.level" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_form_name , { "Name" , "spoolss.form.name" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_form_flags , { "Flags" , "spoolss.form.flags" , FT_UINT32 , BASE_DEC , VALS ( form_type_vals ) , 0 , NULL , HFILL } } , { & hf_form_unknown , { "Unknown" , "spoolss.form.unknown" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL } } , { & hf_form_width , { "Width" , "spoolss.form.width" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_form_height , { "Height" , "spoolss.form.height" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_form_left_margin , { "Left margin" , "spoolss.form.left" , FT_UINT32 , BASE_DEC , NULL , 0 , "Left" , HFILL } } , { & hf_form_top_margin , { "Top" , "spoolss.form.top" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_form_horiz_len , { "Horizontal" , "spoolss.form.horiz" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_form_vert_len , { "Vertical" , "spoolss.form.vert" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_enumforms_num , { "Num" , "spoolss.enumforms.num" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_notify_options_version , { "Version" , "spoolss.notify_options.version" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_notify_options_flags , { "Flags" , "spoolss.notify_options.flags" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_notify_options_count , { "Count" , "spoolss.notify_options.count" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_notify_option_type , { "Type" , "spoolss.notify_option.type" , FT_UINT16 , BASE_DEC , VALS ( printer_notify_types ) , 0 , NULL , HFILL } } , { & hf_notify_option_reserved1 , { "Reserved1" , "spoolss.notify_option.reserved1" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_notify_option_reserved2 , { "Reserved2" , "spoolss.notify_option.reserved2" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_notify_option_reserved3 , { "Reserved3" , "spoolss.notify_option.reserved3" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_notify_option_count , { "Count" , "spoolss.notify_option.count" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_notify_option_data_count , { "Count" , "spoolss.notify_option_data.count" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_notify_options_flags_refresh , { "Refresh" , "spoolss.notify_options.flags.refresh" , FT_BOOLEAN , 32 , TFS ( & tfs_notify_options_flags_refresh ) , PRINTER_NOTIFY_OPTIONS_REFRESH , NULL , HFILL } } , { & hf_notify_info_count , { "Count" , "spoolss.notify_info.count" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_notify_info_version , { "Version" , "spoolss.notify_info.version" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_notify_info_flags , { "Flags" , "spoolss.notify_info.flags" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL } } , { & hf_notify_info_data_type , { "Type" , "spoolss.notify_info_data.type" , FT_UINT16 , BASE_DEC , VALS ( printer_notify_types ) , 0 , NULL , HFILL } } , { & hf_notify_field , { "Field" , "spoolss.notify_field" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_notify_info_data_count , { "Count" , "spoolss.notify_info_data.count" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_notify_info_data_id , { "Job Id" , "spoolss.notify_info_data.jobid" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_notify_info_data_value1 , { "Value1" , "spoolss.notify_info_data.value1" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL } } , { & hf_notify_info_data_value2 , { "Value2" , "spoolss.notify_info_data.value2" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL } } , { & hf_notify_info_data_bufsize , { "Buffer size" , "spoolss.notify_info_data.bufsize" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_notify_info_data_buffer , { "Buffer" , "spoolss.notify_info_data.buffer" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL } } , { & hf_notify_info_data_buffer_len , { "Buffer length" , "spoolss.notify_info_data.buffer.len" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL } } , { & hf_notify_info_data_buffer_data , { "Buffer data" , "spoolss.notify_info_data.buffer.data" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_rffpcnex_options , { "Options" , "spoolss.rffpcnex.options" , FT_UINT32 , BASE_DEC , NULL , 0 , "RFFPCNEX options" , HFILL } } , { & hf_printerlocal , { "Printer local" , "spoolss.printer_local" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_rffpcnex_flags , { "RFFPCNEX flags" , "spoolss.rffpcnex.flags" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_rffpcnex_flags_add_printer , { "Add printer" , "spoolss.rffpcnex.flags.add_printer" , FT_BOOLEAN , 32 , TFS ( & tfs_rffpcnex_flags_add_printer ) , SPOOLSS_PRINTER_CHANGE_ADD_PRINTER , NULL , HFILL } } , { & hf_rffpcnex_flags_set_printer , { "Set printer" , "spoolss.rffpcnex.flags.set_printer" , FT_BOOLEAN , 32 , TFS ( & tfs_rffpcnex_flags_set_printer ) , SPOOLSS_PRINTER_CHANGE_SET_PRINTER , NULL , HFILL } } , { & hf_rffpcnex_flags_delete_printer , { "Delete printer" , "spoolss.rffpcnex.flags.delete_printer" , FT_BOOLEAN , 32 , TFS ( & tfs_rffpcnex_flags_delete_printer ) , SPOOLSS_PRINTER_CHANGE_DELETE_PRINTER , NULL , HFILL } } , { & hf_rffpcnex_flags_add_job , { "Add job" , "spoolss.rffpcnex.flags.add_job" , FT_BOOLEAN , 32 , TFS ( & tfs_rffpcnex_flags_add_job ) , SPOOLSS_PRINTER_CHANGE_ADD_JOB , NULL , HFILL } } , { & hf_rffpcnex_flags_set_job , { "Set job" , "spoolss.rffpcnex.flags.set_job" , FT_BOOLEAN , 32 , TFS ( & tfs_rffpcnex_flags_set_job ) , SPOOLSS_PRINTER_CHANGE_SET_JOB , NULL , HFILL } } , { & hf_rffpcnex_flags_delete_job , { "Delete job" , "spoolss.rffpcnex.flags.delete_job" , FT_BOOLEAN , 32 , TFS ( & tfs_rffpcnex_flags_delete_job ) , SPOOLSS_PRINTER_CHANGE_DELETE_JOB , NULL , HFILL } } , { & hf_rffpcnex_flags_write_job , { "Write job" , "spoolss.rffpcnex.flags.write_job" , FT_BOOLEAN , 32 , TFS ( & tfs_rffpcnex_flags_write_job ) , SPOOLSS_PRINTER_CHANGE_WRITE_JOB , NULL , HFILL } } , { & hf_rffpcnex_flags_add_form , { "Add form" , "spoolss.rffpcnex.flags.add_form" , FT_BOOLEAN , 32 , TFS ( & tfs_rffpcnex_flags_add_form ) , SPOOLSS_PRINTER_CHANGE_ADD_FORM , NULL , HFILL } } , { & hf_rffpcnex_flags_set_form , { "Set form" , "spoolss.rffpcnex.flags.set_form" , FT_BOOLEAN , 32 , TFS ( & tfs_rffpcnex_flags_set_form ) , SPOOLSS_PRINTER_CHANGE_SET_FORM , NULL , HFILL } } , { & hf_rffpcnex_flags_delete_form , { "Delete form" , "spoolss.rffpcnex.flags.delete_form" , FT_BOOLEAN , 32 , TFS ( & tfs_rffpcnex_flags_delete_form ) , SPOOLSS_PRINTER_CHANGE_DELETE_FORM , NULL , HFILL } } , { & hf_rffpcnex_flags_add_port , { "Add port" , "spoolss.rffpcnex.flags.add_port" , FT_BOOLEAN , 32 , TFS ( & tfs_rffpcnex_flags_add_port ) , SPOOLSS_PRINTER_CHANGE_ADD_PORT , NULL , HFILL } } , { & hf_rffpcnex_flags_configure_port , { "Configure port" , "spoolss.rffpcnex.flags.configure_port" , FT_BOOLEAN , 32 , TFS ( & tfs_rffpcnex_flags_configure_port ) , SPOOLSS_PRINTER_CHANGE_CONFIGURE_PORT , NULL , HFILL } } , { & hf_rffpcnex_flags_delete_port , { "Delete port" , "spoolss.rffpcnex.flags.delete_port" , FT_BOOLEAN , 32 , TFS ( & tfs_rffpcnex_flags_delete_port ) , SPOOLSS_PRINTER_CHANGE_DELETE_PORT , NULL , HFILL } } , { & hf_rffpcnex_flags_add_print_processor , { "Add processor" , "spoolss.rffpcnex.flags.add_processor" , FT_BOOLEAN , 32 , TFS ( & tfs_rffpcnex_flags_add_print_processor ) , SPOOLSS_PRINTER_CHANGE_ADD_PRINT_PROCESSOR , NULL , HFILL } } , { & hf_rffpcnex_flags_delete_print_processor , { "Delete processor" , "spoolss.rffpcnex.flags.delete_processor" , FT_BOOLEAN , 32 , TFS ( & tfs_rffpcnex_flags_delete_print_processor ) , SPOOLSS_PRINTER_CHANGE_DELETE_PRINT_PROCESSOR , NULL , HFILL } } , { & hf_rffpcnex_flags_add_driver , { "Add driver" , "spoolss.rffpcnex.flags.add_driver" , FT_BOOLEAN , 32 , TFS ( & tfs_rffpcnex_flags_add_driver ) , SPOOLSS_PRINTER_CHANGE_ADD_PRINTER_DRIVER , NULL , HFILL } } , { & hf_rffpcnex_flags_set_driver , { "Set driver" , "spoolss.rffpcnex.flags.set_driver" , FT_BOOLEAN , 32 , TFS ( & tfs_rffpcnex_flags_set_driver ) , SPOOLSS_PRINTER_CHANGE_SET_PRINTER_DRIVER , NULL , HFILL } } , { & hf_rffpcnex_flags_delete_driver , { "Delete driver" , "spoolss.rffpcnex.flags.delete_driver" , FT_BOOLEAN , 32 , TFS ( & tfs_rffpcnex_flags_delete_driver ) , SPOOLSS_PRINTER_CHANGE_DELETE_PRINTER_DRIVER , NULL , HFILL } } , { & hf_rffpcnex_flags_timeout , { "Timeout" , "spoolss.rffpcnex.flags.timeout" , FT_BOOLEAN , 32 , TFS ( & tfs_rffpcnex_flags_timeout ) , SPOOLSS_PRINTER_CHANGE_TIMEOUT , NULL , HFILL } } , { & hf_rffpcnex_flags_failed_printer_connection , { "Failed printer connection" , "spoolss.rffpcnex.flags.failed_connection_printer" , FT_BOOLEAN , 32 , TFS ( & tfs_rffpcnex_flags_failed_connection_printer ) , SPOOLSS_PRINTER_CHANGE_FAILED_CONNECTION_PRINTER , NULL , HFILL } } , { & hf_rrpcn_changelow , { "Change low" , "spoolss.rrpcn.changelow" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_rrpcn_changehigh , { "Change high" , "spoolss.rrpcn.changehigh" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_rrpcn_unk0 , { "Unknown 0" , "spoolss.rrpcn.unk0" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_rrpcn_unk1 , { "Unknown 1" , "spoolss.rrpcn.unk1" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_replyopenprinter_unk0 , { "Unknown 0" , "spoolss.replyopenprinter.unk0" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_replyopenprinter_unk1 , { "Unknown 1" , "spoolss.replyopenprinter.unk1" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_devmode_devicename , { "DeviceName" , "spoolss.devmode.devicename" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_devmode_form_name , { "FormName" , "spoolss.devmode.form_name" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_relative_string , { "String" , "spoolss.relative_string" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_value_name , { "Value Name" , "spoolss.value_name" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_keybuffer , { "Key" , "spoolss.hf_keybuffer" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_value_string , { "Value" , "spoolss.value_string" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_printer_attributes , { "Attributes" , "spoolss.printer_attributes" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL } } , { & hf_printer_attributes_queued , { "Queued" , "spoolss.printer_attributes.queued" , FT_BOOLEAN , 32 , TFS ( & tfs_printer_attributes_queued ) , PRINTER_ATTRIBUTE_QUEUED , NULL , HFILL } } , { & hf_printer_attributes_direct , { "Direct" , "spoolss.printer_attributes.direct" , FT_BOOLEAN , 32 , TFS ( & tfs_printer_attributes_direct ) , PRINTER_ATTRIBUTE_DIRECT , NULL , HFILL } } , { & hf_printer_attributes_default , { "Default (9x/ME only)" , "spoolss.printer_attributes.default" , FT_BOOLEAN , 32 , TFS ( & tfs_printer_attributes_default ) , PRINTER_ATTRIBUTE_DEFAULT , "Default" , HFILL } } , { & hf_printer_attributes_shared , { "Shared" , "spoolss.printer_attributes.shared" , FT_BOOLEAN , 32 , TFS ( & tfs_printer_attributes_shared ) , PRINTER_ATTRIBUTE_SHARED , NULL , HFILL } } , { & hf_printer_attributes_network , { "Network" , "spoolss.printer_attributes.network" , FT_BOOLEAN , 32 , TFS ( & tfs_printer_attributes_network ) , PRINTER_ATTRIBUTE_NETWORK , NULL , HFILL } } , { & hf_printer_attributes_hidden , { "Hidden" , "spoolss.printer_attributes.hidden" , FT_BOOLEAN , 32 , TFS ( & tfs_printer_attributes_hidden ) , PRINTER_ATTRIBUTE_HIDDEN , NULL , HFILL } } , { & hf_printer_attributes_local , { "Local" , "spoolss.printer_attributes.local" , FT_BOOLEAN , 32 , TFS ( & tfs_printer_attributes_local ) , PRINTER_ATTRIBUTE_LOCAL , NULL , HFILL } } , { & hf_printer_attributes_enable_devq , { "Enable devq" , "spoolss.printer_attributes.enable_devq" , FT_BOOLEAN , 32 , TFS ( & tfs_printer_attributes_enable_devq ) , PRINTER_ATTRIBUTE_ENABLE_DEVQ , "Enable evq" , HFILL } } , { & hf_printer_attributes_keep_printed_jobs , { "Keep printed jobs" , "spoolss.printer_attributes.keep_printed_jobs" , FT_BOOLEAN , 32 , TFS ( & tfs_printer_attributes_keep_printed_jobs ) , PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS , NULL , HFILL } } , { & hf_printer_attributes_do_complete_first , { "Do complete first" , "spoolss.printer_attributes.do_complete_first" , FT_BOOLEAN , 32 , TFS ( & tfs_printer_attributes_do_complete_first ) , PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST , NULL , HFILL } } , { & hf_printer_attributes_work_offline , { "Work offline (9x/ME only)" , "spoolss.printer_attributes.work_offline" , FT_BOOLEAN , 32 , TFS ( & tfs_printer_attributes_work_offline ) , PRINTER_ATTRIBUTE_WORK_OFFLINE , "Work offline" , HFILL } } , { & hf_printer_attributes_enable_bidi , { "Enable bidi (9x/ME only)" , "spoolss.printer_attributes.enable_bidi" , FT_BOOLEAN , 32 , TFS ( & tfs_printer_attributes_enable_bidi ) , PRINTER_ATTRIBUTE_ENABLE_BIDI , "Enable bidi" , HFILL } } , { & hf_printer_attributes_raw_only , { "Raw only" , "spoolss.printer_attributes.raw_only" , FT_BOOLEAN , 32 , TFS ( & tfs_printer_attributes_raw_only ) , PRINTER_ATTRIBUTE_RAW_ONLY , NULL , HFILL } } , { & hf_printer_attributes_published , { "Published" , "spoolss.printer_attributes.published" , FT_BOOLEAN , 32 , TFS ( & tfs_printer_attributes_published ) , PRINTER_ATTRIBUTE_PUBLISHED , NULL , HFILL } } , { & hf_time_year , { "Year" , "spoolss.time.year" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_time_month , { "Month" , "spoolss.time.month" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_time_dow , { "Day of week" , "spoolss.time.dow" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_time_day , { "Day" , "spoolss.time.day" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_time_hour , { "Hour" , "spoolss.time.hour" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_time_minute , { "Minute" , "spoolss.time.minute" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_time_second , { "Second" , "spoolss.time.second" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_time_msec , { "Millisecond" , "spoolss.time.msec" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_userlevel_size , { "Size" , "spoolss.userlevel.size" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_userlevel_client , { "Client" , "spoolss.userlevel.client" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_userlevel_user , { "User" , "spoolss.userlevel.user" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_userlevel_build , { "Build" , "spoolss.userlevel.build" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_userlevel_major , { "Major" , "spoolss.userlevel.major" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_userlevel_minor , { "Minor" , "spoolss.userlevel.minor" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_userlevel_processor , { "Processor" , "spoolss.userlevel.processor" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_enumprinterdataex_name_offset , { "Name offset" , "spoolss.enumprinterdataex.name_offset" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_enumprinterdataex_name_len , { "Name len" , "spoolss.enumprinterdataex.name_len" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_enumprinterdataex_name , { "Name" , "spoolss.enumprinterdataex.name" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL } } , { & hf_enumprinterdataex_val_offset , { "Value offset" , "spoolss.enumprinterdataex.value_offset" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_enumprinterdataex_val_len , { "Value len" , "spoolss.enumprinterdataex.value_len" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_enumprinterdataex_val_dword_high , { "DWORD value (high)" , "spoolss.enumprinterdataex.val_dword.high" , FT_UINT16 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_enumprinterdataex_value_null , { "Value" , "spoolss.enumprinterdataex.val_null" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_enumprinterdataex_value_uint , { "Value" , "spoolss.enumprinterdataex.val_uint" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_enumprinterdataex_value_binary , { "Value" , "spoolss.enumprinterdataex.val_binary" , FT_BYTES , BASE_NONE , NULL , 0x0 , NULL , HFILL } } , { & hf_enumprinterdataex_value_multi_sz , { "Value" , "spoolss.enumprinterdataex.val_multi_sz" , FT_BYTES , BASE_NONE , NULL , 0x0 , NULL , HFILL } } , { & hf_enumprinterdataex_val_dword_low , { "DWORD value (low)" , "spoolss.enumprinterdataex.val_dword.low" , FT_UINT16 , BASE_DEC , NULL , 0x0 , NULL , HFILL } } , { & hf_routerreplyprinter_condition , { "Condition" , "spoolss.routerreplyprinter.condition" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_routerreplyprinter_unknown1 , { "Unknown1" , "spoolss.routerreplyprinter.unknown1" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_routerreplyprinter_changeid , { "Change id" , "spoolss.routerreplyprinter.changeid" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_keybuffer_size , { "Key Buffer size" , "spoolss.keybuffer.size" , FT_UINT32 , BASE_DEC , NULL , 0x0 , "Size of buffer" , HFILL } } , { & hf_setjob_cmd , { "Set job command" , "spoolss.setjob.cmd" , FT_UINT32 , BASE_DEC , VALS ( setjob_commands ) , 0x0 , "Printer data name" , HFILL } } , { & hf_enumjobs_firstjob , { "First job" , "spoolss.enumjobs.firstjob" , FT_UINT32 , BASE_DEC , NULL , 0x0 , "Index of first job to return" , HFILL } } , { & hf_enumjobs_numjobs , { "Num jobs" , "spoolss.enumjobs.numjobs" , FT_UINT32 , BASE_DEC , NULL , 0x0 , "Number of jobs to return" , HFILL } } , { & hf_secdescbuf_maxlen , { "Max len" , "spoolss.secdescbuf.max_len" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_secdescbuf_undoc , { "Undocumented" , "spoolss.secdescbuf.undoc" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_secdescbuf_len , { "Length" , "spoolss.secdescbuf.len" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_spool_printer_info_devmode_ptr , { "Devmode pointer" , "spoolss.spoolprinterinfo.devmode_ptr" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL } } , { & hf_spool_printer_info_secdesc_ptr , { "Secdesc pointer" , "spoolss.spoolprinterinfo.secdesc_ptr" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL } } , { & hf_writeprinter_numwritten , { "Num written" , "spoolss.writeprinter.numwritten" , FT_UINT32 , BASE_DEC , NULL , 0x0 , "Number of bytes written" , HFILL } } , { & hf_setprinterdataex_max_len , { "Max len" , "spoolss.setprinterdataex.max_len" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_setprinterdataex_real_len , { "Real len" , "spoolss.setprinterdataex.real_len" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_setprinterdataex_data , { "Data" , "spoolss.setprinterdataex.data" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_access_required , { "Access required" , "spoolss.access_required" , FT_UINT32 , BASE_HEX , NULL , 0x0 , NULL , HFILL } } , { & hf_server_access_admin , { "Server admin" , "spoolss.access_mask.server_admin" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , SERVER_ACCESS_ADMINISTER , NULL , HFILL } } , { & hf_server_access_enum , { "Server enum" , "spoolss.access_mask.server_enum" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , SERVER_ACCESS_ENUMERATE , NULL , HFILL } } , { & hf_printer_access_admin , { "Printer admin" , "spoolss.access_mask.printer_admin" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , PRINTER_ACCESS_ADMINISTER , NULL , HFILL } } , { & hf_printer_access_use , { "Printer use" , "spoolss.access_mask.printer_use" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , PRINTER_ACCESS_USE , NULL , HFILL } } , { & hf_job_access_admin , { "Job admin" , "spoolss.access_mask.job_admin" , FT_BOOLEAN , 32 , TFS ( & tfs_set_notset ) , JOB_ACCESS_ADMINISTER , NULL , HFILL } } , { & hf_printer_cjobs , { "CJobs" , "spoolss.printer.cjobs" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_total_jobs , { "Total jobs" , "spoolss.printer.total_jobs" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_total_bytes , { "Total bytes" , "spoolss.printer.total_bytes" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_global_counter , { "Global counter" , "spoolss.printer.global_counter" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_total_pages , { "Total pages" , "spoolss.printer.total_pages" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_major_version , { "Major version" , "spoolss.printer.major_version" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_build_version , { "Build version" , "spoolss.printer.build_version" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_unk7 , { "Unknown 7" , "spoolss.printer.unknown7" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_unk8 , { "Unknown 8" , "spoolss.printer.unknown8" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_unk9 , { "Unknown 9" , "spoolss.printer.unknown9" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_session_ctr , { "Session counter" , "spoolss.printer.session_ctr" , FT_UINT32 , BASE_DEC , NULL , 0 , "Sessopm counter" , HFILL } } , { & hf_printer_unk11 , { "Unknown 11" , "spoolss.printer.unknown11" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_printer_errors , { "Printer errors" , "spoolss.printer.printer_errors" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_unk13 , { "Unknown 13" , "spoolss.printer.unknown13" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_unk14 , { "Unknown 14" , "spoolss.printer.unknown14" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_unk15 , { "Unknown 15" , "spoolss.printer.unknown15" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_unk16 , { "Unknown 16" , "spoolss.printer.unknown16" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_changeid , { "Change id" , "spoolss.printer.changeid" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_unk18 , { "Unknown 18" , "spoolss.printer.unknown18" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_unk20 , { "Unknown 20" , "spoolss.printer.unknown20" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_c_setprinter , { "Csetprinter" , "spoolss.printer.c_setprinter" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_unk22 , { "Unknown 22" , "spoolss.printer.unknown22" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_unk23 , { "Unknown 23" , "spoolss.printer.unknown23" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_unk24 , { "Unknown 24" , "spoolss.printer.unknown24" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_unk25 , { "Unknown 25" , "spoolss.printer.unknown25" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_unk26 , { "Unknown 26" , "spoolss.printer.unknown26" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_unk27 , { "Unknown 27" , "spoolss.printer.unknown27" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_unk28 , { "Unknown 28" , "spoolss.printer.unknown28" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_unk29 , { "Unknown 29" , "spoolss.printer.unknown29" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_flags , { "Flags" , "spoolss.printer.flags" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL } } , { & hf_printer_priority , { "Priority" , "spoolss.printer.priority" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_default_priority , { "Default Priority" , "spoolss.printer.default_priority" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_averageppm , { "Average PPM" , "spoolss.printer.averageppm" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_jobs , { "Jobs" , "spoolss.printer.jobs" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL } } , { & hf_printer_guid , { "GUID" , "spoolss.printer.guid" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL } } , { & hf_printer_action , { "Action" , "spoolss.printer.action" , FT_UINT32 , BASE_DEC , VALS ( getprinter_action_vals ) , 0 , NULL , HFILL } } , } ; static gint * ett [ ] = { & ett_dcerpc_spoolss , & ett_PRINTER_DATATYPE , & ett_DEVMODE_CTR , & ett_DEVMODE , & ett_DEVMODE_fields , & ett_USER_LEVEL_CTR , & ett_USER_LEVEL_1 , & ett_BUFFER , & ett_PRINTER_INFO , & ett_SPOOL_PRINTER_INFO_LEVEL , & ett_PRINTER_INFO_0 , & ett_PRINTER_INFO_1 , & ett_PRINTER_INFO_2 , & ett_PRINTER_INFO_3 , & ett_PRINTER_INFO_7 , & ett_RELSTR , & ett_RELSTR_ARRAY , & ett_FORM_REL , & ett_FORM_CTR , & ett_FORM_1 , & ett_JOB_INFO_1 , & ett_JOB_INFO_2 , & ett_SEC_DESC_BUF , & ett_SYSTEM_TIME , & ett_DOC_INFO_1 , & ett_DOC_INFO , & ett_DOC_INFO_CTR , & ett_printerdata_value , & ett_printerdata_data , & ett_writeprinter_buffer , & ett_DRIVER_INFO_1 , & ett_DRIVER_INFO_2 , & ett_DRIVER_INFO_3 , & ett_DRIVER_INFO_6 , & ett_DRIVER_INFO_101 , & ett_rffpcnex_flags , & ett_notify_options_flags , & ett_NOTIFY_INFO_DATA , & ett_NOTIFY_OPTION , & ett_printer_attributes , & ett_job_status , & ett_enumprinters_flags , & ett_PRINTER_DATA_CTR , & ett_printer_enumdataex_value , } ; static ei_register_info ei [ ] = { { & ei_unimplemented_dissector , { "spoolss.unimplemented_dissector" , PI_UNDECODED , PI_WARN , "Unimplemented dissector: SPOOLSS" , EXPFILL } } , { & ei_unknown_data , { "spoolss.unknown_data" , PI_UNDECODED , PI_WARN , "Unknown data follows" , EXPFILL } } , { & ei_printer_info_level , { "spoolss.printer.unknown" , PI_PROTOCOL , PI_WARN , "Unknown printer info level" , EXPFILL } } , { & ei_spool_printer_info_level , { "spoolss.spool_printer.unknown" , PI_PROTOCOL , PI_WARN , "Unknown spool printer info level" , EXPFILL } } , { & ei_form_level , { "spoolss.form.level.unknown" , PI_PROTOCOL , PI_WARN , "Unknown form info level" , EXPFILL } } , { & ei_job_info_level , { "spoolss.job_info.level.unknown" , PI_PROTOCOL , PI_WARN , "Unknown job info level" , EXPFILL } } , { & ei_driver_info_level , { "spoolss.driver_info.level.unknown" , PI_PROTOCOL , PI_WARN , "Unknown driver info level" , EXPFILL } } , { & ei_level , { "spoolss.level.unknown" , PI_PROTOCOL , PI_WARN , "Info level unknown" , EXPFILL } } , { & ei_notify_info_data_type , { "spoolss.notify_info_data.type.unknown" , PI_PROTOCOL , PI_WARN , "Unknown notify type" , EXPFILL } } , { & ei_enumprinterdataex_value , { "spoolss.enumprinterdataex.val_unknown" , PI_PROTOCOL , PI_WARN , "Unknown value type" , EXPFILL } } , } ; expert_module_t * expert_dcerpc_spoolss ; proto_dcerpc_spoolss = proto_register_protocol ( "Microsoft Spool Subsystem" , "SPOOLSS" , "spoolss" ) ; proto_register_field_array ( proto_dcerpc_spoolss , hf , array_length ( hf ) ) ; proto_register_subtree_array ( ett , array_length ( ett ) ) ; expert_dcerpc_spoolss = expert_register_protocol ( proto_dcerpc_spoolss ) ; expert_register_field_array ( expert_dcerpc_spoolss , ei , array_length ( ei ) ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static const char * cmd_rule_engine ( cmd_parms * cmd , void * _dcfg , const char * p1 ) { directory_config * dcfg = ( directory_config * ) _dcfg ; if ( dcfg == NULL ) return NULL ; if ( strcasecmp ( p1 , "on" ) == 0 ) dcfg -> is_enabled = MODSEC_ENABLED ; else if ( strcasecmp ( p1 , "off" ) == 0 ) dcfg -> is_enabled = MODSEC_DISABLED ; else if ( strcasecmp ( p1 , "detectiononly" ) == 0 ) { dcfg -> is_enabled = MODSEC_DETECTION_ONLY ; dcfg -> of_limit_action = RESPONSE_BODY_LIMIT_ACTION_PARTIAL ; dcfg -> if_limit_action = REQUEST_BODY_LIMIT_ACTION_PARTIAL ; } else return apr_psprintf ( cmd -> pool , "ModSecurity: Invalid value for SecRuleEngine: %s" , p1 ) ; return NULL ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int cond_continue ( i_ctx_t * i_ctx_p ) { os_ptr op = osp ; es_ptr ep = esp ; int code ; check_type ( * op , t_boolean ) ; if ( op -> value . boolval ) { array_get ( imemory , ep , 1L , ep ) ; esfile_check_cache ( ) ; code = o_pop_estack ; } else if ( r_size ( ep ) > 2 ) { const ref_packed * elts = ep -> value . packed ; check_estack ( 2 ) ; r_dec_size ( ep , 2 ) ; elts = packed_next ( elts ) ; elts = packed_next ( elts ) ; ep -> value . packed = elts ; array_get ( imemory , ep , 0L , ep + 2 ) ; make_op_estack ( ep + 1 , cond_continue ) ; esp = ep + 2 ; esfile_check_cache ( ) ; code = o_push_estack ; } else { esp = ep - 1 ; code = o_pop_estack ; } pop ( 1 ) ; return code ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void generate_json ( FBuffer * buffer , VALUE Vstate , JSON_Generator_State * state , VALUE obj ) { VALUE tmp ; VALUE klass = CLASS_OF ( obj ) ; if ( klass == rb_cHash ) { generate_json_object ( buffer , Vstate , state , obj ) ; } else if ( klass == rb_cArray ) { generate_json_array ( buffer , Vstate , state , obj ) ; } else if ( klass == rb_cString ) { generate_json_string ( buffer , Vstate , state , obj ) ; } else if ( obj == Qnil ) { generate_json_null ( buffer , Vstate , state , obj ) ; } else if ( obj == Qfalse ) { generate_json_false ( buffer , Vstate , state , obj ) ; } else if ( obj == Qtrue ) { generate_json_true ( buffer , Vstate , state , obj ) ; } else if ( FIXNUM_P ( obj ) ) { generate_json_fixnum ( buffer , Vstate , state , obj ) ; } else if ( RB_TYPE_P ( obj , T_BIGNUM ) ) { generate_json_bignum ( buffer , Vstate , state , obj ) ; } else if ( klass == rb_cFloat ) { generate_json_float ( buffer , Vstate , state , obj ) ; } else if ( rb_respond_to ( obj , i_to_json ) ) { tmp = rb_funcall ( obj , i_to_json , 1 , Vstate ) ; Check_Type ( tmp , T_STRING ) ; fbuffer_append_str ( buffer , tmp ) ; } else { tmp = rb_funcall ( obj , i_to_s , 0 ) ; Check_Type ( tmp , T_STRING ) ; generate_json_string ( buffer , Vstate , state , tmp ) ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
int vp9_rc_clamp_iframe_target_size ( const VP9_COMP * const cpi , int target ) { const RATE_CONTROL * rc = & cpi -> rc ; const VP9EncoderConfig * oxcf = & cpi -> oxcf ; if ( oxcf -> rc_max_intra_bitrate_pct ) { const int max_rate = rc -> avg_frame_bandwidth * oxcf -> rc_max_intra_bitrate_pct / 100 ; target = MIN ( target , max_rate ) ; } if ( target > rc -> max_frame_bandwidth ) target = rc -> max_frame_bandwidth ; return target ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int read_old_huffman_tables ( HYuvContext * s ) { GetBitContext gb ; int i ; init_get_bits ( & gb , classic_shift_luma , classic_shift_luma_table_size * 8 ) ; if ( read_len_table ( s -> len [ 0 ] , & gb ) < 0 ) return - 1 ; init_get_bits ( & gb , classic_shift_chroma , classic_shift_chroma_table_size * 8 ) ; if ( read_len_table ( s -> len [ 1 ] , & gb ) < 0 ) return - 1 ; for ( i = 0 ; i < 256 ; i ++ ) s -> bits [ 0 ] [ i ] = classic_add_luma [ i ] ; for ( i = 0 ; i < 256 ; i ++ ) s -> bits [ 1 ] [ i ] = classic_add_chroma [ i ] ; if ( s -> bitstream_bpp >= 24 ) { memcpy ( s -> bits [ 1 ] , s -> bits [ 0 ] , 256 * sizeof ( uint32_t ) ) ; memcpy ( s -> len [ 1 ] , s -> len [ 0 ] , 256 * sizeof ( uint8_t ) ) ; } memcpy ( s -> bits [ 2 ] , s -> bits [ 1 ] , 256 * sizeof ( uint32_t ) ) ; memcpy ( s -> len [ 2 ] , s -> len [ 1 ] , 256 * sizeof ( uint8_t ) ) ; for ( i = 0 ; i < 3 ; i ++ ) { ff_free_vlc ( & s -> vlc [ i ] ) ; init_vlc ( & s -> vlc [ i ] , VLC_BITS , 256 , s -> len [ i ] , 1 , 1 , s -> bits [ i ] , 4 , 4 , 0 ) ; } generate_joint_tables ( s ) ; return 0 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int evport_del ( void * arg , struct event * ev ) { struct evport_data * evpd = arg ; struct fd_info * fdi ; int i ; int associated = 1 ; check_evportop ( evpd ) ; if ( ev -> ev_events & EV_SIGNAL ) { return ( evsignal_del ( ev ) ) ; } if ( evpd -> ed_nevents < ev -> ev_fd ) { return ( - 1 ) ; } for ( i = 0 ; i < EVENTS_PER_GETN ; ++ i ) { if ( evpd -> ed_pending [ i ] == ev -> ev_fd ) { associated = 0 ; break ; } } fdi = & evpd -> ed_fds [ ev -> ev_fd ] ; if ( ev -> ev_events & EV_READ ) fdi -> fdi_revt = NULL ; if ( ev -> ev_events & EV_WRITE ) fdi -> fdi_wevt = NULL ; if ( associated ) { if ( ! FDI_HAS_EVENTS ( fdi ) && port_dissociate ( evpd -> ed_port , PORT_SOURCE_FD , ev -> ev_fd ) == - 1 ) { if ( errno != EBADFD ) { event_warn ( "port_dissociate" ) ; return ( - 1 ) ; } } else { if ( FDI_HAS_EVENTS ( fdi ) ) { return ( reassociate ( evpd , fdi , ev -> ev_fd ) ) ; } } } else { if ( fdi -> fdi_revt == NULL && fdi -> fdi_wevt == NULL ) { evpd -> ed_pending [ i ] = - 1 ; } } return 0 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void lsf_decode_fp ( float * lsfnew , float * lsf_history , const SiprParameters * parm ) { int i ; float lsf_tmp [ LP_FILTER_ORDER ] ; dequant ( lsf_tmp , parm -> vq_indexes , lsf_codebooks ) ; for ( i = 0 ; i < LP_FILTER_ORDER ; i ++ ) lsfnew [ i ] = lsf_history [ i ] * 0.33 + lsf_tmp [ i ] + mean_lsf [ i ] ; ff_sort_nearly_sorted_floats ( lsfnew , LP_FILTER_ORDER - 1 ) ; ff_set_min_dist_lsf ( lsfnew , LSFQ_DIFF_MIN , LP_FILTER_ORDER - 1 ) ; lsfnew [ 9 ] = FFMIN ( lsfnew [ LP_FILTER_ORDER - 1 ] , 1.3 * M_PI ) ; memcpy ( lsf_history , lsf_tmp , LP_FILTER_ORDER * sizeof ( * lsf_history ) ) ; for ( i = 0 ; i < LP_FILTER_ORDER - 1 ; i ++ ) lsfnew [ i ] = cos ( lsfnew [ i ] ) ; lsfnew [ LP_FILTER_ORDER - 1 ] *= 6.153848 / M_PI ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
void TSfflush ( TSFile filep ) { FileImpl * file = ( FileImpl * ) filep ; file -> fflush ( ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
gboolean proto_can_match_selected ( field_info * finfo , epan_dissect_t * edt ) { return construct_match_selected_string ( finfo , edt , NULL ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
IN_PROC_BROWSER_TEST_F ( PageLoadMetricsBrowserTest , FirstMeaningfulPaintRecorded ) { ASSERT_TRUE ( embedded_test_server ( ) -> Start ( ) ) ; auto waiter = CreatePageLoadMetricsWaiter ( ) ; waiter -> AddPageExpectation ( TimingField : : FIRST_MEANINGFUL_PAINT ) ; ui_test_utils : : NavigateToURL ( browser ( ) , embedded_test_server ( ) -> GetURL ( "/title1.html" ) ) ; waiter -> Wait ( ) ; histogram_tester_ . ExpectUniqueSample ( internal : : kHistogramFirstMeaningfulPaintStatus , internal : : FIRST_MEANINGFUL_PAINT_RECORDED , 1 ) ; histogram_tester_ . ExpectTotalCount ( internal : : kHistogramFirstMeaningfulPaint , 1 ) ; histogram_tester_ . ExpectTotalCount ( internal : : kHistogramParseStartToFirstMeaningfulPaint , 1 ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
int ff_vdpau_common_start_frame ( AVCodecContext * avctx , av_unused const uint8_t * buffer , av_unused uint32_t size ) { AVVDPAUContext * hwctx = avctx -> hwaccel_context ; hwctx -> bitstream_buffers_used = 0 ; return 0 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_nlm4_test_res ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * data ) { return dissect_nlm_test_res ( tvb , 0 , pinfo , tree , 4 , ( rpc_call_info_value * ) data ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void terminate_chunked_client ( int fd , short event , void * arg ) { struct terminate_state * state = arg ; bufferevent_free ( state -> bev ) ; EVUTIL_CLOSESOCKET ( state -> fd ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int zinstopped ( i_ctx_t * i_ctx_p ) { os_ptr op = osp ; uint count ; check_type ( * op , t_integer ) ; count = count_to_stopped ( i_ctx_p , op -> value . intval ) ; if ( count ) { push ( 1 ) ; op [ - 1 ] = * ref_stack_index ( & e_stack , count - 2 ) ; make_true ( op ) ; } else make_false ( op ) ; return 0 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void add_frame_default ( AVFrame * f , const uint8_t * src , int src_stride , int linelen , int height ) { int i , j ; uint8_t * dst = f -> data [ 0 ] ; dst += ( height - 1 ) * f -> linesize [ 0 ] ; for ( i = height ; i ; i -- ) { for ( j = linelen ; j ; j -- ) * dst ++ += * src ++ ; src += src_stride - linelen ; dst -= f -> linesize [ 0 ] + linelen ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void bgr2g ( fz_context * ctx , fz_color_converter * cc , float * dv , const float * sv ) { dv [ 0 ] = sv [ 0 ] * 0.11f + sv [ 1 ] * 0.59f + sv [ 2 ] * 0.3f ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_btatt ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * data ) { proto_item * main_item ; proto_tree * main_tree ; proto_item * sub_item ; proto_tree * sub_tree ; int offset = 0 ; guint8 opcode ; guint8 request_opcode ; bluetooth_data_t * bluetooth_data ; btatt_data_t att_data ; request_data_t * request_data ; guint16 handle ; bluetooth_uuid_t uuid ; guint mtu ; memset ( & uuid , 0 , sizeof uuid ) ; bluetooth_data = ( bluetooth_data_t * ) data ; if ( tvb_reported_length_remaining ( tvb , 0 ) < 1 ) return 0 ; att_data . bluetooth_data = bluetooth_data ; main_item = proto_tree_add_item ( tree , proto_btatt , tvb , 0 , - 1 , ENC_NA ) ; main_tree = proto_item_add_subtree ( main_item , ett_btatt ) ; col_set_str ( pinfo -> cinfo , COL_PROTOCOL , "ATT" ) ; switch ( pinfo -> p2p_dir ) { case P2P_DIR_SENT : col_set_str ( pinfo -> cinfo , COL_INFO , "Sent " ) ; break ; case P2P_DIR_RECV : col_set_str ( pinfo -> cinfo , COL_INFO , "Rcvd " ) ; break ; default : col_set_str ( pinfo -> cinfo , COL_INFO , "UnknownDirection " ) ; break ; } mtu = get_mtu ( pinfo , bluetooth_data ) ; if ( tvb_reported_length ( tvb ) > mtu ) expert_add_info ( pinfo , main_item , & ei_btatt_mtu_exceeded ) ; proto_tree_add_bitmask_with_flags ( main_tree , tvb , offset , hf_btatt_opcode , ett_btatt_opcode , hfx_btatt_opcode , ENC_NA , BMT_NO_APPEND ) ; opcode = tvb_get_guint8 ( tvb , 0 ) ; att_data . opcode = opcode ; offset ++ ; request_data = get_request ( tvb , offset , pinfo , opcode , bluetooth_data ) ; col_append_str ( pinfo -> cinfo , COL_INFO , val_to_str_const ( opcode , opcode_vals , "<unknown>" ) ) ; switch ( opcode ) { case 0x01 : { guint8 error_code ; bluetooth_uuid_t service_uuid ; const value_string * error_vals = error_code_vals ; gint hfx_btatt_error_code = hf_btatt_error_code ; proto_tree_add_bitmask_with_flags ( main_tree , tvb , offset , hf_btatt_req_opcode_in_error , ett_btatt_opcode , hfx_btatt_opcode , ENC_NA , BMT_NO_APPEND ) ; request_opcode = tvb_get_guint8 ( tvb , offset ) ; offset += 1 ; offset = dissect_handle ( main_tree , pinfo , hf_btatt_handle_in_error , tvb , offset , bluetooth_data , NULL , HANDLE_TVB ) ; handle = tvb_get_letohs ( tvb , offset - 2 ) ; error_code = tvb_get_guint8 ( tvb , offset ) ; if ( error_code >= 0x80 && error_code <= 0x9F ) { service_uuid = get_service_uuid_from_handle ( pinfo , handle , bluetooth_data ) ; switch ( service_uuid . bt_uuid ) { case GATT_SERVICE_AUTOMATION_IO : error_vals = error_code_aios_vals ; hfx_btatt_error_code = hf_btatt_error_code_aios ; break ; case GATT_SERVICE_ALERT_NOTIFICATION_SERVICE : error_vals = error_code_ans_vals ; hfx_btatt_error_code = hf_btatt_error_code_ans ; break ; case GATT_SERVICE_BOND_MANAGEMENT : error_vals = error_code_bms_vals ; hfx_btatt_error_code = hf_btatt_error_code_bms ; break ; case GATT_SERVICE_CONTINUOUS_GLUCOSE_MONITORING : error_vals = error_code_cgms_vals ; hfx_btatt_error_code = hf_btatt_error_code_cgms ; break ; case GATT_SERVICE_CYCLING_POWER : error_vals = error_code_cps_vals ; hfx_btatt_error_code = hf_btatt_error_code_cps ; break ; case GATT_SERVICE_CYCLING_SPEED_AND_CADENCE : error_vals = error_code_cscs_vals ; hfx_btatt_error_code = hf_btatt_error_code_cscs ; break ; case GATT_SERVICE_CURRENT_TIME_SERVICE : error_vals = error_code_cts_vals ; hfx_btatt_error_code = hf_btatt_error_code_cts ; break ; case GATT_SERVICE_ENVIRONMENTAL_SENSING : error_vals = error_code_ess_vals ; hfx_btatt_error_code = hf_btatt_error_code_ess ; break ; case GATT_SERVICE_GLUCOSE : error_vals = error_code_gls_vals ; hfx_btatt_error_code = hf_btatt_error_code_gls ; break ; case GATT_SERVICE_HTTP_PROXY : error_vals = error_code_hps_vals ; hfx_btatt_error_code = hf_btatt_error_code_hps ; break ; case GATT_SERVICE_HEART_RATE : error_vals = error_code_hrs_vals ; hfx_btatt_error_code = hf_btatt_error_code_hrs ; break ; case GATT_SERVICE_HEALTH_THERMOMETER : error_vals = error_code_hts_vals ; hfx_btatt_error_code = hf_btatt_error_code_hts ; break ; case GATT_SERVICE_INDOOR_POSITIONING : error_vals = error_code_ips_vals ; hfx_btatt_error_code = hf_btatt_error_code_ips ; break ; case GATT_SERVICE_OBJECT_TRANSFER : error_vals = error_code_ots_vals ; hfx_btatt_error_code = hf_btatt_error_code_ots ; break ; case GATT_SERVICE_RUNNING_SPEED_AND_CADENCE : error_vals = error_code_rscs_vals ; hfx_btatt_error_code = hf_btatt_error_code_rscs ; break ; case GATT_SERVICE_USER_DATA : error_vals = error_code_uds_vals ; hfx_btatt_error_code = hf_btatt_error_code_uds ; break ; default : error_vals = error_code_vals ; hfx_btatt_error_code = hf_btatt_error_code ; } } col_append_fstr ( pinfo -> cinfo , COL_INFO , " - %s" , val_to_str_const ( error_code , error_vals , "<unknown>" ) ) ; col_append_info_by_handle ( pinfo , handle , bluetooth_data ) ; proto_tree_add_item ( main_tree , hfx_btatt_error_code , tvb , offset , 1 , ENC_LITTLE_ENDIAN ) ; offset ++ ; if ( request_data && ( request_opcode == 0x08 || request_opcode == 0x10 ) ) { sub_item = proto_tree_add_uint ( main_tree , hf_btatt_uuid16 , tvb , 0 , 0 , request_data -> parameters . read_by_type . uuid . bt_uuid ) ; PROTO_ITEM_SET_GENERATED ( sub_item ) ; } } break ; case 0x02 : col_append_fstr ( pinfo -> cinfo , COL_INFO , ", Client Rx MTU: %u" , tvb_get_letohs ( tvb , offset ) ) ; proto_tree_add_item ( main_tree , hf_btatt_client_rx_mtu , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ; offset += 2 ; if ( ! pinfo -> fd -> flags . visited && bluetooth_data ) { union request_parameters_union request_parameters ; request_parameters . mtu . mtu = tvb_get_guint16 ( tvb , offset - 2 , ENC_LITTLE_ENDIAN ) ; save_request ( pinfo , opcode , request_parameters , bluetooth_data ) ; } break ; case 0x03 : col_append_fstr ( pinfo -> cinfo , COL_INFO , ", Server Rx MTU: %u" , tvb_get_letohs ( tvb , offset ) ) ; proto_tree_add_item ( main_tree , hf_btatt_server_rx_mtu , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ; if ( ! pinfo -> fd -> flags . visited && request_data && bluetooth_data ) { guint new_mtu ; new_mtu = tvb_get_guint16 ( tvb , offset , ENC_LITTLE_ENDIAN ) ; if ( new_mtu > request_data -> parameters . mtu . mtu ) new_mtu = request_data -> parameters . mtu . mtu ; save_mtu ( pinfo , bluetooth_data , new_mtu ) ; } offset += 2 ; break ; case 0x04 : col_append_fstr ( pinfo -> cinfo , COL_INFO , ", Handles: 0x%04x..0x%04x" , tvb_get_letohs ( tvb , offset ) , tvb_get_letohs ( tvb , offset + 2 ) ) ; proto_tree_add_item ( main_tree , hf_btatt_starting_handle , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ; offset += 2 ; proto_tree_add_item ( main_tree , hf_btatt_ending_handle , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ; offset += 2 ; if ( ! pinfo -> fd -> flags . visited && bluetooth_data ) { union request_parameters_union request_parameters ; request_parameters . find_information . starting_handle = tvb_get_guint16 ( tvb , offset - 4 , ENC_LITTLE_ENDIAN ) ; request_parameters . find_information . ending_handle = tvb_get_guint16 ( tvb , offset - 2 , ENC_LITTLE_ENDIAN ) ; save_request ( pinfo , opcode , request_parameters , bluetooth_data ) ; } break ; case 0x05 : { guint8 format ; sub_item = proto_tree_add_item ( main_tree , hf_btatt_uuid_format , tvb , offset , 1 , ENC_LITTLE_ENDIAN ) ; format = tvb_get_guint8 ( tvb , offset ) ; offset += 1 ; if ( format == 1 ) { while ( tvb_reported_length_remaining ( tvb , offset ) > 0 ) { sub_item = proto_tree_add_item ( main_tree , hf_btatt_information_data , tvb , offset , 4 , ENC_NA ) ; sub_tree = proto_item_add_subtree ( sub_item , ett_btatt_list ) ; offset = dissect_handle ( sub_tree , pinfo , hf_btatt_handle , tvb , offset , bluetooth_data , NULL , HANDLE_TVB ) ; handle = tvb_get_guint16 ( tvb , offset - 2 , ENC_LITTLE_ENDIAN ) ; proto_tree_add_item ( sub_tree , hf_btatt_uuid16 , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ; uuid = get_uuid ( tvb , offset , 2 ) ; offset += 2 ; proto_item_append_text ( sub_item , ", Handle: 0x%04x, UUID: %s" , handle , print_uuid ( & uuid ) ) ; save_handle ( pinfo , uuid , handle , ATTRIBUTE_TYPE_OTHER , bluetooth_data ) ; col_append_info_by_handle ( pinfo , handle , bluetooth_data ) ; } } else if ( format == 2 ) { while ( tvb_reported_length_remaining ( tvb , offset ) > 0 ) { sub_item = proto_tree_add_item ( main_tree , hf_btatt_information_data , tvb , offset , 4 , ENC_NA ) ; sub_tree = proto_item_add_subtree ( sub_item , ett_btatt_list ) ; offset = dissect_handle ( sub_tree , pinfo , hf_btatt_handle , tvb , offset , bluetooth_data , NULL , HANDLE_TVB ) ; handle = tvb_get_guint16 ( tvb , offset - 2 , ENC_LITTLE_ENDIAN ) ; proto_tree_add_item ( sub_tree , hf_btatt_uuid128 , tvb , offset , 16 , ENC_NA ) ; uuid = get_uuid ( tvb , offset , 16 ) ; offset += 16 ; proto_item_append_text ( sub_item , ", Handle: 0x%04x, UUID: %s" , handle , print_uuid ( & uuid ) ) ; save_handle ( pinfo , uuid , handle , ATTRIBUTE_TYPE_OTHER , bluetooth_data ) ; col_append_info_by_handle ( pinfo , handle , bluetooth_data ) ; } } else { expert_add_info ( pinfo , sub_item , & ei_btatt_uuid_format_unknown ) ; } } break ; case 0x06 : col_append_fstr ( pinfo -> cinfo , COL_INFO , ", %s, Handles: 0x%04x..0x%04x" , val_to_str_ext_const ( tvb_get_letohs ( tvb , offset + 4 ) , & bluetooth_uuid_vals_ext , "<unknown>" ) , tvb_get_letohs ( tvb , offset ) , tvb_get_letohs ( tvb , offset + 2 ) ) ; proto_tree_add_item ( main_tree , hf_btatt_starting_handle , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ; offset += 2 ; proto_tree_add_item ( main_tree , hf_btatt_ending_handle , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ; offset += 2 ; proto_tree_add_item ( main_tree , hf_btatt_uuid16 , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ; uuid = get_uuid ( tvb , offset - 2 , 2 ) ; offset += 2 ; dissect_attribute_value ( main_tree , NULL , pinfo , tvb , offset , tvb_captured_length_remaining ( tvb , offset ) , 0 , uuid , & att_data ) ; if ( ! pinfo -> fd -> flags . visited && bluetooth_data ) { union request_parameters_union request_parameters ; request_parameters . read_by_type . starting_handle = tvb_get_guint16 ( tvb , offset - 6 , ENC_LITTLE_ENDIAN ) ; request_parameters . read_by_type . ending_handle = tvb_get_guint16 ( tvb , offset - 4 , ENC_LITTLE_ENDIAN ) ; request_parameters . read_by_type . uuid = uuid ; save_request ( pinfo , opcode , request_parameters , bluetooth_data ) ; } offset = tvb_reported_length ( tvb ) ; break ; case 0x07 : while ( tvb_reported_length_remaining ( tvb , offset ) > 0 ) { sub_item = proto_tree_add_none_format ( main_tree , hf_btatt_handles_info , tvb , offset , 4 , "Handles Info, Handle: 0x%04x, Group End Handle: 0x%04x" , tvb_get_letohs ( tvb , offset ) , tvb_get_letohs ( tvb , offset + 2 ) ) ; sub_tree = proto_item_add_subtree ( sub_item , ett_btatt_list ) ; offset = dissect_handle ( sub_tree , pinfo , hf_btatt_handle , tvb , offset , bluetooth_data , NULL , HANDLE_TVB ) ; proto_tree_add_item ( sub_tree , hf_btatt_group_end_handle , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ; offset += 2 ; if ( request_data ) save_handle ( pinfo , request_data -> parameters . read_by_type . uuid , tvb_get_guint16 ( tvb , offset - 4 , ENC_LITTLE_ENDIAN ) , ATTRIBUTE_TYPE_OTHER , bluetooth_data ) ; } break ; case 0x08 : case 0x10 : col_append_fstr ( pinfo -> cinfo , COL_INFO , ", %s, Handles: 0x%04x..0x%04x" , val_to_str_ext_const ( tvb_get_letohs ( tvb , offset + 4 ) , & bluetooth_uuid_vals_ext , "<unknown>" ) , tvb_get_letohs ( tvb , offset ) , tvb_get_letohs ( tvb , offset + 2 ) ) ; proto_tree_add_item ( main_tree , hf_btatt_starting_handle , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ; offset += 2 ; proto_tree_add_item ( main_tree , hf_btatt_ending_handle , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ; offset += 2 ; if ( tvb_reported_length_remaining ( tvb , offset ) == 2 ) { proto_tree_add_item ( main_tree , hf_btatt_uuid16 , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ; offset += 2 ; if ( ! pinfo -> fd -> flags . visited && bluetooth_data ) { union request_parameters_union request_parameters ; request_parameters . read_by_type . starting_handle = tvb_get_guint16 ( tvb , offset - 6 , ENC_LITTLE_ENDIAN ) ; request_parameters . read_by_type . ending_handle = tvb_get_guint16 ( tvb , offset - 4 , ENC_LITTLE_ENDIAN ) ; request_parameters . read_by_type . uuid = get_uuid ( tvb , offset - 2 , 2 ) ; save_request ( pinfo , opcode , request_parameters , bluetooth_data ) ; } } else if ( tvb_reported_length_remaining ( tvb , offset ) == 16 ) { sub_item = proto_tree_add_item ( main_tree , hf_btatt_uuid128 , tvb , offset , 16 , ENC_NA ) ; proto_item_append_text ( sub_item , " (%s)" , val_to_str_ext_const ( tvb_get_letohs ( tvb , offset ) , & bluetooth_uuid_vals_ext , "<unknown>" ) ) ; offset += 16 ; if ( ! pinfo -> fd -> flags . visited && bluetooth_data ) { union request_parameters_union request_parameters ; request_parameters . read_by_type . starting_handle = tvb_get_guint16 ( tvb , offset - 20 , ENC_LITTLE_ENDIAN ) ; request_parameters . read_by_type . ending_handle = tvb_get_guint16 ( tvb , offset - 18 , ENC_LITTLE_ENDIAN ) ; request_parameters . read_by_type . uuid = get_uuid ( tvb , offset - 16 , 16 ) ; save_request ( pinfo , opcode , request_parameters , bluetooth_data ) ; } } else { sub_item = proto_tree_add_item ( tree , hf_btatt_value , tvb , offset , - 1 , ENC_NA ) ; expert_add_info ( pinfo , sub_item , & ei_btatt_bad_data ) ; offset = tvb_captured_length ( tvb ) ; } break ; case 0x09 : { guint8 length = tvb_get_guint8 ( tvb , offset ) ; proto_tree_add_item ( main_tree , hf_btatt_length , tvb , offset , 1 , ENC_LITTLE_ENDIAN ) ; offset ++ ; if ( length > 0 ) { col_append_fstr ( pinfo -> cinfo , COL_INFO , ", Attribute List Length: %u" , tvb_reported_length_remaining ( tvb , offset ) / length ) ; while ( tvb_reported_length_remaining ( tvb , offset ) >= length ) { sub_item = proto_tree_add_none_format ( main_tree , hf_btatt_attribute_data , tvb , offset , length , "Attribute Data, Handle: 0x%04x" , tvb_get_letohs ( tvb , offset ) ) ; sub_tree = proto_item_add_subtree ( sub_item , ett_btatt_list ) ; if ( request_data ) { save_handle ( pinfo , request_data -> parameters . read_by_type . uuid , tvb_get_guint16 ( tvb , offset , ENC_LITTLE_ENDIAN ) , ATTRIBUTE_TYPE_OTHER , bluetooth_data ) ; } offset = dissect_handle ( sub_tree , pinfo , hf_btatt_handle , tvb , offset , bluetooth_data , NULL , HANDLE_TVB ) ; if ( request_data ) { offset = dissect_attribute_value ( sub_tree , sub_item , pinfo , tvb , offset , length - 2 , tvb_get_guint16 ( tvb , offset - 2 , ENC_LITTLE_ENDIAN ) , request_data -> parameters . read_by_type . uuid , & att_data ) ; } else { proto_tree_add_item ( sub_tree , hf_btatt_value , tvb , offset , length - 2 , ENC_NA ) ; offset += length - 2 ; } } } if ( request_data ) { sub_item = proto_tree_add_uint ( main_tree , hf_btatt_uuid16 , tvb , 0 , 0 , request_data -> parameters . read_by_type . uuid . bt_uuid ) ; PROTO_ITEM_SET_GENERATED ( sub_item ) ; } } break ; case 0x0a : offset = dissect_handle ( main_tree , pinfo , hf_btatt_handle , tvb , offset , bluetooth_data , & uuid , HANDLE_TVB ) ; handle = tvb_get_letohs ( tvb , offset - 2 ) ; col_append_info_by_handle ( pinfo , handle , bluetooth_data ) ; if ( ! pinfo -> fd -> flags . visited && bluetooth_data ) { union request_parameters_union request_parameters ; request_parameters . read_write . handle = handle ; request_parameters . read_write . offset = 0 ; save_request ( pinfo , opcode , request_parameters , bluetooth_data ) ; } offset = dissect_attribute_value ( main_tree , NULL , pinfo , tvb , offset , tvb_captured_length_remaining ( tvb , offset ) , handle , uuid , & att_data ) ; break ; case 0x0b : if ( request_data ) { dissect_handle ( main_tree , pinfo , hf_btatt_handle , tvb , offset , bluetooth_data , & uuid , request_data -> parameters . read_write . handle ) ; col_append_info_by_handle ( pinfo , request_data -> parameters . read_write . handle , bluetooth_data ) ; } if ( is_long_attribute_value ( uuid ) && tvb_captured_length ( tvb ) >= mtu ) { sub_item = proto_tree_add_item ( main_tree , hf_btatt_value , tvb , offset , - 1 , ENC_NA ) ; if ( ! pinfo -> fd -> flags . visited && request_data && bluetooth_data ) save_value_fragment ( pinfo , tvb , offset , request_data -> parameters . read_write . handle , 0 , bluetooth_data ) ; offset = tvb_captured_length ( tvb ) ; expert_add_info ( pinfo , sub_item , & ei_btatt_mtu_full ) ; } else { if ( request_data ) handle = request_data -> parameters . read_write . handle ; else handle = 0 ; offset = dissect_attribute_value ( main_tree , NULL , pinfo , tvb , offset , tvb_captured_length_remaining ( tvb , offset ) , handle , uuid , & att_data ) ; } break ; case 0x0c : offset = dissect_handle ( main_tree , pinfo , hf_btatt_handle , tvb , offset , bluetooth_data , & uuid , HANDLE_TVB ) ; handle = tvb_get_letohs ( tvb , offset - 2 ) ; col_append_info_by_handle ( pinfo , handle , bluetooth_data ) ; col_append_fstr ( pinfo -> cinfo , COL_INFO , ", Offset: %u" , tvb_get_letohs ( tvb , offset ) ) ; proto_tree_add_item ( main_tree , hf_btatt_offset , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ; offset += 2 ; dissect_attribute_value ( main_tree , NULL , pinfo , tvb , offset , 0 , handle , uuid , & att_data ) ; if ( ! pinfo -> fd -> flags . visited && bluetooth_data ) { union request_parameters_union request_parameters ; request_parameters . read_write . handle = handle ; request_parameters . read_write . offset = tvb_get_guint16 ( tvb , offset - 2 , ENC_LITTLE_ENDIAN ) ; save_request ( pinfo , opcode , request_parameters , bluetooth_data ) ; } break ; case 0x0d : if ( request_data ) { dissect_handle ( main_tree , pinfo , hf_btatt_handle , tvb , offset , bluetooth_data , & uuid , request_data -> parameters . read_write . handle ) ; col_append_info_by_handle ( pinfo , request_data -> parameters . read_write . handle , bluetooth_data ) ; if ( request_data -> parameters . read_write . offset == 0 && ! is_long_attribute_value ( uuid ) ) { offset = dissect_attribute_value ( main_tree , NULL , pinfo , tvb , offset , tvb_captured_length_remaining ( tvb , offset ) , request_data -> parameters . read_write . handle , uuid , & att_data ) ; } else { if ( ! pinfo -> fd -> flags . visited && bluetooth_data ) save_value_fragment ( pinfo , tvb , offset , request_data -> parameters . read_write . handle , request_data -> parameters . read_write . offset , bluetooth_data ) ; if ( tvb_captured_length ( tvb ) < mtu ) { tvbuff_t * next_tvb ; guint reassembled_length ; guint8 * reassembled_data ; sub_item = proto_tree_add_item ( main_tree , hf_btatt_value , tvb , offset , - 1 , ENC_NA ) ; offset = tvb_captured_length ( tvb ) ; reassembled_data = get_value ( pinfo , request_data -> parameters . read_write . handle , bluetooth_data , & reassembled_length ) ; if ( reassembled_data ) { sub_tree = proto_item_add_subtree ( sub_item , ett_btatt_value ) ; next_tvb = tvb_new_child_real_data ( tvb , reassembled_data , reassembled_length , reassembled_length ) ; add_new_data_source ( pinfo , next_tvb , "Reassembled ATT" ) ; dissect_attribute_value ( sub_tree , NULL , pinfo , next_tvb , 0 , tvb_captured_length ( next_tvb ) , request_data -> parameters . read_write . handle , uuid , & att_data ) ; } } else { sub_item = proto_tree_add_item ( main_tree , hf_btatt_value , tvb , offset , - 1 , ENC_NA ) ; offset = tvb_captured_length ( tvb ) ; expert_add_info ( pinfo , sub_item , & ei_btatt_mtu_full ) ; } } } else { proto_tree_add_item ( main_tree , hf_btatt_value , tvb , offset , - 1 , ENC_NA ) ; offset = tvb_captured_length ( tvb ) ; } break ; case 0x0e : if ( tvb_reported_length_remaining ( tvb , offset ) < 4 ) { expert_add_info ( pinfo , main_item , & ei_btatt_handle_too_few ) ; break ; } col_append_str ( pinfo -> cinfo , COL_INFO , ", Handles: " ) ; while ( tvb_reported_length_remaining ( tvb , offset ) >= 2 ) { offset = dissect_handle ( main_tree , pinfo , hf_btatt_handle , tvb , offset , bluetooth_data , & uuid , HANDLE_TVB ) ; handle = tvb_get_letohs ( tvb , offset - 2 ) ; col_append_fstr ( pinfo -> cinfo , COL_INFO , "0x%04x " , handle ) ; dissect_attribute_value ( main_tree , NULL , pinfo , tvb , offset , 0 , handle , uuid , & att_data ) ; } if ( ! pinfo -> fd -> flags . visited && bluetooth_data ) { union request_parameters_union request_parameters ; request_parameters . read_multiple . number_of_handles = ( tvb_captured_length ( tvb ) - 1 ) / 2 ; request_parameters . read_multiple . handle = ( guint16 * ) tvb_memdup ( wmem_file_scope ( ) , tvb , 1 , request_parameters . read_multiple . number_of_handles * 2 ) ; save_request ( pinfo , opcode , request_parameters , bluetooth_data ) ; } break ; case 0x0f : if ( request_data ) { guint i_handle ; for ( i_handle = 0 ; i_handle < request_data -> parameters . read_multiple . number_of_handles ; i_handle += 1 ) { dissect_handle ( main_tree , pinfo , hf_btatt_handle , tvb , offset , bluetooth_data , & uuid , request_data -> parameters . read_multiple . handle [ i_handle ] ) ; offset = dissect_attribute_value ( main_tree , NULL , pinfo , tvb , offset , tvb_captured_length_remaining ( tvb , offset ) , request_data -> parameters . read_multiple . handle [ i_handle ] , uuid , & att_data ) ; } } else { proto_tree_add_item ( main_tree , hf_btatt_value , tvb , offset , - 1 , ENC_NA ) ; offset = tvb_reported_length ( tvb ) ; } break ; case 0x11 : { guint8 length = tvb_get_guint8 ( tvb , offset ) ; proto_tree_add_item ( main_tree , hf_btatt_length , tvb , offset , 1 , ENC_LITTLE_ENDIAN ) ; offset ++ ; if ( length > 0 ) { col_append_fstr ( pinfo -> cinfo , COL_INFO , ", Attribute List Length: %u" , tvb_reported_length_remaining ( tvb , offset ) / length ) ; while ( tvb_reported_length_remaining ( tvb , offset ) >= length ) { sub_item = proto_tree_add_none_format ( main_tree , hf_btatt_attribute_data , tvb , offset , length , "Attribute Data, Handle: 0x%04x, Group End Handle: 0x%04x" , tvb_get_letohs ( tvb , offset ) , tvb_get_letohs ( tvb , offset + 2 ) ) ; sub_tree = proto_item_add_subtree ( sub_item , ett_btatt_list ) ; offset = dissect_handle ( sub_tree , pinfo , hf_btatt_handle , tvb , offset , bluetooth_data , NULL , HANDLE_TVB ) ; handle = tvb_get_guint16 ( tvb , offset - 2 , ENC_LITTLE_ENDIAN ) ; proto_tree_add_item ( sub_tree , hf_btatt_group_end_handle , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ; offset += 2 ; if ( request_data ) { offset = dissect_attribute_value ( sub_tree , sub_item , pinfo , tvb , offset , length - 4 , handle , request_data -> parameters . read_by_type . uuid , & att_data ) ; } else { proto_tree_add_item ( sub_tree , hf_btatt_value , tvb , offset , length - 4 , ENC_NA ) ; offset += length - 4 ; } } } if ( request_data ) { sub_item = proto_tree_add_uint ( main_tree , hf_btatt_uuid16 , tvb , 0 , 0 , request_data -> parameters . read_by_type . uuid . bt_uuid ) ; PROTO_ITEM_SET_GENERATED ( sub_item ) ; } } break ; case 0x12 : case 0x1d : case 0x52 : case 0x1b : offset = dissect_handle ( main_tree , pinfo , hf_btatt_handle , tvb , offset , bluetooth_data , & uuid , HANDLE_TVB ) ; handle = tvb_get_letohs ( tvb , offset - 2 ) ; col_append_info_by_handle ( pinfo , handle , bluetooth_data ) ; offset = dissect_attribute_value ( main_tree , NULL , pinfo , tvb , offset , tvb_captured_length_remaining ( tvb , offset ) , tvb_get_guint16 ( tvb , offset - 2 , ENC_LITTLE_ENDIAN ) , uuid , & att_data ) ; if ( ! pinfo -> fd -> flags . visited && bluetooth_data && ( opcode == 0x12 || opcode == 0x1d ) ) { union request_parameters_union request_parameters ; request_parameters . read_write . handle = handle ; request_parameters . read_write . offset = 0 ; save_request ( pinfo , opcode , request_parameters , bluetooth_data ) ; } break ; case 0x13 : if ( request_data ) { dissect_handle ( main_tree , pinfo , hf_btatt_handle , tvb , offset , bluetooth_data , & uuid , request_data -> parameters . read_write . handle ) ; dissect_attribute_value ( main_tree , NULL , pinfo , tvb , offset , 0 , request_data -> parameters . read_write . handle , uuid , & att_data ) ; col_append_info_by_handle ( pinfo , request_data -> parameters . read_write . handle , bluetooth_data ) ; } break ; case 0x16 : case 0x17 : offset = dissect_handle ( main_tree , pinfo , hf_btatt_handle , tvb , offset , bluetooth_data , & uuid , HANDLE_TVB ) ; handle = tvb_get_letohs ( tvb , offset - 2 ) ; col_append_info_by_handle ( pinfo , handle , bluetooth_data ) ; col_append_fstr ( pinfo -> cinfo , COL_INFO , ", Offset: %u" , tvb_get_letohs ( tvb , offset ) ) ; proto_tree_add_item ( main_tree , hf_btatt_offset , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ; offset += 2 ; if ( ! pinfo -> fd -> flags . visited && bluetooth_data && opcode == 0x16 ) { union request_parameters_union request_parameters ; request_parameters . data = NULL ; save_request ( pinfo , opcode , request_parameters , bluetooth_data ) ; } if ( ! pinfo -> fd -> flags . visited && request_data && bluetooth_data && opcode == 0x16 ) save_value_fragment ( pinfo , tvb , offset , tvb_get_guint16 ( tvb , offset - 4 , ENC_LITTLE_ENDIAN ) , tvb_get_guint16 ( tvb , offset - 2 , ENC_LITTLE_ENDIAN ) , bluetooth_data ) ; if ( request_data && tvb_captured_length ( tvb ) < mtu ) { tvbuff_t * next_tvb ; guint reassembled_length ; guint8 * reassembled_data ; sub_item = proto_tree_add_item ( main_tree , hf_btatt_value , tvb , offset , - 1 , ENC_NA ) ; reassembled_data = get_value ( pinfo , request_data -> parameters . read_write . handle , bluetooth_data , & reassembled_length ) ; if ( reassembled_data ) { sub_tree = proto_item_add_subtree ( sub_item , ett_btatt_value ) ; next_tvb = tvb_new_child_real_data ( tvb , reassembled_data , reassembled_length , reassembled_length ) ; add_new_data_source ( pinfo , next_tvb , "Reassembled ATT" ) ; dissect_attribute_value ( sub_tree , NULL , pinfo , next_tvb , 0 , tvb_captured_length ( next_tvb ) , request_data -> parameters . read_write . handle , uuid , & att_data ) ; } } else { proto_tree_add_item ( main_tree , hf_btatt_value , tvb , offset , - 1 , ENC_NA ) ; } offset = tvb_reported_length ( tvb ) ; break ; case 0x18 : col_append_fstr ( pinfo -> cinfo , COL_INFO , ", %s" , val_to_str_const ( tvb_get_guint8 ( tvb , offset ) , flags_vals , "<unknown>" ) ) ; proto_tree_add_item ( main_tree , hf_btatt_flags , tvb , offset , 1 , ENC_LITTLE_ENDIAN ) ; offset ++ ; if ( ! pinfo -> fd -> flags . visited && bluetooth_data ) { union request_parameters_union request_parameters ; request_parameters . data = NULL ; save_request ( pinfo , opcode , request_parameters , bluetooth_data ) ; } break ; case 0x19 : break ; case 0x1E : if ( request_data ) { dissect_handle ( main_tree , pinfo , hf_btatt_handle , tvb , offset , bluetooth_data , & uuid , request_data -> parameters . read_write . handle ) ; col_append_info_by_handle ( pinfo , request_data -> parameters . read_write . handle , bluetooth_data ) ; dissect_attribute_value ( main_tree , NULL , pinfo , tvb , offset , 0 , request_data -> parameters . read_write . handle , uuid , & att_data ) ; } break ; case 0xd2 : { guint8 length ; offset = dissect_handle ( main_tree , pinfo , hf_btatt_handle , tvb , offset , bluetooth_data , & uuid , HANDLE_TVB ) ; handle = tvb_get_letohs ( tvb , offset - 2 ) ; col_append_info_by_handle ( pinfo , handle , bluetooth_data ) ; length = tvb_reported_length_remaining ( tvb , offset ) ; dissect_attribute_value ( main_tree , NULL , pinfo , tvb , offset , ( length > 12 ) ? length - 12 : 0 , handle , uuid , & att_data ) ; if ( length > 12 ) { offset += length - 12 ; } proto_tree_add_item ( main_tree , hf_btatt_sign_counter , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ; offset += 4 ; proto_tree_add_item ( main_tree , hf_btatt_signature , tvb , offset , 8 , ENC_NA ) ; offset += 8 ; break ; } default : break ; } if ( request_data ) { if ( request_data -> request_in_frame > 0 && request_data -> request_in_frame != pinfo -> num ) { sub_item = proto_tree_add_uint ( main_tree , hf_request_in_frame , tvb , 0 , 0 , request_data -> request_in_frame ) ; PROTO_ITEM_SET_GENERATED ( sub_item ) ; } if ( ! pinfo -> fd -> flags . visited && request_data -> response_in_frame == 0 && pinfo -> num > request_data -> request_in_frame ) request_data -> response_in_frame = pinfo -> num ; if ( request_data -> response_in_frame > 0 && request_data -> response_in_frame != pinfo -> num ) { sub_item = proto_tree_add_uint ( main_tree , hf_response_in_frame , tvb , 0 , 0 , request_data -> response_in_frame ) ; PROTO_ITEM_SET_GENERATED ( sub_item ) ; } } return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_rsl_ie_bs_power ( tvbuff_t * tvb , packet_info * pinfo _U_ , proto_tree * tree , int offset , gboolean is_mandatory ) { proto_tree * ie_tree ; guint8 ie_id ; if ( is_mandatory == FALSE ) { ie_id = tvb_get_guint8 ( tvb , offset ) ; if ( ie_id != RSL_IE_BS_POW ) return offset ; } ie_tree = proto_tree_add_subtree ( tree , tvb , offset , 2 , ett_ie_bs_power , NULL , "BS Power IE" ) ; proto_tree_add_item ( ie_tree , hf_rsl_ie_id , tvb , offset , 1 , ENC_BIG_ENDIAN ) ; offset ++ ; proto_tree_add_item ( ie_tree , hf_rsl_epc_mode , tvb , offset , 1 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( ie_tree , hf_rsl_bs_fpc_epc_mode , tvb , offset , 1 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( ie_tree , hf_rsl_bs_power , tvb , offset , 1 , ENC_BIG_ENDIAN ) ; offset ++ ; return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
void mime_hdr_field_block_list_adjust ( int , MIMEFieldBlockImpl * old_list , MIMEFieldBlockImpl * new_list ) { for ( MIMEFieldBlockImpl * new_blk = new_list ; new_blk ; new_blk = new_blk -> m_next ) { for ( MIMEField * field = new_blk -> m_field_slots , * end = field + new_blk -> m_freetop ; field != end ; ++ field ) { if ( field -> is_live ( ) && field -> m_next_dup ) { relocate ( field , new_list , old_list ) ; } } } }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_pvfs2_io_request ( tvbuff_t * tvb , proto_tree * tree , int offset , packet_info * pinfo ) { offset = dissect_pvfs_fh ( tvb , offset , pinfo , tree , "handle" , NULL ) ; offset = dissect_pvfs_fs_id ( tvb , tree , offset ) ; offset += 4 ; offset = dissect_pvfs_io_type ( tvb , tree , offset ) ; offset = dissect_pvfs_flowproto_type ( tvb , tree , offset ) ; proto_tree_add_item ( tree , hf_pvfs_server_nr , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ; offset += 4 ; proto_tree_add_item ( tree , hf_pvfs_server_count , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ; offset += 4 ; offset = dissect_pvfs_distribution ( tvb , tree , offset ) ; proto_tree_add_item ( tree , hf_pvfs_numreq , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ; offset += 4 ; offset += 4 ; dissect_pvfs_pint_request ( tvb , tree , offset ) ; offset = tvb_reported_length ( tvb ) - 16 ; proto_tree_add_item ( tree , hf_pvfs_offset , tvb , offset , 8 , ENC_LITTLE_ENDIAN ) ; offset += 8 ; proto_tree_add_item ( tree , hf_pvfs_size , tvb , offset , 8 , ENC_LITTLE_ENDIAN ) ; offset += 8 ; return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static const value_string * val_to_valstr ( guint32 val , const value_valuestring * vvs ) { gint i = 0 ; while ( vvs [ i ] . valstrptr ) { if ( vvs [ i ] . value == val ) return ( vvs [ i ] . valstrptr ) ; i ++ ; } return ( NULL ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
PyObject * PyString_Encode ( const char * s , Py_ssize_t size , const char * encoding , const char * errors ) { PyObject * v , * str ; str = PyString_FromStringAndSize ( s , size ) ; if ( str == NULL ) return NULL ; v = PyString_AsEncodedString ( str , encoding , errors ) ; Py_DECREF ( str ) ; return v ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int h264_frame_start ( H264Context * h ) { Picture * pic ; int i , ret ; const int pixel_shift = h -> pixel_shift ; int c [ 4 ] = { 1 << ( h -> sps . bit_depth_luma - 1 ) , 1 << ( h -> sps . bit_depth_chroma - 1 ) , 1 << ( h -> sps . bit_depth_chroma - 1 ) , - 1 } ; if ( ! ff_thread_can_start_frame ( h -> avctx ) ) { av_log ( h -> avctx , AV_LOG_ERROR , "Attempt to start a frame outside SETUP state\n" ) ; return - 1 ; } release_unused_pictures ( h , 1 ) ; h -> cur_pic_ptr = NULL ; i = find_unused_picture ( h ) ; if ( i < 0 ) { av_log ( h -> avctx , AV_LOG_ERROR , "no frame buffer available\n" ) ; return i ; } pic = & h -> DPB [ i ] ; pic -> reference = h -> droppable ? 0 : h -> picture_structure ; pic -> f . coded_picture_number = h -> coded_picture_number ++ ; pic -> field_picture = h -> picture_structure != PICT_FRAME ; pic -> f . key_frame = 0 ; pic -> mmco_reset = 0 ; pic -> recovered = 0 ; if ( ( ret = alloc_picture ( h , pic ) ) < 0 ) return ret ; if ( ! h -> frame_recovered && ! h -> avctx -> hwaccel && ! ( h -> avctx -> codec -> capabilities & CODEC_CAP_HWACCEL_VDPAU ) ) avpriv_color_frame ( & pic -> f , c ) ; h -> cur_pic_ptr = pic ; unref_picture ( h , & h -> cur_pic ) ; if ( ( ret = ref_picture ( h , & h -> cur_pic , h -> cur_pic_ptr ) ) < 0 ) return ret ; if ( CONFIG_ERROR_RESILIENCE ) { ff_er_frame_start ( & h -> er ) ; h -> er . last_pic = h -> er . next_pic = NULL ; } assert ( h -> linesize && h -> uvlinesize ) ; for ( i = 0 ; i < 16 ; i ++ ) { h -> block_offset [ i ] = ( 4 * ( ( scan8 [ i ] - scan8 [ 0 ] ) & 7 ) << pixel_shift ) + 4 * h -> linesize * ( ( scan8 [ i ] - scan8 [ 0 ] ) >> 3 ) ; h -> block_offset [ 48 + i ] = ( 4 * ( ( scan8 [ i ] - scan8 [ 0 ] ) & 7 ) << pixel_shift ) + 8 * h -> linesize * ( ( scan8 [ i ] - scan8 [ 0 ] ) >> 3 ) ; } for ( i = 0 ; i < 16 ; i ++ ) { h -> block_offset [ 16 + i ] = h -> block_offset [ 32 + i ] = ( 4 * ( ( scan8 [ i ] - scan8 [ 0 ] ) & 7 ) << pixel_shift ) + 4 * h -> uvlinesize * ( ( scan8 [ i ] - scan8 [ 0 ] ) >> 3 ) ; h -> block_offset [ 48 + 16 + i ] = h -> block_offset [ 48 + 32 + i ] = ( 4 * ( ( scan8 [ i ] - scan8 [ 0 ] ) & 7 ) << pixel_shift ) + 8 * h -> uvlinesize * ( ( scan8 [ i ] - scan8 [ 0 ] ) >> 3 ) ; } h -> cur_pic_ptr -> reference = 0 ; h -> cur_pic_ptr -> field_poc [ 0 ] = h -> cur_pic_ptr -> field_poc [ 1 ] = INT_MAX ; h -> next_output_pic = NULL ; assert ( h -> cur_pic_ptr -> long_ref == 0 ) ; return 0 ; }
1True
Categorize the following code snippet as vulnerable or not. True or False
static void proto_tree_set_vines_tvb ( field_info * fi , tvbuff_t * tvb , gint start ) { proto_tree_set_vines ( fi , tvb_get_ptr ( tvb , start , FT_VINES_ADDR_LEN ) ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void test_derived ( ) { MYSQL_STMT * stmt ; int rc , i ; MYSQL_BIND my_bind [ 1 ] ; int32 my_val = 0 ; ulong my_length = 0L ; my_bool my_null = FALSE ; const char * query = "select count(1) from (select f.id from t1 f where f.id=?) as x" ; myheader ( "test_derived" ) ; rc = mysql_query ( mysql , "DROP TABLE IF EXISTS t1" ) ; myquery ( rc ) ; rc = mysql_query ( mysql , "create table t1 (id int(8), primary key (id)) \ ENGINE=InnoDB DEFAULT CHARSET=utf8" ) ; myquery ( rc ) ; rc = mysql_query ( mysql , "insert into t1 values (1)" ) ; myquery ( rc ) ; stmt = mysql_simple_prepare ( mysql , query ) ; check_stmt ( stmt ) ; memset ( my_bind , 0 , sizeof ( my_bind ) ) ; my_bind [ 0 ] . buffer_type = MYSQL_TYPE_LONG ; my_bind [ 0 ] . buffer = ( void * ) & my_val ; my_bind [ 0 ] . length = & my_length ; my_bind [ 0 ] . is_null = ( char * ) & my_null ; my_val = 1 ; rc = mysql_stmt_bind_param ( stmt , my_bind ) ; check_execute ( stmt , rc ) ; for ( i = 0 ; i < 3 ; i ++ ) { rc = mysql_stmt_execute ( stmt ) ; check_execute ( stmt , rc ) ; rc = my_process_stmt_result ( stmt ) ; DIE_UNLESS ( rc == 1 ) ; } mysql_stmt_close ( stmt ) ; rc = mysql_query ( mysql , "DROP TABLE t1" ) ; myquery ( rc ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
int ff_generate_sliding_window_mmcos ( H264Context * h , int first_slice ) { MMCO mmco_temp [ MAX_MMCO_COUNT ] , * mmco = first_slice ? h -> mmco : mmco_temp ; int mmco_index = 0 , i ; assert ( h -> long_ref_count + h -> short_ref_count <= h -> sps . ref_frame_count ) ; if ( h -> short_ref_count && h -> long_ref_count + h -> short_ref_count == h -> sps . ref_frame_count && ! ( FIELD_PICTURE && ! h -> first_field && h -> cur_pic_ptr -> reference ) ) { mmco [ 0 ] . opcode = MMCO_SHORT2UNUSED ; mmco [ 0 ] . short_pic_num = h -> short_ref [ h -> short_ref_count - 1 ] -> frame_num ; mmco_index = 1 ; if ( FIELD_PICTURE ) { mmco [ 0 ] . short_pic_num *= 2 ; mmco [ 1 ] . opcode = MMCO_SHORT2UNUSED ; mmco [ 1 ] . short_pic_num = mmco [ 0 ] . short_pic_num + 1 ; mmco_index = 2 ; } } if ( first_slice ) { h -> mmco_index = mmco_index ; } else if ( ! first_slice && mmco_index >= 0 && ( mmco_index != h -> mmco_index || ( i = check_opcodes ( h -> mmco , mmco_temp , mmco_index ) ) ) ) { av_log ( h -> avctx , AV_LOG_ERROR , "Inconsistent MMCO state between slices [%d, %d, %d]\n" , mmco_index , h -> mmco_index , i ) ; return AVERROR_INVALIDDATA ; } return 0 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
hidden_def ( _nss_dns_gethostbyaddr2_r ) enum nss_status _nss_dns_gethostbyaddr_r ( const void * addr , socklen_t len , int af , struct hostent * result , char * buffer , size_t buflen , int * errnop , int * h_errnop ) { return _nss_dns_gethostbyaddr2_r ( addr , len , af , result , buffer , buflen , errnop , h_errnop , NULL ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int decode_slice ( struct AVCodecContext * avctx , void * arg ) { H264Context * h = * ( void * * ) arg ; int lf_x_start = h -> mb_x ; h -> mb_skip_run = - 1 ; av_assert0 ( h -> block_offset [ 15 ] == ( 4 * ( ( scan8 [ 15 ] - scan8 [ 0 ] ) & 7 ) << h -> pixel_shift ) + 4 * h -> linesize * ( ( scan8 [ 15 ] - scan8 [ 0 ] ) >> 3 ) ) ; h -> is_complex = FRAME_MBAFF ( h ) || h -> picture_structure != PICT_FRAME || avctx -> codec_id != AV_CODEC_ID_H264 || ( CONFIG_GRAY && ( h -> flags & CODEC_FLAG_GRAY ) ) ; if ( ! ( h -> avctx -> active_thread_type & FF_THREAD_SLICE ) && h -> picture_structure == PICT_FRAME && h -> er . error_status_table ) { const int start_i = av_clip ( h -> resync_mb_x + h -> resync_mb_y * h -> mb_width , 0 , h -> mb_num - 1 ) ; if ( start_i ) { int prev_status = h -> er . error_status_table [ h -> er . mb_index2xy [ start_i - 1 ] ] ; prev_status &= ~ VP_START ; if ( prev_status != ( ER_MV_END | ER_DC_END | ER_AC_END ) ) h -> er . error_occurred = 1 ; } } if ( h -> pps . cabac ) { align_get_bits ( & h -> gb ) ; ff_init_cabac_decoder ( & h -> cabac , h -> gb . buffer + get_bits_count ( & h -> gb ) / 8 , ( get_bits_left ( & h -> gb ) + 7 ) / 8 ) ; ff_h264_init_cabac_states ( h ) ; for ( ; ; ) { int ret = ff_h264_decode_mb_cabac ( h ) ; int eos ; if ( ret >= 0 ) ff_h264_hl_decode_mb ( h ) ; if ( ret >= 0 && FRAME_MBAFF ( h ) ) { h -> mb_y ++ ; ret = ff_h264_decode_mb_cabac ( h ) ; if ( ret >= 0 ) ff_h264_hl_decode_mb ( h ) ; h -> mb_y -- ; } eos = get_cabac_terminate ( & h -> cabac ) ; if ( ( h -> workaround_bugs & FF_BUG_TRUNCATED ) && h -> cabac . bytestream > h -> cabac . bytestream_end + 2 ) { er_add_slice ( h , h -> resync_mb_x , h -> resync_mb_y , h -> mb_x - 1 , h -> mb_y , ER_MB_END ) ; if ( h -> mb_x >= lf_x_start ) loop_filter ( h , lf_x_start , h -> mb_x + 1 ) ; return 0 ; } if ( h -> cabac . bytestream > h -> cabac . bytestream_end + 2 ) av_log ( h -> avctx , AV_LOG_DEBUG , "bytestream overread %td\n" , h -> cabac . bytestream_end - h -> cabac . bytestream ) ; if ( ret < 0 || h -> cabac . bytestream > h -> cabac . bytestream_end + 4 ) { av_log ( h -> avctx , AV_LOG_ERROR , "error while decoding MB %d %d, bytestream (%td)\n" , h -> mb_x , h -> mb_y , h -> cabac . bytestream_end - h -> cabac . bytestream ) ; er_add_slice ( h , h -> resync_mb_x , h -> resync_mb_y , h -> mb_x , h -> mb_y , ER_MB_ERROR ) ; return AVERROR_INVALIDDATA ; } if ( ++ h -> mb_x >= h -> mb_width ) { loop_filter ( h , lf_x_start , h -> mb_x ) ; h -> mb_x = lf_x_start = 0 ; decode_finish_row ( h ) ; ++ h -> mb_y ; if ( FIELD_OR_MBAFF_PICTURE ( h ) ) { ++ h -> mb_y ; if ( FRAME_MBAFF ( h ) && h -> mb_y < h -> mb_height ) predict_field_decoding_flag ( h ) ; } } if ( eos || h -> mb_y >= h -> mb_height ) { tprintf ( h -> avctx , "slice end %d %d\n" , get_bits_count ( & h -> gb ) , h -> gb . size_in_bits ) ; er_add_slice ( h , h -> resync_mb_x , h -> resync_mb_y , h -> mb_x - 1 , h -> mb_y , ER_MB_END ) ; if ( h -> mb_x > lf_x_start ) loop_filter ( h , lf_x_start , h -> mb_x ) ; return 0 ; } } } else { for ( ; ; ) { int ret = ff_h264_decode_mb_cavlc ( h ) ; if ( ret >= 0 ) ff_h264_hl_decode_mb ( h ) ; if ( ret >= 0 && FRAME_MBAFF ( h ) ) { h -> mb_y ++ ; ret = ff_h264_decode_mb_cavlc ( h ) ; if ( ret >= 0 ) ff_h264_hl_decode_mb ( h ) ; h -> mb_y -- ; } if ( ret < 0 ) { av_log ( h -> avctx , AV_LOG_ERROR , "error while decoding MB %d %d\n" , h -> mb_x , h -> mb_y ) ; er_add_slice ( h , h -> resync_mb_x , h -> resync_mb_y , h -> mb_x , h -> mb_y , ER_MB_ERROR ) ; return ret ; } if ( ++ h -> mb_x >= h -> mb_width ) { loop_filter ( h , lf_x_start , h -> mb_x ) ; h -> mb_x = lf_x_start = 0 ; decode_finish_row ( h ) ; ++ h -> mb_y ; if ( FIELD_OR_MBAFF_PICTURE ( h ) ) { ++ h -> mb_y ; if ( FRAME_MBAFF ( h ) && h -> mb_y < h -> mb_height ) predict_field_decoding_flag ( h ) ; } if ( h -> mb_y >= h -> mb_height ) { tprintf ( h -> avctx , "slice end %d %d\n" , get_bits_count ( & h -> gb ) , h -> gb . size_in_bits ) ; if ( get_bits_left ( & h -> gb ) == 0 || get_bits_left ( & h -> gb ) > 0 && ! ( h -> avctx -> err_recognition & AV_EF_AGGRESSIVE ) ) { er_add_slice ( h , h -> resync_mb_x , h -> resync_mb_y , h -> mb_x - 1 , h -> mb_y , ER_MB_END ) ; return 0 ; } else { er_add_slice ( h , h -> resync_mb_x , h -> resync_mb_y , h -> mb_x , h -> mb_y , ER_MB_END ) ; return AVERROR_INVALIDDATA ; } } } if ( get_bits_left ( & h -> gb ) <= 0 && h -> mb_skip_run <= 0 ) { tprintf ( h -> avctx , "slice end %d %d\n" , get_bits_count ( & h -> gb ) , h -> gb . size_in_bits ) ; if ( get_bits_left ( & h -> gb ) == 0 ) { er_add_slice ( h , h -> resync_mb_x , h -> resync_mb_y , h -> mb_x - 1 , h -> mb_y , ER_MB_END ) ; if ( h -> mb_x > lf_x_start ) loop_filter ( h , lf_x_start , h -> mb_x ) ; return 0 ; } else { er_add_slice ( h , h -> resync_mb_x , h -> resync_mb_y , h -> mb_x , h -> mb_y , ER_MB_ERROR ) ; return AVERROR_INVALIDDATA ; } } } } }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void mount_callback_data_notify ( gpointer data , GObject * object ) { GMountOperation * mount_op ; mount_op = G_MOUNT_OPERATION ( data ) ; g_object_set_data ( G_OBJECT ( mount_op ) , "mount-callback" , NULL ) ; g_object_set_data ( G_OBJECT ( mount_op ) , "mount-callback-data" , NULL ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
void vp9_twopass_postencode_update ( VP9_COMP * cpi ) { TWO_PASS * const twopass = & cpi -> twopass ; RATE_CONTROL * const rc = & cpi -> rc ; const int bits_used = rc -> base_frame_target ; rc -> vbr_bits_off_target += rc -> base_frame_target - rc -> projected_frame_size ; twopass -> bits_left = MAX ( twopass -> bits_left - bits_used , 0 ) ; if ( cpi -> common . frame_type != KEY_FRAME && ! vp9_is_upper_layer_key_frame ( cpi ) ) { twopass -> kf_group_bits -= bits_used ; twopass -> last_kfgroup_zeromotion_pct = twopass -> kf_zeromotion_pct ; } twopass -> kf_group_bits = MAX ( twopass -> kf_group_bits , 0 ) ; ++ twopass -> gf_group . index ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void init_t38_info_conv ( packet_info * pinfo ) { t38_info_current ++ ; if ( t38_info_current == MAX_T38_MESSAGES_IN_PACKET ) { t38_info_current = 0 ; } t38_info = & t38_info_arr [ t38_info_current ] ; t38_info -> seq_num = 0 ; t38_info -> type_msg = 0 ; t38_info -> data_value = 0 ; t38_info -> t30ind_value = 0 ; t38_info -> setup_frame_number = 0 ; t38_info -> Data_Field_field_type_value = 0 ; t38_info -> desc [ 0 ] = '\0' ; t38_info -> desc_comment [ 0 ] = '\0' ; t38_info -> time_first_t4_data = 0 ; t38_info -> frame_num_first_t4_data = 0 ; p_t38_packet_conv = NULL ; p_t38_conv = NULL ; p_t38_packet_conv = ( t38_conv * ) p_get_proto_data ( wmem_file_scope ( ) , pinfo , proto_t38 , 0 ) ; p_conv = find_conversation ( pinfo -> fd -> num , & pinfo -> net_dst , & pinfo -> net_src , pinfo -> ptype , pinfo -> destport , pinfo -> srcport , NO_ADDR_B | NO_PORT_B ) ; if ( ! p_conv ) { p_conv = conversation_new ( pinfo -> fd -> num , & pinfo -> net_src , & pinfo -> net_dst , pinfo -> ptype , pinfo -> srcport , pinfo -> destport , NO_ADDR_B | NO_PORT_B ) ; conversation_set_dissector ( p_conv , t38_udp_handle ) ; } p_t38_conv = ( t38_conv * ) conversation_get_proto_data ( p_conv , proto_t38 ) ; if ( ! p_t38_conv ) { p_t38_conv = wmem_new ( wmem_file_scope ( ) , t38_conv ) ; p_t38_conv -> setup_method [ 0 ] = '\0' ; p_t38_conv -> setup_frame_number = 0 ; p_t38_conv -> src_t38_info . reass_ID = 0 ; p_t38_conv -> src_t38_info . reass_start_seqnum = - 1 ; p_t38_conv -> src_t38_info . reass_data_type = 0 ; p_t38_conv -> src_t38_info . last_seqnum = - 1 ; p_t38_conv -> src_t38_info . packet_lost = 0 ; p_t38_conv -> src_t38_info . burst_lost = 0 ; p_t38_conv -> src_t38_info . time_first_t4_data = 0 ; p_t38_conv -> src_t38_info . additional_hdlc_data_field_counter = 0 ; p_t38_conv -> src_t38_info . seqnum_prev_data_field = - 1 ; p_t38_conv -> dst_t38_info . reass_ID = 0 ; p_t38_conv -> dst_t38_info . reass_start_seqnum = - 1 ; p_t38_conv -> dst_t38_info . reass_data_type = 0 ; p_t38_conv -> dst_t38_info . last_seqnum = - 1 ; p_t38_conv -> dst_t38_info . packet_lost = 0 ; p_t38_conv -> dst_t38_info . burst_lost = 0 ; p_t38_conv -> dst_t38_info . time_first_t4_data = 0 ; p_t38_conv -> dst_t38_info . additional_hdlc_data_field_counter = 0 ; p_t38_conv -> dst_t38_info . seqnum_prev_data_field = - 1 ; conversation_add_proto_data ( p_conv , proto_t38 , p_t38_conv ) ; } if ( ! p_t38_packet_conv ) { p_t38_packet_conv = wmem_new ( wmem_file_scope ( ) , t38_conv ) ; g_strlcpy ( p_t38_packet_conv -> setup_method , p_t38_conv -> setup_method , MAX_T38_SETUP_METHOD_SIZE ) ; p_t38_packet_conv -> setup_frame_number = p_t38_conv -> setup_frame_number ; memcpy ( & ( p_t38_packet_conv -> src_t38_info ) , & ( p_t38_conv -> src_t38_info ) , sizeof ( t38_conv_info ) ) ; memcpy ( & ( p_t38_packet_conv -> dst_t38_info ) , & ( p_t38_conv -> dst_t38_info ) , sizeof ( t38_conv_info ) ) ; p_add_proto_data ( wmem_file_scope ( ) , pinfo , proto_t38 , 0 , p_t38_packet_conv ) ; } if ( ADDRESSES_EQUAL ( & p_conv -> key_ptr -> addr1 , & pinfo -> net_src ) ) { p_t38_conv_info = & ( p_t38_conv -> src_t38_info ) ; p_t38_packet_conv_info = & ( p_t38_packet_conv -> src_t38_info ) ; } else { p_t38_conv_info = & ( p_t38_conv -> dst_t38_info ) ; p_t38_packet_conv_info = & ( p_t38_packet_conv -> dst_t38_info ) ; } t38_info -> setup_frame_number = p_t38_packet_conv -> setup_frame_number ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int qcow2_read_extensions ( BlockDriverState * bs , uint64_t start_offset , uint64_t end_offset , void * * p_feature_table , Error * * errp ) { BDRVQcowState * s = bs -> opaque ; QCowExtension ext ; uint64_t offset ; int ret ; # ifdef DEBUG_EXT printf ( "qcow2_read_extensions: start=%ld end=%ld\n" , start_offset , end_offset ) ; # endif offset = start_offset ; while ( offset < end_offset ) { # ifdef DEBUG_EXT if ( offset > s -> cluster_size ) printf ( "qcow2_read_extension: suspicious offset %lu\n" , offset ) ; printf ( "attempting to read extended header in offset %lu\n" , offset ) ; # endif ret = bdrv_pread ( bs -> file , offset , & ext , sizeof ( ext ) ) ; if ( ret < 0 ) { error_setg_errno ( errp , - ret , "qcow2_read_extension: ERROR: " "pread fail from offset %" PRIu64 , offset ) ; return 1 ; } be32_to_cpus ( & ext . magic ) ; be32_to_cpus ( & ext . len ) ; offset += sizeof ( ext ) ; # ifdef DEBUG_EXT printf ( "ext.magic = 0x%x\n" , ext . magic ) ; # endif if ( ext . len > end_offset - offset ) { error_setg ( errp , "Header extension too large" ) ; return - EINVAL ; } switch ( ext . magic ) { case QCOW2_EXT_MAGIC_END : return 0 ; case QCOW2_EXT_MAGIC_BACKING_FORMAT : if ( ext . len >= sizeof ( bs -> backing_format ) ) { error_setg ( errp , "ERROR: ext_backing_format: len=%u too large" " (>=%zu)" , ext . len , sizeof ( bs -> backing_format ) ) ; return 2 ; } ret = bdrv_pread ( bs -> file , offset , bs -> backing_format , ext . len ) ; if ( ret < 0 ) { error_setg_errno ( errp , - ret , "ERROR: ext_backing_format: " "Could not read format name" ) ; return 3 ; } bs -> backing_format [ ext . len ] = '\0' ; # ifdef DEBUG_EXT printf ( "Qcow2: Got format extension %s\n" , bs -> backing_format ) ; # endif break ; case QCOW2_EXT_MAGIC_FEATURE_TABLE : if ( p_feature_table != NULL ) { void * feature_table = g_malloc0 ( ext . len + 2 * sizeof ( Qcow2Feature ) ) ; ret = bdrv_pread ( bs -> file , offset , feature_table , ext . len ) ; if ( ret < 0 ) { error_setg_errno ( errp , - ret , "ERROR: ext_feature_table: " "Could not read table" ) ; return ret ; } * p_feature_table = feature_table ; } break ; default : { Qcow2UnknownHeaderExtension * uext ; uext = g_malloc0 ( sizeof ( * uext ) + ext . len ) ; uext -> magic = ext . magic ; uext -> len = ext . len ; QLIST_INSERT_HEAD ( & s -> unknown_header_ext , uext , next ) ; ret = bdrv_pread ( bs -> file , offset , uext -> data , uext -> len ) ; if ( ret < 0 ) { error_setg_errno ( errp , - ret , "ERROR: unknown extension: " "Could not read data" ) ; return ret ; } } break ; } offset += ( ( ext . len + 7 ) & ~ 7 ) ; } return 0 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_h245_INTEGER_1_448 ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) { offset = dissect_per_constrained_integer ( tvb , offset , actx , tree , hf_index , 1U , 448U , NULL , FALSE ) ; return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int cyuv_decode_frame ( AVCodecContext * avctx , void * data , int * got_frame , AVPacket * avpkt ) { const uint8_t * buf = avpkt -> data ; int buf_size = avpkt -> size ; CyuvDecodeContext * s = avctx -> priv_data ; unsigned char * y_plane ; unsigned char * u_plane ; unsigned char * v_plane ; int y_ptr ; int u_ptr ; int v_ptr ; const signed char * y_table = ( const signed char * ) buf + 0 ; const signed char * u_table = ( const signed char * ) buf + 16 ; const signed char * v_table = ( const signed char * ) buf + 32 ; unsigned char y_pred , u_pred , v_pred ; int stream_ptr ; unsigned char cur_byte ; int pixel_groups ; int ret ; if ( avctx -> codec_id == AV_CODEC_ID_AURA ) { y_table = u_table ; u_table = v_table ; } if ( buf_size != 48 + s -> height * ( s -> width * 3 / 4 ) ) { av_log ( avctx , AV_LOG_ERROR , "got a buffer with %d bytes when %d were expected\n" , buf_size , 48 + s -> height * ( s -> width * 3 / 4 ) ) ; return AVERROR_INVALIDDATA ; } stream_ptr = 48 ; if ( s -> frame . data [ 0 ] ) avctx -> release_buffer ( avctx , & s -> frame ) ; s -> frame . buffer_hints = FF_BUFFER_HINTS_VALID ; s -> frame . reference = 0 ; if ( ( ret = ff_get_buffer ( avctx , & s -> frame ) ) < 0 ) { av_log ( avctx , AV_LOG_ERROR , "get_buffer() failed\n" ) ; return ret ; } y_plane = s -> frame . data [ 0 ] ; u_plane = s -> frame . data [ 1 ] ; v_plane = s -> frame . data [ 2 ] ; for ( y_ptr = 0 , u_ptr = 0 , v_ptr = 0 ; y_ptr < ( s -> height * s -> frame . linesize [ 0 ] ) ; y_ptr += s -> frame . linesize [ 0 ] - s -> width , u_ptr += s -> frame . linesize [ 1 ] - s -> width / 4 , v_ptr += s -> frame . linesize [ 2 ] - s -> width / 4 ) { cur_byte = buf [ stream_ptr ++ ] ; u_plane [ u_ptr ++ ] = u_pred = cur_byte & 0xF0 ; y_plane [ y_ptr ++ ] = y_pred = ( cur_byte & 0x0F ) << 4 ; cur_byte = buf [ stream_ptr ++ ] ; v_plane [ v_ptr ++ ] = v_pred = cur_byte & 0xF0 ; y_pred += y_table [ cur_byte & 0x0F ] ; y_plane [ y_ptr ++ ] = y_pred ; cur_byte = buf [ stream_ptr ++ ] ; y_pred += y_table [ cur_byte & 0x0F ] ; y_plane [ y_ptr ++ ] = y_pred ; y_pred += y_table [ ( cur_byte & 0xF0 ) >> 4 ] ; y_plane [ y_ptr ++ ] = y_pred ; pixel_groups = s -> width / 4 - 1 ; while ( pixel_groups -- ) { cur_byte = buf [ stream_ptr ++ ] ; u_pred += u_table [ ( cur_byte & 0xF0 ) >> 4 ] ; u_plane [ u_ptr ++ ] = u_pred ; y_pred += y_table [ cur_byte & 0x0F ] ; y_plane [ y_ptr ++ ] = y_pred ; cur_byte = buf [ stream_ptr ++ ] ; v_pred += v_table [ ( cur_byte & 0xF0 ) >> 4 ] ; v_plane [ v_ptr ++ ] = v_pred ; y_pred += y_table [ cur_byte & 0x0F ] ; y_plane [ y_ptr ++ ] = y_pred ; cur_byte = buf [ stream_ptr ++ ] ; y_pred += y_table [ cur_byte & 0x0F ] ; y_plane [ y_ptr ++ ] = y_pred ; y_pred += y_table [ ( cur_byte & 0xF0 ) >> 4 ] ; y_plane [ y_ptr ++ ] = y_pred ; } } * got_frame = 1 ; * ( AVFrame * ) data = s -> frame ; return buf_size ; }
1True
Categorize the following code snippet as vulnerable or not. True or False
uint_fast32_t jas_image_rawsize ( jas_image_t * image ) { uint_fast32_t rawsize ; int cmptno ; jas_image_cmpt_t * cmpt ; rawsize = 0 ; for ( cmptno = 0 ; cmptno < image -> numcmpts_ ; ++ cmptno ) { cmpt = image -> cmpts_ [ cmptno ] ; rawsize += ( cmpt -> width_ * cmpt -> height_ * cmpt -> prec_ + 7 ) / 8 ; } return rawsize ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int archive_read_format_cpio_read_header ( struct archive_read * a , struct archive_entry * entry ) { struct cpio * cpio ; const void * h ; struct archive_string_conv * sconv ; size_t namelength ; size_t name_pad ; int r ; cpio = ( struct cpio * ) ( a -> format -> data ) ; sconv = cpio -> opt_sconv ; if ( sconv == NULL ) { if ( ! cpio -> init_default_conversion ) { cpio -> sconv_default = archive_string_default_conversion_for_read ( & ( a -> archive ) ) ; cpio -> init_default_conversion = 1 ; } sconv = cpio -> sconv_default ; } r = ( cpio -> read_header ( a , cpio , entry , & namelength , & name_pad ) ) ; if ( r < ARCHIVE_WARN ) return ( r ) ; h = __archive_read_ahead ( a , namelength + name_pad , NULL ) ; if ( h == NULL ) return ( ARCHIVE_FATAL ) ; if ( archive_entry_copy_pathname_l ( entry , ( const char * ) h , namelength , sconv ) != 0 ) { if ( errno == ENOMEM ) { archive_set_error ( & a -> archive , ENOMEM , "Can't allocate memory for Pathname" ) ; return ( ARCHIVE_FATAL ) ; } archive_set_error ( & a -> archive , ARCHIVE_ERRNO_FILE_FORMAT , "Pathname can't be converted from %s to current locale." , archive_string_conversion_charset_name ( sconv ) ) ; r = ARCHIVE_WARN ; } cpio -> entry_offset = 0 ; __archive_read_consume ( a , namelength + name_pad ) ; if ( archive_entry_filetype ( entry ) == AE_IFLNK ) { h = __archive_read_ahead ( a , ( size_t ) cpio -> entry_bytes_remaining , NULL ) ; if ( h == NULL ) return ( ARCHIVE_FATAL ) ; if ( archive_entry_copy_symlink_l ( entry , ( const char * ) h , ( size_t ) cpio -> entry_bytes_remaining , sconv ) != 0 ) { if ( errno == ENOMEM ) { archive_set_error ( & a -> archive , ENOMEM , "Can't allocate memory for Linkname" ) ; return ( ARCHIVE_FATAL ) ; } archive_set_error ( & a -> archive , ARCHIVE_ERRNO_FILE_FORMAT , "Linkname can't be converted from %s to " "current locale." , archive_string_conversion_charset_name ( sconv ) ) ; r = ARCHIVE_WARN ; } __archive_read_consume ( a , cpio -> entry_bytes_remaining ) ; cpio -> entry_bytes_remaining = 0 ; } if ( namelength == 11 && strcmp ( ( const char * ) h , "TRAILER!!!" ) == 0 ) { archive_clear_error ( & a -> archive ) ; return ( ARCHIVE_EOF ) ; } if ( record_hardlink ( a , cpio , entry ) != ARCHIVE_OK ) { return ( ARCHIVE_FATAL ) ; } return ( r ) ; }
1True
Categorize the following code snippet as vulnerable or not. True or False
static void dumpTimestamp ( const char * msg ) { char buf [ 64 ] ; time_t now = time ( NULL ) ; if ( strftime ( buf , sizeof ( buf ) , PGDUMP_STRFTIME_FMT , localtime ( & now ) ) != 0 ) fprintf ( OPF , "-- %s %s\n\n" , msg , buf ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static enum fetch_step vbf_stp_startfetch ( struct worker * wrk , struct busyobj * bo ) { int i ; double now ; CHECK_OBJ_NOTNULL ( wrk , WORKER_MAGIC ) ; CHECK_OBJ_NOTNULL ( bo , BUSYOBJ_MAGIC ) ; AZ ( bo -> storage ) ; AZ ( bo -> storage_hint ) ; bo -> storage = STV_next ( ) ; if ( bo -> retries > 0 ) http_Unset ( bo -> bereq , "\012X-Varnish:" ) ; http_PrintfHeader ( bo -> bereq , "X-Varnish: %u" , VXID ( bo -> vsl -> wid ) ) ; VCL_backend_fetch_method ( bo -> vcl , wrk , NULL , bo , NULL ) ; bo -> uncacheable = bo -> do_pass ; if ( wrk -> handling == VCL_RET_ABANDON || wrk -> handling == VCL_RET_FAIL ) return ( F_STP_FAIL ) ; assert ( wrk -> handling == VCL_RET_FETCH ) ; HTTP_Setup ( bo -> beresp , bo -> ws , bo -> vsl , SLT_BerespMethod ) ; assert ( bo -> fetch_objcore -> boc -> state <= BOS_REQ_DONE ) ; AZ ( bo -> htc ) ; i = VDI_GetHdr ( wrk , bo ) ; now = W_TIM_real ( wrk ) ; VSLb_ts_busyobj ( bo , "Beresp" , now ) ; if ( i ) { assert ( bo -> director_state == DIR_S_NULL ) ; return ( F_STP_ERROR ) ; } http_VSL_log ( bo -> beresp ) ; if ( ! http_GetHdr ( bo -> beresp , H_Date , NULL ) ) { http_TimeHeader ( bo -> beresp , "Date: " , now ) ; } http_CollectHdr ( bo -> beresp , H_Cache_Control ) ; http_CollectHdr ( bo -> beresp , H_Vary ) ; if ( ! strcasecmp ( http_GetMethod ( bo -> bereq ) , "head" ) ) { wrk -> stats -> fetch_head ++ ; bo -> htc -> body_status = BS_NONE ; } else if ( http_GetStatus ( bo -> beresp ) <= 199 ) { wrk -> stats -> fetch_1xx ++ ; bo -> htc -> body_status = BS_ERROR ; } else if ( http_IsStatus ( bo -> beresp , 204 ) ) { wrk -> stats -> fetch_204 ++ ; if ( ( http_GetHdr ( bo -> beresp , H_Content_Length , NULL ) && bo -> htc -> content_length != 0 ) || http_GetHdr ( bo -> beresp , H_Transfer_Encoding , NULL ) ) bo -> htc -> body_status = BS_ERROR ; else bo -> htc -> body_status = BS_NONE ; } else if ( http_IsStatus ( bo -> beresp , 304 ) ) { wrk -> stats -> fetch_304 ++ ; bo -> htc -> body_status = BS_NONE ; } else if ( bo -> htc -> body_status == BS_CHUNKED ) { wrk -> stats -> fetch_chunked ++ ; } else if ( bo -> htc -> body_status == BS_LENGTH ) { assert ( bo -> htc -> content_length > 0 ) ; wrk -> stats -> fetch_length ++ ; } else if ( bo -> htc -> body_status == BS_EOF ) { wrk -> stats -> fetch_eof ++ ; } else if ( bo -> htc -> body_status == BS_ERROR ) { wrk -> stats -> fetch_bad ++ ; } else if ( bo -> htc -> body_status == BS_NONE ) { wrk -> stats -> fetch_none ++ ; } else { WRONG ( "wrong bodystatus" ) ; } if ( bo -> htc -> body_status == BS_ERROR ) { bo -> htc -> doclose = SC_RX_BODY ; VDI_Finish ( bo -> wrk , bo ) ; VSLb ( bo -> vsl , SLT_Error , "Body cannot be fetched" ) ; assert ( bo -> director_state == DIR_S_NULL ) ; return ( F_STP_ERROR ) ; } if ( bo -> fetch_objcore -> flags & OC_F_PRIVATE ) { bo -> fetch_objcore -> t_origin = now ; bo -> fetch_objcore -> ttl = - 1. ; bo -> fetch_objcore -> grace = 0 ; bo -> fetch_objcore -> keep = 0 ; } else { RFC2616_Ttl ( bo , now , & bo -> fetch_objcore -> t_origin , & bo -> fetch_objcore -> ttl , & bo -> fetch_objcore -> grace , & bo -> fetch_objcore -> keep ) ; } AZ ( bo -> do_esi ) ; AZ ( bo -> was_304 ) ; if ( http_IsStatus ( bo -> beresp , 304 ) ) { if ( bo -> stale_oc != NULL && ObjCheckFlag ( bo -> wrk , bo -> stale_oc , OF_IMSCAND ) ) { if ( ObjCheckFlag ( bo -> wrk , bo -> stale_oc , OF_CHGGZIP ) ) { http_Unset ( bo -> beresp , H_Content_Encoding ) ; RFC2616_Weaken_Etag ( bo -> beresp ) ; } http_Unset ( bo -> beresp , H_Content_Length ) ; HTTP_Merge ( bo -> wrk , bo -> stale_oc , bo -> beresp ) ; assert ( http_IsStatus ( bo -> beresp , 200 ) ) ; bo -> was_304 = 1 ; } else if ( ! bo -> do_pass ) { VSLb ( bo -> vsl , SLT_Error , "304 response but not conditional fetch" ) ; bo -> htc -> doclose = SC_RX_BAD ; VDI_Finish ( bo -> wrk , bo ) ; return ( F_STP_ERROR ) ; } } bo -> vfc -> bo = bo ; bo -> vfc -> oc = bo -> fetch_objcore ; bo -> vfc -> wrk = bo -> wrk ; bo -> vfc -> http = bo -> beresp ; bo -> vfc -> esi_req = bo -> bereq ; VCL_backend_response_method ( bo -> vcl , wrk , NULL , bo , NULL ) ; if ( wrk -> handling == VCL_RET_ABANDON || wrk -> handling == VCL_RET_FAIL ) { bo -> htc -> doclose = SC_RESP_CLOSE ; VDI_Finish ( bo -> wrk , bo ) ; return ( F_STP_FAIL ) ; } if ( wrk -> handling == VCL_RET_RETRY ) { if ( bo -> htc -> body_status != BS_NONE ) bo -> htc -> doclose = SC_RESP_CLOSE ; if ( bo -> director_state != DIR_S_NULL ) VDI_Finish ( bo -> wrk , bo ) ; if ( bo -> retries ++ < cache_param -> max_retries ) return ( F_STP_RETRY ) ; VSLb ( bo -> vsl , SLT_VCL_Error , "Too many retries, delivering 503" ) ; assert ( bo -> director_state == DIR_S_NULL ) ; return ( F_STP_ERROR ) ; } assert ( bo -> fetch_objcore -> boc -> state <= BOS_REQ_DONE ) ; if ( bo -> fetch_objcore -> boc -> state != BOS_REQ_DONE ) { bo -> req = NULL ; ObjSetState ( wrk , bo -> fetch_objcore , BOS_REQ_DONE ) ; } if ( bo -> do_esi ) bo -> do_stream = 0 ; if ( wrk -> handling == VCL_RET_PASS ) { bo -> fetch_objcore -> flags |= OC_F_HFP ; bo -> uncacheable = 1 ; wrk -> handling = VCL_RET_DELIVER ; } if ( bo -> do_pass || bo -> uncacheable ) bo -> fetch_objcore -> flags |= OC_F_PASS ; assert ( wrk -> handling == VCL_RET_DELIVER ) ; return ( bo -> was_304 ? F_STP_CONDFETCH : F_STP_FETCH ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void e1000e_intrmgr_resume ( E1000ECore * core ) { int i ; e1000e_intmgr_timer_resume ( & core -> radv ) ; e1000e_intmgr_timer_resume ( & core -> rdtr ) ; e1000e_intmgr_timer_resume ( & core -> raid ) ; e1000e_intmgr_timer_resume ( & core -> tidv ) ; e1000e_intmgr_timer_resume ( & core -> tadv ) ; e1000e_intmgr_timer_resume ( & core -> itr ) ; for ( i = 0 ; i < E1000E_MSIX_VEC_NUM ; i ++ ) { e1000e_intmgr_timer_resume ( & core -> eitr [ i ] ) ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
TEST_F ( NativeBackendLibsecretTest , SomeKeyringAttributesAreMissing ) { NativeBackendLibsecret backend ( 42 ) ; VerifiedAdd ( & backend , form_google_ ) ; EXPECT_EQ ( 1u , global_mock_libsecret_items -> size ( ) ) ; ( * global_mock_libsecret_items ) [ 0 ] -> RemoveAttribute ( "avatar_url" ) ; ( * global_mock_libsecret_items ) [ 0 ] -> RemoveAttribute ( "times_used" ) ; ScopedVector < autofill : : PasswordForm > form_list ; EXPECT_TRUE ( backend . GetAutofillableLogins ( & form_list ) ) ; EXPECT_EQ ( 1u , form_list . size ( ) ) ; EXPECT_EQ ( GURL ( "" ) , form_list [ 0 ] -> icon_url ) ; EXPECT_EQ ( 0 , form_list [ 0 ] -> times_used ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
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 ) SUBPIX_VAR ( 4 , 4 ) SUBPIX_AVG_VAR ( 4 , 4 ) VAR ( 4 , 8 ) SUBPIX_VAR ( 4 , 8 ) SUBPIX_AVG_VAR ( 4 , 8 ) VAR ( 8 , 4 ) SUBPIX_VAR ( 8 , 4 ) SUBPIX_AVG_VAR ( 8 , 4 ) VAR ( 8 , 8 ) SUBPIX_VAR ( 8 , 8 ) SUBPIX_AVG_VAR ( 8 , 8 )
0False
Categorize the following code snippet as vulnerable or not. True or False
TEST_F ( TemplateURLTest , SearchboxVersionIncludedForAnswers ) { TemplateURLData data ; search_terms_data_ . set_google_base_url ( "http://bar/" ) ; data . SetURL ( "http://bar/search?q={ searchTerms} &{ google:searchVersion} xssi=t" ) ; TemplateURL url ( data ) ; TemplateURLRef : : SearchTermsArgs search_terms_args ( ASCIIToUTF16 ( "foo" ) ) ; std : : string result = url . url_ref ( ) . ReplaceSearchTerms ( search_terms_args , search_terms_data_ ) ; EXPECT_EQ ( "http://bar/search?q=foo&gs_rn=42&xssi=t" , result ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int mi_collect_stats_nonulls_next ( HA_KEYSEG * keyseg , ulonglong * notnull , uchar * prev_key , uchar * last_key ) { uint diffs [ 2 ] ; uint first_null_seg , kp ; HA_KEYSEG * seg ; ha_key_cmp ( keyseg , prev_key , last_key , USE_WHOLE_KEY , SEARCH_FIND | SEARCH_NULL_ARE_NOT_EQUAL , diffs ) ; seg = keyseg + diffs [ 0 ] - 1 ; first_null_seg = ( uint ) ( ha_find_null ( seg , last_key + diffs [ 1 ] ) - keyseg ) ; for ( kp = 0 ; kp < first_null_seg ; kp ++ ) notnull [ kp ] ++ ; return diffs [ 0 ] ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void SRP_user_pwd_set_gN ( SRP_user_pwd * vinfo , const BIGNUM * g , const BIGNUM * N ) { vinfo -> N = N ; vinfo -> g = g ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_h245_T_h223_lc_segmentableFlag ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) { # line 356 "../../asn1/h245/h245.cnf" gboolean value ; offset = dissect_per_boolean ( tvb , offset , actx , tree , hf_index , & value ) ; if ( h223_lc_params_temp ) h223_lc_params_temp -> segmentable = value ; return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static uint32_t pmac_ide_readl ( void * opaque , hwaddr addr ) { uint32_t retval ; MACIOIDEState * d = opaque ; addr = ( addr & 0xFFF ) >> 4 ; if ( addr == 0 ) { retval = ide_data_readl ( & d -> bus , 0 ) ; } else { retval = 0xFFFFFFFF ; } retval = bswap32 ( retval ) ; return retval ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int evhttp_connection_incoming_fail ( struct evhttp_request * req , enum evhttp_connection_error error ) { switch ( error ) { case EVCON_HTTP_TIMEOUT : case EVCON_HTTP_EOF : return ( - 1 ) ; case EVCON_HTTP_INVALID_HEADER : default : if ( req -> uri ) { free ( req -> uri ) ; req -> uri = NULL ; } ( * req -> cb ) ( req , req -> cb_arg ) ; } return ( 0 ) ; }
1True
Categorize the following code snippet as vulnerable or not. True or False
static bool expression_returns_set_rows_walker ( Node * node , double * count ) { if ( node == NULL ) return false ; if ( IsA ( node , FuncExpr ) ) { FuncExpr * expr = ( FuncExpr * ) node ; if ( expr -> funcretset ) * count *= get_func_rows ( expr -> funcid ) ; } if ( IsA ( node , OpExpr ) ) { OpExpr * expr = ( OpExpr * ) node ; if ( expr -> opretset ) { set_opfuncid ( expr ) ; * count *= get_func_rows ( expr -> opfuncid ) ; } } if ( IsA ( node , Aggref ) ) return false ; if ( IsA ( node , WindowFunc ) ) return false ; if ( IsA ( node , DistinctExpr ) ) return false ; if ( IsA ( node , NullIfExpr ) ) return false ; if ( IsA ( node , ScalarArrayOpExpr ) ) return false ; if ( IsA ( node , BoolExpr ) ) return false ; if ( IsA ( node , SubLink ) ) return false ; if ( IsA ( node , SubPlan ) ) return false ; if ( IsA ( node , AlternativeSubPlan ) ) return false ; if ( IsA ( node , ArrayExpr ) ) return false ; if ( IsA ( node , RowExpr ) ) return false ; if ( IsA ( node , RowCompareExpr ) ) return false ; if ( IsA ( node , CoalesceExpr ) ) return false ; if ( IsA ( node , MinMaxExpr ) ) return false ; if ( IsA ( node , XmlExpr ) ) return false ; return expression_tree_walker ( node , expression_returns_set_rows_walker , ( void * ) count ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static inline int unreference_pic ( H264Context * h , Picture * pic , int refmask ) { int i ; if ( pic -> reference &= refmask ) { return 0 ; } else { for ( i = 0 ; h -> delayed_pic [ i ] ; i ++ ) if ( pic == h -> delayed_pic [ i ] ) { pic -> reference = DELAYED_PIC_REF ; break ; } return 1 ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_h245_SET_SIZE_1_15_OF_MultiplexTableEntryNumber ( 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_15_OF_MultiplexTableEntryNumber , SET_SIZE_1_15_OF_MultiplexTableEntryNumber_set_of , 1 , 15 , FALSE ) ; return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
void WriteDataChunksForTocEntry ( ArchiveHandle * AH , TocEntry * te ) { StartDataPtr startPtr ; EndDataPtr endPtr ; AH -> currToc = te ; if ( strcmp ( te -> desc , "BLOBS" ) == 0 ) { startPtr = AH -> StartBlobsPtr ; endPtr = AH -> EndBlobsPtr ; } else { startPtr = AH -> StartDataPtr ; endPtr = AH -> EndDataPtr ; } if ( startPtr != NULL ) ( * startPtr ) ( AH , te ) ; ( * te -> dataDumper ) ( ( Archive * ) AH , te -> dataDumperArg ) ; if ( endPtr != NULL ) ( * endPtr ) ( AH , te ) ; AH -> currToc = NULL ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void idct8 ( const int16_t * input , int16_t * output ) { int16_t step1 [ 8 ] , step2 [ 8 ] ; int temp1 , temp2 ; step1 [ 0 ] = input [ 0 ] ; step1 [ 2 ] = input [ 4 ] ; step1 [ 1 ] = input [ 2 ] ; step1 [ 3 ] = input [ 6 ] ; temp1 = input [ 1 ] * cospi_28_64 - input [ 7 ] * cospi_4_64 ; temp2 = input [ 1 ] * cospi_4_64 + input [ 7 ] * cospi_28_64 ; step1 [ 4 ] = dct_const_round_shift ( temp1 ) ; step1 [ 7 ] = dct_const_round_shift ( temp2 ) ; temp1 = input [ 5 ] * cospi_12_64 - input [ 3 ] * cospi_20_64 ; temp2 = input [ 5 ] * cospi_20_64 + input [ 3 ] * cospi_12_64 ; step1 [ 5 ] = dct_const_round_shift ( temp1 ) ; step1 [ 6 ] = dct_const_round_shift ( temp2 ) ; idct4 ( step1 , step1 ) ; step2 [ 4 ] = step1 [ 4 ] + step1 [ 5 ] ; step2 [ 5 ] = step1 [ 4 ] - step1 [ 5 ] ; step2 [ 6 ] = - step1 [ 6 ] + step1 [ 7 ] ; step2 [ 7 ] = step1 [ 6 ] + step1 [ 7 ] ; step1 [ 4 ] = step2 [ 4 ] ; temp1 = ( step2 [ 6 ] - step2 [ 5 ] ) * cospi_16_64 ; temp2 = ( step2 [ 5 ] + step2 [ 6 ] ) * cospi_16_64 ; step1 [ 5 ] = dct_const_round_shift ( temp1 ) ; step1 [ 6 ] = dct_const_round_shift ( temp2 ) ; step1 [ 7 ] = step2 [ 7 ] ; output [ 0 ] = step1 [ 0 ] + step1 [ 7 ] ; output [ 1 ] = step1 [ 1 ] + step1 [ 6 ] ; output [ 2 ] = step1 [ 2 ] + step1 [ 5 ] ; output [ 3 ] = step1 [ 3 ] + step1 [ 4 ] ; output [ 4 ] = step1 [ 3 ] - step1 [ 4 ] ; output [ 5 ] = step1 [ 2 ] - step1 [ 5 ] ; output [ 6 ] = step1 [ 1 ] - step1 [ 6 ] ; output [ 7 ] = step1 [ 0 ] - step1 [ 7 ] ; }
1True
Categorize the following code snippet as vulnerable or not. True or False
static void vc1_mc_1mv ( VC1Context * v , int dir ) { MpegEncContext * s = & v -> s ; DSPContext * dsp = & v -> s . dsp ; H264ChromaContext * h264chroma = & v -> h264chroma ; uint8_t * srcY , * srcU , * srcV ; int dxy , mx , my , uvmx , uvmy , src_x , src_y , uvsrc_x , uvsrc_y ; int off , off_uv ; int v_edge_pos = s -> v_edge_pos >> v -> field_mode ; if ( ( ! v -> field_mode || ( v -> ref_field_type [ dir ] == 1 && v -> cur_field_type == 1 ) ) && ! v -> s . last_picture . f . data [ 0 ] ) return ; mx = s -> mv [ dir ] [ 0 ] [ 0 ] ; my = s -> mv [ dir ] [ 0 ] [ 1 ] ; if ( s -> pict_type == AV_PICTURE_TYPE_P ) { s -> current_picture . f . motion_val [ 1 ] [ s -> block_index [ 0 ] + v -> blocks_off ] [ 0 ] = mx ; s -> current_picture . f . motion_val [ 1 ] [ s -> block_index [ 0 ] + v -> blocks_off ] [ 1 ] = my ; } uvmx = ( mx + ( ( mx & 3 ) == 3 ) ) >> 1 ; uvmy = ( my + ( ( my & 3 ) == 3 ) ) >> 1 ; v -> luma_mv [ s -> mb_x ] [ 0 ] = uvmx ; v -> luma_mv [ s -> mb_x ] [ 1 ] = uvmy ; if ( v -> field_mode && v -> cur_field_type != v -> ref_field_type [ dir ] ) { my = my - 2 + 4 * v -> cur_field_type ; uvmy = uvmy - 2 + 4 * v -> cur_field_type ; } if ( v -> fastuvmc && ( v -> fcm != ILACE_FRAME ) ) { uvmx = uvmx + ( ( uvmx < 0 ) ? ( uvmx & 1 ) : - ( uvmx & 1 ) ) ; uvmy = uvmy + ( ( uvmy < 0 ) ? ( uvmy & 1 ) : - ( uvmy & 1 ) ) ; } if ( v -> field_mode ) { if ( ! dir ) { if ( ( v -> cur_field_type != v -> ref_field_type [ dir ] ) && v -> cur_field_type ) { srcY = s -> current_picture . f . data [ 0 ] ; srcU = s -> current_picture . f . data [ 1 ] ; srcV = s -> current_picture . f . data [ 2 ] ; } else { srcY = s -> last_picture . f . data [ 0 ] ; srcU = s -> last_picture . f . data [ 1 ] ; srcV = s -> last_picture . f . data [ 2 ] ; } } else { srcY = s -> next_picture . f . data [ 0 ] ; srcU = s -> next_picture . f . data [ 1 ] ; srcV = s -> next_picture . f . data [ 2 ] ; } } else { if ( ! dir ) { srcY = s -> last_picture . f . data [ 0 ] ; srcU = s -> last_picture . f . data [ 1 ] ; srcV = s -> last_picture . f . data [ 2 ] ; } else { srcY = s -> next_picture . f . data [ 0 ] ; srcU = s -> next_picture . f . data [ 1 ] ; srcV = s -> next_picture . f . data [ 2 ] ; } } src_x = s -> mb_x * 16 + ( mx >> 2 ) ; src_y = s -> mb_y * 16 + ( my >> 2 ) ; uvsrc_x = s -> mb_x * 8 + ( uvmx >> 2 ) ; uvsrc_y = s -> mb_y * 8 + ( uvmy >> 2 ) ; if ( v -> profile != PROFILE_ADVANCED ) { src_x = av_clip ( src_x , - 16 , s -> mb_width * 16 ) ; src_y = av_clip ( src_y , - 16 , s -> mb_height * 16 ) ; uvsrc_x = av_clip ( uvsrc_x , - 8 , s -> mb_width * 8 ) ; uvsrc_y = av_clip ( uvsrc_y , - 8 , s -> mb_height * 8 ) ; } else { src_x = av_clip ( src_x , - 17 , s -> avctx -> coded_width ) ; src_y = av_clip ( src_y , - 18 , s -> avctx -> coded_height + 1 ) ; uvsrc_x = av_clip ( uvsrc_x , - 8 , s -> avctx -> coded_width >> 1 ) ; uvsrc_y = av_clip ( uvsrc_y , - 8 , s -> avctx -> coded_height >> 1 ) ; } srcY += src_y * s -> linesize + src_x ; srcU += uvsrc_y * s -> uvlinesize + uvsrc_x ; srcV += uvsrc_y * s -> uvlinesize + uvsrc_x ; if ( v -> field_mode && v -> ref_field_type [ dir ] ) { srcY += s -> current_picture_ptr -> f . linesize [ 0 ] ; srcU += s -> current_picture_ptr -> f . linesize [ 1 ] ; srcV += s -> current_picture_ptr -> f . linesize [ 2 ] ; } if ( s -> flags & CODEC_FLAG_GRAY ) { srcU = s -> edge_emu_buffer + 18 * s -> linesize ; srcV = s -> edge_emu_buffer + 18 * s -> linesize ; } if ( v -> rangeredfrm || ( v -> mv_mode == MV_PMODE_INTENSITY_COMP ) || s -> h_edge_pos < 22 || v_edge_pos < 22 || ( unsigned ) ( src_x - s -> mspel ) > s -> h_edge_pos - ( mx & 3 ) - 16 - s -> mspel * 3 || ( unsigned ) ( src_y - 1 ) > v_edge_pos - ( my & 3 ) - 16 - 3 ) { uint8_t * uvbuf = s -> edge_emu_buffer + 19 * s -> linesize ; srcY -= s -> mspel * ( 1 + s -> linesize ) ; s -> vdsp . emulated_edge_mc ( s -> edge_emu_buffer , srcY , s -> linesize , 17 + s -> mspel * 2 , 17 + s -> mspel * 2 , src_x - s -> mspel , src_y - s -> mspel , s -> h_edge_pos , v_edge_pos ) ; srcY = s -> edge_emu_buffer ; s -> vdsp . emulated_edge_mc ( uvbuf , srcU , s -> uvlinesize , 8 + 1 , 8 + 1 , uvsrc_x , uvsrc_y , s -> h_edge_pos >> 1 , v_edge_pos >> 1 ) ; s -> vdsp . emulated_edge_mc ( uvbuf + 16 , srcV , s -> uvlinesize , 8 + 1 , 8 + 1 , uvsrc_x , uvsrc_y , s -> h_edge_pos >> 1 , v_edge_pos >> 1 ) ; srcU = uvbuf ; srcV = uvbuf + 16 ; if ( v -> rangeredfrm ) { int i , j ; uint8_t * src , * src2 ; src = srcY ; for ( j = 0 ; j < 17 + s -> mspel * 2 ; j ++ ) { for ( i = 0 ; i < 17 + s -> mspel * 2 ; i ++ ) src [ i ] = ( ( src [ i ] - 128 ) >> 1 ) + 128 ; src += s -> linesize ; } src = srcU ; src2 = srcV ; for ( j = 0 ; j < 9 ; j ++ ) { for ( i = 0 ; i < 9 ; i ++ ) { src [ i ] = ( ( src [ i ] - 128 ) >> 1 ) + 128 ; src2 [ i ] = ( ( src2 [ i ] - 128 ) >> 1 ) + 128 ; } src += s -> uvlinesize ; src2 += s -> uvlinesize ; } } if ( v -> mv_mode == MV_PMODE_INTENSITY_COMP ) { int i , j ; uint8_t * src , * src2 ; src = srcY ; for ( j = 0 ; j < 17 + s -> mspel * 2 ; j ++ ) { for ( i = 0 ; i < 17 + s -> mspel * 2 ; i ++ ) src [ i ] = v -> luty [ src [ i ] ] ; src += s -> linesize ; } src = srcU ; src2 = srcV ; for ( j = 0 ; j < 9 ; j ++ ) { for ( i = 0 ; i < 9 ; i ++ ) { src [ i ] = v -> lutuv [ src [ i ] ] ; src2 [ i ] = v -> lutuv [ src2 [ i ] ] ; } src += s -> uvlinesize ; src2 += s -> uvlinesize ; } } srcY += s -> mspel * ( 1 + s -> linesize ) ; } if ( v -> field_mode && v -> cur_field_type ) { off = s -> current_picture_ptr -> f . linesize [ 0 ] ; off_uv = s -> current_picture_ptr -> f . linesize [ 1 ] ; } else { off = 0 ; off_uv = 0 ; } if ( s -> mspel ) { dxy = ( ( my & 3 ) << 2 ) | ( mx & 3 ) ; v -> vc1dsp . put_vc1_mspel_pixels_tab [ dxy ] ( s -> dest [ 0 ] + off , srcY , s -> linesize , v -> rnd ) ; v -> vc1dsp . put_vc1_mspel_pixels_tab [ dxy ] ( s -> dest [ 0 ] + off + 8 , srcY + 8 , s -> linesize , v -> rnd ) ; srcY += s -> linesize * 8 ; v -> vc1dsp . put_vc1_mspel_pixels_tab [ dxy ] ( s -> dest [ 0 ] + off + 8 * s -> linesize , srcY , s -> linesize , v -> rnd ) ; v -> vc1dsp . put_vc1_mspel_pixels_tab [ dxy ] ( s -> dest [ 0 ] + off + 8 * s -> linesize + 8 , srcY + 8 , s -> linesize , v -> rnd ) ; } else { dxy = ( my & 2 ) | ( ( mx & 2 ) >> 1 ) ; if ( ! v -> rnd ) dsp -> put_pixels_tab [ 0 ] [ dxy ] ( s -> dest [ 0 ] + off , srcY , s -> linesize , 16 ) ; else dsp -> put_no_rnd_pixels_tab [ 0 ] [ dxy ] ( s -> dest [ 0 ] + off , srcY , s -> linesize , 16 ) ; } if ( s -> flags & CODEC_FLAG_GRAY ) return ; uvmx = ( uvmx & 3 ) << 1 ; uvmy = ( uvmy & 3 ) << 1 ; if ( ! v -> rnd ) { h264chroma -> put_h264_chroma_pixels_tab [ 0 ] ( s -> dest [ 1 ] + off_uv , srcU , s -> uvlinesize , 8 , uvmx , uvmy ) ; h264chroma -> put_h264_chroma_pixels_tab [ 0 ] ( s -> dest [ 2 ] + off_uv , srcV , s -> uvlinesize , 8 , uvmx , uvmy ) ; } else { v -> vc1dsp . put_no_rnd_vc1_chroma_pixels_tab [ 0 ] ( s -> dest [ 1 ] + off_uv , srcU , s -> uvlinesize , 8 , uvmx , uvmy ) ; v -> vc1dsp . put_no_rnd_vc1_chroma_pixels_tab [ 0 ] ( s -> dest [ 2 ] + off_uv , srcV , s -> uvlinesize , 8 , uvmx , uvmy ) ; } }
1True
Categorize the following code snippet as vulnerable or not. True or False
static const char * comp_http_hdr ( HTTPHdr * h1 , HTTPHdr * h2 ) { int h1_len , h2_len ; int p_index , p_dumpoffset , rval ; char * h1_pbuf , * h2_pbuf ; h1_len = h1 -> length_get ( ) ; h2_len = h2 -> length_get ( ) ; if ( h1_len != h2_len ) { return "length mismatch" ; } h1_pbuf = ( char * ) ats_malloc ( h1_len + 1 ) ; h2_pbuf = ( char * ) ats_malloc ( h2_len + 1 ) ; p_index = p_dumpoffset = 0 ; rval = h1 -> print ( h1_pbuf , h1_len , & p_index , & p_dumpoffset ) ; if ( rval != 1 ) { ats_free ( h1_pbuf ) ; ats_free ( h2_pbuf ) ; return "hdr print failed" ; } p_index = p_dumpoffset = 0 ; rval = h2 -> print ( h2_pbuf , h2_len , & p_index , & p_dumpoffset ) ; if ( rval != 1 ) { ats_free ( h1_pbuf ) ; ats_free ( h2_pbuf ) ; return "hdr print failed" ; } rval = memcmp ( h1_pbuf , h2_pbuf , h1_len ) ; ats_free ( h1_pbuf ) ; ats_free ( h2_pbuf ) ; if ( rval != 0 ) { return "compare failed" ; } else { return nullptr ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void do_list_files_write_file_command ( struct st_command * command , my_bool append ) { int error ; static DYNAMIC_STRING ds_content ; static DYNAMIC_STRING ds_filename ; static DYNAMIC_STRING ds_dirname ; static DYNAMIC_STRING ds_wild ; const struct command_arg list_files_args [ ] = { { "filename" , ARG_STRING , TRUE , & ds_filename , "Filename for write" } , { "dirname" , ARG_STRING , TRUE , & ds_dirname , "Directory to list" } , { "file" , ARG_STRING , FALSE , & ds_wild , "Filename (incl. wildcard)" } } ; DBUG_ENTER ( "do_list_files_write_file" ) ; command -> used_replace = 1 ; check_command_args ( command , command -> first_argument , list_files_args , sizeof ( list_files_args ) / sizeof ( struct command_arg ) , ' ' ) ; init_dynamic_string ( & ds_content , "" , 1024 , 1024 ) ; error = get_list_files ( & ds_content , & ds_dirname , & ds_wild ) ; handle_command_error ( command , error , my_errno ) ; str_to_file2 ( ds_filename . str , ds_content . str , ds_content . length , append ) ; dynstr_free ( & ds_content ) ; dynstr_free ( & ds_filename ) ; dynstr_free ( & ds_dirname ) ; dynstr_free ( & ds_wild ) ; DBUG_VOID_RETURN ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void strip_parentheses ( struct st_command * command ) { if ( strip_surrounding ( command -> first_argument , '(' , ')' ) ) die ( "%.*s - argument list started with '%c' must be ended with '%c'" , command -> first_word_len , command -> query , '(' , ')' ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int pxa2xx_rtc_init ( SysBusDevice * dev ) { PXA2xxRTCState * s = FROM_SYSBUS ( PXA2xxRTCState , dev ) ; struct tm tm ; int wom ; s -> rttr = 0x7fff ; s -> rtsr = 0 ; qemu_get_timedate ( & tm , 0 ) ; wom = ( ( tm . tm_mday - 1 ) / 7 ) + 1 ; s -> last_rcnr = ( uint32_t ) mktimegm ( & tm ) ; s -> last_rdcr = ( wom << 20 ) | ( ( tm . tm_wday + 1 ) << 17 ) | ( tm . tm_hour << 12 ) | ( tm . tm_min << 6 ) | tm . tm_sec ; s -> last_rycr = ( ( tm . tm_year + 1900 ) << 9 ) | ( ( tm . tm_mon + 1 ) << 5 ) | tm . tm_mday ; s -> last_swcr = ( tm . tm_hour << 19 ) | ( tm . tm_min << 13 ) | ( tm . tm_sec << 7 ) ; s -> last_rtcpicr = 0 ; s -> last_hz = s -> last_sw = s -> last_pi = qemu_get_clock_ms ( rtc_clock ) ; s -> rtc_hz = qemu_new_timer_ms ( rtc_clock , pxa2xx_rtc_hz_tick , s ) ; s -> rtc_rdal1 = qemu_new_timer_ms ( rtc_clock , pxa2xx_rtc_rdal1_tick , s ) ; s -> rtc_rdal2 = qemu_new_timer_ms ( rtc_clock , pxa2xx_rtc_rdal2_tick , s ) ; s -> rtc_swal1 = qemu_new_timer_ms ( rtc_clock , pxa2xx_rtc_swal1_tick , s ) ; s -> rtc_swal2 = qemu_new_timer_ms ( rtc_clock , pxa2xx_rtc_swal2_tick , s ) ; s -> rtc_pi = qemu_new_timer_ms ( rtc_clock , pxa2xx_rtc_pi_tick , s ) ; sysbus_init_irq ( dev , & s -> rtc_irq ) ; memory_region_init_io ( & s -> iomem , OBJECT ( s ) , & pxa2xx_rtc_ops , s , "pxa2xx-rtc" , 0x10000 ) ; sysbus_init_mmio ( dev , & s -> iomem ) ; return 0 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_h245_RequestMultiplexEntry ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) { offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h245_RequestMultiplexEntry , RequestMultiplexEntry_sequence ) ; return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
protocol_t * find_protocol_by_id ( const int proto_id ) { header_field_info * hfinfo ; if ( proto_id < 0 ) return NULL ; PROTO_REGISTRAR_GET_NTH ( proto_id , hfinfo ) ; DISSECTOR_ASSERT_FIELD_TYPE ( hfinfo , FT_PROTOCOL ) ; return ( protocol_t * ) hfinfo -> strings ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
SPL_METHOD ( SplFileObject , current ) { spl_filesystem_object * intern = ( spl_filesystem_object * ) zend_object_store_get_object ( getThis ( ) TSRMLS_CC ) ; if ( zend_parse_parameters_none ( ) == FAILURE ) { return ; } if ( ! intern -> u . file . current_line && ! intern -> u . file . current_zval ) { spl_filesystem_file_read_line ( getThis ( ) , intern , 1 TSRMLS_CC ) ; } if ( intern -> u . file . current_line && ( ! SPL_HAS_FLAG ( intern -> flags , SPL_FILE_OBJECT_READ_CSV ) || ! intern -> u . file . current_zval ) ) { RETURN_STRINGL ( intern -> u . file . current_line , intern -> u . file . current_line_len , 1 ) ; } else if ( intern -> u . file . current_zval ) { RETURN_ZVAL ( intern -> u . file . current_zval , 1 , 0 ) ; } RETURN_FALSE ; }
1True
Categorize the following code snippet as vulnerable or not. True or False
static void pk_transaction_authorize_actions_finished_cb ( GObject * source_object , GAsyncResult * res , struct AuthorizeActionsData * data ) { const gchar * action_id = NULL ; PkTransactionPrivate * priv = data -> transaction -> priv ; g_autoptr ( GError ) error = NULL ; g_autoptr ( PolkitAuthorizationResult ) result = NULL ; g_assert ( data -> actions && data -> actions -> len > 0 ) ; action_id = g_ptr_array_index ( data -> actions , 0 ) ; result = polkit_authority_check_authorization_finish ( priv -> authority , res , & error ) ; if ( g_cancellable_is_cancelled ( priv -> cancellable ) ) { priv -> waiting_for_auth = FALSE ; pk_transaction_status_changed_emit ( data -> transaction , PK_STATUS_ENUM_FINISHED ) ; pk_transaction_error_code_emit ( data -> transaction , PK_ERROR_ENUM_NOT_AUTHORIZED , "The authentication was cancelled due to a timeout." ) ; pk_transaction_finished_emit ( data -> transaction , PK_EXIT_ENUM_FAILED , 0 ) ; goto out ; } if ( result == NULL ) { g_autofree gchar * message = NULL ; priv -> waiting_for_auth = FALSE ; g_warning ( "failed to check for auth: %s" , error -> message ) ; pk_transaction_status_changed_emit ( data -> transaction , PK_STATUS_ENUM_FINISHED ) ; message = g_strdup_printf ( "Failed to check for authentication: %s" , error -> message ) ; pk_transaction_error_code_emit ( data -> transaction , PK_ERROR_ENUM_NOT_AUTHORIZED , message ) ; pk_transaction_finished_emit ( data -> transaction , PK_EXIT_ENUM_FAILED , 0 ) ; goto out ; } if ( ! polkit_authorization_result_get_is_authorized ( result ) ) { priv -> waiting_for_auth = FALSE ; pk_transaction_status_changed_emit ( data -> transaction , PK_STATUS_ENUM_FINISHED ) ; pk_transaction_error_code_emit ( data -> transaction , PK_ERROR_ENUM_NOT_AUTHORIZED , "Failed to obtain authentication." ) ; pk_transaction_finished_emit ( data -> transaction , PK_EXIT_ENUM_FAILED , 0 ) ; syslog ( LOG_AUTH | LOG_NOTICE , "uid %i failed to obtain auth" , priv -> uid ) ; goto out ; } if ( data -> actions -> len <= 1 ) { priv -> waiting_for_auth = FALSE ; pk_transaction_set_state ( data -> transaction , PK_TRANSACTION_STATE_READY ) ; syslog ( LOG_AUTH | LOG_INFO , "uid %i obtained auth for %s" , priv -> uid , action_id ) ; } else { g_ptr_array_remove_index ( data -> actions , 0 ) ; pk_transaction_authorize_actions ( data -> transaction , data -> role , data -> actions ) ; } out : g_ptr_array_unref ( data -> actions ) ; g_free ( data ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int __tipc_nl_compat_dumpit ( struct tipc_nl_compat_cmd_dump * cmd , struct tipc_nl_compat_msg * msg , struct sk_buff * arg ) { int len = 0 ; int err ; struct sk_buff * buf ; struct nlmsghdr * nlmsg ; struct netlink_callback cb ; memset ( & cb , 0 , sizeof ( cb ) ) ; cb . nlh = ( struct nlmsghdr * ) arg -> data ; cb . skb = arg ; buf = nlmsg_new ( NLMSG_GOODSIZE , GFP_KERNEL ) ; if ( ! buf ) return - ENOMEM ; buf -> sk = msg -> dst_sk ; do { int rem ; len = ( * cmd -> dumpit ) ( buf , & cb ) ; nlmsg_for_each_msg ( nlmsg , nlmsg_hdr ( buf ) , len , rem ) { struct nlattr * * attrs ; err = tipc_nlmsg_parse ( nlmsg , & attrs ) ; if ( err ) goto err_out ; err = ( * cmd -> format ) ( msg , attrs ) ; if ( err ) goto err_out ; if ( tipc_skb_tailroom ( msg -> rep ) <= 1 ) { err = - EMSGSIZE ; goto err_out ; } } skb_reset_tail_pointer ( buf ) ; buf -> len = 0 ; } while ( len ) ; err = 0 ; err_out : kfree_skb ( buf ) ; if ( err == - EMSGSIZE ) { if ( ( TIPC_SKB_MAX - msg -> rep -> len ) <= 1 ) { char * tail = skb_tail_pointer ( msg -> rep ) ; if ( * tail != '\0' ) sprintf ( tail - sizeof ( REPLY_TRUNCATED ) - 1 , REPLY_TRUNCATED ) ; } return 0 ; } return err ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void matroska_fix_ass_packet ( MatroskaDemuxContext * matroska , AVPacket * pkt , uint64_t display_duration ) { AVBufferRef * line ; char * layer , * ptr = pkt -> data , * end = ptr + pkt -> size ; for ( ; * ptr != ',' && ptr < end - 1 ; ptr ++ ) ; if ( * ptr == ',' ) layer = ++ ptr ; for ( ; * ptr != ',' && ptr < end - 1 ; ptr ++ ) ; if ( * ptr == ',' ) { int64_t end_pts = pkt -> pts + display_duration ; int sc = matroska -> time_scale * pkt -> pts / 10000000 ; int ec = matroska -> time_scale * end_pts / 10000000 ; int sh , sm , ss , eh , em , es , len ; sh = sc / 360000 ; sc -= 360000 * sh ; sm = sc / 6000 ; sc -= 6000 * sm ; ss = sc / 100 ; sc -= 100 * ss ; eh = ec / 360000 ; ec -= 360000 * eh ; em = ec / 6000 ; ec -= 6000 * em ; es = ec / 100 ; ec -= 100 * es ; * ptr ++ = '\0' ; len = 50 + end - ptr + FF_INPUT_BUFFER_PADDING_SIZE ; if ( ! ( line = av_buffer_alloc ( len ) ) ) return ; snprintf ( line -> data , len , "Dialogue: %s,%d:%02d:%02d.%02d,%d:%02d:%02d.%02d,%s\r\n" , layer , sh , sm , ss , sc , eh , em , es , ec , ptr ) ; av_buffer_unref ( & pkt -> buf ) ; pkt -> buf = line ; pkt -> data = line -> data ; pkt -> size = strlen ( line -> data ) ; } }
0False