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 void progress ( int c ) {
if ( progress_cb ) progress_cb ( progress_cb_data , c ) ;
else fputc ( c , stderr ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
unsigned long # endif # undef mul # undef mul_add # define mul_add ( r , a , word , carry ) do {
\ register BN_ULONG high , low ;
\ asm ( "mulq %3" \ : "=a" ( low ) , "=d" ( high ) \ : "a" ( word ) , "m" ( a ) \ : "cc" ) ;
\ asm ( "addq %2,%0;
adcq %3,%1" \ : "+r" ( carry ) , "+d" ( high ) \ : "a" ( low ) , "g" ( 0 ) \ : "cc" ) ;
\ asm ( "addq %2,%0;
adcq %3,%1" \ : "+m" ( r ) , "+d" ( high ) \ : "r" ( carry ) , "g" ( 0 ) \ : "cc" ) ;
\ carry = high ;
\ }
while ( 0 ) # define mul ( r , a , word , carry ) do {
\ register BN_ULONG high , low ;
\ asm ( "mulq %3" \ : "=a" ( low ) , "=d" ( high ) \ : "a" ( word ) , "g" ( a ) \ : "cc" ) ;
\ asm ( "addq %2,%0;
adcq %3,%1" \ : "+r" ( carry ) , "+d" ( high ) \ : "a" ( low ) , "g" ( 0 ) \ : "cc" ) ;
\ ( r ) = carry , carry = high ;
\ }
while ( 0 ) # undef sqr # define sqr ( r0 , r1 , a ) \ asm ( "mulq %2" \ : "=a" ( r0 ) , "=d" ( r1 ) \ : "a" ( a ) \ : "cc" ) ;
BN_ULONG bn_mul_add_words ( BN_ULONG * rp , const BN_ULONG * ap , int num , BN_ULONG w ) {
BN_ULONG c1 = 0 ;
if ( num <= 0 ) return ( c1 ) ;
while ( num & ~ 3 ) {
mul_add ( rp [ 0 ] , ap [ 0 ] , w , c1 ) ;
mul_add ( rp [ 1 ] , ap [ 1 ] , w , c1 ) ;
mul_add ( rp [ 2 ] , ap [ 2 ] , w , c1 ) ;
mul_add ( rp [ 3 ] , ap [ 3 ] , w , c1 ) ;
ap += 4 ;
rp += 4 ;
num -= 4 ;
}
if ( num ) {
mul_add ( rp [ 0 ] , ap [ 0 ] , w , c1 ) ;
if ( -- num == 0 ) return c1 ;
mul_add ( rp [ 1 ] , ap [ 1 ] , w , c1 ) ;
if ( -- num == 0 ) return c1 ;
mul_add ( rp [ 2 ] , ap [ 2 ] , w , c1 ) ;
return c1 ;
}
return ( c1 ) ;
}
BN_ULONG bn_mul_words ( BN_ULONG * rp , const BN_ULONG * ap , int num , BN_ULONG w ) {
BN_ULONG c1 = 0 ;
if ( num <= 0 ) return ( c1 ) ;
while ( num & ~ 3 ) {
mul ( rp [ 0 ] , ap [ 0 ] , w , c1 ) ;
mul ( rp [ 1 ] , ap [ 1 ] , w , c1 ) ;
mul ( rp [ 2 ] , ap [ 2 ] , w , c1 ) ;
mul ( rp [ 3 ] , ap [ 3 ] , w , c1 ) ;
ap += 4 ;
rp += 4 ;
num -= 4 ;
}
if ( num ) {
mul ( rp [ 0 ] , ap [ 0 ] , w , c1 ) ;
if ( -- num == 0 ) return c1 ;
mul ( rp [ 1 ] , ap [ 1 ] , w , c1 ) ;
if ( -- num == 0 ) return c1 ;
mul ( rp [ 2 ] , ap [ 2 ] , w , c1 ) ;
}
return ( c1 ) ;
}
void bn_sqr_words ( BN_ULONG * r , const BN_ULONG * a , int n ) {
if ( n <= 0 ) return ;
while ( n & ~ 3 ) {
sqr ( r [ 0 ] , r [ 1 ] , a [ 0 ] ) ;
sqr ( r [ 2 ] , r [ 3 ] , a [ 1 ] ) ;
sqr ( r [ 4 ] , r [ 5 ] , a [ 2 ] ) ;
sqr ( r [ 6 ] , r [ 7 ] , a [ 3 ] ) ;
a += 4 ;
r += 8 ;
n -= 4 ;
}
if ( n ) {
sqr ( r [ 0 ] , r [ 1 ] , a [ 0 ] ) ;
if ( -- n == 0 ) return ;
sqr ( r [ 2 ] , r [ 3 ] , a [ 1 ] ) ;
if ( -- n == 0 ) return ;
sqr ( r [ 4 ] , r [ 5 ] , a [ 2 ] ) ;
}
}
BN_ULONG bn_div_words ( BN_ULONG h , BN_ULONG l , BN_ULONG d ) {
BN_ULONG ret , waste ;
asm ( "divq %4" : "=a" ( ret ) , "=d" ( waste ) : "a" ( l ) , "d" ( h ) , "g" ( d ) : "cc" ) ;
return ret ;
}
BN_ULONG bn_add_words ( BN_ULONG * rp , const BN_ULONG * ap , const BN_ULONG * bp , int n ) {
BN_ULONG ret ;
size_t i = 0 ;
if ( n <= 0 ) return 0 ;
asm volatile ( " subq %0,%0 \n" " jmp 1f \n" ".p2align 4 \n" "1: movq (%4,%2,8),%0 \n" " adcq (%5,%2,8),%0 \n" " movq %0,(%3,%2,8) \n" " lea 1(%2),%2 \n" " loop 1b \n" " sbbq %0,%0 \n" : "=&r" ( ret ) , "+c" ( n ) , "+r" ( i ) : "r" ( rp ) , "r" ( ap ) , "r" ( bp ) : "cc" , "memory" ) ;
return ret & 1 ;
}
# ifndef SIMICS BN_ULONG bn_sub_words ( BN_ULONG * rp , const BN_ULONG * ap , const BN_ULONG * bp , int n ) {
BN_ULONG ret ;
size_t i = 0 ;
if ( n <= 0 ) return 0 ;
asm volatile ( " subq %0,%0 \n" " jmp 1f \n" ".p2align 4 \n" "1: movq (%4,%2,8),%0 \n" " sbbq (%5,%2,8),%0 \n" " movq %0,(%3,%2,8) \n" " lea 1(%2),%2 \n" " loop 1b \n" " sbbq %0,%0 \n" : "=&r" ( ret ) , "+c" ( n ) , "+r" ( i ) : "r" ( rp ) , "r" ( ap ) , "r" ( bp ) : "cc" , "memory" ) ;
return ret & 1 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void proto_register_gsm_a_dtap ( void ) {
guint i ;
guint last_offset ;
static hf_register_info hf [ ] = {
{
& hf_gsm_a_seq_no , {
"Sequence number" , "gsm_a.dtap.seq_no" , FT_UINT8 , BASE_DEC , NULL , 0xc0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_msg_gcc_type , {
"DTAP Group Call Control Message Type" , "gsm_a.dtap.msg_gcc_type" , FT_UINT8 , BASE_HEX , VALS ( gsm_a_dtap_msg_gcc_strings ) , 0x3f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_msg_bcc_type , {
"DTAP Broadcast Call Control Message Type" , "gsm_a.dtap.msg_bcc_type" , FT_UINT8 , BASE_HEX , VALS ( gsm_a_dtap_msg_bcc_strings ) , 0x3f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_msg_mm_type , {
"DTAP Mobility Management Message Type" , "gsm_a.dtap.msg_mm_type" , FT_UINT8 , BASE_HEX , VALS ( gsm_a_dtap_msg_mm_strings ) , 0x3f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_msg_cc_type , {
"DTAP Call Control Message Type" , "gsm_a.dtap.msg_cc_type" , FT_UINT8 , BASE_HEX , VALS ( gsm_a_dtap_msg_cc_strings ) , 0x3f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_msg_sms_type , {
"DTAP Short Message Service Message Type" , "gsm_a.dtap.msg_sms_type" , FT_UINT8 , BASE_HEX , VALS ( gsm_a_dtap_msg_sms_strings ) , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_msg_ss_type , {
"DTAP Non call Supplementary Service Message Type" , "gsm_a.dtap.msg_ss_type" , FT_UINT8 , BASE_HEX , VALS ( gsm_a_dtap_msg_ss_strings ) , 0x3f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_msg_tp_type , {
"DTAP Tests Procedures Message Type" , "gsm_a.dtap.msg_tp_type" , FT_UINT8 , BASE_HEX , VALS ( gsm_a_dtap_msg_tp_strings ) , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_elem_id , {
"Element ID" , "gsm_a.dtap.elem_id" , FT_UINT8 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_cld_party_bcd_num , {
"Called Party BCD Number" , "gsm_a.dtap.cld_party_bcd_num" , FT_STRING , BASE_NONE , 0 , 0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_clg_party_bcd_num , {
"Calling Party BCD Number" , "gsm_a.dtap.clg_party_bcd_num" , FT_STRING , BASE_NONE , 0 , 0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_conn_num , {
"Connected Number" , "gsm_a.dtap.conn_num" , FT_STRING , BASE_NONE , 0 , 0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_red_party_bcd_num , {
"Redirecting Party BCD Number" , "gsm_a.dtap.red_party_bcd_num" , FT_STRING , BASE_NONE , 0 , 0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_cause , {
"DTAP Cause" , "gsm_a.dtap.cause" , FT_UINT8 , BASE_HEX , 0 , 0x7f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_type_of_number , {
"Type of number" , "gsm_a.dtap.type_of_number" , FT_UINT8 , BASE_HEX , VALS ( gsm_a_dtap_type_of_number_values ) , 0x70 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_numbering_plan_id , {
"Numbering plan identification" , "gsm_a.dtap.numbering_plan_id" , FT_UINT8 , BASE_HEX , VALS ( gsm_a_dtap_numbering_plan_id_values ) , 0x0f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_present_ind , {
"Presentation indicator" , "gsm_a.dtap.present_ind" , FT_UINT8 , BASE_HEX , VALS ( gsm_a_dtap_present_ind_values ) , 0x60 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_screening_ind , {
"Screening indicator" , "gsm_a.dtap.screening_ind" , FT_UINT8 , BASE_HEX , VALS ( gsm_a_dtap_screening_ind_values ) , 0x03 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_type_of_sub_addr , {
"Type of subaddress" , "gsm_a.dtap.type_of_sub_addr" , FT_UINT8 , BASE_HEX , VALS ( gsm_a_dtap_type_of_sub_addr_values ) , 0x70 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_odd_even_ind , {
"Odd/even indicator" , "gsm_a.dtap.odd_even_ind" , FT_UINT8 , BASE_HEX , VALS ( gsm_a_dtap_odd_even_ind_values ) , 0x08 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_lsa_id , {
"LSA Identifier" , "gsm_a.dtap.lsa_id" , FT_UINT24 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_speech_vers_ind , {
"Speech version indication" , "gsm_a.dtap.speech_vers_ind" , FT_UINT8 , BASE_HEX , VALS ( gsm_a_dtap_speech_vers_ind_values ) , 0x0f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_itc , {
"Information transfer capability" , "gsm_a.dtap.itc" , FT_UINT8 , BASE_HEX , VALS ( gsm_a_dtap_itc_values ) , 0x07 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_sysid , {
"System Identification (SysID)" , "gsm_a.dtap.sysid" , FT_UINT8 , BASE_HEX , VALS ( gsm_a_dtap_sysid_values ) , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_bitmap_length , {
"Bitmap Length" , "gsm_a.dtap.bitmap_length" , FT_UINT8 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_serv_cat_b7 , {
"Automatically initiated eCall" , "gsm_a.dtap.serv_cat_b7" , FT_BOOLEAN , 8 , NULL , 0x40 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_serv_cat_b6 , {
"Manually initiated eCall" , "gsm_a.dtap.serv_cat_b6" , FT_BOOLEAN , 8 , NULL , 0x20 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_serv_cat_b5 , {
"Mountain Rescue" , "gsm_a.dtap.serv_cat_b5" , FT_BOOLEAN , 8 , NULL , 0x10 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_serv_cat_b4 , {
"Marine Guard" , "gsm_a.dtap.serv_cat_b4" , FT_BOOLEAN , 8 , NULL , 0x08 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_serv_cat_b3 , {
"Fire Brigade" , "gsm_a.dtap.serv_cat_b3" , FT_BOOLEAN , 8 , NULL , 0x04 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_serv_cat_b2 , {
"Ambulance" , "gsm_a.dtap.serv_cat_b2" , FT_BOOLEAN , 8 , NULL , 0x02 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_serv_cat_b1 , {
"Police" , "gsm_a.dtap.serv_cat_b1" , FT_BOOLEAN , 8 , NULL , 0x01 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_csmo , {
"CSMO" , "gsm_a.dtap.csmo" , FT_BOOLEAN , BASE_NONE , TFS ( & gsm_a_dtap_csmo_value ) , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_csmt , {
"CSMT" , "gsm_a.dtap.csmt" , FT_BOOLEAN , BASE_NONE , TFS ( & gsm_a_dtap_csmt_value ) , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_mm_timer_unit , {
"Unit" , "gsm_a.dtap.mm_timer_unit" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_mm_timer_unit_vals ) , 0xe0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_mm_timer_value , {
"Timer value" , "gsm_a.dtap.mm_timer_value" , FT_UINT8 , BASE_DEC , NULL , 0x1f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_alerting_pattern , {
"Alerting Pattern" , "gsm_a.dtap.alerting_pattern" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_alerting_pattern_vals ) , 0x0f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_ccbs_activation , {
"CCBS Activation" , "gsm_a.dtap.ccbs_activation" , FT_BOOLEAN , 8 , TFS ( & gsm_a_ccbs_activation_value ) , 0x80 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_stream_identifier , {
"Stream Identifier" , "gsm_a.dtap.stream_identifier" , FT_UINT8 , BASE_HEX , 0 , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_mcs , {
"MCS" , "gsm_a.dtap.mcs" , FT_BOOLEAN , 8 , TFS ( & gsm_a_mcs_value ) , 0x01 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_cause_of_no_cli , {
"Cause of no CLI" , "gsm_a.dtap.cause_of_no_cli" , FT_UINT8 , BASE_HEX , 0 , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_cause_ss_diagnostics , {
"Supplementary Services Diagnostics" , "gsm_a.dtap.cause_ss_diagnostics" , FT_UINT8 , BASE_HEX , VALS ( gsm_a_dtap_cause_ss_diagnostics_vals ) , 0x7f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_codec_tdma_efr , {
"TDMA EFR" , "gsm_a.dtap.codec.tdma_efr" , FT_BOOLEAN , 8 , NULL , 0x80 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_codec_umts_amr_2 , {
"UMTS AMR 2" , "gsm_a.dtap.codec.umts_amr_2" , FT_BOOLEAN , 8 , NULL , 0x40 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_codec_umts_amr , {
"UMTS AMR" , "gsm_a.dtap.codec.umts_amr" , FT_BOOLEAN , 8 , NULL , 0x20 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_codec_hr_amr , {
"HR AMR" , "gsm_a.dtap.codec.hr_amr" , FT_BOOLEAN , 8 , NULL , 0x10 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_codec_fr_amr , {
"FR AMR" , "gsm_a.dtap.codec.fr_amr" , FT_BOOLEAN , 8 , NULL , 0x08 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_codec_gsm_efr , {
"GSM EFR" , "gsm_a.dtap.codec.gsm_efr" , FT_BOOLEAN , 8 , NULL , 0x04 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_codec_gsm_hr , {
"GSM HR" , "gsm_a.dtap.codec.gsm_hr" , FT_BOOLEAN , 8 , NULL , 0x02 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_codec_gsm_fr , {
"GSM FR" , "gsm_a.dtap.codec.gsm_fr" , FT_BOOLEAN , 8 , NULL , 0x01 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_codec_ohr_amr_wb , {
"OHR AMR-WB" , "gsm_a.dtap.codec.ohr_amr_wb" , FT_BOOLEAN , 8 , NULL , 0x20 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_codec_ofr_amr_wb , {
"OFR AMR-WB" , "gsm_a.dtap.codec.ofr_amr_wb" , FT_BOOLEAN , 8 , NULL , 0x10 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_codec_ohr_amr , {
"OHR AMR" , "gsm_a.dtap.codec.ohr_amr" , FT_BOOLEAN , 8 , NULL , 0x08 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_codec_umts_amr_wb , {
"UMTS AMR-WB" , "gsm_a.dtap.codec.umts_amr_wb" , FT_BOOLEAN , 8 , NULL , 0x04 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_codec_fr_amr_wb , {
"FR AMR-WB" , "gsm_a.dtap.codec.fr_amr_wb" , FT_BOOLEAN , 8 , NULL , 0x02 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_codec_pdc_efr , {
"PDC EFR" , "gsm_a.dtap.codec.pdc_efr" , FT_BOOLEAN , 8 , NULL , 0x01 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_notification_description , {
"Notification description" , "gsm_a.dtap.notif_descr" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_notification_description_vals ) , 0x7f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_emerg_num_info_length , {
"Emergency Number Info length" , "gsm_a.dtap.emerg_num_info_length" , FT_UINT8 , BASE_DEC , 0 , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_emergency_bcd_num , {
"Emergency BCD Number" , "gsm_a.dtap.emergency_bcd_num" , FT_STRING , BASE_NONE , 0 , 0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_signal_value , {
"Signal value" , "gsm_a.dtap.signal_value" , FT_UINT8 , BASE_HEX , VALS ( gsm_a_dtap_signal_value_vals ) , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_recall_type , {
"Recall type" , "gsm_a.dtap.recall_type" , FT_UINT8 , BASE_HEX | BASE_RANGE_STRING , RVALS ( gsm_a_dtap_recall_type_vals ) , 0x07 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_coding_standard , {
"Coding standard" , "gsm_a.dtap.coding_standard" , FT_UINT8 , BASE_HEX , VALS ( gsm_a_dtap_coding_standard_vals ) , 0xc0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_call_state , {
"Call state" , "gsm_a.dtap.call_state" , FT_UINT8 , BASE_DEC , NULL , 0x3f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_prog_coding_standard , {
"Coding standard" , "gsm_a.dtap.coding_standard" , FT_UINT8 , BASE_HEX , VALS ( gsm_a_dtap_coding_standard_vals ) , 0x60 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_location , {
"Location" , "gsm_a.dtap.location" , FT_UINT8 , BASE_HEX , VALS ( gsm_a_dtap_location_vals ) , 0x0f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_progress_description , {
"Progress description" , "gsm_a.dtap.progress_description" , FT_UINT8 , BASE_DEC , NULL , 0x7f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_afi , {
"Authority and Format Identifier" , "gsm_a.dtap.afi" , FT_UINT8 , BASE_HEX | BASE_EXT_STRING , & x213_afi_value_ext , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_rej_cause , {
"Reject cause" , "gsm_a.dtap.rej_cause" , FT_UINT8 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_timezone , {
"Timezone" , "gsm_a.dtap.timezone" , FT_UINT8 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_u2u_prot_discr , {
"User-user protocol discriminator" , "gsm_a.dtap.u2u_prot_discr" , FT_UINT8 , BASE_HEX | BASE_RANGE_STRING , RVALS ( gsm_a_dtap_u2u_prot_discr_vals ) , 0x00 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_mcat , {
"MCAT" , "gsm_a.dtap.mcat" , FT_BOOLEAN , 8 , TFS ( & gsm_a_dtap_mcat_value ) , 0x08 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_enicm , {
"ENICM" , "gsm_a.dtap.mcat" , FT_BOOLEAN , 8 , TFS ( & gsm_a_dtap_enicm_value ) , 0x04 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_rand , {
"RAND value" , "gsm_a.dtap.rand" , FT_BYTES , FT_NONE , NULL , 0x00 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_autn , {
"AUTN value" , "gsm_a.dtap.autn" , FT_BYTES , FT_NONE , NULL , 0x00 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_sres , {
"SRES value" , "gsm_a.dtap.sres" , FT_BYTES , FT_NONE , NULL , 0x00 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_xres , {
"XRES value" , "gsm_a.dtap.xres" , FT_BYTES , FT_NONE , NULL , 0x00 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_auts , {
"AUTS value" , "gsm_a.dtap.auts" , FT_BYTES , FT_NONE , NULL , 0x00 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_autn_sqn_xor_ak , {
"SQN xor AK" , "gsm_a.dtap.autn.sqn_xor_ak" , FT_BYTES , FT_NONE , NULL , 0x00 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_autn_amf , {
"AMF" , "gsm_a.dtap.autn.amf" , FT_BYTES , FT_NONE , NULL , 0x00 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_autn_mac , {
"MAC" , "gsm_a.dtap.autn.mac" , FT_BYTES , FT_NONE , NULL , 0x00 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_auts_sqn_ms_xor_ak , {
"SQN_MS xor AK" , "gsm_a.dtap.auts.sqn_ms_xor_ak" , FT_BYTES , FT_NONE , NULL , 0x00 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_auts_mac_s , {
"MAC-S" , "gsm_a.dtap.auts.mac_s" , FT_BYTES , FT_NONE , NULL , 0x00 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_epc_ue_tl_mode , {
"UE test loop mode" , "gsm_a.dtap.epc.ue_tl_mode" , FT_UINT8 , BASE_DEC , VALS ( epc_ue_test_loop_mode_vals ) , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_epc_ue_tl_a_ul_sdu_size , {
"Uplink PDCP SDU size in bits" , "gsm_a.dtap.epc.ue_tl_a_ul_sdu_size" , FT_UINT16 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_epc_ue_tl_a_drb , {
"Data Radio Bearer identity number" , "gsm_a.dtap.epc.ue_tl_a_drb" , FT_UINT8 , BASE_DEC , NULL , 0x1f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_epc_ue_tl_b_ip_pdu_delay , {
"IP PDU delay in seconds" , "gsm_a.dtap.epc.ue_tl_b_ip_pdu_delay" , FT_UINT8 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_epc_ue_tl_c_mbsfn_area_id , {
"MBSFN area identity" , "gsm_a.dtap.epc.ue_tl_c_mbsfn_area_id" , FT_UINT8 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_epc_ue_tl_c_mch_id , {
"MCH identity" , "gsm_a.dtap.epc.ue_tl_c_mch_id" , FT_UINT8 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_epc_ue_tl_c_lcid , {
"Logical channel identity" , "gsm_a.dtap.epc.ue_tl_c_lcid" , FT_UINT8 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_epc_ue_positioning_technology , {
"UE positioning technology" , "gsm_a.dtap.epc.ue_positioning_technology" , FT_UINT8 , BASE_DEC , VALS ( epc_ue_positioning_technology_vals ) , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_epc_mbms_packet_counter_value , {
"MBMS packet counter value" , "gsm_a.dtap.epc.mbms_packet_counter_value" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_epc_latitude_sign , {
"Latitude Sign" , "gsm_a.dtap.epc.latitude_sign" , FT_BOOLEAN , BASE_NONE , TFS ( & epc_latitude_sign_value ) , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_epc_degrees_latitude , {
"Degrees Latitude" , "gsm_a.dtap.epc.degrees_latitude" , FT_UINT24 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_epc_degrees_longitude , {
"Degrees Longitude" , "gsm_a.dtap.epc.degrees_longitude" , FT_INT24 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_epc_altitude_dir , {
"Altitude Direction" , "gsm_a.dtap.epc.altitude_direction" , FT_BOOLEAN , BASE_NONE , TFS ( & epc_altitude_dir_value ) , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_epc_altitude , {
"Altitude" , "gsm_a.dtap.epc.altitude" , FT_UINT16 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_epc_bearing , {
"Bearing" , "gsm_a.dtap.epc.bearing" , FT_UINT16 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_epc_horizontal_speed , {
"Horizontal Speed" , "gsm_a.dtap.epc.horizontal_speed" , FT_UINT16 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_epc_gnss_tod_msec , {
"GNSS-TOD-msec" , "gsm_a.dtap.epc.gnss_tod_msec" , FT_UINT24 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_gcc_call_ref , {
"Call Reference" , "gsm_a.dtap.gcc.call_ref" , FT_UINT32 , BASE_DEC , NULL , 0xffffffe0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_gcc_call_ref_has_priority , {
"Call Reference includes priority" , "gsm_a.dtap.gcc.call_ref_has_priority" , FT_BOOLEAN , 32 , NULL , 0x00000010 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_gcc_call_priority , {
"Call Priority" , "gsm_a.dtap.gcc.call_priority" , FT_UINT32 , BASE_DEC , VALS ( gcc_call_ref_priority ) , 0x0000000e , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_gcc_call_state , {
"Call state" , "gsm_a.dtap.gcc.call_state" , FT_UINT24 , BASE_DEC , VALS ( gcc_call_state_vals ) , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_gcc_cause_structure , {
"Cause structure" , "gsm_a.dtap.gcc.cause_structure" , FT_BOOLEAN , 8 , TFS ( & gcc_cause_structure_val ) , 0x80 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_gcc_cause , {
"Cause" , "gsm_a.dtap.gcc.cause" , FT_UINT8 , BASE_DEC | BASE_RANGE_STRING , RVALS ( gcc_cause_vals ) , 0x7f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_gcc_orig_ind , {
"Originator indication" , "gsm_a.dtap.gcc.orig_ind" , FT_BOOLEAN , 8 , TFS ( & gcc_orig_ind_vals ) , 0x01 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_gcc_state_attr , {
"State attributes" , "gsm_a.dtap.gcc.state_attr" , FT_UINT8 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_gcc_state_attr_da , {
"DA" , "gsm_a.dtap.gcc.state_attr_da" , FT_BOOLEAN , 8 , TFS ( & gcc_state_attr_da ) , 0x08 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_gcc_state_attr_ua , {
"UA" , "gsm_a.dtap.gcc.state_attr_ua" , FT_BOOLEAN , 8 , TFS ( & gcc_state_attr_ua ) , 0x04 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_gcc_state_attr_comm , {
"COMM" , "gsm_a.dtap.gcc.state_attr_comm" , FT_BOOLEAN , 8 , TFS ( & gcc_state_attr_comm ) , 0x02 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_gcc_state_attr_oi , {
"OI" , "gsm_a.dtap.gcc.state_attr_oi" , FT_BOOLEAN , 8 , TFS ( & gcc_state_attr_oi ) , 0x01 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_gcc_spare_1 , {
"Spare_1 (This field shall be ignored)" , "gsm_a.dtap.gcc.spare_1" , FT_UINT32 , BASE_DEC , NULL , 0x00000001 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_gcc_spare_3 , {
"Spare_3 (This field shall be ignored)" , "gsm_a.dtap.gcc.spare_3" , FT_UINT8 , BASE_DEC , NULL , 0x0e , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_gcc_spare_4 , {
"Spare_4 (This field shall be ignored)" , "gsm_a.dtap.gcc.spare_4" , FT_UINT32 , BASE_DEC , NULL , 0x00000010 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_bcc_call_ref , {
"Call Reference" , "gsm_a.dtap.bcc.call_ref" , FT_UINT32 , BASE_DEC , NULL , 0xffffffe0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_bcc_call_ref_has_priority , {
"Call Reference includes priority" , "gsm_a.dtap.bcc.call_ref_has_priority" , FT_BOOLEAN , 32 , NULL , 0x00000010 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_bcc_call_priority , {
"Call Priority" , "gsm_a.dtap.bcc.call_priority" , FT_UINT32 , BASE_DEC , VALS ( bcc_call_ref_priority ) , 0x0000000e , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_bcc_call_state , {
"Call state" , "gsm_a.dtap.bcc.call_state" , FT_UINT24 , BASE_DEC | BASE_RANGE_STRING , RVALS ( bcc_call_state_vals ) , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_bcc_cause_structure , {
"Cause structure" , "gsm_a.dtap.bcc.cause_structure" , FT_BOOLEAN , 8 , TFS ( & bcc_cause_structure_val ) , 0x80 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_bcc_cause , {
"Cause" , "gsm_a.dtap.bcc.cause" , FT_UINT8 , BASE_DEC | BASE_RANGE_STRING , RVALS ( bcc_cause_vals ) , 0x7f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_bcc_orig_ind , {
"Originator indication" , "gsm_a.dtap.bcc.orig_ind" , FT_BOOLEAN , 8 , TFS ( & bcc_orig_ind_vals ) , 0x01 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_bcc_state_attr , {
"State attributes" , "gsm_a.dtap.bcc.state_attr" , FT_UINT8 , BASE_HEX , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_bcc_state_attr_da , {
"DA" , "gsm_a.dtap.bcc.state_attr_da" , FT_BOOLEAN , 8 , TFS ( & bcc_state_attr_da ) , 0x08 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_bcc_state_attr_ua , {
"UA" , "gsm_a.dtap.bcc.state_attr_ua" , FT_BOOLEAN , 8 , TFS ( & bcc_state_attr_ua ) , 0x04 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_bcc_state_attr_comm , {
"COMM" , "gsm_a.dtap.bcc.state_attr_comm" , FT_BOOLEAN , 8 , TFS ( & bcc_state_attr_comm ) , 0x02 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_bcc_state_attr_oi , {
"OI" , "gsm_a.dtap.bcc.state_attr_oi" , FT_BOOLEAN , 8 , TFS ( & bcc_state_attr_oi ) , 0x01 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_bcc_compr_otdi , {
"Compressed otdi" , "gsm_a.dtap.bcc.compr_otdi" , FT_BYTES , BASE_NONE , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_bcc_spare_1 , {
"Spare_1 (This field shall be ignored)" , "gsm_a.dtap.bcc.spare_1" , FT_UINT32 , BASE_DEC , NULL , 0x00000001 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_bcc_spare_3 , {
"Spare_3 (This field shall be ignored)" , "gsm_a.dtap.bcc.spare_3" , FT_UINT8 , BASE_DEC , NULL , 0x0e , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_bcc_spare_4 , {
"Spare_4 (This field shall be ignored)" , "gsm_a.dtap.bcc.spare_4" , FT_UINT32 , BASE_DEC , NULL , 0x00000010 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_coding_scheme , {
"Coding Scheme" , "gsm_a.dtap.coding_scheme" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_coding_scheme_vals ) , 0x70 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_add_ci , {
"Add CI" , "gsm_a.dtap.add_ci" , FT_BOOLEAN , 8 , TFS ( & tfs_add_ci ) , 0x08 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_number_of_spare_bits , {
"Number of spare bits in last octet" , "gsm_a.dtap.number_of_spare_bits" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_number_of_spare_bits_vals ) , 0x07 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_text_string , {
"Text String" , "gsm_a.dtap.text_string" , FT_STRING , STR_UNICODE , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_time_zone_time , {
"Time" , "gsm_a.dtap.time_zone_time" , FT_ABSOLUTE_TIME , ABSOLUTE_TIME_UTC , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_dst_adjustment , {
"DST Adjustment" , "gsm_a.dtap.dst_adjustment" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_dst_adjustment_vals ) , 0x03 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_emergency_number_information , {
"Emergency Number Information" , "gsm_a.dtap.emergency_number_information" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_mm_timer , {
"MM Timer" , "gsm_a.dtap.mm_timer" , FT_UINT8 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_hold_auxiliary_state , {
"Hold auxiliary state" , "gsm_a.dtap.hold_auxiliary_state" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_hold_auxilary_state_vals ) , 0x0C , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_multi_party_auxiliary_state , {
"Multi party auxiliary state" , "gsm_a.dtap.multi_party_auxiliary_state" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_multi_party_auxilary_state_vals ) , 0x03 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_radio_channel_requirement , {
"Radio channel requirement" , "gsm_a.dtap.radio_channel_requirement" , FT_UINT8 , BASE_DEC , NULL , 0x60 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_bearer_cap_coding_standard , {
"Coding standard" , "gsm_a.dtap.cap_coding_standard" , FT_BOOLEAN , 8 , TFS ( & tfs_bearer_cap_coding_standard ) , 0x10 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_transfer_mode , {
"Transfer mode" , "gsm_a.dtap.transfer_mode" , FT_BOOLEAN , 8 , TFS ( & tfs_bearer_cap_transfer_mode ) , 0x08 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_coding , {
"Coding" , "gsm_a.dtap.coding" , FT_BOOLEAN , 8 , TFS ( & tfs_bearer_cap_coding ) , 0x40 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_compression , {
"Compression" , "gsm_a.dtap.compression" , FT_BOOLEAN , 8 , TFS ( & tfs_possible_not_possible ) , 0x40 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_compression_up , {
"Compression" , "gsm_a.dtap.compression" , FT_BOOLEAN , 8 , TFS ( & tfs_allowed_not_allowed ) , 0x40 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_structure , {
"Structure" , "gsm_a.dtap.structure" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_structure_vals ) , 0x30 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_duplex_mode , {
"Duplex mode" , "gsm_a.dtap.duplex_mode" , FT_BOOLEAN , 8 , TFS ( & tfs_full_half ) , 0x08 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_subaddress , {
"Subaddress" , "gsm_a.dtap.subaddress" , FT_STRING , BASE_NONE , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_subaddress_information , {
"Subaddress information" , "gsm_a.dtap.subaddress_information" , FT_BYTES , BASE_NONE , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_message_elements , {
"Message Elements" , "gsm_a.dtap.message_elements" , FT_BYTES , BASE_NONE , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_rpdu , {
"RPDU" , "gsm_a.dtap.rpdu" , FT_BYTES , BASE_NONE , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_configuration , {
"Configuration" , "gsm_a.dtap.configuration" , FT_BOOLEAN , 8 , TFS ( & tfs_bearer_cap_configuration ) , 0x04 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_nirr , {
"NIRR" , "gsm_a.dtap.nirr" , FT_BOOLEAN , 8 , TFS ( & tfs_nirr ) , 0x02 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_establishment , {
"Establishment" , "gsm_a.dtap.establishment" , FT_BOOLEAN , 8 , TFS ( & tfs_bearer_cap_establishment ) , 0x01 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_access_identity , {
"Access Identity" , "gsm_a.dtap.access_identity" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_access_identity_vals ) , 0x60 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_rate_adaption , {
"Rate Adaption" , "gsm_a.dtap.rate_adaption" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_rate_adaption_vals ) , 0x18 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_signalling_access_protocol , {
"Signalling Access Protocol" , "gsm_a.dtap.signalling_access_protocol" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_signal_access_protocol_vals ) , 0x07 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_other_itc , {
"Other ITC" , "gsm_a.dtap.other_itc" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_other_itc_vals ) , 0x60 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_other_rate_adaption , {
"Other Rate Adaption" , "gsm_a.dtap.other_rate_adaption" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_other_rate_adaption_vals ) , 0x18 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_rate_adaption_header , {
"Rate Adaption Header" , "gsm_a.dtap.rate_adaption_header" , FT_BOOLEAN , 8 , TFS ( & tfs_included_not_included ) , 0x40 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_multiple_frame_establishment_support , {
"Multiple frame establishment support in data link" , "gsm_a.dtap.multiple_frame_establishment_support" , FT_BOOLEAN , 8 , TFS ( & tfs_frame_est_supported_not_supported ) , 0x20 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_mode_of_operation , {
"Mode of operation" , "gsm_a.dtap.mode_of_operation" , FT_BOOLEAN , 8 , TFS ( & tfs_protocol_sensative_bit_transparent ) , 0x10 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_logical_link_identifier_negotiation , {
"Logical link identifier negotiation" , "gsm_a.dtap.logical_link_identifier_negotiation" , FT_BOOLEAN , 8 , TFS ( & tfs_log_link_neg ) , 0x08 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_assignor_assignee , {
"Assignor/Assignee" , "gsm_a.dtap.assignor_assignee" , FT_BOOLEAN , 8 , TFS ( & tfs_assignor_assignee ) , 0x04 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_in_out_band , {
"In band/Out of band negotiation" , "gsm_a.dtap.in_out_band" , FT_BOOLEAN , 8 , TFS ( & tfs_in_out_band ) , 0x02 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_layer_1_identity , {
"Layer 1 Identity" , "gsm_a.dtap.layer_1_identity" , FT_UINT8 , BASE_DEC , NULL , 0x60 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_user_information_layer_1_protocol , {
"User information layer 1 protocol" , "gsm_a.dtap.user_information_layer_1_protocol" , FT_UINT8 , BASE_DEC , NULL , 0x1e , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_synchronous , {
"Synchronous/asynchronous" , "gsm_a.dtap.synchronous" , FT_BOOLEAN , 8 , TFS ( & tfs_asynchronous_synchronous ) , 0x01 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_number_of_stop_bits , {
"Number of Stop Bits" , "gsm_a.dtap.number_of_stop_bits" , FT_BOOLEAN , 8 , TFS ( & tfs_stop_bits ) , 0x40 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_negotiation , {
"Negotiation" , "gsm_a.dtap.negotiation" , FT_BOOLEAN , 8 , TFS ( & tfs_negotiation ) , 0x20 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_number_of_data_bits , {
"Number of data bits excluding parity bit if present" , "gsm_a.dtap.number_of_data_bits" , FT_BOOLEAN , 8 , TFS ( & tfs_parity_bits ) , 0x10 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_user_rate , {
"User rate" , "gsm_a.dtap.user_rate" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_user_rate_vals ) , 0x0F , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_v110_x30_rate_adaptation , {
"V.110/X.30 rate adaptation Intermediate rate" , "gsm_a.dtap.v110_x30_rate_adaptation" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_v110_x30_rate_adaptation_vals ) , 0x60 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_nic_on_tx , {
"Network independent clock (NIC) on transmission (Tx)" , "gsm_a.dtap.nic_on_tx" , FT_BOOLEAN , 8 , TFS ( & tfs_nic_on_tx ) , 0x10 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_nic_on_rx , {
"Network independent clock (NIC) on reception (Rx)" , "gsm_a.dtap.nic_on_rx" , FT_BOOLEAN , 8 , TFS ( & tfs_nic_on_rx ) , 0x08 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_parity_information , {
"Parity information" , "gsm_a.dtap.parity_information" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_parity_info_vals ) , 0x07 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_connection_element , {
"Connection element" , "gsm_a.dtap.connection_element" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_connection_element_vals ) , 0x60 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_modem_type , {
"Modem type" , "gsm_a.dtap.modem_type" , FT_UINT8 , BASE_DEC , NULL , 0x1f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_other_modem_type , {
"Other modem type" , "gsm_a.dtap.other_modem_type" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_other_modem_type_vals ) , 0x60 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_fixed_network_user_rate , {
"Fixed network user rate" , "gsm_a.dtap.fixed_network_user_rate" , FT_UINT8 , BASE_DEC , NULL , 0x1f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_acceptable_channel_codings_TCH_F14_4 , {
"Acceptable channel codings (TCH/F14.4)" , "gsm_a.dtap.acceptable_channel_codings.TCH_F14_4" , FT_BOOLEAN , 8 , TFS ( & tfs_acceptable_not_acceptable ) , 0x40 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_acceptable_channel_codings_spare20 , {
"Acceptable channel codings (Spare)" , "gsm_a.dtap.acceptable_channel_codings.spare" , FT_BOOLEAN , 8 , NULL , 0x20 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_acceptable_channel_codings_TCH_F9_6 , {
"Acceptable channel codings (TCH/F9.6)" , "gsm_a.dtap.acceptable_channel_codings.TCH_F9_6" , FT_BOOLEAN , 8 , TFS ( & tfs_acceptable_not_acceptable ) , 0x10 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_acceptable_channel_codings_TCH_F4_8 , {
"Acceptable channel codings (TCH/F4.8)" , "gsm_a.dtap.acceptable_channel_codings.TCH_F4_8" , FT_BOOLEAN , 8 , TFS ( & tfs_acceptable_not_acceptable ) , 0x08 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_maximum_number_of_traffic_channels , {
"Maximum number of traffic channels" , "gsm_a.dtap.maximum_number_of_traffic_channels" , FT_UINT8 , BASE_DEC , NULL , 0x07 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_acceptable_channel_codings_spare78 , {
"Acceptable channel codings" , "gsm_a.dtap.acceptable_channel_codings" , FT_UINT8 , BASE_DEC , NULL , 0x78 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_uimi , {
"UIMI, User initiated modification indication" , "gsm_a.dtap.uimi" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_uimi_vals ) , 0x70 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_wanted_air_interface_user_rate , {
"Wanted air interface user rate" , "gsm_a.dtap.wanted_air_interface_user_rate" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_wanted_air_rate_vals ) , 0x0F , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_acceptable_channel_codings_ext_TCH_F28_8 , {
"Acceptable channel codings extended (TCH/F28.8)" , "gsm_a.dtap.acceptable_channel_codings_ext.TCH_F28_8" , FT_BOOLEAN , 8 , TFS ( & tfs_acceptable_not_acceptable ) , 0x40 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_acceptable_channel_codings_ext_TCH_F32_0 , {
"Acceptable channel codings extended (TCH/F32.0)" , "gsm_a.dtap.acceptable_channel_codings_ext.TCH_F32_0" , FT_BOOLEAN , 8 , TFS ( & tfs_acceptable_not_acceptable ) , 0x20 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_acceptable_channel_codings_ext_TCH_F43_2 , {
"Acceptable channel codings extended (TCH/F43.2)" , "gsm_a.dtap.acceptable_channel_codings_ext.TCH_F43_2" , FT_BOOLEAN , 8 , TFS ( & tfs_acceptable_not_acceptable ) , 0x10 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_channel_coding_asymmetry_indication , {
"Channel Coding Asymmetry Indication" , "gsm_a.dtap.channel_coding_asymmetry_indication" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_channel_coding_asymmetry_ind_vals ) , 0x0c , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_edge_channel_codings , {
"EDGE Channel Codings" , "gsm_a.dtap.edge_channel_codings" , FT_UINT8 , BASE_DEC , NULL , 0x7c , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_layer_2_identity , {
"Layer 2 Identity" , "gsm_a.dtap.layer_2_identity" , FT_UINT8 , BASE_DEC , NULL , 0x60 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_user_information_layer_2_protocol , {
"User information layer 2 protocol" , "gsm_a.dtap.user_information_layer_2_protocol" , FT_UINT8 , BASE_DEC , NULL , 0x1f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_maximum_number_of_supported_bearers , {
"Maximum number of supported bearers" , "gsm_a.dtap.maximum_number_of_supported_bearers" , FT_UINT8 , BASE_DEC , NULL , 0xf0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_pcp , {
"Prolonged Clearing Procedure" , "gsm_a.dtap.pcp" , FT_BOOLEAN , 8 , TFS ( & tfs_supported_not_supported ) , 0x02 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_dtmf , {
"DTMF" , "gsm_a.dtap.dtmf" , FT_BOOLEAN , 8 , TFS ( & gsm_a_dtap_dtmf_value ) , 0x01 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_max_num_of_speech_bearers , {
"Maximum number of speech bearers" , "gsm_a.dtap.max_num_of_speech_bearers" , FT_UINT8 , BASE_DEC , NULL , 0x0f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_de_cause_coding_standard , {
"Coding standard" , "gsm_a.dtap.coding_standard" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_de_cause_coding_standard_vals ) , 0x60 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_recommendation , {
"Recommendation" , "gsm_a.dtap.recommendation" , FT_UINT8 , BASE_DEC , NULL , 0x7f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_data , {
"Data" , "gsm_a.dtap.data" , FT_BYTES , BASE_NONE , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_keypad_information , {
"Keypad information" , "gsm_a.dtap.keypad_information" , FT_UINT8 , BASE_DEC , NULL , 0x7f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_repeat_indicator , {
"Repeat Indicator" , "gsm_a.dtap.repeat_indicator" , FT_UINT8 , BASE_DEC , NULL , 0x0f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_ss_version_indicator , {
"SS Version Indicator" , "gsm_a.dtap.ss_version_indicator" , FT_UINT8 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_cp_cause , {
"Cause" , "gsm_a.dtap.cp_cause" , FT_UINT8 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_test_loop , {
"Test Loop" , "gsm_a.dtap.test_loop" , FT_UINT8 , BASE_DEC , NULL , 0x3f , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_subchannel , {
"Subchannel" , "gsm_a.dtap.subchannel" , FT_BOOLEAN , 8 , TFS ( & tfs_gsm_a_dtap_subchannel ) , 0x01 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_ack_element , {
"Acknowledgment element" , "gsm_a.dtap.ack_element" , FT_UINT8 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_channel_coding03 , {
"Channel coding" , "gsm_a.dtap.channel_coding" , FT_UINT8 , BASE_DEC , VALS ( gsm_channel_coding_vals ) , 0x03 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_channel_coding30 , {
"Channel coding" , "gsm_a.dtap.channel_coding" , FT_UINT8 , BASE_DEC , VALS ( gsm_channel_coding_vals ) , 0x30 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_loop_mechanism0E , {
"Loop mechanism" , "gsm_a.dtap.loop_mechanism" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_loop_mech_vals ) , 0x0e , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_loop_mechanism1C , {
"Loop mechanism" , "gsm_a.dtap.loop_mechanism" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_loop_mech_vals ) , 0x1c , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_multislot_tch , {
"Multi-slot TCH loop" , "gsm_a.dtap.multislot_tch" , FT_BOOLEAN , 8 , TFS ( & tfs_multislot_tch ) , 0x01 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_tp_tested_device , {
"Tested device" , "gsm_a.dtap.tp_tested_device" , FT_UINT8 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_tp_pdu_description , {
"PDUs transmitted" , "gsm_a.dtap.tp_pdu_description" , FT_UINT16 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_mode_flag , {
"Mode flag" , "gsm_a.dtap.mode_flag" , FT_BOOLEAN , 8 , TFS ( & tfs_gsm_a_dtap_mode_flag ) , 0x01 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_egprs_mode_flag , {
"EGPRS Mode flag" , "gsm_a.dtap.egprs_mode_flag" , FT_BOOLEAN , 8 , TFS ( & tfs_gsm_a_dtap_egprs_mode_flag ) , 0x01 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_downlink_timeslot_offset , {
"Downlink Timeslot Offset" , "gsm_a.dtap.downlink_timeslot_offset" , FT_UINT8 , BASE_DEC , NULL , 0x0E , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_ms_positioning_technology , {
"MS positioning technology" , "gsm_a.dtap.ms_positioning_technology" , FT_UINT8 , BASE_DEC , VALS ( gsm_positioning_technology_vals ) , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_ue_test_loop_mode , {
"UE test loop mode" , "gsm_a.dtap.ue_test_loop_mode" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_ue_test_loop_mode_vals ) , 0x03 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_ue_positioning_technology , {
"UE positioning technology" , "gsm_a.dtap.ue_positioning_technology" , FT_UINT8 , BASE_DEC , VALS ( gsm_positioning_technology_vals ) , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_ciphering_key_sequence_number , {
"Ciphering Key Sequence Number" , "gsm_a.dtap.ciphering_key_sequence_number" , FT_UINT8 , BASE_DEC , NULL , 0x07 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_ciphering_key_sequence_number70 , {
"Ciphering Key Sequence Number" , "gsm_a.dtap.ciphering_key_sequence_number" , FT_UINT8 , BASE_DEC , NULL , 0x70 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_service_type , {
"Service Type" , "gsm_a.dtap.service_type" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_service_type_vals ) , 0x0F , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_type_of_identity , {
"Type of identity" , "gsm_a.dtap.type_of_identity" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_type_of_identity_vals ) , 0x07 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_follow_on_request , {
"Follow-On Request (FOR)" , "gsm_a.dtap.follow_on_request" , FT_BOOLEAN , 8 , TFS ( & tfs_follow_on_request_value ) , 0x08 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_updating_type , {
"Updating Type" , "gsm_a.dtap.updating_type" , FT_UINT8 , BASE_DEC , VALS ( gsm_a_dtap_updating_type_vals ) , 0x03 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_congestion_level , {
"Congestion level" , "gsm_a.dtap.congestion_level" , FT_UINT8 , BASE_DEC , NULL , 0x0F , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_protocol_discriminator , {
"Protocol Discriminator" , "gsm_a.dtap.protocol_discriminator" , FT_UINT8 , BASE_DEC , VALS ( protocol_discriminator_vals ) , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_ti_flag , {
"TI flag" , "gsm_a.dtap.ti_flag" , FT_BOOLEAN , 8 , TFS ( & tfs_allocated_by_receiver_sender ) , 0x80 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_tio , {
"TIO" , "gsm_a.dtap.tio" , FT_UINT8 , BASE_DEC , NULL , 0x70 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_tie , {
"TIE" , "gsm_a.dtap.tie" , FT_UINT8 , BASE_DEC , NULL , DTAP_TIE_MASK , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_timeslot_number , {
"Timeslot number" , "gsm_a_dtap.timeslot_number" , FT_UINT8 , BASE_DEC , NULL , 0xe0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_uplink_rlc_sdu_size , {
"Uplink RLC SDU size" , "gsm_a_dtap.uplink_rlc_sdu_size" , FT_UINT16 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_radio_bearer , {
"Radio Bearer" , "gsm_a_dtap.radio_bearer" , FT_UINT8 , BASE_DEC , NULL , 0x1F , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_mbms_short_transmission_identity , {
"MBMS short transmission identity" , "gsm_a_dtap.mbms_short_transmission_identity" , FT_UINT8 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_ue_received_rlc_sdu_counter_value , {
"UE received RLC SDU counter value" , "gsm_a_dtap.ue_received_rlc_sdu_counter_value" , FT_UINT8 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
}
, {
& hf_gsm_a_dtap_num_lb_entities , {
"Number of LB entities" , "gsm_a_dtap.num_lb_entities" , FT_UINT32 , BASE_DEC , NULL , 0x0 , NULL , HFILL }
}
, }
;
# define NUM_INDIVIDUAL_ELEMS 22 gint * ett [ NUM_INDIVIDUAL_ELEMS + NUM_GSM_DTAP_MSG_MM + NUM_GSM_DTAP_MSG_CC + NUM_GSM_DTAP_MSG_SMS + NUM_GSM_DTAP_MSG_SS + NUM_GSM_DTAP_MSG_TP + NUM_GSM_DTAP_ELEM ] ;
static ei_register_info ei [ ] = {
{
& ei_gsm_a_dtap_autn , {
"gsm_a.dtap.autn.invalid" , PI_MALFORMED , PI_WARN , "AUTN length not equal to 16" , EXPFILL }
}
, {
& ei_gsm_a_dtap_auts , {
"gsm_a.dtap.auts.invalid" , PI_MALFORMED , PI_WARN , "AUTS length not equal to 14" , EXPFILL }
}
, {
& ei_gsm_a_dtap_text_string_not_multiple_of_7 , {
"gsm_a.dtap.text_string_not_multiple_of_7" , PI_MALFORMED , PI_WARN , "Value leads to a Text String whose length is not a multiple of 7 bits" , EXPFILL }
}
, {
& ei_gsm_a_dtap_not_digit , {
"gsm_a.dtap.not_digit" , PI_MALFORMED , PI_WARN , "BCD number contains a value that is not a digit" , EXPFILL }
}
, {
& ei_gsm_a_dtap_end_mark_unexpected , {
"gsm_a.dtap.end_mark_unexpected" , PI_MALFORMED , PI_WARN , "\'f\' end mark present in unexpected position" , EXPFILL }
}
, {
& ei_gsm_a_dtap_invalid_ia5_character , {
"gsm_a.dtap.invalid_ia5_character" , PI_MALFORMED , PI_WARN , "Invalid IA5 character(s) in string (value > 127)" , EXPFILL }
}
, {
& ei_gsm_a_dtap_keypad_info_not_dtmf_digit , {
"gsm_a.dtap.keypad_info_not_dtmf_digit" , PI_MALFORMED , PI_WARN , "Keypad information contains character that is not a DTMF digit" , EXPFILL }
}
, {
& ei_gsm_a_dtap_extraneous_data , {
"gsm_a.dtap.extraneous_data" , PI_PROTOCOL , PI_NOTE , "Extraneous Data, dissector bug or later version spec(report to wireshark.org)" , EXPFILL }
}
, {
& ei_gsm_a_dtap_missing_mandatory_element , {
"gsm_a.dtap.missing_mandatory_element" , PI_PROTOCOL , PI_WARN , "Missing Mandatory element, rest of dissection is suspect" , EXPFILL }
}
, {
& ei_gsm_a_dtap_coding_scheme , {
"gsm_a.dtap.coding_scheme.unknown" , PI_PROTOCOL , PI_WARN , "Text string encoded according to an unknown Coding Scheme" , EXPFILL }
}
, }
;
expert_module_t * expert_a_dtap ;
ett [ 0 ] = & ett_dtap_msg ;
ett [ 1 ] = & ett_dtap_oct_1 ;
ett [ 2 ] = & ett_cm_srvc_type ;
ett [ 3 ] = & ett_gsm_enc_info ;
ett [ 4 ] = & ett_bc_oct_3 ;
ett [ 5 ] = & ett_bc_oct_3a ;
ett [ 6 ] = & ett_bc_oct_4 ;
ett [ 7 ] = & ett_bc_oct_5 ;
ett [ 8 ] = & ett_bc_oct_5a ;
ett [ 9 ] = & ett_bc_oct_5b ;
ett [ 10 ] = & ett_bc_oct_6 ;
ett [ 11 ] = & ett_bc_oct_6a ;
ett [ 12 ] = & ett_bc_oct_6b ;
ett [ 13 ] = & ett_bc_oct_6c ;
ett [ 14 ] = & ett_bc_oct_6d ;
ett [ 15 ] = & ett_bc_oct_6e ;
ett [ 16 ] = & ett_bc_oct_6f ;
ett [ 17 ] = & ett_bc_oct_6g ;
ett [ 18 ] = & ett_bc_oct_7 ;
ett [ 19 ] = & ett_epc_ue_tl_a_lb_setup ;
ett [ 20 ] = & ett_mm_timer ;
ett [ 21 ] = & ett_ue_test_loop_mode ;
last_offset = NUM_INDIVIDUAL_ELEMS ;
for ( i = 0 ;
i < NUM_GSM_DTAP_MSG_MM ;
i ++ , last_offset ++ ) {
ett_gsm_dtap_msg_mm [ i ] = - 1 ;
ett [ last_offset ] = & ett_gsm_dtap_msg_mm [ i ] ;
}
for ( i = 0 ;
i < NUM_GSM_DTAP_MSG_CC ;
i ++ , last_offset ++ ) {
ett_gsm_dtap_msg_cc [ i ] = - 1 ;
ett [ last_offset ] = & ett_gsm_dtap_msg_cc [ i ] ;
}
for ( i = 0 ;
i < NUM_GSM_DTAP_MSG_SMS ;
i ++ , last_offset ++ ) {
ett_gsm_dtap_msg_sms [ i ] = - 1 ;
ett [ last_offset ] = & ett_gsm_dtap_msg_sms [ i ] ;
}
for ( i = 0 ;
i < NUM_GSM_DTAP_MSG_SS ;
i ++ , last_offset ++ ) {
ett_gsm_dtap_msg_ss [ i ] = - 1 ;
ett [ last_offset ] = & ett_gsm_dtap_msg_ss [ i ] ;
}
for ( i = 0 ;
i < NUM_GSM_DTAP_MSG_TP ;
i ++ , last_offset ++ ) {
ett_gsm_dtap_msg_tp [ i ] = - 1 ;
ett [ last_offset ] = & ett_gsm_dtap_msg_tp [ i ] ;
}
for ( i = 0 ;
i < NUM_GSM_DTAP_ELEM ;
i ++ , last_offset ++ ) {
ett_gsm_dtap_elem [ i ] = - 1 ;
ett [ last_offset ] = & ett_gsm_dtap_elem [ i ] ;
}
proto_a_dtap = proto_register_protocol ( "GSM A-I/F DTAP" , "GSM DTAP" , "gsm_a.dtap" ) ;
proto_register_field_array ( proto_a_dtap , hf , array_length ( hf ) ) ;
proto_register_subtree_array ( ett , array_length ( ett ) ) ;
expert_a_dtap = expert_register_protocol ( proto_a_dtap ) ;
expert_register_field_array ( expert_a_dtap , ei , array_length ( ei ) ) ;
register_dissector ( "gsm_a_dtap" , dissect_dtap , proto_a_dtap ) ;
u2u_dissector_table = register_dissector_table ( "gsm_a.dtap.u2u_prot_discr" , "GSM User to User Signalling" , proto_a_dtap , FT_UINT8 , BASE_DEC ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
TEST_F ( SoundContentSettingObserverTest , DontMuteWhenUnmutedByExtension ) {
EXPECT_FALSE ( web_contents ( ) -> IsAudioMuted ( ) ) ;
ChangeSoundContentSettingTo ( CONTENT_SETTING_BLOCK ) ;
EXPECT_TRUE ( web_contents ( ) -> IsAudioMuted ( ) ) ;
SetMuteStateForReason ( false , TabMutedReason : : EXTENSION ) ;
EXPECT_FALSE ( web_contents ( ) -> IsAudioMuted ( ) ) ;
NavigateAndCommit ( GURL ( kURL2 ) ) ;
EXPECT_FALSE ( web_contents ( ) -> IsAudioMuted ( ) ) ;
NavigateAndCommit ( GURL ( kURL1 ) ) ;
EXPECT_FALSE ( web_contents ( ) -> IsAudioMuted ( ) ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int gx_finish_output_page ( gx_device * dev , int num_copies , int flush ) {
dev -> PageCount += num_copies ;
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_t38_T_seq_number ( 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 , 0U , 65535U , & seq_number , FALSE ) ;
# line 238 "../../asn1/t38/t38.cnf" if ( primary_part ) t38_info -> seq_num = seq_number ;
col_append_fstr ( actx -> pinfo -> cinfo , COL_INFO , "Seq=%05u " , seq_number ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static VALUE ossl_cipher_reset ( VALUE self ) {
EVP_CIPHER_CTX * ctx ;
GetCipher ( self , ctx ) ;
if ( EVP_CipherInit_ex ( ctx , NULL , NULL , NULL , NULL , - 1 ) != 1 ) ossl_raise ( eCipherError , NULL ) ;
return self ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
THD * first_global_thread ( ) {
if ( threads . is_empty ( ) ) return NULL ;
return threads . head ( ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int32_t usArrayToRLEString ( const uint16_t * src , int32_t srcLen , uint16_t * buffer , int32_t bufLen , UErrorCode * status ) {
uint16_t * bufLimit = buffer + bufLen ;
uint16_t * saveBuffer = buffer ;
if ( buffer < bufLimit ) {
* buffer ++ = ( uint16_t ) ( srcLen >> 16 ) ;
if ( buffer < bufLimit ) {
uint16_t runValue = src [ 0 ] ;
int32_t runLength = 1 ;
int i = 1 ;
* buffer ++ = ( uint16_t ) srcLen ;
for ( ;
i < srcLen ;
++ i ) {
uint16_t s = src [ i ] ;
if ( s == runValue && runLength < 0xFFFF ) {
++ runLength ;
}
else {
buffer = encodeRunShort ( buffer , bufLimit , ( uint16_t ) runValue , runLength , status ) ;
runValue = s ;
runLength = 1 ;
}
}
buffer = encodeRunShort ( buffer , bufLimit , ( uint16_t ) runValue , runLength , status ) ;
}
else {
* status = U_BUFFER_OVERFLOW_ERROR ;
}
}
else {
* status = U_BUFFER_OVERFLOW_ERROR ;
}
return ( int32_t ) ( buffer - saveBuffer ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int ff_wmv2_decode_secondary_picture_header ( MpegEncContext * s ) {
Wmv2Context * const w = ( Wmv2Context * ) s ;
if ( s -> pict_type == AV_PICTURE_TYPE_I ) {
if ( w -> j_type_bit ) w -> j_type = get_bits1 ( & s -> gb ) ;
else w -> j_type = 0 ;
if ( ! w -> j_type ) {
if ( w -> per_mb_rl_bit ) s -> per_mb_rl_table = get_bits1 ( & s -> gb ) ;
else s -> per_mb_rl_table = 0 ;
if ( ! s -> per_mb_rl_table ) {
s -> rl_chroma_table_index = decode012 ( & s -> gb ) ;
s -> rl_table_index = decode012 ( & s -> gb ) ;
}
s -> dc_table_index = get_bits1 ( & s -> gb ) ;
}
s -> inter_intra_pred = 0 ;
s -> no_rounding = 1 ;
if ( s -> avctx -> debug & FF_DEBUG_PICT_INFO ) {
av_log ( s -> avctx , AV_LOG_DEBUG , "qscale:%d rlc:%d rl:%d dc:%d mbrl:%d j_type:%d \n" , s -> qscale , s -> rl_chroma_table_index , s -> rl_table_index , s -> dc_table_index , s -> per_mb_rl_table , w -> j_type ) ;
}
}
else {
int cbp_index ;
w -> j_type = 0 ;
parse_mb_skip ( w ) ;
cbp_index = decode012 ( & s -> gb ) ;
if ( s -> qscale <= 10 ) {
int map [ 3 ] = {
0 , 2 , 1 }
;
w -> cbp_table_index = map [ cbp_index ] ;
}
else if ( s -> qscale <= 20 ) {
int map [ 3 ] = {
1 , 0 , 2 }
;
w -> cbp_table_index = map [ cbp_index ] ;
}
else {
int map [ 3 ] = {
2 , 1 , 0 }
;
w -> cbp_table_index = map [ cbp_index ] ;
}
if ( w -> mspel_bit ) s -> mspel = get_bits1 ( & s -> gb ) ;
else s -> mspel = 0 ;
if ( w -> abt_flag ) {
w -> per_mb_abt = get_bits1 ( & s -> gb ) ^ 1 ;
if ( ! w -> per_mb_abt ) {
w -> abt_type = decode012 ( & s -> gb ) ;
}
}
if ( w -> per_mb_rl_bit ) s -> per_mb_rl_table = get_bits1 ( & s -> gb ) ;
else s -> per_mb_rl_table = 0 ;
if ( ! s -> per_mb_rl_table ) {
s -> rl_table_index = decode012 ( & s -> gb ) ;
s -> rl_chroma_table_index = s -> rl_table_index ;
}
s -> dc_table_index = get_bits1 ( & s -> gb ) ;
s -> mv_table_index = get_bits1 ( & s -> gb ) ;
s -> inter_intra_pred = 0 ;
s -> no_rounding ^= 1 ;
if ( s -> avctx -> debug & FF_DEBUG_PICT_INFO ) {
av_log ( s -> avctx , AV_LOG_DEBUG , "rl:%d rlc:%d dc:%d mv:%d mbrl:%d qp:%d mspel:%d per_mb_abt:%d abt_type:%d cbp:%d ii:%d\n" , s -> rl_table_index , s -> rl_chroma_table_index , s -> dc_table_index , s -> mv_table_index , s -> per_mb_rl_table , s -> qscale , s -> mspel , w -> per_mb_abt , w -> abt_type , w -> cbp_table_index , s -> inter_intra_pred ) ;
}
}
s -> esc3_level_length = 0 ;
s -> esc3_run_length = 0 ;
s -> picture_number ++ ;
if ( w -> j_type ) {
ff_intrax8_decode_picture ( & w -> x8 , 2 * s -> qscale , ( s -> qscale - 1 ) | 1 ) ;
return 1 ;
}
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
TEST_F ( WebFrameTest , NoLoadingCompletionCallbacksInDetach ) {
class LoadingObserverFrameClient : public FrameTestHelpers : : TestWebFrameClient {
public : LoadingObserverFrameClient ( ) = default ;
~ LoadingObserverFrameClient ( ) override = default ;
void FrameDetached ( DetachType type ) override {
did_call_frame_detached_ = true ;
TestWebFrameClient : : FrameDetached ( type ) ;
}
void DidStopLoading ( ) override {
did_call_did_stop_loading_ = true ;
TestWebFrameClient : : DidStopLoading ( ) ;
}
void DidFailProvisionalLoad ( const WebURLError & , WebHistoryCommitType ) override {
EXPECT_TRUE ( false ) << "The load should not have failed." ;
}
void DidFinishDocumentLoad ( ) override {
did_call_did_finish_document_load_ = true ;
}
void DidHandleOnloadEvents ( ) override {
did_call_did_handle_onload_events_ = true ;
}
void DidFinishLoad ( ) override {
EXPECT_TRUE ( false ) << "didFinishLoad() should not have been called." ;
}
void DispatchLoad ( ) override {
EXPECT_TRUE ( false ) << "dispatchLoad() should not have been called." ;
}
bool DidCallFrameDetached ( ) const {
return did_call_frame_detached_ ;
}
bool DidCallDidStopLoading ( ) const {
return did_call_did_stop_loading_ ;
}
bool DidCallDidFinishDocumentLoad ( ) const {
return did_call_did_finish_document_load_ ;
}
bool DidCallDidHandleOnloadEvents ( ) const {
return did_call_did_handle_onload_events_ ;
}
private : bool did_call_frame_detached_ = false ;
bool did_call_did_stop_loading_ = false ;
bool did_call_did_finish_document_load_ = false ;
bool did_call_did_handle_onload_events_ = false ;
}
;
class MainFrameClient : public FrameTestHelpers : : TestWebFrameClient {
public : MainFrameClient ( ) = default ;
~ MainFrameClient ( ) override = default ;
WebLocalFrame * CreateChildFrame ( WebLocalFrame * parent , WebTreeScopeType scope , const WebString & name , const WebString & fallback_name , WebSandboxFlags sandbox_flags , const ParsedFeaturePolicy & container_policy , const WebFrameOwnerProperties & ) override {
return CreateLocalChild ( * parent , scope , & child_client_ ) ;
}
LoadingObserverFrameClient & ChildClient ( ) {
return child_client_ ;
}
private : LoadingObserverFrameClient child_client_ ;
}
;
RegisterMockedHttpURLLoad ( "single_iframe.html" ) ;
URLTestHelpers : : RegisterMockedURLLoad ( ToKURL ( base_url_ + "visible_iframe.html" ) , test : : CoreTestDataPath ( "frame_with_frame.html" ) ) ;
RegisterMockedHttpURLLoad ( "parent_detaching_frame.html" ) ;
FrameTestHelpers : : WebViewHelper web_view_helper ;
MainFrameClient main_frame_client ;
web_view_helper . InitializeAndLoad ( base_url_ + "single_iframe.html" , & main_frame_client ) ;
EXPECT_TRUE ( main_frame_client . ChildClient ( ) . DidCallFrameDetached ( ) ) ;
EXPECT_TRUE ( main_frame_client . ChildClient ( ) . DidCallDidStopLoading ( ) ) ;
EXPECT_TRUE ( main_frame_client . ChildClient ( ) . DidCallDidFinishDocumentLoad ( ) ) ;
EXPECT_TRUE ( main_frame_client . ChildClient ( ) . DidCallDidHandleOnloadEvents ( ) ) ;
web_view_helper . Reset ( ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int kex_method_diffie_hellman_group_exchange_sha256_key_exchange ( LIBSSH2_SESSION * session , key_exchange_state_low_t * key_state ) {
unsigned long p_len , g_len ;
int ret = 0 ;
int rc ;
if ( key_state -> state == libssh2_NB_state_idle ) {
key_state -> p = _libssh2_bn_init ( ) ;
key_state -> g = _libssh2_bn_init ( ) ;
# ifdef LIBSSH2_DH_GEX_NEW key_state -> request [ 0 ] = SSH_MSG_KEX_DH_GEX_REQUEST ;
_libssh2_htonu32 ( key_state -> request + 1 , LIBSSH2_DH_GEX_MINGROUP ) ;
_libssh2_htonu32 ( key_state -> request + 5 , LIBSSH2_DH_GEX_OPTGROUP ) ;
_libssh2_htonu32 ( key_state -> request + 9 , LIBSSH2_DH_GEX_MAXGROUP ) ;
key_state -> request_len = 13 ;
_libssh2_debug ( session , LIBSSH2_TRACE_KEX , "Initiating Diffie-Hellman Group-Exchange (New Method SHA256)" ) ;
# else key_state -> request [ 0 ] = SSH_MSG_KEX_DH_GEX_REQUEST_OLD ;
_libssh2_htonu32 ( key_state -> request + 1 , LIBSSH2_DH_GEX_OPTGROUP ) ;
key_state -> request_len = 5 ;
_libssh2_debug ( session , LIBSSH2_TRACE_KEX , "Initiating Diffie-Hellman Group-Exchange (Old Method SHA256)" ) ;
# endif key_state -> state = libssh2_NB_state_created ;
}
if ( key_state -> state == libssh2_NB_state_created ) {
rc = _libssh2_transport_send ( session , key_state -> request , key_state -> request_len , NULL , 0 ) ;
if ( rc == LIBSSH2_ERROR_EAGAIN ) {
return rc ;
}
else if ( rc ) {
ret = _libssh2_error ( session , rc , "Unable to send Group Exchange Request SHA256" ) ;
goto dh_gex_clean_exit ;
}
key_state -> state = libssh2_NB_state_sent ;
}
if ( key_state -> state == libssh2_NB_state_sent ) {
rc = _libssh2_packet_require ( session , SSH_MSG_KEX_DH_GEX_GROUP , & key_state -> data , & key_state -> data_len , 0 , NULL , 0 , & key_state -> req_state ) ;
if ( rc == LIBSSH2_ERROR_EAGAIN ) {
return rc ;
}
else if ( rc ) {
ret = _libssh2_error ( session , rc , "Timeout waiting for GEX_GROUP reply SHA256" ) ;
goto dh_gex_clean_exit ;
}
key_state -> state = libssh2_NB_state_sent1 ;
}
if ( key_state -> state == libssh2_NB_state_sent1 ) {
unsigned char * s = key_state -> data + 1 ;
p_len = _libssh2_ntohu32 ( s ) ;
s += 4 ;
_libssh2_bn_from_bin ( key_state -> p , p_len , s ) ;
s += p_len ;
g_len = _libssh2_ntohu32 ( s ) ;
s += 4 ;
_libssh2_bn_from_bin ( key_state -> g , g_len , s ) ;
ret = diffie_hellman_sha256 ( session , key_state -> g , key_state -> p , p_len , SSH_MSG_KEX_DH_GEX_INIT , SSH_MSG_KEX_DH_GEX_REPLY , key_state -> data + 1 , key_state -> data_len - 1 , & key_state -> exchange_state ) ;
if ( ret == LIBSSH2_ERROR_EAGAIN ) {
return ret ;
}
LIBSSH2_FREE ( session , key_state -> data ) ;
}
dh_gex_clean_exit : key_state -> state = libssh2_NB_state_idle ;
_libssh2_bn_free ( key_state -> g ) ;
key_state -> g = NULL ;
_libssh2_bn_free ( key_state -> p ) ;
key_state -> p = NULL ;
return ret ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void dtls1_stop_timer ( SSL * s ) {
memset ( & s -> d1 -> timeout , 0 , sizeof ( s -> d1 -> timeout ) ) ;
memset ( & s -> d1 -> next_timeout , 0 , sizeof ( s -> d1 -> next_timeout ) ) ;
s -> d1 -> timeout_duration = 1 ;
BIO_ctrl ( SSL_get_rbio ( s ) , BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT , 0 , & ( s -> d1 -> next_timeout ) ) ;
dtls1_clear_record_buffer ( s ) ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
void proto_tree_children_foreach ( proto_tree * tree , proto_tree_foreach_func func , gpointer data ) {
proto_node * node = tree ;
proto_node * current ;
if ( ! node ) return ;
node = node -> first_child ;
while ( node != NULL ) {
current = node ;
node = current -> next ;
func ( ( proto_tree * ) current , data ) ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void rfbProcessClientMessage ( rfbClientPtr cl ) {
switch ( cl -> state ) {
case RFB_PROTOCOL_VERSION : rfbProcessClientProtocolVersion ( cl ) ;
return ;
case RFB_SECURITY_TYPE : rfbProcessClientSecurityType ( cl ) ;
return ;
case RFB_AUTHENTICATION : rfbAuthProcessClientMessage ( cl ) ;
return ;
case RFB_INITIALISATION : case RFB_INITIALISATION_SHARED : rfbProcessClientInitMessage ( cl ) ;
return ;
default : rfbProcessClientNormalMessage ( cl ) ;
return ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void nautilus_directory_remove_file_from_work_queue ( NautilusDirectory * directory , NautilusFile * file ) {
nautilus_file_queue_remove ( directory -> details -> high_priority_queue , file ) ;
nautilus_file_queue_remove ( directory -> details -> low_priority_queue , file ) ;
nautilus_file_queue_remove ( directory -> details -> extension_queue , file ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void update_skip_probs ( VP9_COMMON * cm , vp9_writer * w ) {
int k ;
for ( k = 0 ;
k < SKIP_CONTEXTS ;
++ k ) vp9_cond_prob_diff_update ( w , & cm -> fc . skip_probs [ k ] , cm -> counts . skip [ k ] ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static gcry_err_code_t mgf1 ( unsigned char * output , size_t outlen , unsigned char * seed , size_t seedlen , int algo ) {
size_t dlen , nbytes , n ;
int idx ;
gcry_md_hd_t hd ;
gcry_error_t err ;
err = gcry_md_open ( & hd , algo , 0 ) ;
if ( err ) return gpg_err_code ( err ) ;
dlen = gcry_md_get_algo_dlen ( algo ) ;
nbytes = 0 ;
idx = 0 ;
while ( nbytes < outlen ) {
unsigned char c [ 4 ] , * digest ;
if ( idx ) gcry_md_reset ( hd ) ;
c [ 0 ] = ( idx >> 24 ) & 0xFF ;
c [ 1 ] = ( idx >> 16 ) & 0xFF ;
c [ 2 ] = ( idx >> 8 ) & 0xFF ;
c [ 3 ] = idx & 0xFF ;
idx ++ ;
gcry_md_write ( hd , seed , seedlen ) ;
gcry_md_write ( hd , c , 4 ) ;
digest = gcry_md_read ( hd , 0 ) ;
n = ( outlen - nbytes < dlen ) ? ( outlen - nbytes ) : dlen ;
memcpy ( output + nbytes , digest , n ) ;
nbytes += n ;
}
gcry_md_close ( hd ) ;
return GPG_ERR_NO_ERROR ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void vp9_ ## type ## _predictor_ ## size ## x ## size ## _c ( uint8_t * dst , ptrdiff_t stride , const uint8_t * above , const uint8_t * left ) {
type ## _predictor ( dst , stride , size , above , left ) ;
}
# if CONFIG_VP9_HIGHBITDEPTH # define intra_pred_high_sized ( type , size ) void vp9_high_ ## type ## _predictor_ ## size ## x ## size ## _c ( uint16_t * dst , ptrdiff_t stride , const uint16_t * above , const uint16_t * left , int bd ) {
high_ ## type ## _predictor ( dst , stride , size , above , left , bd ) ;
}
# define intra_pred_allsizes ( type ) intra_pred_sized ( type , 4 ) intra_pred_sized ( type , 8 ) intra_pred_sized ( type , 16 ) intra_pred_sized ( type , 32 ) intra_pred_high_sized ( type , 4 ) intra_pred_high_sized ( type , 8 ) intra_pred_high_sized ( type , 16 ) intra_pred_high_sized ( type , 32 ) # else # define intra_pred_allsizes ( type ) intra_pred_sized ( type , 4 ) intra_pred_sized ( type , 8 ) intra_pred_sized ( type , 16 ) intra_pred_sized ( type , 32 ) # endif # if CONFIG_VP9_HIGHBITDEPTH static INLINE void high_d207_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r , c ;
( void ) above ;
( void ) bd ;
for ( r = 0 ;
r < bs - 1 ;
++ r ) {
dst [ r * stride ] = ROUND_POWER_OF_TWO ( left [ r ] + left [ r + 1 ] , 1 ) ;
}
dst [ ( bs - 1 ) * stride ] = left [ bs - 1 ] ;
dst ++ ;
for ( r = 0 ;
r < bs - 2 ;
++ r ) {
dst [ r * stride ] = ROUND_POWER_OF_TWO ( left [ r ] + left [ r + 1 ] * 2 + left [ r + 2 ] , 2 ) ;
}
dst [ ( bs - 2 ) * stride ] = ROUND_POWER_OF_TWO ( left [ bs - 2 ] + left [ bs - 1 ] * 3 , 2 ) ;
dst [ ( bs - 1 ) * stride ] = left [ bs - 1 ] ;
dst ++ ;
for ( c = 0 ;
c < bs - 2 ;
++ c ) dst [ ( bs - 1 ) * stride + c ] = left [ bs - 1 ] ;
for ( r = bs - 2 ;
r >= 0 ;
-- r ) {
for ( c = 0 ;
c < bs - 2 ;
++ c ) dst [ r * stride + c ] = dst [ ( r + 1 ) * stride + c - 2 ] ;
}
}
static INLINE void high_d63_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r , c ;
( void ) left ;
( void ) bd ;
for ( r = 0 ;
r < bs ;
++ r ) {
for ( c = 0 ;
c < bs ;
++ c ) {
dst [ c ] = r & 1 ? ROUND_POWER_OF_TWO ( above [ r / 2 + c ] + above [ r / 2 + c + 1 ] * 2 + above [ r / 2 + c + 2 ] , 2 ) : ROUND_POWER_OF_TWO ( above [ r / 2 + c ] + above [ r / 2 + c + 1 ] , 1 ) ;
}
dst += stride ;
}
}
static INLINE void high_d45_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r , c ;
( void ) left ;
( void ) bd ;
for ( r = 0 ;
r < bs ;
++ r ) {
for ( c = 0 ;
c < bs ;
++ c ) {
dst [ c ] = r + c + 2 < bs * 2 ? ROUND_POWER_OF_TWO ( above [ r + c ] + above [ r + c + 1 ] * 2 + above [ r + c + 2 ] , 2 ) : above [ bs * 2 - 1 ] ;
}
dst += stride ;
}
}
static INLINE void high_d117_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r , c ;
( void ) bd ;
for ( c = 0 ;
c < bs ;
c ++ ) dst [ c ] = ROUND_POWER_OF_TWO ( above [ c - 1 ] + above [ c ] , 1 ) ;
dst += stride ;
dst [ 0 ] = ROUND_POWER_OF_TWO ( left [ 0 ] + above [ - 1 ] * 2 + above [ 0 ] , 2 ) ;
for ( c = 1 ;
c < bs ;
c ++ ) dst [ c ] = ROUND_POWER_OF_TWO ( above [ c - 2 ] + above [ c - 1 ] * 2 + above [ c ] , 2 ) ;
dst += stride ;
dst [ 0 ] = ROUND_POWER_OF_TWO ( above [ - 1 ] + left [ 0 ] * 2 + left [ 1 ] , 2 ) ;
for ( r = 3 ;
r < bs ;
++ r ) dst [ ( r - 2 ) * stride ] = ROUND_POWER_OF_TWO ( left [ r - 3 ] + left [ r - 2 ] * 2 + left [ r - 1 ] , 2 ) ;
for ( r = 2 ;
r < bs ;
++ r ) {
for ( c = 1 ;
c < bs ;
c ++ ) dst [ c ] = dst [ - 2 * stride + c - 1 ] ;
dst += stride ;
}
}
static INLINE void high_d135_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r , c ;
( void ) bd ;
dst [ 0 ] = ROUND_POWER_OF_TWO ( left [ 0 ] + above [ - 1 ] * 2 + above [ 0 ] , 2 ) ;
for ( c = 1 ;
c < bs ;
c ++ ) dst [ c ] = ROUND_POWER_OF_TWO ( above [ c - 2 ] + above [ c - 1 ] * 2 + above [ c ] , 2 ) ;
dst [ stride ] = ROUND_POWER_OF_TWO ( above [ - 1 ] + left [ 0 ] * 2 + left [ 1 ] , 2 ) ;
for ( r = 2 ;
r < bs ;
++ r ) dst [ r * stride ] = ROUND_POWER_OF_TWO ( left [ r - 2 ] + left [ r - 1 ] * 2 + left [ r ] , 2 ) ;
dst += stride ;
for ( r = 1 ;
r < bs ;
++ r ) {
for ( c = 1 ;
c < bs ;
c ++ ) dst [ c ] = dst [ - stride + c - 1 ] ;
dst += stride ;
}
}
static INLINE void high_d153_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r , c ;
( void ) bd ;
dst [ 0 ] = ROUND_POWER_OF_TWO ( above [ - 1 ] + left [ 0 ] , 1 ) ;
for ( r = 1 ;
r < bs ;
r ++ ) dst [ r * stride ] = ROUND_POWER_OF_TWO ( left [ r - 1 ] + left [ r ] , 1 ) ;
dst ++ ;
dst [ 0 ] = ROUND_POWER_OF_TWO ( left [ 0 ] + above [ - 1 ] * 2 + above [ 0 ] , 2 ) ;
dst [ stride ] = ROUND_POWER_OF_TWO ( above [ - 1 ] + left [ 0 ] * 2 + left [ 1 ] , 2 ) ;
for ( r = 2 ;
r < bs ;
r ++ ) dst [ r * stride ] = ROUND_POWER_OF_TWO ( left [ r - 2 ] + left [ r - 1 ] * 2 + left [ r ] , 2 ) ;
dst ++ ;
for ( c = 0 ;
c < bs - 2 ;
c ++ ) dst [ c ] = ROUND_POWER_OF_TWO ( above [ c - 1 ] + above [ c ] * 2 + above [ c + 1 ] , 2 ) ;
dst += stride ;
for ( r = 1 ;
r < bs ;
++ r ) {
for ( c = 0 ;
c < bs - 2 ;
c ++ ) dst [ c ] = dst [ - stride + c - 2 ] ;
dst += stride ;
}
}
static INLINE void high_v_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r ;
( void ) left ;
( void ) bd ;
for ( r = 0 ;
r < bs ;
r ++ ) {
vpx_memcpy ( dst , above , bs * sizeof ( uint16_t ) ) ;
dst += stride ;
}
}
static INLINE void high_h_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r ;
( void ) above ;
( void ) bd ;
for ( r = 0 ;
r < bs ;
r ++ ) {
vpx_memset16 ( dst , left [ r ] , bs ) ;
dst += stride ;
}
}
static INLINE void high_tm_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r , c ;
int ytop_left = above [ - 1 ] ;
( void ) bd ;
for ( r = 0 ;
r < bs ;
r ++ ) {
for ( c = 0 ;
c < bs ;
c ++ ) dst [ c ] = clip_pixel_high ( left [ r ] + above [ c ] - ytop_left , bd ) ;
dst += stride ;
}
}
static INLINE void high_dc_128_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int r ;
( void ) above ;
( void ) left ;
for ( r = 0 ;
r < bs ;
r ++ ) {
vpx_memset16 ( dst , 128 << ( bd - 8 ) , bs ) ;
dst += stride ;
}
}
static INLINE void high_dc_left_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int i , r , expected_dc , sum = 0 ;
( void ) above ;
( void ) bd ;
for ( i = 0 ;
i < bs ;
i ++ ) sum += left [ i ] ;
expected_dc = ( sum + ( bs >> 1 ) ) / bs ;
for ( r = 0 ;
r < bs ;
r ++ ) {
vpx_memset16 ( dst , expected_dc , bs ) ;
dst += stride ;
}
}
static INLINE void high_dc_top_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int i , r , expected_dc , sum = 0 ;
( void ) left ;
( void ) bd ;
for ( i = 0 ;
i < bs ;
i ++ ) sum += above [ i ] ;
expected_dc = ( sum + ( bs >> 1 ) ) / bs ;
for ( r = 0 ;
r < bs ;
r ++ ) {
vpx_memset16 ( dst , expected_dc , bs ) ;
dst += stride ;
}
}
static INLINE void high_dc_predictor ( uint16_t * dst , ptrdiff_t stride , int bs , const uint16_t * above , const uint16_t * left , int bd ) {
int i , r , expected_dc , sum = 0 ;
const int count = 2 * bs ;
( void ) bd ;
for ( i = 0 ;
i < bs ;
i ++ ) {
sum += above [ i ] ;
sum += left [ i ] ;
}
expected_dc = ( sum + ( count >> 1 ) ) / count ;
for ( r = 0 ;
r < bs ;
r ++ ) {
vpx_memset16 ( dst , expected_dc , bs ) ;
dst += stride ;
}
}
# endif static INLINE void d207_predictor ( uint8_t * dst , ptrdiff_t stride , int bs , const uint8_t * above , const uint8_t * left ) {
int r , c ;
( void ) above ;
for ( r = 0 ;
r < bs - 1 ;
++ r ) dst [ r * stride ] = ROUND_POWER_OF_TWO ( left [ r ] + left [ r + 1 ] , 1 ) ;
dst [ ( bs - 1 ) * stride ] = left [ bs - 1 ] ;
dst ++ ;
for ( r = 0 ;
r < bs - 2 ;
++ r ) dst [ r * stride ] = ROUND_POWER_OF_TWO ( left [ r ] + left [ r + 1 ] * 2 + left [ r + 2 ] , 2 ) ;
dst [ ( bs - 2 ) * stride ] = ROUND_POWER_OF_TWO ( left [ bs - 2 ] + left [ bs - 1 ] * 3 , 2 ) ;
dst [ ( bs - 1 ) * stride ] = left [ bs - 1 ] ;
dst ++ ;
for ( c = 0 ;
c < bs - 2 ;
++ c ) dst [ ( bs - 1 ) * stride + c ] = left [ bs - 1 ] ;
for ( r = bs - 2 ;
r >= 0 ;
-- r ) for ( c = 0 ;
c < bs - 2 ;
++ c ) dst [ r * stride + c ] = dst [ ( r + 1 ) * stride + c - 2 ] ;
}
intra_pred_allsizes ( d207 ) static INLINE void d63_predictor ( uint8_t * dst , ptrdiff_t stride , int bs , const uint8_t * above , const uint8_t * left ) {
int r , c ;
( void ) left ;
for ( r = 0 ;
r < bs ;
++ r ) {
for ( c = 0 ;
c < bs ;
++ c ) dst [ c ] = r & 1 ? ROUND_POWER_OF_TWO ( above [ r / 2 + c ] + above [ r / 2 + c + 1 ] * 2 + above [ r / 2 + c + 2 ] , 2 ) : ROUND_POWER_OF_TWO ( above [ r / 2 + c ] + above [ r / 2 + c + 1 ] , 1 ) ;
dst += stride ;
}
}
intra_pred_allsizes ( d63 ) static INLINE void d45_predictor ( uint8_t * dst , ptrdiff_t stride , int bs , const uint8_t * above , const uint8_t * left ) {
int r , c ;
( void ) left ;
for ( r = 0 ;
r < bs ;
++ r ) {
for ( c = 0 ;
c < bs ;
++ c ) dst [ c ] = r + c + 2 < bs * 2 ? ROUND_POWER_OF_TWO ( above [ r + c ] + above [ r + c + 1 ] * 2 + above [ r + c + 2 ] , 2 ) : above [ bs * 2 - 1 ] ;
dst += stride ;
}
}
intra_pred_allsizes ( d45 ) static INLINE void d117_predictor ( uint8_t * dst , ptrdiff_t stride , int bs , const uint8_t * above , const uint8_t * left ) {
int r , c ;
for ( c = 0 ;
c < bs ;
c ++ ) dst [ c ] = ROUND_POWER_OF_TWO ( above [ c - 1 ] + above [ c ] , 1 ) ;
dst += stride ;
dst [ 0 ] = ROUND_POWER_OF_TWO ( left [ 0 ] + above [ - 1 ] * 2 + above [ 0 ] , 2 ) ;
for ( c = 1 ;
c < bs ;
c ++ ) dst [ c ] = ROUND_POWER_OF_TWO ( above [ c - 2 ] + above [ c - 1 ] * 2 + above [ c ] , 2 ) ;
dst += stride ;
dst [ 0 ] = ROUND_POWER_OF_TWO ( above [ - 1 ] + left [ 0 ] * 2 + left [ 1 ] , 2 ) ;
for ( r = 3 ;
r < bs ;
++ r ) dst [ ( r - 2 ) * stride ] = ROUND_POWER_OF_TWO ( left [ r - 3 ] + left [ r - 2 ] * 2 + left [ r - 1 ] , 2 ) ;
for ( r = 2 ;
r < bs ;
++ r ) {
for ( c = 1 ;
c < bs ;
c ++ ) dst [ c ] = dst [ - 2 * stride + c - 1 ] ;
dst += stride ;
}
}
intra_pred_allsizes ( d117 ) static INLINE void d135_predictor ( uint8_t * dst , ptrdiff_t stride , int bs , const uint8_t * above , const uint8_t * left ) {
int r , c ;
dst [ 0 ] = ROUND_POWER_OF_TWO ( left [ 0 ] + above [ - 1 ] * 2 + above [ 0 ] , 2 ) ;
for ( c = 1 ;
c < bs ;
c ++ ) dst [ c ] = ROUND_POWER_OF_TWO ( above [ c - 2 ] + above [ c - 1 ] * 2 + above [ c ] , 2 ) ;
dst [ stride ] = ROUND_POWER_OF_TWO ( above [ - 1 ] + left [ 0 ] * 2 + left [ 1 ] , 2 ) ;
for ( r = 2 ;
r < bs ;
++ r ) dst [ r * stride ] = ROUND_POWER_OF_TWO ( left [ r - 2 ] + left [ r - 1 ] * 2 + left [ r ] , 2 ) ;
dst += stride ;
for ( r = 1 ;
r < bs ;
++ r ) {
for ( c = 1 ;
c < bs ;
c ++ ) dst [ c ] = dst [ - stride + c - 1 ] ;
dst += stride ;
}
}
intra_pred_allsizes ( d135 ) static INLINE void d153_predictor ( uint8_t * dst , ptrdiff_t stride , int bs , const uint8_t * above , const uint8_t * left ) {
int r , c ;
dst [ 0 ] = ROUND_POWER_OF_TWO ( above [ - 1 ] + left [ 0 ] , 1 ) ;
for ( r = 1 ;
r < bs ;
r ++ ) dst [ r * stride ] = ROUND_POWER_OF_TWO ( left [ r - 1 ] + left [ r ] , 1 ) ;
dst ++ ;
dst [ 0 ] = ROUND_POWER_OF_TWO ( left [ 0 ] + above [ - 1 ] * 2 + above [ 0 ] , 2 ) ;
dst [ stride ] = ROUND_POWER_OF_TWO ( above [ - 1 ] + left [ 0 ] * 2 + left [ 1 ] , 2 ) ;
for ( r = 2 ;
r < bs ;
r ++ ) dst [ r * stride ] = ROUND_POWER_OF_TWO ( left [ r - 2 ] + left [ r - 1 ] * 2 + left [ r ] , 2 ) ;
dst ++ ;
for ( c = 0 ;
c < bs - 2 ;
c ++ ) dst [ c ] = ROUND_POWER_OF_TWO ( above [ c - 1 ] + above [ c ] * 2 + above [ c + 1 ] , 2 ) ;
dst += stride ;
for ( r = 1 ;
r < bs ;
++ r ) {
for ( c = 0 ;
c < bs - 2 ;
c ++ ) dst [ c ] = dst [ - stride + c - 2 ] ;
dst += stride ;
}
}
intra_pred_allsizes ( d153 ) static INLINE void v_predictor ( uint8_t * dst , ptrdiff_t stride , int bs , const uint8_t * above , const uint8_t * left ) {
int r ;
( void ) left ;
for ( r = 0 ;
r < bs ;
r ++ ) {
vpx_memcpy ( dst , above , bs ) ;
dst += stride ;
}
}
intra_pred_allsizes ( v ) static INLINE void h_predictor ( uint8_t * dst , ptrdiff_t stride , int bs , const uint8_t * above , const uint8_t * left ) {
int r ;
( void ) above ;
for ( r = 0 ;
r < bs ;
r ++ ) {
vpx_memset ( dst , left [ r ] , bs ) ;
dst += stride ;
}
}
intra_pred_allsizes ( h ) static INLINE void tm_predictor ( uint8_t * dst , ptrdiff_t stride , int bs , const uint8_t * above , const uint8_t * left ) {
int r , c ;
int ytop_left = above [ - 1 ] ;
for ( r = 0 ;
r < bs ;
r ++ ) {
for ( c = 0 ;
c < bs ;
c ++ ) dst [ c ] = clip_pixel ( left [ r ] + above [ c ] - ytop_left ) ;
dst += stride ;
}
}
intra_pred_allsizes ( tm ) static INLINE void dc_128_predictor ( uint8_t * dst , ptrdiff_t stride , int bs , const uint8_t * above , const uint8_t * left ) {
int r ;
( void ) above ;
( void ) left ;
for ( r = 0 ;
r < bs ;
r ++ ) {
vpx_memset ( dst , 128 , bs ) ;
dst += stride ;
}
}
intra_pred_allsizes ( dc_128 ) static INLINE void dc_left_predictor ( uint8_t * dst , ptrdiff_t stride , int bs , const uint8_t * above , const uint8_t * left ) {
int i , r , expected_dc , sum = 0 ;
( void ) above ;
for ( i = 0 ;
i < bs ;
i ++ ) sum += left [ i ] ;
expected_dc = ( sum + ( bs >> 1 ) ) / bs ;
for ( r = 0 ;
r < bs ;
r ++ ) {
vpx_memset ( dst , expected_dc , bs ) ;
dst += stride ;
}
}
intra_pred_allsizes ( dc_left ) static INLINE void dc_top_predictor ( uint8_t * dst , ptrdiff_t stride , int bs , const uint8_t * above , const uint8_t * left ) {
int i , r , expected_dc , sum = 0 ;
( void ) left ;
for ( i = 0 ;
i < bs ;
i ++ ) sum += above [ i ] ;
expected_dc = ( sum + ( bs >> 1 ) ) / bs ;
for ( r = 0 ;
r < bs ;
r ++ ) {
vpx_memset ( dst , expected_dc , bs ) ;
dst += stride ;
}
}
intra_pred_allsizes ( dc_top )
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int tls1_setup_key_block ( SSL * s ) {
unsigned char * p1 , * p2 = NULL ;
const EVP_CIPHER * c ;
const EVP_MD * hash ;
int num ;
SSL_COMP * comp ;
int mac_type = NID_undef , mac_secret_size = 0 ;
int ret = 0 ;
# ifdef KSSL_DEBUG printf ( "tls1_setup_key_block()\n" ) ;
# endif if ( s -> s3 -> tmp . key_block_length != 0 ) return ( 1 ) ;
if ( ! ssl_cipher_get_evp ( s -> session , & c , & hash , & mac_type , & mac_secret_size , & comp ) ) {
SSLerr ( SSL_F_TLS1_SETUP_KEY_BLOCK , SSL_R_CIPHER_OR_HASH_UNAVAILABLE ) ;
return ( 0 ) ;
}
s -> s3 -> tmp . new_sym_enc = c ;
s -> s3 -> tmp . new_hash = hash ;
s -> s3 -> tmp . new_mac_pkey_type = mac_type ;
s -> s3 -> tmp . new_mac_secret_size = mac_secret_size ;
num = EVP_CIPHER_key_length ( c ) + mac_secret_size + EVP_CIPHER_iv_length ( c ) ;
num *= 2 ;
ssl3_cleanup_key_block ( s ) ;
if ( ( p1 = ( unsigned char * ) OPENSSL_malloc ( num ) ) == NULL ) {
SSLerr ( SSL_F_TLS1_SETUP_KEY_BLOCK , ERR_R_MALLOC_FAILURE ) ;
goto err ;
}
s -> s3 -> tmp . key_block_length = num ;
s -> s3 -> tmp . key_block = p1 ;
if ( ( p2 = ( unsigned char * ) OPENSSL_malloc ( num ) ) == NULL ) {
SSLerr ( SSL_F_TLS1_SETUP_KEY_BLOCK , ERR_R_MALLOC_FAILURE ) ;
goto err ;
}
# ifdef TLS_DEBUG printf ( "client random\n" ) ;
{
int z ;
for ( z = 0 ;
z < SSL3_RANDOM_SIZE ;
z ++ ) printf ( "%02X%c" , s -> s3 -> client_random [ z ] , ( ( z + 1 ) % 16 ) ? ' ' : '\n' ) ;
}
printf ( "server random\n" ) ;
{
int z ;
for ( z = 0 ;
z < SSL3_RANDOM_SIZE ;
z ++ ) printf ( "%02X%c" , s -> s3 -> server_random [ z ] , ( ( z + 1 ) % 16 ) ? ' ' : '\n' ) ;
}
printf ( "pre-master\n" ) ;
{
int z ;
for ( z = 0 ;
z < s -> session -> master_key_length ;
z ++ ) printf ( "%02X%c" , s -> session -> master_key [ z ] , ( ( z + 1 ) % 16 ) ? ' ' : '\n' ) ;
}
# endif if ( ! tls1_generate_key_block ( s , p1 , p2 , num ) ) goto err ;
# ifdef TLS_DEBUG printf ( "\nkey block\n" ) ;
{
int z ;
for ( z = 0 ;
z < num ;
z ++ ) printf ( "%02X%c" , p1 [ z ] , ( ( z + 1 ) % 16 ) ? ' ' : '\n' ) ;
}
# endif if ( ! ( s -> options & SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS ) && s -> method -> version <= TLS1_VERSION ) {
s -> s3 -> need_empty_fragments = 1 ;
if ( s -> session -> cipher != NULL ) {
if ( s -> session -> cipher -> algorithm_enc == SSL_eNULL ) s -> s3 -> need_empty_fragments = 0 ;
# ifndef OPENSSL_NO_RC4 if ( s -> session -> cipher -> algorithm_enc == SSL_RC4 ) s -> s3 -> need_empty_fragments = 0 ;
# endif }
}
ret = 1 ;
err : if ( p2 ) {
OPENSSL_cleanse ( p2 , num ) ;
OPENSSL_free ( p2 ) ;
}
return ( ret ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_u3v ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * data ) {
gint offset = 0 ;
proto_tree * u3v_tree = NULL , * ccd_tree_flag , * u3v_telegram_tree = NULL , * ccd_tree = NULL ;
gint data_length = 0 ;
gint req_id = 0 ;
gint command_id = - 1 ;
gint status = 0 ;
guint prefix = 0 ;
proto_item * ti = NULL ;
proto_item * item = NULL ;
const char * command_string ;
usb_conv_info_t * usb_conv_info ;
gint stream_detected = FALSE ;
gint control_detected = FALSE ;
u3v_conv_info_t * u3v_conv_info = NULL ;
gencp_transaction_t * gencp_trans = NULL ;
usb_conv_info = ( usb_conv_info_t * ) data ;
u3v_conv_info = ( u3v_conv_info_t * ) usb_conv_info -> class_data ;
if ( ! u3v_conv_info ) {
u3v_conv_info = wmem_new0 ( wmem_file_scope ( ) , u3v_conv_info_t ) ;
usb_conv_info -> class_data = u3v_conv_info ;
}
prefix = tvb_get_letohl ( tvb , 0 ) ;
if ( ( tvb_reported_length ( tvb ) >= 4 ) && ( ( U3V_CONTROL_PREFIX == prefix ) || ( U3V_EVENT_PREFIX == prefix ) ) ) {
control_detected = TRUE ;
}
if ( ( ( tvb_reported_length ( tvb ) >= 4 ) && ( ( U3V_STREAM_LEADER_PREFIX == prefix ) || ( U3V_STREAM_TRAILER_PREFIX == prefix ) ) ) || ( usb_conv_info -> endpoint == u3v_conv_info -> ep_stream ) ) {
stream_detected = TRUE ;
}
if ( control_detected || stream_detected ) {
if ( usb_conv_info -> interfaceClass == IF_CLASS_UNKNOWN && usb_conv_info -> interfaceSubclass == IF_SUBCLASS_UNKNOWN ) {
usb_conv_info -> interfaceClass = IF_CLASS_MISCELLANEOUS ;
usb_conv_info -> interfaceSubclass = IF_SUBCLASS_MISC_U3V ;
}
}
if ( control_detected ) {
col_set_str ( pinfo -> cinfo , COL_PROTOCOL , "U3V" ) ;
col_clear ( pinfo -> cinfo , COL_INFO ) ;
ti = proto_tree_add_item ( tree , proto_u3v , tvb , offset , - 1 , ENC_NA ) ;
u3v_tree = proto_item_add_subtree ( ti , ett_u3v ) ;
prefix = tvb_get_letohl ( tvb , offset ) ;
command_id = tvb_get_letohs ( tvb , offset + 6 ) ;
if ( ( prefix == U3V_CONTROL_PREFIX || prefix == U3V_EVENT_PREFIX ) && ( ( command_id % 2 ) == 0 ) ) {
command_string = val_to_str ( command_id , command_names , "Unknown Command (0x%x)" ) ;
item = proto_tree_add_item ( u3v_tree , hf_u3v_ccd_cmd , tvb , offset , 8 , ENC_NA ) ;
proto_item_append_text ( item , ": %s" , command_string ) ;
ccd_tree = proto_item_add_subtree ( item , ett_u3v_cmd ) ;
proto_tree_add_item ( ccd_tree , hf_u3v_gencp_prefix , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
offset += 4 ;
item = proto_tree_add_item ( ccd_tree , hf_u3v_flag , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ;
ccd_tree_flag = proto_item_add_subtree ( item , ett_u3v_flags ) ;
proto_tree_add_item ( ccd_tree_flag , hf_u3v_acknowledge_required_flag , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ;
offset += 2 ;
col_append_fstr ( pinfo -> cinfo , COL_INFO , "> %s " , command_string ) ;
}
else if ( prefix == U3V_CONTROL_PREFIX && ( ( command_id % 2 ) == 1 ) ) {
command_string = val_to_str ( command_id , command_names , "Unknown Acknowledge (0x%x)" ) ;
item = proto_tree_add_item ( u3v_tree , hf_u3v_ccd_ack , tvb , offset , 8 , ENC_NA ) ;
proto_item_append_text ( item , ": %s" , command_string ) ;
ccd_tree = proto_item_add_subtree ( item , ett_u3v_ack ) ;
proto_tree_add_item ( ccd_tree , hf_u3v_gencp_prefix , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
offset += 4 ;
proto_tree_add_item ( ccd_tree , hf_u3v_status , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ;
status = tvb_get_letohs ( tvb , offset ) ;
offset += 2 ;
col_append_fstr ( pinfo -> cinfo , COL_INFO , "< %s %s" , command_string , val_to_str ( status , status_names_short , "Unknown status (0x%04X)" ) ) ;
}
else {
return 0 ;
}
proto_tree_add_item ( ccd_tree , hf_u3v_command_id , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ;
offset += 2 ;
proto_tree_add_item ( ccd_tree , hf_u3v_length , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ;
data_length = tvb_get_letohs ( tvb , offset ) ;
offset += 2 ;
proto_tree_add_item ( ccd_tree , hf_u3v_request_id , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ;
req_id = tvb_get_letohs ( tvb , offset ) ;
offset += 2 ;
u3v_telegram_tree = proto_item_add_subtree ( u3v_tree , ett_u3v ) ;
if ( ! PINFO_FD_VISITED ( pinfo ) ) {
if ( ( command_id % 2 ) == 0 ) {
gencp_trans = wmem_new ( wmem_file_scope ( ) , gencp_transaction_t ) ;
gencp_trans -> cmd_frame = pinfo -> fd -> num ;
gencp_trans -> ack_frame = 0 ;
gencp_trans -> cmd_time = pinfo -> fd -> abs_ts ;
p_add_proto_data ( wmem_file_scope ( ) , pinfo , proto_u3v , req_id , gencp_trans ) ;
u3v_conv_info -> trans_info = gencp_trans ;
}
else {
gencp_trans = u3v_conv_info -> trans_info ;
if ( gencp_trans ) {
gencp_trans -> ack_frame = pinfo -> fd -> num ;
p_add_proto_data ( wmem_file_scope ( ) , pinfo , proto_u3v , req_id , gencp_trans ) ;
}
}
}
else {
gencp_trans = ( gencp_transaction_t * ) p_get_proto_data ( wmem_file_scope ( ) , pinfo , proto_u3v , req_id ) ;
}
if ( ! gencp_trans ) {
gencp_trans = wmem_new ( wmem_packet_scope ( ) , gencp_transaction_t ) ;
gencp_trans -> cmd_frame = 0 ;
gencp_trans -> ack_frame = 0 ;
gencp_trans -> cmd_time = pinfo -> fd -> abs_ts ;
}
switch ( command_id ) {
case U3V_READMEM_CMD : dissect_u3v_read_mem_cmd ( u3v_telegram_tree , tvb , pinfo , offset , data_length , u3v_conv_info , gencp_trans ) ;
break ;
case U3V_WRITEMEM_CMD : dissect_u3v_write_mem_cmd ( u3v_telegram_tree , tvb , pinfo , offset , data_length , u3v_conv_info , gencp_trans ) ;
break ;
case U3V_EVENT_CMD : dissect_u3v_event_cmd ( u3v_telegram_tree , tvb , pinfo , offset , data_length ) ;
break ;
case U3V_READMEM_ACK : if ( U3V_STATUS_GENCP_SUCCESS == status ) {
dissect_u3v_read_mem_ack ( u3v_telegram_tree , tvb , pinfo , offset , data_length , u3v_conv_info , gencp_trans ) ;
}
break ;
case U3V_WRITEMEM_ACK : dissect_u3v_write_mem_ack ( u3v_telegram_tree , tvb , pinfo , offset , data_length , u3v_conv_info , gencp_trans ) ;
break ;
case U3V_PENDING_ACK : dissect_u3v_pending_ack ( u3v_telegram_tree , tvb , pinfo , offset , data_length , u3v_conv_info , gencp_trans ) ;
break ;
default : proto_tree_add_item ( u3v_telegram_tree , hf_u3v_payloaddata , tvb , offset , data_length , ENC_NA ) ;
break ;
}
return data_length + 12 ;
}
else if ( stream_detected ) {
u3v_conv_info = ( u3v_conv_info_t * ) usb_conv_info -> class_data ;
u3v_conv_info -> ep_stream = usb_conv_info -> endpoint ;
col_set_str ( pinfo -> cinfo , COL_PROTOCOL , "U3V" ) ;
col_clear ( pinfo -> cinfo , COL_INFO ) ;
ti = proto_tree_add_item ( tree , proto_u3v , tvb , offset , - 1 , ENC_NA ) ;
u3v_tree = proto_item_add_subtree ( ti , ett_u3v ) ;
if ( tvb_captured_length ( tvb ) >= 4 ) {
prefix = tvb_get_letohl ( tvb , offset ) ;
switch ( prefix ) {
case U3V_STREAM_LEADER_PREFIX : dissect_u3v_stream_leader ( u3v_tree , tvb , pinfo , usb_conv_info ) ;
break ;
case U3V_STREAM_TRAILER_PREFIX : dissect_u3v_stream_trailer ( u3v_tree , tvb , pinfo , usb_conv_info ) ;
break ;
default : dissect_u3v_stream_payload ( u3v_tree , tvb , pinfo , usb_conv_info ) ;
break ;
}
}
return tvb_captured_length ( tvb ) ;
}
return 0 ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void RefigureCompositeMaxPts ( SplineFont * sf , struct glyphinfo * gi ) {
int i ;
for ( i = 0 ;
i < gi -> gcnt ;
++ i ) if ( gi -> bygid [ i ] != - 1 && sf -> glyphs [ gi -> bygid [ i ] ] -> ttf_glyph != - 1 ) {
if ( sf -> glyphs [ gi -> bygid [ i ] ] -> layers [ gi -> layer ] . splines == NULL && sf -> glyphs [ gi -> bygid [ i ] ] -> layers [ gi -> layer ] . refs != NULL && gi -> pointcounts [ i ] == - 1 ) CountCompositeMaxPts ( sf -> glyphs [ gi -> bygid [ i ] ] , gi ) ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
TEST_F ( BudgetDatabaseTest , GetBudgetNegativeTime ) {
base : : SimpleTestClock * clock = SetClockForTesting ( ) ;
SetSiteEngagementScore ( kEngagement ) ;
GetBudgetDetails ( ) ;
clock -> Advance ( base : : TimeDelta : : FromDays ( 1 ) ) ;
GetBudgetDetails ( ) ;
ASSERT_EQ ( 3U , prediction_ . size ( ) ) ;
double budget = prediction_ [ 0 ] -> budget_at ;
clock -> SetNow ( clock -> Now ( ) - base : : TimeDelta : : FromDays ( 5 ) ) ;
GetBudgetDetails ( ) ;
ASSERT_EQ ( 3U , prediction_ . size ( ) ) ;
ASSERT_EQ ( budget , prediction_ [ 0 ] -> budget_at ) ;
clock -> SetNow ( clock -> Now ( ) + base : : TimeDelta : : FromDays ( 5 ) ) ;
GetBudgetDetails ( ) ;
ASSERT_EQ ( 3U , prediction_ . size ( ) ) ;
ASSERT_EQ ( budget , prediction_ [ 0 ] -> budget_at ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int vc1_decode_frame ( AVCodecContext * avctx , void * data , int * got_frame , AVPacket * avpkt ) {
const uint8_t * buf = avpkt -> data ;
int buf_size = avpkt -> size , n_slices = 0 , i ;
VC1Context * v = avctx -> priv_data ;
MpegEncContext * s = & v -> s ;
AVFrame * pict = data ;
uint8_t * buf2 = NULL ;
const uint8_t * buf_start = buf ;
int mb_height , n_slices1 ;
struct {
uint8_t * buf ;
GetBitContext gb ;
int mby_start ;
}
* slices = NULL , * tmp ;
if ( buf_size == 0 || ( buf_size == 4 && AV_RB32 ( buf ) == VC1_CODE_ENDOFSEQ ) ) {
if ( s -> low_delay == 0 && s -> next_picture_ptr ) {
* pict = s -> next_picture_ptr -> f ;
s -> next_picture_ptr = NULL ;
* got_frame = 1 ;
}
return 0 ;
}
if ( s -> avctx -> codec -> capabilities & CODEC_CAP_HWACCEL_VDPAU ) {
if ( v -> profile < PROFILE_ADVANCED ) avctx -> pix_fmt = AV_PIX_FMT_VDPAU_WMV3 ;
else avctx -> pix_fmt = AV_PIX_FMT_VDPAU_VC1 ;
}
if ( avctx -> codec_id == AV_CODEC_ID_VC1 || avctx -> codec_id == AV_CODEC_ID_VC1IMAGE ) {
int buf_size2 = 0 ;
buf2 = av_mallocz ( buf_size + FF_INPUT_BUFFER_PADDING_SIZE ) ;
if ( IS_MARKER ( AV_RB32 ( buf ) ) ) {
const uint8_t * start , * end , * next ;
int size ;
next = buf ;
for ( start = buf , end = buf + buf_size ;
next < end ;
start = next ) {
next = find_next_marker ( start + 4 , end ) ;
size = next - start - 4 ;
if ( size <= 0 ) continue ;
switch ( AV_RB32 ( start ) ) {
case VC1_CODE_FRAME : if ( avctx -> hwaccel || s -> avctx -> codec -> capabilities & CODEC_CAP_HWACCEL_VDPAU ) buf_start = start ;
buf_size2 = vc1_unescape_buffer ( start + 4 , size , buf2 ) ;
break ;
case VC1_CODE_FIELD : {
int buf_size3 ;
tmp = av_realloc ( slices , sizeof ( * slices ) * ( n_slices + 1 ) ) ;
if ( ! tmp ) goto err ;
slices = tmp ;
slices [ n_slices ] . buf = av_mallocz ( buf_size + FF_INPUT_BUFFER_PADDING_SIZE ) ;
if ( ! slices [ n_slices ] . buf ) goto err ;
buf_size3 = vc1_unescape_buffer ( start + 4 , size , slices [ n_slices ] . buf ) ;
init_get_bits ( & slices [ n_slices ] . gb , slices [ n_slices ] . buf , buf_size3 << 3 ) ;
slices [ n_slices ] . mby_start = s -> mb_height >> 1 ;
n_slices1 = n_slices - 1 ;
n_slices ++ ;
break ;
}
case VC1_CODE_ENTRYPOINT : buf_size2 = vc1_unescape_buffer ( start + 4 , size , buf2 ) ;
init_get_bits ( & s -> gb , buf2 , buf_size2 * 8 ) ;
ff_vc1_decode_entry_point ( avctx , v , & s -> gb ) ;
break ;
case VC1_CODE_SLICE : {
int buf_size3 ;
tmp = av_realloc ( slices , sizeof ( * slices ) * ( n_slices + 1 ) ) ;
if ( ! tmp ) goto err ;
slices = tmp ;
slices [ n_slices ] . buf = av_mallocz ( buf_size + FF_INPUT_BUFFER_PADDING_SIZE ) ;
if ( ! slices [ n_slices ] . buf ) goto err ;
buf_size3 = vc1_unescape_buffer ( start + 4 , size , slices [ n_slices ] . buf ) ;
init_get_bits ( & slices [ n_slices ] . gb , slices [ n_slices ] . buf , buf_size3 << 3 ) ;
slices [ n_slices ] . mby_start = get_bits ( & slices [ n_slices ] . gb , 9 ) ;
n_slices ++ ;
break ;
}
}
}
}
else if ( v -> interlace && ( ( buf [ 0 ] & 0xC0 ) == 0xC0 ) ) {
const uint8_t * divider ;
int buf_size3 ;
divider = find_next_marker ( buf , buf + buf_size ) ;
if ( ( divider == ( buf + buf_size ) ) || AV_RB32 ( divider ) != VC1_CODE_FIELD ) {
av_log ( avctx , AV_LOG_ERROR , "Error in WVC1 interlaced frame\n" ) ;
goto err ;
}
else {
tmp = av_realloc ( slices , sizeof ( * slices ) * ( n_slices + 1 ) ) ;
if ( ! tmp ) goto err ;
slices = tmp ;
slices [ n_slices ] . buf = av_mallocz ( buf_size + FF_INPUT_BUFFER_PADDING_SIZE ) ;
if ( ! slices [ n_slices ] . buf ) goto err ;
buf_size3 = vc1_unescape_buffer ( divider + 4 , buf + buf_size - divider - 4 , slices [ n_slices ] . buf ) ;
init_get_bits ( & slices [ n_slices ] . gb , slices [ n_slices ] . buf , buf_size3 << 3 ) ;
slices [ n_slices ] . mby_start = s -> mb_height >> 1 ;
n_slices1 = n_slices - 1 ;
n_slices ++ ;
}
buf_size2 = vc1_unescape_buffer ( buf , divider - buf , buf2 ) ;
}
else {
buf_size2 = vc1_unescape_buffer ( buf , buf_size , buf2 ) ;
}
init_get_bits ( & s -> gb , buf2 , buf_size2 * 8 ) ;
}
else init_get_bits ( & s -> gb , buf , buf_size * 8 ) ;
if ( v -> res_sprite ) {
v -> new_sprite = ! get_bits1 ( & s -> gb ) ;
v -> two_sprites = get_bits1 ( & s -> gb ) ;
if ( avctx -> codec_id == AV_CODEC_ID_WMV3IMAGE || avctx -> codec_id == AV_CODEC_ID_VC1IMAGE ) {
if ( v -> new_sprite ) {
avctx -> width = avctx -> coded_width = v -> sprite_width ;
avctx -> height = avctx -> coded_height = v -> sprite_height ;
}
else {
goto image ;
}
}
}
if ( s -> context_initialized && ( s -> width != avctx -> coded_width || s -> height != avctx -> coded_height ) ) {
ff_vc1_decode_end ( avctx ) ;
}
if ( ! s -> context_initialized ) {
if ( ff_msmpeg4_decode_init ( avctx ) < 0 || ff_vc1_decode_init_alloc_tables ( v ) < 0 ) goto err ;
s -> low_delay = ! avctx -> has_b_frames || v -> res_sprite ;
if ( v -> profile == PROFILE_ADVANCED ) {
s -> h_edge_pos = avctx -> coded_width ;
s -> v_edge_pos = avctx -> coded_height ;
}
}
if ( s -> current_picture_ptr == NULL || s -> current_picture_ptr -> f . data [ 0 ] ) {
int i = ff_find_unused_picture ( s , 0 ) ;
if ( i < 0 ) goto err ;
s -> current_picture_ptr = & s -> picture [ i ] ;
}
v -> pic_header_flag = 0 ;
if ( v -> profile < PROFILE_ADVANCED ) {
if ( ff_vc1_parse_frame_header ( v , & s -> gb ) == - 1 ) {
goto err ;
}
}
else {
if ( ff_vc1_parse_frame_header_adv ( v , & s -> gb ) == - 1 ) {
goto err ;
}
}
if ( ( avctx -> codec_id == AV_CODEC_ID_WMV3IMAGE || avctx -> codec_id == AV_CODEC_ID_VC1IMAGE ) && s -> pict_type != AV_PICTURE_TYPE_I ) {
av_log ( v -> s . avctx , AV_LOG_ERROR , "Sprite decoder: expected I-frame\n" ) ;
goto err ;
}
s -> current_picture_ptr -> f . repeat_pict = 0 ;
if ( v -> rff ) {
s -> current_picture_ptr -> f . repeat_pict = 1 ;
}
else if ( v -> rptfrm ) {
s -> current_picture_ptr -> f . repeat_pict = v -> rptfrm * 2 ;
}
s -> current_picture . f . pict_type = s -> pict_type ;
s -> current_picture . f . key_frame = s -> pict_type == AV_PICTURE_TYPE_I ;
if ( s -> last_picture_ptr == NULL && ( s -> pict_type == AV_PICTURE_TYPE_B || s -> droppable ) ) {
goto err ;
}
if ( ( avctx -> skip_frame >= AVDISCARD_NONREF && s -> pict_type == AV_PICTURE_TYPE_B ) || ( avctx -> skip_frame >= AVDISCARD_NONKEY && s -> pict_type != AV_PICTURE_TYPE_I ) || avctx -> skip_frame >= AVDISCARD_ALL ) {
goto end ;
}
if ( s -> next_p_frame_damaged ) {
if ( s -> pict_type == AV_PICTURE_TYPE_B ) goto end ;
else s -> next_p_frame_damaged = 0 ;
}
if ( ff_MPV_frame_start ( s , avctx ) < 0 ) {
goto err ;
}
s -> me . qpel_put = s -> dsp . put_qpel_pixels_tab ;
s -> me . qpel_avg = s -> dsp . avg_qpel_pixels_tab ;
if ( ( CONFIG_VC1_VDPAU_DECODER ) && s -> avctx -> codec -> capabilities & CODEC_CAP_HWACCEL_VDPAU ) ff_vdpau_vc1_decode_picture ( s , buf_start , ( buf + buf_size ) - buf_start ) ;
else if ( avctx -> hwaccel ) {
if ( avctx -> hwaccel -> start_frame ( avctx , buf , buf_size ) < 0 ) goto err ;
if ( avctx -> hwaccel -> decode_slice ( avctx , buf_start , ( buf + buf_size ) - buf_start ) < 0 ) goto err ;
if ( avctx -> hwaccel -> end_frame ( avctx ) < 0 ) goto err ;
}
else {
ff_mpeg_er_frame_start ( s ) ;
v -> bits = buf_size * 8 ;
v -> end_mb_x = s -> mb_width ;
if ( v -> field_mode ) {
uint8_t * tmp [ 2 ] ;
s -> current_picture . f . linesize [ 0 ] <<= 1 ;
s -> current_picture . f . linesize [ 1 ] <<= 1 ;
s -> current_picture . f . linesize [ 2 ] <<= 1 ;
s -> linesize <<= 1 ;
s -> uvlinesize <<= 1 ;
tmp [ 0 ] = v -> mv_f_last [ 0 ] ;
tmp [ 1 ] = v -> mv_f_last [ 1 ] ;
v -> mv_f_last [ 0 ] = v -> mv_f_next [ 0 ] ;
v -> mv_f_last [ 1 ] = v -> mv_f_next [ 1 ] ;
v -> mv_f_next [ 0 ] = v -> mv_f [ 0 ] ;
v -> mv_f_next [ 1 ] = v -> mv_f [ 1 ] ;
v -> mv_f [ 0 ] = tmp [ 0 ] ;
v -> mv_f [ 1 ] = tmp [ 1 ] ;
}
mb_height = s -> mb_height >> v -> field_mode ;
for ( i = 0 ;
i <= n_slices ;
i ++ ) {
if ( i > 0 && slices [ i - 1 ] . mby_start >= mb_height ) {
if ( v -> field_mode <= 0 ) {
av_log ( v -> s . avctx , AV_LOG_ERROR , "Slice %d starts beyond " "picture boundary (%d >= %d)\n" , i , slices [ i - 1 ] . mby_start , mb_height ) ;
continue ;
}
v -> second_field = 1 ;
v -> blocks_off = s -> mb_width * s -> mb_height << 1 ;
v -> mb_off = s -> mb_stride * s -> mb_height >> 1 ;
}
else {
v -> second_field = 0 ;
v -> blocks_off = 0 ;
v -> mb_off = 0 ;
}
if ( i ) {
v -> pic_header_flag = 0 ;
if ( v -> field_mode && i == n_slices1 + 2 ) {
if ( ff_vc1_parse_frame_header_adv ( v , & s -> gb ) < 0 ) {
av_log ( v -> s . avctx , AV_LOG_ERROR , "Field header damaged\n" ) ;
continue ;
}
}
else if ( get_bits1 ( & s -> gb ) ) {
v -> pic_header_flag = 1 ;
if ( ff_vc1_parse_frame_header_adv ( v , & s -> gb ) < 0 ) {
av_log ( v -> s . avctx , AV_LOG_ERROR , "Slice header damaged\n" ) ;
continue ;
}
}
}
s -> start_mb_y = ( i == 0 ) ? 0 : FFMAX ( 0 , slices [ i - 1 ] . mby_start % mb_height ) ;
if ( ! v -> field_mode || v -> second_field ) s -> end_mb_y = ( i == n_slices ) ? mb_height : FFMIN ( mb_height , slices [ i ] . mby_start % mb_height ) ;
else s -> end_mb_y = ( i <= n_slices1 + 1 ) ? mb_height : FFMIN ( mb_height , slices [ i ] . mby_start % mb_height ) ;
ff_vc1_decode_blocks ( v ) ;
if ( i != n_slices ) s -> gb = slices [ i ] . gb ;
}
if ( v -> field_mode ) {
v -> second_field = 0 ;
if ( s -> pict_type == AV_PICTURE_TYPE_B ) {
memcpy ( v -> mv_f_base , v -> mv_f_next_base , 2 * ( s -> b8_stride * ( s -> mb_height * 2 + 1 ) + s -> mb_stride * ( s -> mb_height + 1 ) * 2 ) ) ;
}
s -> current_picture . f . linesize [ 0 ] >>= 1 ;
s -> current_picture . f . linesize [ 1 ] >>= 1 ;
s -> current_picture . f . linesize [ 2 ] >>= 1 ;
s -> linesize >>= 1 ;
s -> uvlinesize >>= 1 ;
}
av_dlog ( s -> avctx , "Consumed %i/%i bits\n" , get_bits_count ( & s -> gb ) , s -> gb . size_in_bits ) ;
ff_er_frame_end ( & s -> er ) ;
}
ff_MPV_frame_end ( s ) ;
if ( avctx -> codec_id == AV_CODEC_ID_WMV3IMAGE || avctx -> codec_id == AV_CODEC_ID_VC1IMAGE ) {
image : avctx -> width = avctx -> coded_width = v -> output_width ;
avctx -> height = avctx -> coded_height = v -> output_height ;
if ( avctx -> skip_frame >= AVDISCARD_NONREF ) goto end ;
# if CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER if ( vc1_decode_sprites ( v , & s -> gb ) ) goto err ;
# endif * pict = v -> sprite_output_frame ;
* got_frame = 1 ;
}
else {
if ( s -> pict_type == AV_PICTURE_TYPE_B || s -> low_delay ) {
* pict = s -> current_picture_ptr -> f ;
}
else if ( s -> last_picture_ptr != NULL ) {
* pict = s -> last_picture_ptr -> f ;
}
if ( s -> last_picture_ptr || s -> low_delay ) {
* got_frame = 1 ;
ff_print_debug_info ( s , pict ) ;
}
}
end : av_free ( buf2 ) ;
for ( i = 0 ;
i < n_slices ;
i ++ ) av_free ( slices [ i ] . buf ) ;
av_free ( slices ) ;
return buf_size ;
err : av_free ( buf2 ) ;
for ( i = 0 ;
i < n_slices ;
i ++ ) av_free ( slices [ i ] . buf ) ;
av_free ( slices ) ;
return - 1 ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static gint get_record ( k12_t * file_data , FILE_T fh , gint64 file_offset , gboolean is_random , int * err , gchar * * err_info ) {
guint8 * buffer = is_random ? file_data -> rand_read_buff : file_data -> seq_read_buff ;
guint buffer_len = is_random ? file_data -> rand_read_buff_len : file_data -> seq_read_buff_len ;
guint total_read = 0 ;
guint left ;
guint8 * writep ;
# ifdef DEBUG_K12 guint actual_len ;
# endif guint junky_offset = 8192 - ( gint ) ( ( file_offset - K12_FILE_HDR_LEN ) % 8192 ) ;
K12_DBG ( 6 , ( "get_record: ENTER: junky_offset=%" G_GINT64_MODIFIER "d, file_offset=%" G_GINT64_MODIFIER "d" , junky_offset , file_offset ) ) ;
if ( buffer == NULL ) {
buffer = ( guint8 * ) g_malloc ( 8192 ) ;
buffer_len = 8192 ;
if ( is_random ) {
file_data -> rand_read_buff = buffer ;
file_data -> rand_read_buff_len = buffer_len ;
}
else {
file_data -> seq_read_buff = buffer ;
file_data -> seq_read_buff_len = buffer_len ;
}
}
if ( junky_offset == 8192 ) {
if ( ! file_skip ( fh , K12_FILE_BLOB_LEN , err ) ) return - 1 ;
total_read += K12_FILE_BLOB_LEN ;
}
if ( ! wtap_read_bytes ( fh , buffer , 4 , err , err_info ) ) return - 1 ;
total_read += 4 ;
left = pntoh32 ( buffer + K12_RECORD_LEN ) ;
# ifdef DEBUG_K12 actual_len = left ;
# endif junky_offset -= 4 ;
K12_DBG ( 5 , ( "get_record: GET length=%u" , left ) ) ;
if ( left < 8 ) {
* err = WTAP_ERR_BAD_FILE ;
* err_info = g_strdup_printf ( "k12: Record length %u is less than 8 bytes long" , left ) ;
return - 1 ;
}
if ( left > WTAP_MAX_PACKET_SIZE ) {
* err = WTAP_ERR_BAD_FILE ;
* err_info = g_strdup_printf ( "k12: Record length %u is greater than the maximum %u" , left , WTAP_MAX_PACKET_SIZE ) ;
return - 1 ;
}
while ( left > buffer_len ) {
buffer = ( guint8 * ) g_realloc ( buffer , buffer_len *= 2 ) ;
if ( is_random ) {
file_data -> rand_read_buff = buffer ;
file_data -> rand_read_buff_len = buffer_len ;
}
else {
file_data -> seq_read_buff = buffer ;
file_data -> seq_read_buff_len = buffer_len ;
}
}
writep = buffer + 4 ;
left -= 4 ;
do {
K12_DBG ( 6 , ( "get_record: looping left=%d junky_offset=%" G_GINT64_MODIFIER "d" , left , junky_offset ) ) ;
if ( junky_offset > left ) {
if ( ! wtap_read_bytes ( fh , writep , left , err , err_info ) ) return - 1 ;
total_read += left ;
break ;
}
else {
if ( ! wtap_read_bytes ( fh , writep , junky_offset , err , err_info ) ) return - 1 ;
total_read += junky_offset ;
writep += junky_offset ;
if ( ! file_skip ( fh , K12_FILE_BLOB_LEN , err ) ) return - 1 ;
total_read += K12_FILE_BLOB_LEN ;
left -= junky_offset ;
junky_offset = 8192 ;
}
}
while ( left ) ;
K12_HEX_ASCII_DUMP ( 5 , file_offset , "GOT record" , buffer , actual_len ) ;
return total_read ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
TEST ( BuildTime , DateLooksValid ) {
# if ! defined ( DONT_EMBED_BUILD_METADATA ) char build_date [ ] = __DATE__ ;
# else char build_date [ ] = "Sep 02 2008" ;
# endif EXPECT_EQ ( 11u , strlen ( build_date ) ) ;
EXPECT_EQ ( ' ' , build_date [ 3 ] ) ;
EXPECT_EQ ( ' ' , build_date [ 6 ] ) ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void free_mi ( VP9_COMMON * cm ) {
int i ;
for ( i = 0 ;
i < 2 ;
++ i ) {
vpx_free ( cm -> mip_array [ i ] ) ;
cm -> mip_array [ i ] = NULL ;
vpx_free ( cm -> mi_grid_base_array [ i ] ) ;
cm -> mi_grid_base_array [ i ] = NULL ;
}
cm -> mip = NULL ;
cm -> prev_mip = NULL ;
cm -> mi_grid_base = NULL ;
cm -> prev_mi_grid_base = NULL ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static uint64_t s390_virtio_device_vq_token ( VirtIOS390Device * dev , int vq ) {
ram_addr_t token_off ;
token_off = ( dev -> dev_offs + VIRTIO_DEV_OFFS_CONFIG ) + ( vq * VIRTIO_VQCONFIG_LEN ) + VIRTIO_VQCONFIG_OFFS_TOKEN ;
return ldq_phys ( token_off ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
SPL_METHOD ( SplFileObject , next ) {
spl_filesystem_object * intern = ( spl_filesystem_object * ) zend_object_store_get_object ( getThis ( ) TSRMLS_CC ) ;
if ( zend_parse_parameters_none ( ) == FAILURE ) {
return ;
}
spl_filesystem_file_free_line ( intern TSRMLS_CC ) ;
if ( SPL_HAS_FLAG ( intern -> flags , SPL_FILE_OBJECT_READ_AHEAD ) ) {
spl_filesystem_file_read_line ( getThis ( ) , intern , 1 TSRMLS_CC ) ;
}
intern -> u . file . current_line_num ++ ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void purple_add_buddy ( struct im_connection * ic , char * who , char * group ) {
PurpleBuddy * pb ;
PurpleGroup * pg = NULL ;
struct purple_data * pd = ic -> proto_data ;
if ( group && ! ( pg = purple_find_group ( group ) ) ) {
pg = purple_group_new ( group ) ;
purple_blist_add_group ( pg , NULL ) ;
}
pb = purple_buddy_new ( pd -> account , who , NULL ) ;
purple_blist_add_buddy ( pb , NULL , pg , NULL ) ;
purple_account_add_buddy ( pd -> account , pb ) ;
purple_gg_buddylist_export ( pd -> account -> gc ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void e1000e_write_packet_to_guest ( E1000ECore * core , struct NetRxPkt * pkt , const E1000E_RxRing * rxr , const E1000E_RSSInfo * rss_info ) {
PCIDevice * d = core -> owner ;
dma_addr_t base ;
uint8_t desc [ E1000_MAX_RX_DESC_LEN ] ;
size_t desc_size ;
size_t desc_offset = 0 ;
size_t iov_ofs = 0 ;
struct iovec * iov = net_rx_pkt_get_iovec ( pkt ) ;
size_t size = net_rx_pkt_get_total_len ( pkt ) ;
size_t total_size = size + e1000x_fcs_len ( core -> mac ) ;
const E1000E_RingInfo * rxi ;
size_t ps_hdr_len = 0 ;
bool do_ps = e1000e_do_ps ( core , pkt , & ps_hdr_len ) ;
bool is_first = true ;
rxi = rxr -> i ;
do {
hwaddr ba [ MAX_PS_BUFFERS ] ;
e1000e_ba_state bastate = {
{
0 }
}
;
bool is_last = false ;
desc_size = total_size - desc_offset ;
if ( desc_size > core -> rx_desc_buf_size ) {
desc_size = core -> rx_desc_buf_size ;
}
base = e1000e_ring_head_descr ( core , rxi ) ;
pci_dma_read ( d , base , & desc , core -> rx_desc_len ) ;
trace_e1000e_rx_descr ( rxi -> idx , base , core -> rx_desc_len ) ;
e1000e_read_rx_descr ( core , desc , & ba ) ;
if ( ba [ 0 ] ) {
if ( desc_offset < size ) {
static const uint32_t fcs_pad ;
size_t iov_copy ;
size_t copy_size = size - desc_offset ;
if ( copy_size > core -> rx_desc_buf_size ) {
copy_size = core -> rx_desc_buf_size ;
}
if ( do_ps ) {
if ( is_first ) {
size_t ps_hdr_copied = 0 ;
do {
iov_copy = MIN ( ps_hdr_len - ps_hdr_copied , iov -> iov_len - iov_ofs ) ;
e1000e_write_hdr_to_rx_buffers ( core , & ba , & bastate , iov -> iov_base , iov_copy ) ;
copy_size -= iov_copy ;
ps_hdr_copied += iov_copy ;
iov_ofs += iov_copy ;
if ( iov_ofs == iov -> iov_len ) {
iov ++ ;
iov_ofs = 0 ;
}
}
while ( ps_hdr_copied < ps_hdr_len ) ;
is_first = false ;
}
else {
e1000e_write_hdr_to_rx_buffers ( core , & ba , & bastate , NULL , 0 ) ;
}
}
while ( copy_size ) {
iov_copy = MIN ( copy_size , iov -> iov_len - iov_ofs ) ;
e1000e_write_to_rx_buffers ( core , & ba , & bastate , iov -> iov_base + iov_ofs , iov_copy ) ;
copy_size -= iov_copy ;
iov_ofs += iov_copy ;
if ( iov_ofs == iov -> iov_len ) {
iov ++ ;
iov_ofs = 0 ;
}
}
if ( desc_offset + desc_size >= total_size ) {
e1000e_write_to_rx_buffers ( core , & ba , & bastate , ( const char * ) & fcs_pad , e1000x_fcs_len ( core -> mac ) ) ;
}
}
desc_offset += desc_size ;
if ( desc_offset >= total_size ) {
is_last = true ;
}
}
else {
trace_e1000e_rx_null_descriptor ( ) ;
}
e1000e_write_rx_descr ( core , desc , is_last ? core -> rx_pkt : NULL , rss_info , do_ps ? ps_hdr_len : 0 , & bastate . written ) ;
pci_dma_write ( d , base , & desc , core -> rx_desc_len ) ;
e1000e_ring_advance ( core , rxi , core -> rx_desc_len / E1000_MIN_RX_DESC_LEN ) ;
}
while ( desc_offset < total_size ) ;
e1000e_update_rx_stats ( core , size , total_size ) ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
BerElement * der_alloc ( void ) {
return ber_alloc_t ( LBER_USE_DER ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_DEVMODE ( tvbuff_t * tvb , int offset , packet_info * pinfo , proto_tree * tree , dcerpc_info * di , guint8 * drep ) {
proto_item * item ;
proto_tree * subtree ;
guint16 driver_extra ;
gint16 print_quality ;
guint32 fields ;
int struct_start = offset ;
if ( di -> conformant_run ) return offset ;
subtree = proto_tree_add_subtree ( tree , tvb , offset , 0 , ett_DEVMODE , & item , "Devicemode" ) ;
offset = dissect_ndr_uint32 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_size , NULL ) ;
dissect_spoolss_uint16uni ( tvb , offset , pinfo , subtree , drep , NULL , hf_devmode_devicename ) ;
offset += 64 ;
offset = dissect_ndr_uint16 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_spec_version , NULL ) ;
offset = dissect_ndr_uint16 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_driver_version , NULL ) ;
offset = dissect_ndr_uint16 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_size2 , NULL ) ;
offset = dissect_ndr_uint16 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_driver_extra_len , & driver_extra ) ;
offset = dissect_DEVMODE_fields ( tvb , offset , pinfo , subtree , di , drep , & fields ) ;
offset = dissect_ndr_uint16 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_orientation , NULL ) ;
offset = dissect_ndr_uint16 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_paper_size , NULL ) ;
offset = dissect_ndr_uint16 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_paper_length , NULL ) ;
offset = dissect_ndr_uint16 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_paper_width , NULL ) ;
offset = dissect_ndr_uint16 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_scale , NULL ) ;
offset = dissect_ndr_uint16 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_copies , NULL ) ;
offset = dissect_ndr_uint16 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_default_source , NULL ) ;
offset = dissect_ndr_uint16 ( tvb , offset , pinfo , NULL , di , drep , hf_devmode_print_quality , & print_quality ) ;
if ( print_quality < 0 ) proto_tree_add_item ( subtree , hf_devmode_print_quality , tvb , offset - 2 , 2 , DREP_ENC_INTEGER ( drep ) ) ;
else proto_tree_add_uint_format_value ( subtree , hf_devmode_print_quality , tvb , offset - 4 , 4 , print_quality , "%d dpi" , print_quality ) ;
offset = dissect_ndr_uint16 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_color , NULL ) ;
offset = dissect_ndr_uint16 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_duplex , NULL ) ;
offset = dissect_ndr_uint16 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_y_resolution , NULL ) ;
offset = dissect_ndr_uint16 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_tt_option , NULL ) ;
offset = dissect_ndr_uint16 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_collate , NULL ) ;
dissect_spoolss_uint16uni ( tvb , offset , pinfo , subtree , drep , NULL , hf_devmode_form_name ) ;
offset += 64 ;
offset = dissect_ndr_uint16 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_log_pixels , NULL ) ;
offset = dissect_ndr_uint32 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_bits_per_pel , NULL ) ;
offset = dissect_ndr_uint32 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_pels_width , NULL ) ;
offset = dissect_ndr_uint32 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_pels_height , NULL ) ;
offset = dissect_ndr_uint32 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_display_flags , NULL ) ;
offset = dissect_ndr_uint32 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_display_freq , NULL ) ;
offset = dissect_ndr_uint32 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_icm_method , NULL ) ;
offset = dissect_ndr_uint32 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_icm_intent , NULL ) ;
offset = dissect_ndr_uint32 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_media_type , NULL ) ;
offset = dissect_ndr_uint32 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_dither_type , NULL ) ;
offset = dissect_ndr_uint32 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_reserved1 , NULL ) ;
offset = dissect_ndr_uint32 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_reserved2 , NULL ) ;
offset = dissect_ndr_uint32 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_panning_width , NULL ) ;
offset = dissect_ndr_uint32 ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_panning_height , NULL ) ;
if ( driver_extra ) offset = dissect_ndr_uint8s ( tvb , offset , pinfo , subtree , di , drep , hf_devmode_driver_extra , driver_extra , NULL ) ;
proto_item_set_len ( item , offset - struct_start ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_CPMGetRows ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * parent_tree , gboolean in , void * private_data ) {
struct mswsp_ct * ct = NULL ;
gint offset = 16 ;
proto_item * item ;
proto_tree * tree ;
proto_tree * seek_tree ;
guint32 eType = 0 ;
item = proto_tree_add_item ( parent_tree , hf_mswsp_msg , tvb , offset , in ? 0 : - 1 , ENC_NA ) ;
tree = proto_item_add_subtree ( item , ett_mswsp_msg ) ;
proto_item_set_text ( item , "GetRows%s" , in ? "In" : "Out" ) ;
col_append_str ( pinfo -> cinfo , COL_INFO , "GetRows" ) ;
ct = get_create_converstation_data ( pinfo ) ;
if ( in ) {
struct message_data * data = NULL ;
proto_tree_add_item ( tree , hf_mswsp_msg_cpmgetrows_hcursor , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
offset += 4 ;
proto_tree_add_item ( tree , hf_mswsp_msg_cpmgetrows_rowstotransfer , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
offset += 4 ;
proto_tree_add_item ( tree , hf_mswsp_msg_cpmgetrows_rowwidth , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
offset += 4 ;
proto_tree_add_item ( tree , hf_mswsp_msg_cpmgetrows_cbseek , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
offset += 4 ;
data = find_or_create_message_data ( ct , pinfo , 0xCC , in , private_data ) ;
if ( data ) {
data -> content . rowsin . cbreserved = tvb_get_letohl ( tvb , offset ) ;
}
proto_tree_add_item ( tree , hf_mswsp_msg_cpmgetrows_cbreserved , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
offset += 4 ;
proto_tree_add_item ( tree , hf_mswsp_msg_cpmgetrows_cbreadbuffer , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
offset += 4 ;
if ( data ) {
data -> content . rowsin . ulclientbase = tvb_get_letohl ( tvb , offset ) ;
}
proto_tree_add_item ( tree , hf_mswsp_msg_cpmgetrows_ulclientbase , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
offset += 4 ;
proto_tree_add_item ( tree , hf_mswsp_msg_cpmgetrows_fbwdfetch , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
offset += 4 ;
eType = tvb_get_letohl ( tvb , offset ) ;
proto_tree_add_item ( tree , hf_mswsp_msg_cpmgetrows_etype , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
offset += 4 ;
proto_tree_add_item ( tree , hf_mswsp_msg_cpmgetrows_chapt , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
offset += 4 ;
seek_tree = proto_tree_add_subtree ( tree , tvb , offset , 0 , ett_SeekDescription , NULL , "SeekDescription" ) ;
switch ( eType ) {
case 0 : break ;
case 1 : parse_CRowSeekNext ( tvb , offset , seek_tree , "CRowSeekNext" ) ;
break ;
case 2 : parse_CRowSeekAt ( tvb , offset , seek_tree , "CRowSeekAt" ) ;
break ;
case 3 : parse_CRowSeekAtRatio ( tvb , offset , seek_tree , "CRowSeekAtRatio" ) ;
break ;
case 4 : parse_CRowSeekByBookmark ( tvb , offset , seek_tree , "CRowSeekByRatio" ) ;
break ;
default : break ;
}
}
else {
guint32 num_rows = 0 ;
proto_item * ti ;
proto_tree * pad_tree = proto_tree_add_subtree ( tree , tvb , offset , 0 , ett_mswsp_pad , & ti , "Padding" ) ;
struct CPMSetBindingsIn * bindingsin = find_binding_msg_data ( ct , pinfo , private_data ) ;
struct rows_data * rowsin = find_rowsin_msg_data ( ct , pinfo , private_data ) ;
gboolean b_64bit_mode = FALSE ;
gboolean b_has_arch = is_64bit_mode ( ct , pinfo , & b_64bit_mode , private_data ) ;
num_rows = tvb_get_letohl ( tvb , offset ) ;
proto_tree_add_item ( tree , hf_mswsp_msg_cpmgetrows_crowsreturned , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
offset += 4 ;
eType = tvb_get_letohl ( tvb , offset ) ;
proto_tree_add_item ( tree , hf_mswsp_msg_cpmgetrows_etype , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
offset += 4 ;
proto_tree_add_item ( tree , hf_mswsp_msg_cpmgetrows_chapt , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
offset += 4 ;
seek_tree = proto_tree_add_subtree ( tree , tvb , offset , 0 , ett_SeekDescription , NULL , "SeekDescription" ) ;
switch ( eType ) {
case 0 : break ;
case 1 : parse_CRowSeekNext ( tvb , offset , seek_tree , "CRowSeekNext" ) ;
break ;
case 2 : parse_CRowSeekAt ( tvb , offset , seek_tree , "CRowSeekAt" ) ;
break ;
case 3 : parse_CRowSeekAtRatio ( tvb , offset , seek_tree , "CRowSeekAtRatio" ) ;
break ;
case 4 : parse_CRowSeekByBookmark ( tvb , offset , seek_tree , "CRowSeekByRatio" ) ;
break ;
default : break ;
}
if ( b_has_arch && bindingsin && rowsin ) {
offset = parse_padding ( tvb , offset , rowsin -> cbreserved , pad_tree , "paddingRows" ) ;
parse_RowsBuffer ( tvb , offset , num_rows , bindingsin , rowsin , b_64bit_mode , tree , "Rows" ) ;
}
else {
gint nbytes = tvb_reported_length_remaining ( tvb , offset ) ;
proto_tree_add_expert_format ( tree , pinfo , & ei_missing_msg_context , tvb , offset , nbytes , "Undissected %d bytes (due to missing preceding msg(s))" , nbytes ) ;
}
}
return tvb_reported_length ( tvb ) ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int SpoolssEnumPrinters_r ( tvbuff_t * tvb , int offset , packet_info * pinfo , proto_tree * tree , dcerpc_info * di , guint8 * drep _U_ ) {
guint32 num_drivers ;
dcerpc_call_value * dcv = ( dcerpc_call_value * ) di -> call_data ;
gint16 level = GPOINTER_TO_INT ( dcv -> se_data ) ;
BUFFER buffer ;
proto_item * item ;
proto_tree * subtree = NULL ;
col_append_fstr ( pinfo -> cinfo , COL_INFO , ", level %d" , level ) ;
offset = dissect_spoolss_buffer ( tvb , offset , pinfo , tree , di , drep , & buffer ) ;
if ( buffer . tvb ) {
subtree = proto_tree_add_subtree_format ( buffer . tree , buffer . tvb , 0 , - 1 , ett_PRINTER_INFO , & item , "Print info level %d" , level ) ;
switch ( level ) {
case 0 : dissect_PRINTER_INFO_0 ( buffer . tvb , 0 , pinfo , subtree , di , drep ) ;
break ;
case 1 : dissect_PRINTER_INFO_1 ( buffer . tvb , 0 , pinfo , subtree , di , drep ) ;
break ;
case 2 : dissect_PRINTER_INFO_2 ( buffer . tvb , 0 , pinfo , subtree , di , drep ) ;
break ;
case 3 : dissect_PRINTER_INFO_3 ( buffer . tvb , 0 , pinfo , subtree , di , drep ) ;
break ;
case 7 : dissect_PRINTER_INFO_7 ( buffer . tvb , 0 , pinfo , subtree , di , drep ) ;
break ;
default : expert_add_info ( pinfo , item , & ei_printer_info_level ) ;
break ;
}
}
offset = dissect_ndr_uint32 ( tvb , offset , pinfo , tree , di , drep , hf_needed , NULL ) ;
offset = dissect_ndr_uint32 ( tvb , offset , pinfo , tree , di , drep , hf_returned , & num_drivers ) ;
offset = dissect_doserror ( tvb , offset , pinfo , tree , di , drep , hf_rc , NULL ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void flat_print_int ( WriterContext * wctx , const char * key , long long int value ) {
printf ( "%s%s=%lld\n" , wctx -> section_pbuf [ wctx -> level ] . str , key , value ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static inline int pic_is_unused ( H264Context * h , Picture * pic ) {
if ( ! pic -> f . buf [ 0 ] ) return 1 ;
if ( pic -> needs_realloc && ! ( pic -> reference & DELAYED_PIC_REF ) ) return 1 ;
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int sccp_calls_packet ( void * ptr _U_ , packet_info * pinfo , epan_dissect_t * edt _U_ , const void * prot_info ) {
sccp_payload_values = sccp_message_type_acro_values ;
return sccp_calls ( pinfo , prot_info ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void vga_draw_line24_le ( VGACommonState * s1 , uint8_t * d , const uint8_t * s , int width ) {
int w ;
uint32_t r , g , b ;
w = width ;
do {
b = s [ 0 ] ;
g = s [ 1 ] ;
r = s [ 2 ] ;
( ( uint32_t * ) d ) [ 0 ] = rgb_to_pixel32 ( r , g , b ) ;
s += 3 ;
d += 4 ;
}
while ( -- w != 0 ) ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void sbr_dequant ( SpectralBandReplication * sbr , int id_aac ) {
int k , e ;
int ch ;
if ( id_aac == TYPE_CPE && sbr -> bs_coupling ) {
float alpha = sbr -> data [ 0 ] . bs_amp_res ? 1.0f : 0.5f ;
float pan_offset = sbr -> data [ 0 ] . bs_amp_res ? 12.0f : 24.0f ;
for ( e = 1 ;
e <= sbr -> data [ 0 ] . bs_num_env ;
e ++ ) {
for ( k = 0 ;
k < sbr -> n [ sbr -> data [ 0 ] . bs_freq_res [ e ] ] ;
k ++ ) {
float temp1 = exp2f ( sbr -> data [ 0 ] . env_facs [ e ] [ k ] * alpha + 7.0f ) ;
float temp2 = exp2f ( ( pan_offset - sbr -> data [ 1 ] . env_facs [ e ] [ k ] ) * alpha ) ;
float fac ;
if ( temp1 > 1E20 ) {
av_log ( NULL , AV_LOG_ERROR , "envelope scalefactor overflow in dequant\n" ) ;
temp1 = 1 ;
}
fac = temp1 / ( 1.0f + temp2 ) ;
sbr -> data [ 0 ] . env_facs [ e ] [ k ] = fac ;
sbr -> data [ 1 ] . env_facs [ e ] [ k ] = fac * temp2 ;
}
}
for ( e = 1 ;
e <= sbr -> data [ 0 ] . bs_num_noise ;
e ++ ) {
for ( k = 0 ;
k < sbr -> n_q ;
k ++ ) {
float temp1 = exp2f ( NOISE_FLOOR_OFFSET - sbr -> data [ 0 ] . noise_facs [ e ] [ k ] + 1 ) ;
float temp2 = exp2f ( 12 - sbr -> data [ 1 ] . noise_facs [ e ] [ k ] ) ;
float fac ;
if ( temp1 > 1E20 ) {
av_log ( NULL , AV_LOG_ERROR , "envelope scalefactor overflow in dequant\n" ) ;
temp1 = 1 ;
}
fac = temp1 / ( 1.0f + temp2 ) ;
sbr -> data [ 0 ] . noise_facs [ e ] [ k ] = fac ;
sbr -> data [ 1 ] . noise_facs [ e ] [ k ] = fac * temp2 ;
}
}
}
else {
for ( ch = 0 ;
ch < ( id_aac == TYPE_CPE ) + 1 ;
ch ++ ) {
float alpha = sbr -> data [ ch ] . bs_amp_res ? 1.0f : 0.5f ;
for ( e = 1 ;
e <= sbr -> data [ ch ] . bs_num_env ;
e ++ ) for ( k = 0 ;
k < sbr -> n [ sbr -> data [ ch ] . bs_freq_res [ e ] ] ;
k ++ ) {
sbr -> data [ ch ] . env_facs [ e ] [ k ] = exp2f ( alpha * sbr -> data [ ch ] . env_facs [ e ] [ k ] + 6.0f ) ;
if ( sbr -> data [ ch ] . env_facs [ e ] [ k ] > 1E20 ) {
av_log ( NULL , AV_LOG_ERROR , "envelope scalefactor overflow in dequant\n" ) ;
sbr -> data [ ch ] . env_facs [ e ] [ k ] = 1 ;
}
}
for ( e = 1 ;
e <= sbr -> data [ ch ] . bs_num_noise ;
e ++ ) for ( k = 0 ;
k < sbr -> n_q ;
k ++ ) sbr -> data [ ch ] . noise_facs [ e ] [ k ] = exp2f ( NOISE_FLOOR_OFFSET - sbr -> data [ ch ] . noise_facs [ e ] [ k ] ) ;
}
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
hb_bool_t hb_face_is_immutable ( hb_face_t * face ) {
return face -> immutable ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void DefaultTTFEnglishNames ( struct ttflangname * dummy , SplineFont * sf ) {
time_t now ;
struct tm * tm ;
char buffer [ 200 ] ;
if ( dummy -> names [ ttf_copyright ] == NULL || * dummy -> names [ ttf_copyright ] == '\0' ) dummy -> names [ ttf_copyright ] = utf8_verify_copy ( sf -> copyright ) ;
if ( dummy -> names [ ttf_family ] == NULL || * dummy -> names [ ttf_family ] == '\0' ) dummy -> names [ ttf_family ] = utf8_verify_copy ( sf -> familyname ) ;
if ( dummy -> names [ ttf_subfamily ] == NULL || * dummy -> names [ ttf_subfamily ] == '\0' ) dummy -> names [ ttf_subfamily ] = utf8_verify_copy ( SFGetModifiers ( sf ) ) ;
if ( dummy -> names [ ttf_uniqueid ] == NULL || * dummy -> names [ ttf_uniqueid ] == '\0' ) {
time ( & now ) ;
tm = localtime ( & now ) ;
sprintf ( buffer , "%s : %s : %d-%d-%d" , BDFFoundry ? BDFFoundry : TTFFoundry ? TTFFoundry : "FontForge 2.0" , sf -> fullname != NULL ? sf -> fullname : sf -> fontname , tm -> tm_mday , tm -> tm_mon + 1 , tm -> tm_year + 1900 ) ;
dummy -> names [ ttf_uniqueid ] = copy ( buffer ) ;
}
if ( dummy -> names [ ttf_fullname ] == NULL || * dummy -> names [ ttf_fullname ] == '\0' ) dummy -> names [ ttf_fullname ] = utf8_verify_copy ( sf -> fullname ) ;
if ( dummy -> names [ ttf_version ] == NULL || * dummy -> names [ ttf_version ] == '\0' ) {
if ( sf -> subfontcnt != 0 ) sprintf ( buffer , "Version %f " , ( double ) sf -> cidversion ) ;
else if ( sf -> version != NULL ) sprintf ( buffer , "Version %.20s " , sf -> version ) ;
else strcpy ( buffer , "Version 1.0" ) ;
dummy -> names [ ttf_version ] = copy ( buffer ) ;
}
if ( dummy -> names [ ttf_postscriptname ] == NULL || * dummy -> names [ ttf_postscriptname ] == '\0' ) dummy -> names [ ttf_postscriptname ] = utf8_verify_copy ( sf -> fontname ) ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void virtio_write_config ( PCIDevice * pci_dev , uint32_t address , uint32_t val , int len ) {
VirtIOPCIProxy * proxy = DO_UPCAST ( VirtIOPCIProxy , pci_dev , pci_dev ) ;
if ( PCI_COMMAND == address ) {
if ( ! ( val & PCI_COMMAND_MASTER ) ) {
proxy -> vdev -> status &= ~ VIRTIO_CONFIG_S_DRIVER_OK ;
}
}
pci_default_write_config ( pci_dev , address , val , len ) ;
msix_write_config ( pci_dev , address , val , len ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void stroke_terminate ( private_stroke_socket_t * this , stroke_msg_t * msg , FILE * out ) {
pop_string ( msg , & msg -> terminate . name ) ;
DBG1 ( DBG_CFG , "received stroke: terminate '%s'" , msg -> terminate . name ) ;
this -> control -> terminate ( this -> control , msg , out ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void setup_frame_size ( VP9_COMMON * cm , struct vp9_read_bit_buffer * rb ) {
int width , height ;
vp9_read_frame_size ( rb , & width , & height ) ;
resize_context_buffers ( cm , width , height ) ;
setup_display_size ( cm , rb ) ;
if ( vp9_realloc_frame_buffer ( get_frame_new_buffer ( cm ) , cm -> width , cm -> height , cm -> subsampling_x , cm -> subsampling_y , # if CONFIG_VP9_HIGHBITDEPTH cm -> use_highbitdepth , # endif VP9_DEC_BORDER_IN_PIXELS , & cm -> frame_bufs [ cm -> new_fb_idx ] . raw_frame_buffer , cm -> get_fb_cb , cm -> cb_priv ) ) {
vpx_internal_error ( & cm -> error , VPX_CODEC_MEM_ERROR , "Failed to allocate frame buffer" ) ;
}
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int x ( struct vcache * avc , int afun , struct vrequest * areq , \ struct afs_pdata * ain , struct afs_pdata * aout , \ afs_ucred_t * * acred ) DECL_PIOCTL ( PGetFID ) ;
DECL_PIOCTL ( PSetAcl ) ;
DECL_PIOCTL ( PStoreBehind ) ;
DECL_PIOCTL ( PGCPAGs ) ;
DECL_PIOCTL ( PGetAcl ) ;
DECL_PIOCTL ( PNoop ) ;
DECL_PIOCTL ( PBogus ) ;
DECL_PIOCTL ( PGetFileCell ) ;
DECL_PIOCTL ( PGetWSCell ) ;
DECL_PIOCTL ( PGetUserCell ) ;
DECL_PIOCTL ( PSetTokens ) ;
DECL_PIOCTL ( PGetVolumeStatus ) ;
DECL_PIOCTL ( PSetVolumeStatus ) ;
DECL_PIOCTL ( PFlush ) ;
DECL_PIOCTL ( PNewStatMount ) ;
DECL_PIOCTL ( PGetTokens ) ;
DECL_PIOCTL ( PUnlog ) ;
DECL_PIOCTL ( PMariner )
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static my_bool get_one_option ( int optid , const struct my_option * opt , char * argument ) {
switch ( optid ) {
case '#' : # ifndef DBUG_OFF DBUG_PUSH ( argument ? argument : "d:t:S:i:O,/tmp/mysqltest.trace" ) ;
debug_check_flag = 1 ;
debug_info_flag = 1 ;
# endif break ;
case 'r' : record = 1 ;
break ;
case 'x' : {
char buff [ FN_REFLEN ] ;
if ( ! test_if_hard_path ( argument ) ) {
strxmov ( buff , opt_basedir , argument , NullS ) ;
argument = buff ;
}
fn_format ( buff , argument , "" , "" , MY_UNPACK_FILENAME ) ;
DBUG_ASSERT ( cur_file == file_stack && cur_file -> file == 0 ) ;
if ( ! ( cur_file -> file = fopen ( buff , "rb" ) ) ) die ( "Could not open '%s' for reading, errno: %d" , buff , errno ) ;
cur_file -> file_name = my_strdup ( buff , MYF ( MY_FAE ) ) ;
cur_file -> lineno = 1 ;
break ;
}
case 'm' : {
static char buff [ FN_REFLEN ] ;
if ( ! test_if_hard_path ( argument ) ) {
strxmov ( buff , opt_basedir , argument , NullS ) ;
argument = buff ;
}
fn_format ( buff , argument , "" , "" , MY_UNPACK_FILENAME ) ;
timer_file = buff ;
unlink ( timer_file ) ;
break ;
}
case 'p' : if ( argument == disabled_my_option ) argument = ( char * ) "" ;
if ( argument ) {
my_free ( opt_pass ) ;
opt_pass = my_strdup ( argument , MYF ( MY_FAE ) ) ;
while ( * argument ) * argument ++ = 'x' ;
tty_password = 0 ;
}
else tty_password = 1 ;
break ;
# include < sslopt - case . h > case 't' : strnmov ( TMPDIR , argument , sizeof ( TMPDIR ) ) ;
break ;
case 'A' : if ( ! embedded_server_arg_count ) {
embedded_server_arg_count = 1 ;
embedded_server_args [ 0 ] = ( char * ) "" ;
}
if ( embedded_server_arg_count == MAX_EMBEDDED_SERVER_ARGS - 1 || ! ( embedded_server_args [ embedded_server_arg_count ++ ] = my_strdup ( argument , MYF ( MY_FAE ) ) ) ) {
die ( "Can't use server argument" ) ;
}
break ;
case OPT_LOG_DIR : if ( access ( opt_logdir , F_OK ) != 0 ) die ( "The specified log directory does not exist: '%s'" , opt_logdir ) ;
break ;
case 'F' : read_embedded_server_arguments ( argument ) ;
break ;
case OPT_RESULT_FORMAT_VERSION : set_result_format_version ( opt_result_format_version ) ;
break ;
case 'V' : print_version ( ) ;
exit ( 0 ) ;
case OPT_MYSQL_PROTOCOL : # ifndef EMBEDDED_LIBRARY opt_protocol = find_type_or_exit ( argument , & sql_protocol_typelib , opt -> name ) ;
# endif break ;
case '?' : usage ( ) ;
exit ( 0 ) ;
}
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int ber_realloc ( BerElement * ber , ber_len_t len ) {
ber_len_t total , offset , sos_offset ;
char * buf ;
assert ( ber != NULL ) ;
assert ( LBER_VALID ( ber ) ) ;
if ( ++ len == 0 ) {
return ( - 1 ) ;
}
total = ber_pvt_ber_total ( ber ) ;
# define LBER_EXBUFSIZ 4060 # if defined ( LBER_EXBUFSIZ ) && LBER_EXBUFSIZ > 0 # ifndef notdef total += len < LBER_EXBUFSIZ ? LBER_EXBUFSIZ : len ;
# else {
ber_len_t have = ( total + ( LBER_EXBUFSIZE - 1 ) ) / LBER_EXBUFSIZ ;
ber_len_t need = ( len + ( LBER_EXBUFSIZ - 1 ) ) / LBER_EXBUFSIZ ;
total = ( have + need ) * LBER_EXBUFSIZ ;
}
# endif # else total += len ;
# endif if ( total < len || total > ( ber_len_t ) - 1 / 2 ) {
return ( - 1 ) ;
}
buf = ber -> ber_buf ;
offset = ber -> ber_ptr - buf ;
sos_offset = ber -> ber_sos_ptr ? ber -> ber_sos_ptr - buf : 0 ;
buf = ( char * ) ber_memrealloc_x ( buf , total , ber -> ber_memctx ) ;
if ( buf == NULL ) {
return ( - 1 ) ;
}
ber -> ber_buf = buf ;
ber -> ber_end = buf + total ;
ber -> ber_ptr = buf + offset ;
if ( sos_offset ) ber -> ber_sos_ptr = buf + sos_offset ;
return ( 0 ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int vp9_full_search_sadx3 ( const MACROBLOCK * x , const MV * ref_mv , int sad_per_bit , int distance , const vp9_variance_fn_ptr_t * fn_ptr , const MV * center_mv , MV * best_mv ) {
int r ;
const MACROBLOCKD * const xd = & x -> e_mbd ;
const struct buf_2d * const what = & x -> plane [ 0 ] . src ;
const struct buf_2d * const in_what = & xd -> plane [ 0 ] . pre [ 0 ] ;
const int row_min = MAX ( ref_mv -> row - distance , x -> mv_row_min ) ;
const int row_max = MIN ( ref_mv -> row + distance , x -> mv_row_max ) ;
const int col_min = MAX ( ref_mv -> col - distance , x -> mv_col_min ) ;
const int col_max = MIN ( ref_mv -> col + distance , x -> mv_col_max ) ;
const MV fcenter_mv = {
center_mv -> row >> 3 , center_mv -> col >> 3 }
;
unsigned int best_sad = fn_ptr -> sdf ( what -> buf , what -> stride , get_buf_from_mv ( in_what , ref_mv ) , in_what -> stride ) + mvsad_err_cost ( x , ref_mv , & fcenter_mv , sad_per_bit ) ;
* best_mv = * ref_mv ;
for ( r = row_min ;
r < row_max ;
++ r ) {
int c = col_min ;
const uint8_t * check_here = & in_what -> buf [ r * in_what -> stride + c ] ;
if ( fn_ptr -> sdx3f != NULL ) {
while ( ( c + 2 ) < col_max ) {
int i ;
unsigned int sads [ 3 ] ;
fn_ptr -> sdx3f ( what -> buf , what -> stride , check_here , in_what -> stride , sads ) ;
for ( i = 0 ;
i < 3 ;
++ i ) {
unsigned int sad = sads [ i ] ;
if ( sad < best_sad ) {
const MV mv = {
r , c }
;
sad += mvsad_err_cost ( x , & mv , & fcenter_mv , sad_per_bit ) ;
if ( sad < best_sad ) {
best_sad = sad ;
* best_mv = mv ;
}
}
++ check_here ;
++ c ;
}
}
}
while ( c < col_max ) {
unsigned int sad = fn_ptr -> sdf ( what -> buf , what -> stride , check_here , in_what -> stride ) ;
if ( sad < best_sad ) {
const MV mv = {
r , c }
;
sad += mvsad_err_cost ( x , & mv , & fcenter_mv , sad_per_bit ) ;
if ( sad < best_sad ) {
best_sad = sad ;
* best_mv = mv ;
}
}
++ check_here ;
++ c ;
}
}
return best_sad ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int main ( int argc , char * * argv ) {
int frame_cnt = 0 ;
FILE * outfile = NULL ;
vpx_codec_ctx_t codec ;
VpxVideoReader * reader = NULL ;
const VpxVideoInfo * info = NULL ;
const VpxInterface * decoder = NULL ;
exec_name = argv [ 0 ] ;
if ( argc != 3 ) die ( "Invalid number of arguments." ) ;
reader = vpx_video_reader_open ( argv [ 1 ] ) ;
if ( ! reader ) die ( "Failed to open %s for reading." , argv [ 1 ] ) ;
if ( ! ( outfile = fopen ( argv [ 2 ] , "wb" ) ) ) die ( "Failed to open %s for writing." , argv [ 2 ] ) ;
info = vpx_video_reader_get_info ( reader ) ;
decoder = get_vpx_decoder_by_fourcc ( info -> codec_fourcc ) ;
if ( ! decoder ) die ( "Unknown input codec." ) ;
printf ( "Using %s\n" , vpx_codec_iface_name ( decoder -> codec_interface ( ) ) ) ;
if ( vpx_codec_dec_init ( & codec , decoder -> codec_interface ( ) , NULL , 0 ) ) die_codec ( & codec , "Failed to initialize decoder" ) ;
while ( vpx_video_reader_read_frame ( reader ) ) {
vpx_codec_iter_t iter = NULL ;
vpx_image_t * img = NULL ;
size_t frame_size = 0 ;
const unsigned char * frame = vpx_video_reader_get_frame ( reader , & frame_size ) ;
if ( vpx_codec_decode ( & codec , frame , ( unsigned int ) frame_size , NULL , 0 ) ) die_codec ( & codec , "Failed to decode frame" ) ;
while ( ( img = vpx_codec_get_frame ( & codec , & iter ) ) != NULL ) {
unsigned char digest [ 16 ] ;
get_image_md5 ( img , digest ) ;
print_md5 ( outfile , digest ) ;
fprintf ( outfile , " img-%dx%d-%04d.i420\n" , img -> d_w , img -> d_h , ++ frame_cnt ) ;
}
}
printf ( "Processed %d frames.\n" , frame_cnt ) ;
if ( vpx_codec_destroy ( & codec ) ) die_codec ( & codec , "Failed to destroy codec." ) ;
vpx_video_reader_close ( reader ) ;
fclose ( outfile ) ;
return EXIT_SUCCESS ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void remap_codebooks ( RoqContext * enc , RoqTempdata * tempData ) {
int i , j , idx = 0 ;
for ( i = 0 ;
i < MAX_CBS_4x4 ;
i ++ ) {
if ( tempData -> codebooks . usedCB4 [ i ] ) {
tempData -> i2f4 [ i ] = idx ;
tempData -> f2i4 [ idx ] = i ;
for ( j = 0 ;
j < 4 ;
j ++ ) tempData -> codebooks . usedCB2 [ enc -> cb4x4 [ i ] . idx [ j ] ] ++ ;
idx ++ ;
}
}
tempData -> numCB4 = idx ;
idx = 0 ;
for ( i = 0 ;
i < MAX_CBS_2x2 ;
i ++ ) {
if ( tempData -> codebooks . usedCB2 [ i ] ) {
tempData -> i2f2 [ i ] = idx ;
tempData -> f2i2 [ idx ] = i ;
idx ++ ;
}
}
tempData -> numCB2 = idx ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_h245_INTEGER_96_127 ( 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 , 96U , 127U , NULL , FALSE ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void systick_reload ( nvic_state * s , int reset ) {
if ( reset ) s -> systick . tick = qemu_get_clock_ns ( vm_clock ) ;
s -> systick . tick += ( s -> systick . reload + 1 ) * systick_scale ( s ) ;
qemu_mod_timer ( s -> systick . timer , s -> systick . tick ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void rd_encode_breakout_test ( VP9_COMP * cpi , MACROBLOCK * x , BLOCK_SIZE bsize , int * rate2 , int64_t * distortion , int64_t * distortion_uv , int * disable_skip ) {
VP9_COMMON * cm = & cpi -> common ;
MACROBLOCKD * xd = & x -> e_mbd ;
const BLOCK_SIZE y_size = get_plane_block_size ( bsize , & xd -> plane [ 0 ] ) ;
const BLOCK_SIZE uv_size = get_plane_block_size ( bsize , & xd -> plane [ 1 ] ) ;
unsigned int var , sse ;
unsigned int thresh_ac ;
unsigned int thresh_dc ;
var = cpi -> fn_ptr [ y_size ] . vf ( x -> plane [ 0 ] . src . buf , x -> plane [ 0 ] . src . stride , xd -> plane [ 0 ] . dst . buf , xd -> plane [ 0 ] . dst . stride , & sse ) ;
if ( x -> encode_breakout > 0 ) {
const unsigned int max_thresh = ( cpi -> allow_encode_breakout == ENCODE_BREAKOUT_LIMITED ) ? 128 : 36000 ;
const unsigned int min_thresh = MIN ( ( ( unsigned int ) x -> encode_breakout << 4 ) , max_thresh ) ;
thresh_ac = ( xd -> plane [ 0 ] . dequant [ 1 ] * xd -> plane [ 0 ] . dequant [ 1 ] ) / 9 ;
thresh_ac = clamp ( thresh_ac , min_thresh , max_thresh ) ;
thresh_ac >>= 8 - ( b_width_log2 ( bsize ) + b_height_log2 ( bsize ) ) ;
thresh_dc = ( xd -> plane [ 0 ] . dequant [ 0 ] * xd -> plane [ 0 ] . dequant [ 0 ] >> 6 ) ;
}
else {
thresh_ac = 0 ;
thresh_dc = 0 ;
}
if ( sse < thresh_ac || sse == 0 ) {
if ( ( sse - var ) < thresh_dc || sse == var ) {
unsigned int sse_u , sse_v ;
unsigned int var_u , var_v ;
var_u = cpi -> fn_ptr [ uv_size ] . vf ( x -> plane [ 1 ] . src . buf , x -> plane [ 1 ] . src . stride , xd -> plane [ 1 ] . dst . buf , xd -> plane [ 1 ] . dst . stride , & sse_u ) ;
if ( ( sse_u * 4 < thresh_ac || sse_u == 0 ) && ( sse_u - var_u < thresh_dc || sse_u == var_u ) ) {
var_v = cpi -> fn_ptr [ uv_size ] . vf ( x -> plane [ 2 ] . src . buf , x -> plane [ 2 ] . src . stride , xd -> plane [ 2 ] . dst . buf , xd -> plane [ 2 ] . dst . stride , & sse_v ) ;
if ( ( sse_v * 4 < thresh_ac || sse_v == 0 ) && ( sse_v - var_v < thresh_dc || sse_v == var_v ) ) {
x -> skip = 1 ;
* rate2 += vp9_cost_bit ( vp9_get_skip_prob ( cm , xd ) , 1 ) ;
* distortion_uv = ( sse_u + sse_v ) << 4 ;
* distortion = ( sse << 4 ) + * distortion_uv ;
* disable_skip = 1 ;
}
}
}
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void scaled_hb_excitation ( AMRWBContext * ctx , float * hb_exc , const float * synth_exc , float hb_gain ) {
int i ;
float energy = avpriv_scalarproduct_float_c ( synth_exc , synth_exc , AMRWB_SFR_SIZE ) ;
for ( i = 0 ;
i < AMRWB_SFR_SIZE_16k ;
i ++ ) hb_exc [ i ] = 32768.0 - ( uint16_t ) av_lfg_get ( & ctx -> prng ) ;
ff_scale_vector_to_given_sum_of_squares ( hb_exc , hb_exc , energy * hb_gain * hb_gain , AMRWB_SFR_SIZE_16k ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int decode ( MimicContext * ctx , int quality , int num_coeffs , int is_iframe ) {
int ret , y , x , plane , cur_row = 0 ;
for ( plane = 0 ;
plane < 3 ;
plane ++ ) {
const int is_chroma = ! ! plane ;
const int qscale = av_clip ( 10000 - quality , is_chroma ? 1000 : 2000 , 10000 ) << 2 ;
const int stride = ctx -> flipped_ptrs [ ctx -> cur_index ] . linesize [ plane ] ;
const uint8_t * src = ctx -> flipped_ptrs [ ctx -> prev_index ] . data [ plane ] ;
uint8_t * dst = ctx -> flipped_ptrs [ ctx -> cur_index ] . data [ plane ] ;
for ( y = 0 ;
y < ctx -> num_vblocks [ plane ] ;
y ++ ) {
for ( x = 0 ;
x < ctx -> num_hblocks [ plane ] ;
x ++ ) {
if ( is_iframe || get_bits1 ( & ctx -> gb ) == is_chroma ) {
if ( is_chroma || is_iframe || ! get_bits1 ( & ctx -> gb ) ) {
if ( ( ret = vlc_decode_block ( ctx , num_coeffs , qscale ) ) < 0 ) {
av_log ( ctx -> avctx , AV_LOG_ERROR , "Error decoding " "block.\n" ) ;
return ret ;
}
ctx -> dsp . idct_put ( dst , stride , ctx -> dct_block ) ;
}
else {
unsigned int backref = get_bits ( & ctx -> gb , 4 ) ;
int index = ( ctx -> cur_index + backref ) & 15 ;
uint8_t * p = ctx -> flipped_ptrs [ index ] . data [ 0 ] ;
if ( index != ctx -> cur_index && p ) {
ff_thread_await_progress ( & ctx -> frames [ index ] , cur_row , 0 ) ;
p += src - ctx -> flipped_ptrs [ ctx -> prev_index ] . data [ plane ] ;
ctx -> dsp . put_pixels_tab [ 1 ] [ 0 ] ( dst , p , stride , 8 ) ;
}
else {
av_log ( ctx -> avctx , AV_LOG_ERROR , "No such backreference! Buggy sample.\n" ) ;
}
}
}
else {
ff_thread_await_progress ( & ctx -> frames [ ctx -> prev_index ] , cur_row , 0 ) ;
ctx -> dsp . put_pixels_tab [ 1 ] [ 0 ] ( dst , src , stride , 8 ) ;
}
src += 8 ;
dst += 8 ;
}
src += ( stride - ctx -> num_hblocks [ plane ] ) << 3 ;
dst += ( stride - ctx -> num_hblocks [ plane ] ) << 3 ;
ff_thread_report_progress ( & ctx -> frames [ ctx -> cur_index ] , cur_row ++ , 0 ) ;
}
}
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void xps_draw_one_linear_gradient ( xps_document * doc , const fz_matrix * ctm , struct stop * stops , int count , int extend , float x0 , float y0 , float x1 , float y1 ) {
fz_shade * shade ;
shade = fz_malloc_struct ( doc -> ctx , fz_shade ) ;
FZ_INIT_STORABLE ( shade , 1 , fz_free_shade_imp ) ;
shade -> colorspace = fz_device_rgb ( doc -> ctx ) ;
shade -> bbox = fz_infinite_rect ;
shade -> matrix = fz_identity ;
shade -> use_background = 0 ;
shade -> use_function = 1 ;
shade -> type = FZ_LINEAR ;
shade -> u . l_or_r . extend [ 0 ] = extend ;
shade -> u . l_or_r . extend [ 1 ] = extend ;
xps_sample_gradient_stops ( shade , stops , count ) ;
shade -> u . l_or_r . coords [ 0 ] [ 0 ] = x0 ;
shade -> u . l_or_r . coords [ 0 ] [ 1 ] = y0 ;
shade -> u . l_or_r . coords [ 0 ] [ 2 ] = 0 ;
shade -> u . l_or_r . coords [ 1 ] [ 0 ] = x1 ;
shade -> u . l_or_r . coords [ 1 ] [ 1 ] = y1 ;
shade -> u . l_or_r . coords [ 1 ] [ 2 ] = 0 ;
fz_fill_shade ( doc -> dev , shade , ctm , doc -> opacity [ doc -> opacity_top ] ) ;
fz_drop_shade ( doc -> ctx , shade ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void x_get_work_area ( gx_device_X * xdev , int * pwidth , int * pheight ) {
long * area ;
if ( ( area = x_get_win_property ( xdev , "_NET_WORKAREA" ) ) != NULL || ( area = x_get_win_property ( xdev , "_WIN_WORKAREA" ) ) != NULL ) {
* pwidth = area [ 2 ] ;
* pheight = area [ 3 ] ;
XFree ( area ) ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int main ( int argc , char * * argv ) {
gpg_error_t err ;
if ( argc ) {
argc -- ;
argv ++ ;
}
if ( ! argc ) {
test_oid_to_str ( ) ;
}
else if ( ! strcmp ( * argv , "--from-str" ) ) {
unsigned char * buffer ;
size_t n , buflen ;
for ( argv ++ , argc -- ;
argc ;
argc -- , argv ++ ) {
err = ksba_oid_from_str ( * argv , & buffer , & buflen ) ;
if ( err ) {
fprintf ( stderr , "can't convert `%s': %s\n" , * argv , gpg_strerror ( err ) ) ;
return 1 ;
}
printf ( "%s ->" , * argv ) ;
for ( n = 0 ;
n < buflen ;
n ++ ) printf ( " %02X" , buffer [ n ] ) ;
putchar ( '\n' ) ;
free ( buffer ) ;
}
}
else if ( ! strcmp ( * argv , "--to-str" ) ) {
char * buffer ;
size_t buflen ;
char * result ;
argv ++ ;
argc -- ;
buffer = read_into_buffer ( stdin , & buflen ) ;
result = ksba_oid_to_str ( buffer , buflen ) ;
free ( buffer ) ;
printf ( "%s\n" , result ? result : "[malloc failed]" ) ;
free ( result ) ;
}
else {
fputs ( "usage: " PGM " [--from-str|--to-str]\n" , stderr ) ;
return 1 ;
}
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_h245_LogicalChannelRateRejectReason ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_choice ( tvb , offset , actx , tree , hf_index , ett_h245_LogicalChannelRateRejectReason , LogicalChannelRateRejectReason_choice , NULL ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int ra144_decode_frame ( AVCodecContext * avctx , void * data , int * got_frame_ptr , AVPacket * avpkt ) {
AVFrame * frame = data ;
const uint8_t * buf = avpkt -> data ;
int buf_size = avpkt -> size ;
static const uint8_t sizes [ LPC_ORDER ] = {
6 , 5 , 5 , 4 , 4 , 3 , 3 , 3 , 3 , 2 }
;
unsigned int refl_rms [ NBLOCKS ] ;
uint16_t block_coefs [ NBLOCKS ] [ LPC_ORDER ] ;
unsigned int lpc_refl [ LPC_ORDER ] ;
int i , j ;
int ret ;
int16_t * samples ;
unsigned int energy ;
RA144Context * ractx = avctx -> priv_data ;
GetBitContext gb ;
frame -> nb_samples = NBLOCKS * BLOCKSIZE ;
if ( ( ret = ff_get_buffer ( avctx , frame , 0 ) ) < 0 ) {
av_log ( avctx , AV_LOG_ERROR , "get_buffer() failed\n" ) ;
return ret ;
}
samples = ( int16_t * ) frame -> data [ 0 ] ;
if ( buf_size < FRAMESIZE ) {
av_log ( avctx , AV_LOG_ERROR , "Frame too small (%d bytes). Truncated file?\n" , buf_size ) ;
* got_frame_ptr = 0 ;
return buf_size ;
}
init_get_bits ( & gb , buf , FRAMESIZE * 8 ) ;
for ( i = 0 ;
i < LPC_ORDER ;
i ++ ) lpc_refl [ i ] = ff_lpc_refl_cb [ i ] [ get_bits ( & gb , sizes [ i ] ) ] ;
ff_eval_coefs ( ractx -> lpc_coef [ 0 ] , lpc_refl ) ;
ractx -> lpc_refl_rms [ 0 ] = ff_rms ( lpc_refl ) ;
energy = ff_energy_tab [ get_bits ( & gb , 5 ) ] ;
refl_rms [ 0 ] = ff_interp ( ractx , block_coefs [ 0 ] , 1 , 1 , ractx -> old_energy ) ;
refl_rms [ 1 ] = ff_interp ( ractx , block_coefs [ 1 ] , 2 , energy <= ractx -> old_energy , ff_t_sqrt ( energy * ractx -> old_energy ) >> 12 ) ;
refl_rms [ 2 ] = ff_interp ( ractx , block_coefs [ 2 ] , 3 , 0 , energy ) ;
refl_rms [ 3 ] = ff_rescale_rms ( ractx -> lpc_refl_rms [ 0 ] , energy ) ;
ff_int_to_int16 ( block_coefs [ 3 ] , ractx -> lpc_coef [ 0 ] ) ;
for ( i = 0 ;
i < NBLOCKS ;
i ++ ) {
do_output_subblock ( ractx , block_coefs [ i ] , refl_rms [ i ] , & gb ) ;
for ( j = 0 ;
j < BLOCKSIZE ;
j ++ ) * samples ++ = av_clip_int16 ( ractx -> curr_sblock [ j + 10 ] << 2 ) ;
}
ractx -> old_energy = energy ;
ractx -> lpc_refl_rms [ 1 ] = ractx -> lpc_refl_rms [ 0 ] ;
FFSWAP ( unsigned int * , ractx -> lpc_coef [ 0 ] , ractx -> lpc_coef [ 1 ] ) ;
* got_frame_ptr = 1 ;
return FRAMESIZE ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int ff_h264_execute_ref_pic_marking ( H264Context * h , MMCO * mmco , int mmco_count ) {
int i , av_uninit ( j ) ;
int current_ref_assigned = 0 , err = 0 ;
Picture * av_uninit ( pic ) ;
if ( ( h -> avctx -> debug & FF_DEBUG_MMCO ) && mmco_count == 0 ) av_log ( h -> avctx , AV_LOG_DEBUG , "no mmco here\n" ) ;
for ( i = 0 ;
i < mmco_count ;
i ++ ) {
int av_uninit ( structure ) , av_uninit ( frame_num ) ;
if ( h -> avctx -> debug & FF_DEBUG_MMCO ) av_log ( h -> avctx , AV_LOG_DEBUG , "mmco:%d %d %d\n" , h -> mmco [ i ] . opcode , h -> mmco [ i ] . short_pic_num , h -> mmco [ i ] . long_arg ) ;
if ( mmco [ i ] . opcode == MMCO_SHORT2UNUSED || mmco [ i ] . opcode == MMCO_SHORT2LONG ) {
frame_num = pic_num_extract ( h , mmco [ i ] . short_pic_num , & structure ) ;
pic = find_short ( h , frame_num , & j ) ;
if ( ! pic ) {
if ( mmco [ i ] . opcode != MMCO_SHORT2LONG || ! h -> long_ref [ mmco [ i ] . long_arg ] || h -> long_ref [ mmco [ i ] . long_arg ] -> frame_num != frame_num ) {
av_log ( h -> avctx , AV_LOG_ERROR , "mmco: unref short failure\n" ) ;
err = AVERROR_INVALIDDATA ;
}
continue ;
}
}
switch ( mmco [ i ] . opcode ) {
case MMCO_SHORT2UNUSED : if ( h -> avctx -> debug & FF_DEBUG_MMCO ) av_log ( h -> avctx , AV_LOG_DEBUG , "mmco: unref short %d count %d\n" , h -> mmco [ i ] . short_pic_num , h -> short_ref_count ) ;
remove_short ( h , frame_num , structure ^ PICT_FRAME ) ;
break ;
case MMCO_SHORT2LONG : if ( h -> long_ref [ mmco [ i ] . long_arg ] != pic ) remove_long ( h , mmco [ i ] . long_arg , 0 ) ;
remove_short_at_index ( h , j ) ;
h -> long_ref [ mmco [ i ] . long_arg ] = pic ;
if ( h -> long_ref [ mmco [ i ] . long_arg ] ) {
h -> long_ref [ mmco [ i ] . long_arg ] -> long_ref = 1 ;
h -> long_ref_count ++ ;
}
break ;
case MMCO_LONG2UNUSED : j = pic_num_extract ( h , mmco [ i ] . long_arg , & structure ) ;
pic = h -> long_ref [ j ] ;
if ( pic ) {
remove_long ( h , j , structure ^ PICT_FRAME ) ;
}
else if ( h -> avctx -> debug & FF_DEBUG_MMCO ) av_log ( h -> avctx , AV_LOG_DEBUG , "mmco: unref long failure\n" ) ;
break ;
case MMCO_LONG : if ( h -> long_ref [ mmco [ i ] . long_arg ] != h -> cur_pic_ptr ) {
remove_long ( h , mmco [ i ] . long_arg , 0 ) ;
h -> long_ref [ mmco [ i ] . long_arg ] = h -> cur_pic_ptr ;
h -> long_ref [ mmco [ i ] . long_arg ] -> long_ref = 1 ;
h -> long_ref_count ++ ;
}
h -> cur_pic_ptr -> reference |= h -> picture_structure ;
current_ref_assigned = 1 ;
break ;
case MMCO_SET_MAX_LONG : assert ( mmco [ i ] . long_arg <= 16 ) ;
for ( j = mmco [ i ] . long_arg ;
j < 16 ;
j ++ ) {
remove_long ( h , j , 0 ) ;
}
break ;
case MMCO_RESET : while ( h -> short_ref_count ) {
remove_short ( h , h -> short_ref [ 0 ] -> frame_num , 0 ) ;
}
for ( j = 0 ;
j < 16 ;
j ++ ) {
remove_long ( h , j , 0 ) ;
}
h -> frame_num = h -> cur_pic_ptr -> frame_num = 0 ;
h -> mmco_reset = 1 ;
h -> cur_pic_ptr -> mmco_reset = 1 ;
break ;
default : assert ( 0 ) ;
}
}
if ( ! current_ref_assigned ) {
if ( h -> short_ref_count && h -> short_ref [ 0 ] == h -> cur_pic_ptr ) {
h -> cur_pic_ptr -> reference = PICT_FRAME ;
}
else if ( h -> cur_pic_ptr -> long_ref ) {
av_log ( h -> avctx , AV_LOG_ERROR , "illegal short term reference " "assignment for second field " "in complementary field pair " "(first field is long term)\n" ) ;
err = AVERROR_INVALIDDATA ;
}
else {
pic = remove_short ( h , h -> cur_pic_ptr -> frame_num , 0 ) ;
if ( pic ) {
av_log ( h -> avctx , AV_LOG_ERROR , "illegal short term buffer state detected\n" ) ;
err = AVERROR_INVALIDDATA ;
}
if ( h -> short_ref_count ) memmove ( & h -> short_ref [ 1 ] , & h -> short_ref [ 0 ] , h -> short_ref_count * sizeof ( Picture * ) ) ;
h -> short_ref [ 0 ] = h -> cur_pic_ptr ;
h -> short_ref_count ++ ;
h -> cur_pic_ptr -> reference |= h -> picture_structure ;
}
}
if ( h -> long_ref_count + h -> short_ref_count - ( h -> short_ref [ 0 ] == h -> cur_pic_ptr ) > h -> sps . ref_frame_count ) {
av_log ( h -> avctx , AV_LOG_ERROR , "number of reference frames (%d+%d) exceeds max (%d;
probably " "corrupt input), discarding one\n" , h -> long_ref_count , h -> short_ref_count , h -> sps . ref_frame_count ) ;
err = AVERROR_INVALIDDATA ;
if ( h -> long_ref_count && ! h -> short_ref_count ) {
for ( i = 0 ;
i < 16 ;
++ i ) if ( h -> long_ref [ i ] ) break ;
assert ( i < 16 ) ;
remove_long ( h , i , 0 ) ;
}
else {
pic = h -> short_ref [ h -> short_ref_count - 1 ] ;
remove_short ( h , pic -> frame_num , 0 ) ;
}
}
print_short_term ( h ) ;
print_long_term ( h ) ;
return ( h -> avctx -> err_recognition & AV_EF_EXPLODE ) ? err : 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int copy_rules ( apr_pool_t * mp , msre_ruleset * parent_ruleset , msre_ruleset * child_ruleset , apr_array_header_t * exceptions_arr ) {
copy_rules_phase ( mp , parent_ruleset -> phase_request_headers , child_ruleset -> phase_request_headers , exceptions_arr ) ;
copy_rules_phase ( mp , parent_ruleset -> phase_request_body , child_ruleset -> phase_request_body , exceptions_arr ) ;
copy_rules_phase ( mp , parent_ruleset -> phase_response_headers , child_ruleset -> phase_response_headers , exceptions_arr ) ;
copy_rules_phase ( mp , parent_ruleset -> phase_response_body , child_ruleset -> phase_response_body , exceptions_arr ) ;
copy_rules_phase ( mp , parent_ruleset -> phase_logging , child_ruleset -> phase_logging , exceptions_arr ) ;
return 1 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static guint nlm_msg_res_unmatched_hash ( gconstpointer k ) {
const nlm_msg_res_unmatched_data * umd = ( const nlm_msg_res_unmatched_data * ) k ;
guint8 hash = 0 ;
int i ;
for ( i = 0 ;
i < umd -> cookie_len ;
i ++ ) {
hash ^= umd -> cookie [ i ] ;
}
return hash ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void aes_setkey_enc ( aes_context * ctx , const unsigned char * key , int keysize ) {
int i ;
unsigned long * RK ;
# if ! defined ( XYSSL_AES_ROM_TABLES ) if ( aes_init_done == 0 ) {
aes_gen_tables ( ) ;
aes_init_done = 1 ;
}
# endif switch ( keysize ) {
case 128 : ctx -> nr = 10 ;
break ;
case 192 : ctx -> nr = 12 ;
break ;
case 256 : ctx -> nr = 14 ;
break ;
default : return ;
}
# if defined ( PADLOCK_ALIGN16 ) ctx -> rk = RK = PADLOCK_ALIGN16 ( ctx -> buf ) ;
# else ctx -> rk = RK = ctx -> buf ;
# endif for ( i = 0 ;
i < ( keysize >> 5 ) ;
i ++ ) {
GET_ULONG_LE ( RK [ i ] , key , i << 2 ) ;
}
switch ( ctx -> nr ) {
case 10 : for ( i = 0 ;
i < 10 ;
i ++ , RK += 4 ) {
RK [ 4 ] = RK [ 0 ] ^ RCON [ i ] ^ ( FSb [ ( RK [ 3 ] >> 8 ) & 0xFF ] ) ^ ( FSb [ ( RK [ 3 ] >> 16 ) & 0xFF ] << 8 ) ^ ( FSb [ ( RK [ 3 ] >> 24 ) & 0xFF ] << 16 ) ^ ( ( ( unsigned int ) FSb [ ( RK [ 3 ] ) & 0xFF ] ) << 24 ) ;
RK [ 5 ] = RK [ 1 ] ^ RK [ 4 ] ;
RK [ 6 ] = RK [ 2 ] ^ RK [ 5 ] ;
RK [ 7 ] = RK [ 3 ] ^ RK [ 6 ] ;
}
break ;
case 12 : for ( i = 0 ;
i < 8 ;
i ++ , RK += 6 ) {
RK [ 6 ] = RK [ 0 ] ^ RCON [ i ] ^ ( FSb [ ( RK [ 5 ] >> 8 ) & 0xFF ] ) ^ ( FSb [ ( RK [ 5 ] >> 16 ) & 0xFF ] << 8 ) ^ ( FSb [ ( RK [ 5 ] >> 24 ) & 0xFF ] << 16 ) ^ ( ( ( unsigned int ) FSb [ ( RK [ 5 ] ) & 0xFF ] ) << 24 ) ;
RK [ 7 ] = RK [ 1 ] ^ RK [ 6 ] ;
RK [ 8 ] = RK [ 2 ] ^ RK [ 7 ] ;
RK [ 9 ] = RK [ 3 ] ^ RK [ 8 ] ;
RK [ 10 ] = RK [ 4 ] ^ RK [ 9 ] ;
RK [ 11 ] = RK [ 5 ] ^ RK [ 10 ] ;
}
break ;
case 14 : for ( i = 0 ;
i < 7 ;
i ++ , RK += 8 ) {
RK [ 8 ] = RK [ 0 ] ^ RCON [ i ] ^ ( FSb [ ( RK [ 7 ] >> 8 ) & 0xFF ] ) ^ ( FSb [ ( RK [ 7 ] >> 16 ) & 0xFF ] << 8 ) ^ ( FSb [ ( RK [ 7 ] >> 24 ) & 0xFF ] << 16 ) ^ ( ( ( unsigned int ) FSb [ ( RK [ 7 ] ) & 0xFF ] ) << 24 ) ;
RK [ 9 ] = RK [ 1 ] ^ RK [ 8 ] ;
RK [ 10 ] = RK [ 2 ] ^ RK [ 9 ] ;
RK [ 11 ] = RK [ 3 ] ^ RK [ 10 ] ;
RK [ 12 ] = RK [ 4 ] ^ ( FSb [ ( RK [ 11 ] ) & 0xFF ] ) ^ ( FSb [ ( RK [ 11 ] >> 8 ) & 0xFF ] << 8 ) ^ ( FSb [ ( RK [ 11 ] >> 16 ) & 0xFF ] << 16 ) ^ ( ( ( unsigned int ) FSb [ ( RK [ 11 ] >> 24 ) & 0xFF ] ) << 24 ) ;
RK [ 13 ] = RK [ 5 ] ^ RK [ 12 ] ;
RK [ 14 ] = RK [ 6 ] ^ RK [ 13 ] ;
RK [ 15 ] = RK [ 7 ] ^ RK [ 14 ] ;
}
break ;
default : break ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_h245_Ack_mediaChannel ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
# line 887 "../../asn1/h245/h245.cnf" if ( upcoming_channel ) upcoming_channel -> upcoming_addr = & upcoming_channel -> media_addr ;
offset = dissect_h245_TransportAddress ( tvb , offset , actx , tree , hf_index ) ;
# line 891 "../../asn1/h245/h245.cnf" if ( upcoming_channel ) upcoming_channel -> upcoming_addr = NULL ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int multiply ( unsigned long * amount , long with ) {
unsigned long sum = * amount * with ;
if ( sum / with != * amount ) return 1 ;
* amount = sum ;
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int mem_close ( gx_device * dev ) {
gx_device_memory * const mdev = ( gx_device_memory * ) dev ;
if ( mdev -> bitmap_memory != 0 ) {
gs_free_object ( mdev -> bitmap_memory , mdev -> base , "mem_close" ) ;
mdev -> base = 0 ;
}
else if ( mdev -> line_pointer_memory != 0 ) {
gs_free_object ( mdev -> line_pointer_memory , mdev -> line_ptrs , "mem_close" ) ;
mdev -> line_ptrs = 0 ;
}
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
IN_PROC_BROWSER_TEST_F ( PageLoadMetricsBrowserTest , PaintInMultipleChildFrames ) {
ASSERT_TRUE ( embedded_test_server ( ) -> Start ( ) ) ;
GURL a_url ( embedded_test_server ( ) -> GetURL ( "/page_load_metrics/iframes.html" ) ) ;
auto waiter = CreatePageLoadMetricsWaiter ( ) ;
waiter -> AddPageExpectation ( TimingField : : FIRST_LAYOUT ) ;
waiter -> AddPageExpectation ( TimingField : : LOAD_EVENT ) ;
waiter -> AddSubFrameExpectation ( TimingField : : FIRST_PAINT ) ;
waiter -> AddSubFrameExpectation ( TimingField : : FIRST_CONTENTFUL_PAINT ) ;
ui_test_utils : : NavigateToURL ( browser ( ) , a_url ) ;
waiter -> Wait ( ) ;
histogram_tester_ . ExpectTotalCount ( internal : : kHistogramFirstLayout , 1 ) ;
histogram_tester_ . ExpectTotalCount ( internal : : kHistogramLoad , 1 ) ;
histogram_tester_ . ExpectTotalCount ( internal : : kHistogramFirstPaint , 1 ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static MagickBooleanType ReadOneLayer ( const ImageInfo * image_info , Image * image , XCFDocInfo * inDocInfo , XCFLayerInfo * outLayer , const ssize_t layer , ExceptionInfo * exception ) {
MagickOffsetType offset ;
unsigned int foundPropEnd = 0 ;
size_t hierarchy_offset , layer_mask_offset ;
( void ) ResetMagickMemory ( outLayer , 0 , sizeof ( XCFLayerInfo ) ) ;
outLayer -> width = ReadBlobMSBLong ( image ) ;
outLayer -> height = ReadBlobMSBLong ( image ) ;
outLayer -> type = ReadBlobMSBLong ( image ) ;
( void ) ReadBlobStringWithLongSize ( image , outLayer -> name , sizeof ( outLayer -> name ) , exception ) ;
foundPropEnd = 0 ;
while ( ( foundPropEnd == MagickFalse ) && ( EOFBlob ( image ) == MagickFalse ) ) {
PropType prop_type = ( PropType ) ReadBlobMSBLong ( image ) ;
size_t prop_size = ReadBlobMSBLong ( image ) ;
switch ( prop_type ) {
case PROP_END : foundPropEnd = 1 ;
break ;
case PROP_ACTIVE_LAYER : outLayer -> active = 1 ;
break ;
case PROP_FLOATING_SELECTION : outLayer -> floating_offset = ReadBlobMSBLong ( image ) ;
break ;
case PROP_OPACITY : outLayer -> alpha = ReadBlobMSBLong ( image ) ;
break ;
case PROP_VISIBLE : outLayer -> visible = ReadBlobMSBLong ( image ) ;
break ;
case PROP_LINKED : outLayer -> linked = ReadBlobMSBLong ( image ) ;
break ;
case PROP_PRESERVE_TRANSPARENCY : outLayer -> preserve_trans = ReadBlobMSBLong ( image ) ;
break ;
case PROP_APPLY_MASK : outLayer -> apply_mask = ReadBlobMSBLong ( image ) ;
break ;
case PROP_EDIT_MASK : outLayer -> edit_mask = ReadBlobMSBLong ( image ) ;
break ;
case PROP_SHOW_MASK : outLayer -> show_mask = ReadBlobMSBLong ( image ) ;
break ;
case PROP_OFFSETS : outLayer -> offset_x = ( int ) ReadBlobMSBLong ( image ) ;
outLayer -> offset_y = ( int ) ReadBlobMSBLong ( image ) ;
break ;
case PROP_MODE : outLayer -> mode = ReadBlobMSBLong ( image ) ;
break ;
case PROP_TATTOO : outLayer -> preserve_trans = ReadBlobMSBLong ( image ) ;
break ;
case PROP_PARASITES : {
if ( DiscardBlobBytes ( image , prop_size ) == MagickFalse ) ThrowFileException ( exception , CorruptImageError , "UnexpectedEndOfFile" , image -> filename ) ;
}
break ;
default : {
int buf [ 16 ] ;
ssize_t amount ;
while ( ( prop_size > 0 ) && ( EOFBlob ( image ) == MagickFalse ) ) {
amount = ( ssize_t ) MagickMin ( 16 , prop_size ) ;
amount = ReadBlob ( image , ( size_t ) amount , ( unsigned char * ) & buf ) ;
if ( ! amount ) ThrowBinaryException ( CorruptImageError , "CorruptImage" , image -> filename ) ;
prop_size -= ( size_t ) MagickMin ( 16 , ( size_t ) amount ) ;
}
}
break ;
}
}
if ( foundPropEnd == MagickFalse ) return ( MagickFalse ) ;
if ( image_info -> number_scenes != 0 ) {
ssize_t scene ;
scene = inDocInfo -> number_layers - layer - 1 ;
if ( scene > ( ssize_t ) ( image_info -> scene + image_info -> number_scenes - 1 ) ) {
outLayer -> image = CloneImage ( image , 0 , 0 , MagickTrue , exception ) ;
if ( outLayer -> image == ( Image * ) NULL ) return ( MagickFalse ) ;
InitXCFImage ( outLayer , exception ) ;
return ( MagickTrue ) ;
}
}
outLayer -> image = CloneImage ( image , outLayer -> width , outLayer -> height , MagickTrue , exception ) ;
if ( outLayer -> image == ( Image * ) NULL ) return ( MagickFalse ) ;
outLayer -> image -> background_color . alpha = ScaleCharToQuantum ( ( unsigned char ) outLayer -> alpha ) ;
( void ) SetImageBackgroundColor ( outLayer -> image , exception ) ;
InitXCFImage ( outLayer , exception ) ;
outLayer -> image -> compose = GIMPBlendModeToCompositeOperator ( outLayer -> mode ) ;
if ( outLayer -> visible == MagickFalse ) {
outLayer -> image -> compose = NoCompositeOp ;
}
hierarchy_offset = ReadBlobMSBLong ( image ) ;
layer_mask_offset = ReadBlobMSBLong ( image ) ;
offset = SeekBlob ( image , ( MagickOffsetType ) hierarchy_offset , SEEK_SET ) ;
if ( offset < 0 ) ( void ) ThrowMagickException ( exception , GetMagickModule ( ) , CorruptImageError , "InvalidImageHeader" , "`%s'" , image -> filename ) ;
if ( load_hierarchy ( image , inDocInfo , outLayer , exception ) == 0 ) return ( MagickFalse ) ;
if ( layer_mask_offset != 0 ) {
offset = SeekBlob ( image , ( MagickOffsetType ) layer_mask_offset , SEEK_SET ) ;
# if 0 layer_mask = xcf_load_layer_mask ( info , gimage ) ;
if ( layer_mask == 0 ) goto error ;
GIMP_DRAWABLE ( layer_mask ) -> offset_x = GIMP_DRAWABLE ( layer ) -> offset_x ;
GIMP_DRAWABLE ( layer_mask ) -> offset_y = GIMP_DRAWABLE ( layer ) -> offset_y ;
gimp_layer_add_mask ( layer , layer_mask , MagickFalse ) ;
layer -> mask -> apply_mask = apply_mask ;
layer -> mask -> edit_mask = edit_mask ;
layer -> mask -> show_mask = show_mask ;
# endif }
# if 0 if ( add_floating_sel ) {
GimpLayer * floating_sel ;
floating_sel = info -> floating_sel ;
floating_sel_attach ( floating_sel , GIMP_DRAWABLE ( layer ) ) ;
}
# endif return MagickTrue ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void directory_count_stop ( NautilusDirectory * directory ) {
NautilusFile * file ;
if ( directory -> details -> count_in_progress != NULL ) {
file = directory -> details -> count_in_progress -> count_file ;
if ( file != NULL ) {
g_assert ( NAUTILUS_IS_FILE ( file ) ) ;
g_assert ( file -> details -> directory == directory ) ;
if ( is_needy ( file , should_get_directory_count_now , REQUEST_DIRECTORY_COUNT ) ) {
return ;
}
}
directory_count_cancel ( directory ) ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void cmd_channel_remove ( const char * data ) {
CHANNEL_SETUP_REC * rec ;
char * chatnet , * channel ;
void * free_arg ;
if ( ! cmd_get_params ( data , & free_arg , 2 , & channel , & chatnet ) ) return ;
if ( * chatnet == '\0' || * channel == '\0' ) cmd_param_error ( CMDERR_NOT_ENOUGH_PARAMS ) ;
rec = channel_setup_find ( channel , chatnet ) ;
if ( rec == NULL ) printformat ( NULL , NULL , MSGLEVEL_CLIENTNOTICE , TXT_CHANSETUP_NOT_FOUND , channel , chatnet ) ;
else {
printformat ( NULL , NULL , MSGLEVEL_CLIENTNOTICE , TXT_CHANSETUP_REMOVED , channel , chatnet ) ;
channel_setup_remove ( rec ) ;
}
cmd_params_free ( free_arg ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
TSReturnCode TSHttpTxnCntl ( TSHttpTxn txnp , TSHttpCntlType cntl , void * data ) {
sdk_assert ( sdk_sanity_check_txn ( txnp ) == TS_SUCCESS ) ;
HttpSM * sm = ( HttpSM * ) txnp ;
switch ( cntl ) {
case TS_HTTP_CNTL_GET_LOGGING_MODE : {
if ( data == nullptr ) {
return TS_ERROR ;
}
intptr_t * rptr = ( intptr_t * ) data ;
if ( sm -> t_state . api_info . logging_enabled ) {
* rptr = ( intptr_t ) TS_HTTP_CNTL_ON ;
}
else {
* rptr = ( intptr_t ) TS_HTTP_CNTL_OFF ;
}
return TS_SUCCESS ;
}
case TS_HTTP_CNTL_SET_LOGGING_MODE : if ( data != TS_HTTP_CNTL_ON && data != TS_HTTP_CNTL_OFF ) {
return TS_ERROR ;
}
else {
sm -> t_state . api_info . logging_enabled = ( bool ) data ;
return TS_SUCCESS ;
}
break ;
case TS_HTTP_CNTL_GET_INTERCEPT_RETRY_MODE : {
if ( data == nullptr ) {
return TS_ERROR ;
}
intptr_t * rptr = ( intptr_t * ) data ;
if ( sm -> t_state . api_info . retry_intercept_failures ) {
* rptr = ( intptr_t ) TS_HTTP_CNTL_ON ;
}
else {
* rptr = ( intptr_t ) TS_HTTP_CNTL_OFF ;
}
return TS_SUCCESS ;
}
case TS_HTTP_CNTL_SET_INTERCEPT_RETRY_MODE : if ( data != TS_HTTP_CNTL_ON && data != TS_HTTP_CNTL_OFF ) {
return TS_ERROR ;
}
else {
sm -> t_state . api_info . retry_intercept_failures = ( bool ) data ;
return TS_SUCCESS ;
}
default : return TS_ERROR ;
}
return TS_ERROR ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_h245_INTEGER_2_255 ( 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 , 2U , 255U , NULL , FALSE ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static Datum ExecEvalNot ( BoolExprState * notclause , ExprContext * econtext , bool * isNull , ExprDoneCond * isDone ) {
ExprState * clause = linitial ( notclause -> args ) ;
Datum expr_value ;
if ( isDone ) * isDone = ExprSingleResult ;
expr_value = ExecEvalExpr ( clause , econtext , isNull , NULL ) ;
if ( * isNull ) return expr_value ;
return BoolGetDatum ( ! DatumGetBool ( expr_value ) ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void http_hdr_url_set ( HdrHeap * heap , HTTPHdrImpl * hh , URLImpl * url ) {
ink_assert ( hh -> m_polarity == HTTP_TYPE_REQUEST ) ;
if ( hh -> u . req . m_url_impl != url ) {
if ( hh -> u . req . m_url_impl != nullptr ) {
heap -> deallocate_obj ( hh -> u . req . m_url_impl ) ;
}
hh -> u . req . m_url_impl = url ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int is_fullwidth ( int c ) {
int i ;
if ( c < mbfl_eaw_table [ 0 ] . begin ) {
return 0 ;
}
for ( i = 0 ;
i < sizeof ( mbfl_eaw_table ) / sizeof ( mbfl_eaw_table [ 0 ] ) ;
i ++ ) {
if ( mbfl_eaw_table [ i ] . begin <= c && c <= mbfl_eaw_table [ i ] . end ) {
return 1 ;
}
}
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void cyclic_background_refresh ( VP8_COMP * cpi , int Q , int lf_adjustment ) {
unsigned char * seg_map = cpi -> segmentation_map ;
signed char feature_data [ MB_LVL_MAX ] [ MAX_MB_SEGMENTS ] ;
int i ;
int block_count = cpi -> cyclic_refresh_mode_max_mbs_perframe ;
int mbs_in_frame = cpi -> common . mb_rows * cpi -> common . mb_cols ;
cpi -> cyclic_refresh_q = Q / 2 ;
vpx_memset ( cpi -> segmentation_map , 0 , mbs_in_frame ) ;
if ( cpi -> common . frame_type != KEY_FRAME ) {
i = cpi -> cyclic_refresh_mode_index ;
assert ( i < mbs_in_frame ) ;
do {
if ( cpi -> cyclic_refresh_map [ i ] == 0 ) {
seg_map [ i ] = 1 ;
block_count -- ;
}
else if ( cpi -> cyclic_refresh_map [ i ] < 0 ) cpi -> cyclic_refresh_map [ i ] ++ ;
i ++ ;
if ( i == mbs_in_frame ) i = 0 ;
}
while ( block_count && i != cpi -> cyclic_refresh_mode_index ) ;
cpi -> cyclic_refresh_mode_index = i ;
# if CONFIG_TEMPORAL_DENOISING if ( cpi -> oxcf . noise_sensitivity > 0 ) {
if ( cpi -> denoiser . denoiser_mode == kDenoiserOnYUVAggressive && Q < ( int ) cpi -> denoiser . denoise_pars . qp_thresh ) {
cpi -> cyclic_refresh_q = Q ;
lf_adjustment = - MAX_LOOP_FILTER ;
for ( i = 0 ;
i < mbs_in_frame ;
++ i ) {
seg_map [ i ] = ( cpi -> consec_zero_last [ i ] > cpi -> denoiser . denoise_pars . consec_zerolast ) ? 1 : 0 ;
}
}
}
# endif }
cpi -> mb . e_mbd . update_mb_segmentation_map = 1 ;
cpi -> mb . e_mbd . update_mb_segmentation_data = 1 ;
enable_segmentation ( cpi ) ;
feature_data [ MB_LVL_ALT_Q ] [ 0 ] = 0 ;
feature_data [ MB_LVL_ALT_Q ] [ 1 ] = ( cpi -> cyclic_refresh_q - Q ) ;
feature_data [ MB_LVL_ALT_Q ] [ 2 ] = 0 ;
feature_data [ MB_LVL_ALT_Q ] [ 3 ] = 0 ;
feature_data [ MB_LVL_ALT_LF ] [ 0 ] = 0 ;
feature_data [ MB_LVL_ALT_LF ] [ 1 ] = lf_adjustment ;
feature_data [ MB_LVL_ALT_LF ] [ 2 ] = 0 ;
feature_data [ MB_LVL_ALT_LF ] [ 3 ] = 0 ;
set_segment_data ( cpi , & feature_data [ 0 ] [ 0 ] , SEGMENT_DELTADATA ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void free_cal ( fz_context * ctx , fz_colorspace * cs ) {
fz_cal_colorspace * cal_data = cs -> data ;
if ( cal_data -> profile != NULL ) {
fz_drop_buffer ( ctx , cal_data -> profile -> buffer ) ;
fz_cmm_fin_profile ( ctx , cal_data -> profile ) ;
fz_free ( ctx , cal_data -> profile ) ;
}
fz_free ( ctx , cal_data ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int decode_13 ( AVCodecContext * avctx , DxaDecContext * c , uint8_t * dst , uint8_t * src , uint8_t * ref ) {
uint8_t * code , * data , * mv , * msk , * tmp , * tmp2 ;
int i , j , k ;
int type , x , y , d , d2 ;
int stride = c -> pic . linesize [ 0 ] ;
uint32_t mask ;
code = src + 12 ;
data = code + ( ( avctx -> width * avctx -> height ) >> 4 ) ;
mv = data + AV_RB32 ( src + 0 ) ;
msk = mv + AV_RB32 ( src + 4 ) ;
for ( j = 0 ;
j < avctx -> height ;
j += 4 ) {
for ( i = 0 ;
i < avctx -> width ;
i += 4 ) {
tmp = dst + i ;
tmp2 = ref + i ;
type = * code ++ ;
switch ( type ) {
case 4 : x = ( * mv ) >> 4 ;
if ( x & 8 ) x = 8 - x ;
y = ( * mv ++ ) & 0xF ;
if ( y & 8 ) y = 8 - y ;
tmp2 += x + y * stride ;
case 0 : case 5 : for ( y = 0 ;
y < 4 ;
y ++ ) {
memcpy ( tmp , tmp2 , 4 ) ;
tmp += stride ;
tmp2 += stride ;
}
break ;
case 1 : case 10 : case 11 : case 12 : case 13 : case 14 : case 15 : if ( type == 1 ) {
mask = AV_RB16 ( msk ) ;
msk += 2 ;
}
else {
type -= 10 ;
mask = ( ( msk [ 0 ] & 0xF0 ) << shift1 [ type ] ) | ( ( msk [ 0 ] & 0xF ) << shift2 [ type ] ) ;
msk ++ ;
}
for ( y = 0 ;
y < 4 ;
y ++ ) {
for ( x = 0 ;
x < 4 ;
x ++ ) {
tmp [ x ] = ( mask & 0x8000 ) ? * data ++ : tmp2 [ x ] ;
mask <<= 1 ;
}
tmp += stride ;
tmp2 += stride ;
}
break ;
case 2 : for ( y = 0 ;
y < 4 ;
y ++ ) {
memset ( tmp , data [ 0 ] , 4 ) ;
tmp += stride ;
}
data ++ ;
break ;
case 3 : for ( y = 0 ;
y < 4 ;
y ++ ) {
memcpy ( tmp , data , 4 ) ;
data += 4 ;
tmp += stride ;
}
break ;
case 8 : mask = * msk ++ ;
for ( k = 0 ;
k < 4 ;
k ++ ) {
d = ( ( k & 1 ) << 1 ) + ( ( k & 2 ) * stride ) ;
d2 = ( ( k & 1 ) << 1 ) + ( ( k & 2 ) * stride ) ;
tmp2 = ref + i + d2 ;
switch ( mask & 0xC0 ) {
case 0x80 : x = ( * mv ) >> 4 ;
if ( x & 8 ) x = 8 - x ;
y = ( * mv ++ ) & 0xF ;
if ( y & 8 ) y = 8 - y ;
tmp2 += x + y * stride ;
case 0x00 : tmp [ d + 0 ] = tmp2 [ 0 ] ;
tmp [ d + 1 ] = tmp2 [ 1 ] ;
tmp [ d + 0 + stride ] = tmp2 [ 0 + stride ] ;
tmp [ d + 1 + stride ] = tmp2 [ 1 + stride ] ;
break ;
case 0x40 : tmp [ d + 0 ] = data [ 0 ] ;
tmp [ d + 1 ] = data [ 0 ] ;
tmp [ d + 0 + stride ] = data [ 0 ] ;
tmp [ d + 1 + stride ] = data [ 0 ] ;
data ++ ;
break ;
case 0xC0 : tmp [ d + 0 ] = * data ++ ;
tmp [ d + 1 ] = * data ++ ;
tmp [ d + 0 + stride ] = * data ++ ;
tmp [ d + 1 + stride ] = * data ++ ;
break ;
}
mask <<= 2 ;
}
break ;
case 32 : mask = AV_RB16 ( msk ) ;
msk += 2 ;
for ( y = 0 ;
y < 4 ;
y ++ ) {
for ( x = 0 ;
x < 4 ;
x ++ ) {
tmp [ x ] = data [ mask & 1 ] ;
mask >>= 1 ;
}
tmp += stride ;
tmp2 += stride ;
}
data += 2 ;
break ;
case 33 : case 34 : mask = AV_RB32 ( msk ) ;
msk += 4 ;
for ( y = 0 ;
y < 4 ;
y ++ ) {
for ( x = 0 ;
x < 4 ;
x ++ ) {
tmp [ x ] = data [ mask & 3 ] ;
mask >>= 2 ;
}
tmp += stride ;
tmp2 += stride ;
}
data += type - 30 ;
break ;
default : av_log ( avctx , AV_LOG_ERROR , "Unknown opcode %d\n" , type ) ;
return AVERROR_INVALIDDATA ;
}
}
dst += stride * 4 ;
ref += stride * 4 ;
}
return 0 ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static ossl_inline int lh_ ## type ## _error ( LHASH_OF ( type ) * lh ) {
return OPENSSL_LH_error ( ( OPENSSL_LHASH * ) lh ) ;
}
static ossl_inline unsigned long lh_ ## type ## _num_items ( LHASH_OF ( type ) * lh ) {
return OPENSSL_LH_num_items ( ( OPENSSL_LHASH * ) lh ) ;
}
static ossl_inline void lh_ ## type ## _node_stats_bio ( const LHASH_OF ( type ) * lh , BIO * out ) {
OPENSSL_LH_node_stats_bio ( ( const OPENSSL_LHASH * ) lh , out ) ;
}
static ossl_inline void lh_ ## type ## _node_usage_stats_bio ( const LHASH_OF ( type ) * lh , BIO * out ) {
OPENSSL_LH_node_usage_stats_bio ( ( const OPENSSL_LHASH * ) lh , out ) ;
}
static ossl_inline void lh_ ## type ## _stats_bio ( const LHASH_OF ( type ) * lh , BIO * out ) {
OPENSSL_LH_stats_bio ( ( const OPENSSL_LHASH * ) lh , out ) ;
}
static ossl_inline unsigned long lh_ ## type ## _get_down_load ( LHASH_OF ( type ) * lh ) {
return OPENSSL_LH_get_down_load ( ( OPENSSL_LHASH * ) lh ) ;
}
static ossl_inline void lh_ ## type ## _set_down_load ( LHASH_OF ( type ) * lh , unsigned long dl ) {
OPENSSL_LH_set_down_load ( ( OPENSSL_LHASH * ) lh , dl ) ;
}
static ossl_inline void lh_ ## type ## _doall ( LHASH_OF ( type ) * lh , void ( * doall ) ( type * ) ) {
OPENSSL_LH_doall ( ( OPENSSL_LHASH * ) lh , ( OPENSSL_LH_DOALL_FUNC ) doall ) ;
}
LHASH_OF ( type ) # define IMPLEMENT_LHASH_DOALL_ARG_CONST ( type , argtype ) int_implement_lhash_doall ( type , argtype , const type ) # define IMPLEMENT_LHASH_DOALL_ARG ( type , argtype ) int_implement_lhash_doall ( type , argtype , type ) # define int_implement_lhash_doall ( type , argtype , cbargtype ) static ossl_inline void lh_ ## type ## _doall_ ## argtype ( LHASH_OF ( type ) * lh , void ( * fn ) ( cbargtype * , argtype * ) , argtype * arg ) {
OPENSSL_LH_doall_arg ( ( OPENSSL_LHASH * ) lh , ( OPENSSL_LH_DOALL_FUNCARG ) fn , ( void * ) arg ) ;
}
LHASH_OF ( type ) DEFINE_LHASH_OF ( OPENSSL_STRING )
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void decouple_info ( COOKContext * q , COOKSubpacket * p , int * decouple_tab ) {
int i ;
int vlc = get_bits1 ( & q -> gb ) ;
int start = cplband [ p -> js_subband_start ] ;
int end = cplband [ p -> subbands - 1 ] ;
int length = end - start + 1 ;
if ( start > end ) return ;
if ( vlc ) for ( i = 0 ;
i < length ;
i ++ ) decouple_tab [ start + i ] = get_vlc2 ( & q -> gb , p -> channel_coupling . table , p -> channel_coupling . bits , 2 ) ;
else for ( i = 0 ;
i < length ;
i ++ ) decouple_tab [ start + i ] = get_bits ( & q -> gb , p -> js_vlc_bits ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int fill_schema_column_privileges ( THD * thd , TABLE_LIST * tables , COND * cond ) {
# ifndef NO_EMBEDDED_ACCESS_CHECKS int error = 0 ;
uint index ;
char buff [ 100 ] ;
TABLE * table = tables -> table ;
bool no_global_access = check_access ( thd , SELECT_ACL , "mysql" , 0 , 1 , 1 , 0 ) ;
char * curr_host = thd -> security_ctx -> priv_host_name ( ) ;
DBUG_ENTER ( "fill_schema_table_privileges" ) ;
rw_rdlock ( & LOCK_grant ) ;
for ( index = 0 ;
index < column_priv_hash . records ;
index ++ ) {
const char * user , * host , * is_grantable = "YES" ;
GRANT_TABLE * grant_table = ( GRANT_TABLE * ) hash_element ( & column_priv_hash , index ) ;
if ( ! ( user = grant_table -> user ) ) user = "" ;
if ( ! ( host = grant_table -> host . hostname ) ) host = "" ;
if ( no_global_access && ( strcmp ( thd -> security_ctx -> priv_user , user ) || my_strcasecmp ( system_charset_info , curr_host , host ) ) ) continue ;
ulong table_access = grant_table -> cols ;
if ( table_access != 0 ) {
if ( ! ( grant_table -> privs & GRANT_ACL ) ) is_grantable = "NO" ;
ulong test_access = table_access & ~ GRANT_ACL ;
strxmov ( buff , "'" , user , "'@'" , host , "'" , NullS ) ;
if ( ! test_access ) continue ;
else {
ulong j ;
int cnt ;
for ( cnt = 0 , j = SELECT_ACL ;
j <= TABLE_ACLS ;
cnt ++ , j <<= 1 ) {
if ( test_access & j ) {
for ( uint col_index = 0 ;
col_index < grant_table -> hash_columns . records ;
col_index ++ ) {
GRANT_COLUMN * grant_column = ( GRANT_COLUMN * ) hash_element ( & grant_table -> hash_columns , col_index ) ;
if ( ( grant_column -> rights & j ) && ( table_access & j ) ) {
if ( update_schema_privilege ( thd , table , buff , grant_table -> db , grant_table -> tname , grant_column -> column , grant_column -> key_length , command_array [ cnt ] , command_lengths [ cnt ] , is_grantable ) ) {
error = 1 ;
goto err ;
}
}
}
}
}
}
}
}
err : rw_unlock ( & LOCK_grant ) ;
DBUG_RETURN ( error ) ;
# else return ( 0 ) ;
# endif }
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static uint32_t read_offs ( AVCodecContext * avctx , GetBitContext * gb , uint32_t size , const char * err_msg ) {
uint32_t offs = get_bits_long ( gb , 32 ) ;
if ( offs >= size ) {
av_log ( avctx , AV_LOG_WARNING , err_msg , offs , size ) ;
return 0 ;
}
return offs ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static bool config_filter_match_rest ( const struct config_filter * mask , const struct config_filter * filter ) {
bool matched ;
if ( mask -> local_name != NULL ) {
if ( filter -> local_name == NULL ) return FALSE ;
T_BEGIN {
matched = config_filter_match_local_name ( mask , filter -> local_name ) ;
}
T_END ;
if ( ! matched ) return FALSE ;
}
if ( mask -> remote_bits != 0 ) {
if ( filter -> remote_bits == 0 ) return FALSE ;
if ( ! net_is_in_network ( & filter -> remote_net , & mask -> remote_net , mask -> remote_bits ) ) return FALSE ;
}
if ( mask -> local_bits != 0 ) {
if ( filter -> local_bits == 0 ) return FALSE ;
if ( ! net_is_in_network ( & filter -> local_net , & mask -> local_net , mask -> local_bits ) ) return FALSE ;
}
return TRUE ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
xsltLocale xsltNewLocale ( const xmlChar * languageTag ) {
# ifdef XSLT_LOCALE_XLOCALE xsltLocale locale ;
char localeName [ XSLTMAX_LANGTAGLEN + 6 ] ;
const xmlChar * p = languageTag ;
const char * region = NULL ;
char * q = localeName ;
int i , llen ;
if ( languageTag == NULL ) return ( NULL ) ;
for ( i = 0 ;
i < XSLTMAX_ISO639LANGLEN && ISALPHA ( * p ) ;
++ i ) * q ++ = TOLOWER ( * p ++ ) ;
if ( i == 0 ) return ( NULL ) ;
llen = i ;
if ( * p ) {
if ( * p ++ != '-' ) return ( NULL ) ;
* q ++ = '_' ;
for ( i = 0 ;
i < XSLTMAX_ISO3166CNTRYLEN && ISALPHA ( * p ) ;
++ i ) * q ++ = TOUPPER ( * p ++ ) ;
if ( i == 0 || * p ) return ( NULL ) ;
memcpy ( q , ".utf8" , 6 ) ;
locale = newlocale ( LC_COLLATE_MASK , localeName , NULL ) ;
if ( locale != NULL ) return ( locale ) ;
q = localeName + llen ;
}
memcpy ( q , ".utf8" , 6 ) ;
locale = newlocale ( LC_COLLATE_MASK , localeName , NULL ) ;
if ( locale != NULL ) return ( locale ) ;
if ( llen != 2 ) return ( NULL ) ;
region = ( char * ) xsltDefaultRegion ( ( xmlChar * ) localeName ) ;
if ( region == NULL ) return ( NULL ) ;
q = localeName + llen ;
* q ++ = '_' ;
* q ++ = region [ 0 ] ;
* q ++ = region [ 1 ] ;
memcpy ( q , ".utf8" , 6 ) ;
locale = newlocale ( LC_COLLATE_MASK , localeName , NULL ) ;
return ( locale ) ;
# endif # ifdef XSLT_LOCALE_WINAPI {
xsltLocale locale = ( xsltLocale ) 0 ;
xmlChar localeName [ XSLTMAX_LANGTAGLEN + 1 ] ;
xmlChar * q = localeName ;
const xmlChar * p = languageTag ;
int i , llen ;
const xmlChar * region = NULL ;
if ( languageTag == NULL ) goto end ;
xsltEnumSupportedLocales ( ) ;
for ( i = 0 ;
i < XSLTMAX_ISO639LANGLEN && ISALPHA ( * p ) ;
++ i ) * q ++ = TOLOWER ( * p ++ ) ;
if ( i == 0 ) goto end ;
llen = i ;
* q ++ = '-' ;
if ( * p ) {
if ( * p ++ != '-' ) goto end ;
for ( i = 0 ;
i < XSLTMAX_ISO3166CNTRYLEN && ISALPHA ( * p ) ;
++ i ) * q ++ = TOUPPER ( * p ++ ) ;
if ( i == 0 || * p ) goto end ;
* q = '\0' ;
locale = xslt_locale_WINAPI ( localeName ) ;
if ( locale != ( xsltLocale ) 0 ) goto end ;
}
region = xsltDefaultRegion ( localeName ) ;
if ( region == NULL ) goto end ;
strcpy ( localeName + llen + 1 , region ) ;
locale = xslt_locale_WINAPI ( localeName ) ;
end : return ( locale ) ;
}
# endif # ifdef XSLT_LOCALE_NONE return ( NULL ) ;
# endif }
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void init_dequant_tables ( H264Context * h ) {
int i , x ;
init_dequant4_coeff_table ( h ) ;
if ( h -> pps . transform_8x8_mode ) init_dequant8_coeff_table ( h ) ;
if ( h -> sps . transform_bypass ) {
for ( i = 0 ;
i < 6 ;
i ++ ) for ( x = 0 ;
x < 16 ;
x ++ ) h -> dequant4_coeff [ i ] [ 0 ] [ x ] = 1 << 6 ;
if ( h -> pps . transform_8x8_mode ) for ( i = 0 ;
i < 6 ;
i ++ ) for ( x = 0 ;
x < 64 ;
x ++ ) h -> dequant8_coeff [ i ] [ 0 ] [ x ] = 1 << 6 ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void ExecuteSqlStatement ( Archive * AHX , const char * query ) {
ArchiveHandle * AH = ( ArchiveHandle * ) AHX ;
PGresult * res ;
res = PQexec ( AH -> connection , query ) ;
if ( PQresultStatus ( res ) != PGRES_COMMAND_OK ) die_on_query_failure ( AH , modulename , query ) ;
PQclear ( res ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void pk_transaction_search_files ( PkTransaction * transaction , GVariant * params , GDBusMethodInvocation * context ) {
gboolean ret ;
guint i ;
PkBitfield filter ;
g_autofree gchar * * values = NULL ;
g_autoptr ( GError ) error = NULL ;
g_return_if_fail ( PK_IS_TRANSACTION ( transaction ) ) ;
g_return_if_fail ( transaction -> priv -> tid != NULL ) ;
g_variant_get ( params , "(t^a&s)" , & filter , & values ) ;
g_debug ( "SearchFiles method called: %" G_GUINT64_FORMAT ", %s" , filter , values [ 0 ] ) ;
if ( ! pk_backend_is_implemented ( transaction -> priv -> backend , PK_ROLE_ENUM_SEARCH_FILE ) ) {
g_set_error ( & error , PK_TRANSACTION_ERROR , PK_TRANSACTION_ERROR_NOT_SUPPORTED , "SearchFiles not supported by backend" ) ;
pk_transaction_set_state ( transaction , PK_TRANSACTION_STATE_ERROR ) ;
goto out ;
}
ret = pk_transaction_search_check ( values , & error ) ;
if ( ! ret ) {
pk_transaction_set_state ( transaction , PK_TRANSACTION_STATE_ERROR ) ;
goto out ;
}
for ( i = 0 ;
values [ i ] != NULL ;
i ++ ) {
if ( values [ i ] [ 0 ] != '/' && strstr ( values [ i ] , "/" ) != NULL ) {
g_set_error ( & error , PK_TRANSACTION_ERROR , PK_TRANSACTION_ERROR_SEARCH_PATH_INVALID , "Invalid search path" ) ;
pk_transaction_set_state ( transaction , PK_TRANSACTION_STATE_ERROR ) ;
goto out ;
}
}
transaction -> priv -> cached_filters = filter ;
transaction -> priv -> cached_values = g_strdupv ( values ) ;
pk_transaction_set_role ( transaction , PK_ROLE_ENUM_SEARCH_FILE ) ;
pk_transaction_set_state ( transaction , PK_TRANSACTION_STATE_READY ) ;
out : pk_transaction_dbus_return ( context , error ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int i2d_PKCS8PrivateKeyInfo_bio ( BIO * bp , EVP_PKEY * key ) {
PKCS8_PRIV_KEY_INFO * p8inf ;
int ret ;
p8inf = EVP_PKEY2PKCS8 ( key ) ;
if ( ! p8inf ) return 0 ;
ret = i2d_PKCS8_PRIV_KEY_INFO_bio ( bp , p8inf ) ;
PKCS8_PRIV_KEY_INFO_free ( p8inf ) ;
return ret ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
unsigned int vp9_sub_pixel_variance ## W ## x ## H ## _c ( const uint8_t * src , int src_stride , int xoffset , int yoffset , const uint8_t * dst , int dst_stride , unsigned int * sse ) {
uint16_t fdata3 [ ( H + 1 ) * W ] ;
uint8_t temp2 [ H * W ] ;
var_filter_block2d_bil_first_pass ( src , fdata3 , src_stride , 1 , H + 1 , W , BILINEAR_FILTERS_2TAP ( xoffset ) ) ;
var_filter_block2d_bil_second_pass ( fdata3 , temp2 , W , W , H , W , BILINEAR_FILTERS_2TAP ( yoffset ) ) ;
return vp9_variance ## W ## x ## H ## _c ( temp2 , W , dst , dst_stride , sse ) ;
\ }
# define SUBPIX_AVG_VAR ( W , H ) unsigned int vp9_sub_pixel_avg_variance ## W ## x ## H ## _c ( const uint8_t * src , int src_stride , int xoffset , int yoffset , const uint8_t * dst , int dst_stride , unsigned int * sse , const uint8_t * second_pred ) {
uint16_t fdata3 [ ( H + 1 ) * W ] ;
uint8_t temp2 [ H * W ] ;
DECLARE_ALIGNED_ARRAY ( 16 , uint8_t , temp3 , H * W ) ;
var_filter_block2d_bil_first_pass ( src , fdata3 , src_stride , 1 , H + 1 , W , BILINEAR_FILTERS_2TAP ( xoffset ) ) ;
var_filter_block2d_bil_second_pass ( fdata3 , temp2 , W , W , H , W , BILINEAR_FILTERS_2TAP ( yoffset ) ) ;
vp9_comp_avg_pred ( temp3 , second_pred , W , H , temp2 , W ) ;
return vp9_variance ## W ## x ## H ## _c ( temp3 , W , dst , dst_stride , sse ) ;
\ }
void vp9_get16x16var_c ( const uint8_t * src_ptr , int source_stride , const uint8_t * ref_ptr , int ref_stride , unsigned int * sse , int * sum ) {
variance ( src_ptr , source_stride , ref_ptr , ref_stride , 16 , 16 , sse , sum ) ;
}
void vp9_get8x8var_c ( const uint8_t * src_ptr , int source_stride , const uint8_t * ref_ptr , int ref_stride , unsigned int * sse , int * sum ) {
variance ( src_ptr , source_stride , ref_ptr , ref_stride , 8 , 8 , sse , sum ) ;
}
unsigned int vp9_mse16x16_c ( const uint8_t * src , int src_stride , const uint8_t * ref , int ref_stride , unsigned int * sse ) {
int sum ;
variance ( src , src_stride , ref , ref_stride , 16 , 16 , sse , & sum ) ;
return * sse ;
}
unsigned int vp9_mse16x8_c ( const uint8_t * src , int src_stride , const uint8_t * ref , int ref_stride , unsigned int * sse ) {
int sum ;
variance ( src , src_stride , ref , ref_stride , 16 , 8 , sse , & sum ) ;
return * sse ;
}
unsigned int vp9_mse8x16_c ( const uint8_t * src , int src_stride , const uint8_t * ref , int ref_stride , unsigned int * sse ) {
int sum ;
variance ( src , src_stride , ref , ref_stride , 8 , 16 , sse , & sum ) ;
return * sse ;
}
unsigned int vp9_mse8x8_c ( const uint8_t * src , int src_stride , const uint8_t * ref , int ref_stride , unsigned int * sse ) {
int sum ;
variance ( src , src_stride , ref , ref_stride , 8 , 8 , sse , & sum ) ;
return * sse ;
}
VAR ( 4 , 4 ) SUBPIX_VAR ( 4 , 4 ) SUBPIX_AVG_VAR ( 4 , 4 ) VAR ( 4 , 8 ) SUBPIX_VAR ( 4 , 8 )
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
inline TSReturnCode sdk_sanity_check_cachekey ( TSCacheKey key ) {
if ( nullptr == key ) {
return TS_ERROR ;
}
return TS_SUCCESS ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static __inline__ int TLV_LIST_EMPTY ( struct tlv_list_desc * list ) {
return ( list -> tlv_space == 0 ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int lcc_network_buffer_add_value ( lcc_network_buffer_t * nb , const lcc_value_list_t * vl ) {
int status ;
if ( ( nb == NULL ) || ( vl == NULL ) ) return ( EINVAL ) ;
status = nb_add_value_list ( nb , vl ) ;
return ( status ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
TSReturnCode TSClientRequestUuidGet ( TSHttpTxn txnp , char * uuid_str ) {
sdk_assert ( sdk_sanity_check_null_ptr ( ( void * ) uuid_str ) == TS_SUCCESS ) ;
HttpSM * sm = ( HttpSM * ) txnp ;
const char * machine = ( char * ) Machine : : instance ( ) -> uuid . getString ( ) ;
int len ;
len = snprintf ( uuid_str , TS_CRUUID_STRING_LEN , "%s-%" PRId64 "" , machine , sm -> sm_id ) ;
if ( len > TS_CRUUID_STRING_LEN ) {
return TS_ERROR ;
}
return TS_SUCCESS ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void dissect_mdns_udp ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree ) {
col_set_str ( pinfo -> cinfo , COL_PROTOCOL , "MDNS" ) ;
dissect_dns_common ( tvb , pinfo , tree , FALSE , TRUE , FALSE ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int test_div_word ( BIO * bp ) {
BIGNUM a , b ;
BN_ULONG r , s ;
int i ;
BN_init ( & a ) ;
BN_init ( & b ) ;
for ( i = 0 ;
i < num0 ;
i ++ ) {
do {
BN_bntest_rand ( & a , 512 , - 1 , 0 ) ;
BN_bntest_rand ( & b , BN_BITS2 , - 1 , 0 ) ;
s = b . d [ 0 ] ;
}
while ( ! s ) ;
BN_copy ( & b , & a ) ;
r = BN_div_word ( & b , s ) ;
if ( bp != NULL ) {
if ( ! results ) {
BN_print ( bp , & a ) ;
BIO_puts ( bp , " / " ) ;
print_word ( bp , s ) ;
BIO_puts ( bp , " - " ) ;
}
BN_print ( bp , & b ) ;
BIO_puts ( bp , "\n" ) ;
if ( ! results ) {
BN_print ( bp , & a ) ;
BIO_puts ( bp , " % " ) ;
print_word ( bp , s ) ;
BIO_puts ( bp , " - " ) ;
}
print_word ( bp , r ) ;
BIO_puts ( bp , "\n" ) ;
}
BN_mul_word ( & b , s ) ;
BN_add_word ( & b , r ) ;
BN_sub ( & b , & a , & b ) ;
if ( ! BN_is_zero ( & b ) ) {
fprintf ( stderr , "Division (word) test failed!\n" ) ;
return 0 ;
}
}
BN_free ( & a ) ;
BN_free ( & b ) ;
return ( 1 ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
IN_PROC_BROWSER_TEST_F ( ContentFaviconDriverTest , AssociateIconWithInitialPageDespiteLocationOverrideWithinPage ) {
ASSERT_TRUE ( embedded_test_server ( ) -> Start ( ) ) ;
GURL url = embedded_test_server ( ) -> GetURL ( "/favicon/page_with_location_override_within_page.html" ) ;
GURL landing_url = embedded_test_server ( ) -> GetURL ( "/favicon/page_with_location_override_within_page.html#foo" ) ;
PendingTaskWaiter waiter ( web_contents ( ) ) ;
waiter . AlsoRequireUrl ( landing_url ) ;
ui_test_utils : : NavigateToURLWithDisposition ( browser ( ) , url , WindowOpenDisposition : : CURRENT_TAB , ui_test_utils : : BROWSER_TEST_NONE ) ;
waiter . Wait ( ) ;
EXPECT_NE ( nullptr , GetFaviconForPageURL ( url , favicon_base : : IconType : : kFavicon ) . bitmap_data ) ;
EXPECT_NE ( nullptr , GetFaviconForPageURL ( landing_url , favicon_base : : IconType : : kFavicon ) . bitmap_data ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_pvfs2_setattr_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_object_attr ( tvb , tree , offset , pinfo ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
ulong get_column_grant ( THD * thd , GRANT_INFO * grant , const char * db_name , const char * table_name , const char * field_name ) {
GRANT_TABLE * grant_table ;
GRANT_COLUMN * grant_column ;
ulong priv ;
rw_rdlock ( & LOCK_grant ) ;
if ( grant -> version != grant_version ) {
Security_context * sctx = thd -> security_ctx ;
grant -> grant_table = table_hash_search ( sctx -> host , sctx -> ip , db_name , sctx -> priv_user , table_name , 0 ) ;
grant -> version = grant_version ;
}
if ( ! ( grant_table = grant -> grant_table ) ) priv = grant -> privilege ;
else {
grant_column = column_hash_search ( grant_table , field_name , ( uint ) strlen ( field_name ) ) ;
if ( ! grant_column ) priv = ( grant -> privilege | grant_table -> privs ) ;
else priv = ( grant -> privilege | grant_table -> privs | grant_column -> rights ) ;
}
rw_unlock ( & LOCK_grant ) ;
return priv ;
}
| 0False
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.