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 long downtomult ( long x , long y ) {
assert ( x >= 0 ) ;
return ( x / y ) * y ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
SPL_METHOD ( SplFileObject , eof ) {
spl_filesystem_object * intern = ( spl_filesystem_object * ) zend_object_store_get_object ( getThis ( ) TSRMLS_CC ) ;
if ( zend_parse_parameters_none ( ) == FAILURE ) {
return ;
}
RETURN_BOOL ( php_stream_eof ( intern -> u . file . stream ) ) ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void test_free_result ( ) {
MYSQL_STMT * stmt ;
MYSQL_BIND my_bind [ 1 ] ;
char c2 [ 5 ] ;
ulong bl1 , l2 ;
int rc , c1 , bc1 ;
myheader ( "test_free_result" ) ;
rc = mysql_query ( mysql , "drop table if exists test_free_result" ) ;
myquery ( rc ) ;
rc = mysql_query ( mysql , "create table test_free_result(" "c1 int primary key auto_increment)" ) ;
myquery ( rc ) ;
rc = mysql_query ( mysql , "insert into test_free_result values(), (), ()" ) ;
myquery ( rc ) ;
stmt = mysql_simple_prepare ( mysql , "select * from test_free_result" ) ;
check_stmt ( stmt ) ;
memset ( my_bind , 0 , sizeof ( my_bind ) ) ;
my_bind [ 0 ] . buffer_type = MYSQL_TYPE_LONG ;
my_bind [ 0 ] . buffer = ( void * ) & bc1 ;
my_bind [ 0 ] . length = & bl1 ;
rc = mysql_stmt_execute ( stmt ) ;
check_execute ( stmt , rc ) ;
rc = mysql_stmt_bind_result ( stmt , my_bind ) ;
check_execute ( stmt , rc ) ;
rc = mysql_stmt_fetch ( stmt ) ;
check_execute ( stmt , rc ) ;
c2 [ 0 ] = '\0' ;
l2 = 0 ;
my_bind [ 0 ] . buffer_type = MYSQL_TYPE_STRING ;
my_bind [ 0 ] . buffer = ( void * ) c2 ;
my_bind [ 0 ] . buffer_length = 7 ;
my_bind [ 0 ] . is_null = 0 ;
my_bind [ 0 ] . length = & l2 ;
rc = mysql_stmt_fetch_column ( stmt , my_bind , 0 , 0 ) ;
check_execute ( stmt , rc ) ;
if ( ! opt_silent ) fprintf ( stdout , "\n col 0: %s(%ld)" , c2 , l2 ) ;
DIE_UNLESS ( strncmp ( c2 , "1" , 1 ) == 0 && l2 == 1 ) ;
rc = mysql_stmt_fetch ( stmt ) ;
check_execute ( stmt , rc ) ;
c1 = 0 , l2 = 0 ;
my_bind [ 0 ] . buffer_type = MYSQL_TYPE_LONG ;
my_bind [ 0 ] . buffer = ( void * ) & c1 ;
my_bind [ 0 ] . buffer_length = 0 ;
my_bind [ 0 ] . is_null = 0 ;
my_bind [ 0 ] . length = & l2 ;
rc = mysql_stmt_fetch_column ( stmt , my_bind , 0 , 0 ) ;
check_execute ( stmt , rc ) ;
if ( ! opt_silent ) fprintf ( stdout , "\n col 0: %d(%ld)" , c1 , l2 ) ;
DIE_UNLESS ( c1 == 2 && l2 == 4 ) ;
rc = mysql_query ( mysql , "drop table test_free_result" ) ;
myquery_r ( rc ) ;
rc = mysql_stmt_free_result ( stmt ) ;
check_execute ( stmt , rc ) ;
rc = mysql_query ( mysql , "drop table test_free_result" ) ;
myquery ( rc ) ;
mysql_stmt_close ( stmt ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static __inline __uint64_t __uint64_identity ( __uint64_t __x ) {
return __x ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_h245_SET_SIZE_1_16_OF_H263ModeComboFlags ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_constrained_set_of ( tvb , offset , actx , tree , hf_index , ett_h245_SET_SIZE_1_16_OF_H263ModeComboFlags , SET_SIZE_1_16_OF_H263ModeComboFlags_set_of , 1 , 16 , FALSE ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int qemuMonitorJSONSaveVirtualMemory ( qemuMonitorPtr mon , unsigned long long offset , size_t length , const char * path ) {
return qemuMonitorJSONSaveMemory ( mon , "memsave" , offset , length , path ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
bool is_pseudo_constant_clause_relids ( Node * clause , Relids relids ) {
if ( bms_is_empty ( relids ) && ! contain_volatile_functions ( clause ) ) return true ;
return false ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void vga_draw_line4d2 ( VGACommonState * vga , uint8_t * d , uint32_t addr , int width ) {
uint32_t plane_mask , data , v , * palette ;
int x ;
palette = vga -> last_palette ;
plane_mask = mask16 [ vga -> ar [ VGA_ATC_PLANE_ENABLE ] & 0xf ] ;
width >>= 3 ;
for ( x = 0 ;
x < width ;
x ++ ) {
data = vga_read_dword_le ( vga , addr ) ;
data &= plane_mask ;
v = expand4 [ GET_PLANE ( data , 0 ) ] ;
v |= expand4 [ GET_PLANE ( data , 1 ) ] << 1 ;
v |= expand4 [ GET_PLANE ( data , 2 ) ] << 2 ;
v |= expand4 [ GET_PLANE ( data , 3 ) ] << 3 ;
PUT_PIXEL2 ( d , 0 , palette [ v >> 28 ] ) ;
PUT_PIXEL2 ( d , 1 , palette [ ( v >> 24 ) & 0xf ] ) ;
PUT_PIXEL2 ( d , 2 , palette [ ( v >> 20 ) & 0xf ] ) ;
PUT_PIXEL2 ( d , 3 , palette [ ( v >> 16 ) & 0xf ] ) ;
PUT_PIXEL2 ( d , 4 , palette [ ( v >> 12 ) & 0xf ] ) ;
PUT_PIXEL2 ( d , 5 , palette [ ( v >> 8 ) & 0xf ] ) ;
PUT_PIXEL2 ( d , 6 , palette [ ( v >> 4 ) & 0xf ] ) ;
PUT_PIXEL2 ( d , 7 , palette [ ( v >> 0 ) & 0xf ] ) ;
d += 64 ;
addr += 4 ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
REGRESSION_TEST ( SDK_API_TSIOBufferCopy ) ( RegressionTest * test , int , int * pstatus ) {
bool test_passed = false ;
* pstatus = REGRESSION_TEST_INPROGRESS ;
char input_buf [ ] = "This is the test for TSIOBufferCopy, TSIOBufferWrite, TSIOBufferReaderCopy" ;
char output_buf [ 1024 ] ;
TSIOBuffer bufp = TSIOBufferSizedCreate ( TS_IOBUFFER_SIZE_INDEX_4K ) ;
TSIOBuffer bufp2 = TSIOBufferSizedCreate ( TS_IOBUFFER_SIZE_INDEX_4K ) ;
TSIOBufferReader readerp = TSIOBufferReaderAlloc ( bufp ) ;
TSIOBufferWrite ( bufp , input_buf , ( strlen ( input_buf ) + 1 ) ) ;
TSIOBufferCopy ( bufp2 , readerp , ( strlen ( input_buf ) + 1 ) , 0 ) ;
TSIOBufferReaderCopy ( readerp , output_buf , ( strlen ( input_buf ) + 1 ) ) ;
if ( strcmp ( input_buf , output_buf ) == 0 ) {
SDK_RPRINT ( test , "TSIOBufferWrite" , "TestCase1" , TC_PASS , "ok" ) ;
SDK_RPRINT ( test , "TSIOBufferCopy" , "TestCase1" , TC_PASS , "ok" ) ;
SDK_RPRINT ( test , "TSIOBufferReaderCopy" , "TestCase1" , TC_PASS , "ok" ) ;
test_passed = true ;
}
else {
SDK_RPRINT ( test , "TSIOBufferWrite" , "TestCase1" , TC_FAIL , "failed" ) ;
SDK_RPRINT ( test , "TSIOBufferCopy" , "TestCase1" , TC_FAIL , "failed" ) ;
SDK_RPRINT ( test , "TSIOBufferReaderCopy" , "TestCase1" , TC_FAIL , "failed" ) ;
}
* pstatus = ( ( test_passed == true ) ? REGRESSION_TEST_PASSED : REGRESSION_TEST_FAILED ) ;
return ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int gcry_pk_map_name ( const char * string ) {
gcry_module_t pubkey ;
int algorithm = 0 ;
if ( ! string ) return 0 ;
REGISTER_DEFAULT_PUBKEYS ;
ath_mutex_lock ( & pubkeys_registered_lock ) ;
pubkey = gcry_pk_lookup_name ( string ) ;
if ( pubkey ) {
algorithm = pubkey -> mod_id ;
_gcry_module_release ( pubkey ) ;
}
ath_mutex_unlock ( & pubkeys_registered_lock ) ;
return algorithm ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static size_t wrap_fwrite ( const void * ptr , size_t size , size_t nmemb , FILE * stream ) {
return fwrite ( ptr , size , nmemb , stream ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int vp3_decode_frame ( AVCodecContext * avctx , void * data , int * got_frame , AVPacket * avpkt ) {
const uint8_t * buf = avpkt -> data ;
int buf_size = avpkt -> size ;
Vp3DecodeContext * s = avctx -> priv_data ;
GetBitContext gb ;
int i , ret ;
init_get_bits ( & gb , buf , buf_size * 8 ) ;
if ( s -> theora && get_bits1 ( & gb ) ) {
av_log ( avctx , AV_LOG_ERROR , "Header packet passed to frame decoder, skipping\n" ) ;
return - 1 ;
}
s -> keyframe = ! get_bits1 ( & gb ) ;
if ( ! s -> theora ) skip_bits ( & gb , 1 ) ;
for ( i = 0 ;
i < 3 ;
i ++ ) s -> last_qps [ i ] = s -> qps [ i ] ;
s -> nqps = 0 ;
do {
s -> qps [ s -> nqps ++ ] = get_bits ( & gb , 6 ) ;
}
while ( s -> theora >= 0x030200 && s -> nqps < 3 && get_bits1 ( & gb ) ) ;
for ( i = s -> nqps ;
i < 3 ;
i ++ ) s -> qps [ i ] = - 1 ;
if ( s -> avctx -> debug & FF_DEBUG_PICT_INFO ) av_log ( s -> avctx , AV_LOG_INFO , " VP3 %sframe #%d: Q index = %d\n" , s -> keyframe ? "key" : "" , avctx -> frame_number + 1 , s -> qps [ 0 ] ) ;
s -> skip_loop_filter = ! s -> filter_limit_values [ s -> qps [ 0 ] ] || avctx -> skip_loop_filter >= ( s -> keyframe ? AVDISCARD_ALL : AVDISCARD_NONKEY ) ;
if ( s -> qps [ 0 ] != s -> last_qps [ 0 ] ) init_loop_filter ( s ) ;
for ( i = 0 ;
i < s -> nqps ;
i ++ ) if ( s -> qps [ i ] != s -> last_qps [ i ] || s -> qps [ 0 ] != s -> last_qps [ 0 ] ) init_dequantizer ( s , i ) ;
if ( avctx -> skip_frame >= AVDISCARD_NONKEY && ! s -> keyframe ) return buf_size ;
s -> current_frame . f -> pict_type = s -> keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P ;
if ( ff_thread_get_buffer ( avctx , & s -> current_frame , AV_GET_BUFFER_FLAG_REF ) < 0 ) {
av_log ( s -> avctx , AV_LOG_ERROR , "get_buffer() failed\n" ) ;
goto error ;
}
if ( ! s -> edge_emu_buffer ) s -> edge_emu_buffer = av_malloc ( 9 * FFABS ( s -> current_frame . f -> linesize [ 0 ] ) ) ;
if ( s -> keyframe ) {
if ( ! s -> theora ) {
skip_bits ( & gb , 4 ) ;
skip_bits ( & gb , 4 ) ;
if ( s -> version ) {
s -> version = get_bits ( & gb , 5 ) ;
if ( avctx -> frame_number == 0 ) av_log ( s -> avctx , AV_LOG_DEBUG , "VP version: %d\n" , s -> version ) ;
}
}
if ( s -> version || s -> theora ) {
if ( get_bits1 ( & gb ) ) av_log ( s -> avctx , AV_LOG_ERROR , "Warning, unsupported keyframe coding type?!\n" ) ;
skip_bits ( & gb , 2 ) ;
}
}
else {
if ( ! s -> golden_frame . f -> data [ 0 ] ) {
av_log ( s -> avctx , AV_LOG_WARNING , "vp3: first frame not a keyframe\n" ) ;
s -> golden_frame . f -> pict_type = AV_PICTURE_TYPE_I ;
if ( ff_thread_get_buffer ( avctx , & s -> golden_frame , AV_GET_BUFFER_FLAG_REF ) < 0 ) {
av_log ( s -> avctx , AV_LOG_ERROR , "get_buffer() failed\n" ) ;
goto error ;
}
ff_thread_release_buffer ( avctx , & s -> last_frame ) ;
if ( ( ret = ff_thread_ref_frame ( & s -> last_frame , & s -> golden_frame ) ) < 0 ) goto error ;
ff_thread_report_progress ( & s -> last_frame , INT_MAX , 0 ) ;
}
}
memset ( s -> all_fragments , 0 , s -> fragment_count * sizeof ( Vp3Fragment ) ) ;
ff_thread_finish_setup ( avctx ) ;
if ( unpack_superblocks ( s , & gb ) ) {
av_log ( s -> avctx , AV_LOG_ERROR , "error in unpack_superblocks\n" ) ;
goto error ;
}
if ( unpack_modes ( s , & gb ) ) {
av_log ( s -> avctx , AV_LOG_ERROR , "error in unpack_modes\n" ) ;
goto error ;
}
if ( unpack_vectors ( s , & gb ) ) {
av_log ( s -> avctx , AV_LOG_ERROR , "error in unpack_vectors\n" ) ;
goto error ;
}
if ( unpack_block_qpis ( s , & gb ) ) {
av_log ( s -> avctx , AV_LOG_ERROR , "error in unpack_block_qpis\n" ) ;
goto error ;
}
if ( unpack_dct_coeffs ( s , & gb ) ) {
av_log ( s -> avctx , AV_LOG_ERROR , "error in unpack_dct_coeffs\n" ) ;
goto error ;
}
for ( i = 0 ;
i < 3 ;
i ++ ) {
int height = s -> height >> ( i && s -> chroma_y_shift ) ;
if ( s -> flipped_image ) s -> data_offset [ i ] = 0 ;
else s -> data_offset [ i ] = ( height - 1 ) * s -> current_frame . f -> linesize [ i ] ;
}
s -> last_slice_end = 0 ;
for ( i = 0 ;
i < s -> c_superblock_height ;
i ++ ) render_slice ( s , i ) ;
for ( i = 0 ;
i < 3 ;
i ++ ) {
int row = ( s -> height >> ( 3 + ( i && s -> chroma_y_shift ) ) ) - 1 ;
apply_loop_filter ( s , i , row , row + 1 ) ;
}
vp3_draw_horiz_band ( s , s -> avctx -> height ) ;
if ( ( ret = av_frame_ref ( data , s -> current_frame . f ) ) < 0 ) return ret ;
* got_frame = 1 ;
if ( ! HAVE_THREADS || ! ( s -> avctx -> active_thread_type & FF_THREAD_FRAME ) ) {
ret = update_frames ( avctx ) ;
if ( ret < 0 ) return ret ;
}
return buf_size ;
error : ff_thread_report_progress ( & s -> current_frame , INT_MAX , 0 ) ;
if ( ! HAVE_THREADS || ! ( s -> avctx -> active_thread_type & FF_THREAD_FRAME ) ) av_frame_unref ( s -> current_frame . f ) ;
return - 1 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_PRINTER_DATATYPE ( tvbuff_t * tvb , int offset , packet_info * pinfo , proto_tree * tree , dcerpc_info * di , guint8 * drep _U_ ) {
if ( di -> conformant_run ) return offset ;
offset = dissect_ndr_cvstring ( tvb , offset , pinfo , tree , di , drep , sizeof ( guint16 ) , hf_datatype , TRUE , NULL ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void key_put ( struct key * key ) {
if ( key ) {
key_check ( key ) ;
if ( atomic_dec_and_test ( & key -> usage ) ) schedule_work ( & key_gc_work ) ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void name ## _free ( type * a ) ;
# define DECLARE_ASN1_PRINT_FUNCTION ( stname ) DECLARE_ASN1_PRINT_FUNCTION_fname ( stname , stname ) # define DECLARE_ASN1_PRINT_FUNCTION_fname ( stname , fname ) int fname ## _print_ctx ( BIO * out , stname * x , int indent , const ASN1_PCTX * pctx ) ;
# define D2I_OF ( type ) type * ( * ) ( type * * , const unsigned char * * , long ) # define I2D_OF ( type ) int ( * ) ( type * , unsigned char * * ) # define I2D_OF_const ( type ) int ( * ) ( const type * , unsigned char * * ) # define CHECKED_D2I_OF ( type , d2i ) ( ( d2i_of_void * ) ( 1 ? d2i : ( ( D2I_OF ( type ) ) 0 ) ) ) # define CHECKED_I2D_OF ( type , i2d ) ( ( i2d_of_void * ) ( 1 ? i2d : ( ( I2D_OF ( type ) ) 0 ) ) ) # define CHECKED_NEW_OF ( type , xnew ) ( ( void * ( * ) ( void ) ) ( 1 ? xnew : ( ( type * ( * ) ( void ) ) 0 ) ) ) # define CHECKED_PTR_OF ( type , p ) ( ( void * ) ( 1 ? p : ( type * ) 0 ) ) # define CHECKED_PPTR_OF ( type , p ) ( ( void * * ) ( 1 ? p : ( type * * ) 0 ) ) # define TYPEDEF_D2I_OF ( type ) typedef type * d2i_of_ ## type ( type * * , const unsigned char * * , long ) # define TYPEDEF_I2D_OF ( type ) typedef int i2d_of_ ## type ( type * , unsigned char * * ) # define TYPEDEF_D2I2D_OF ( type ) TYPEDEF_D2I_OF ( type ) ;
TYPEDEF_I2D_OF ( type ) TYPEDEF_D2I2D_OF ( void ) ;
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION typedef const ASN1_ITEM ASN1_ITEM_EXP ;
# define ASN1_ITEM_ptr ( iptr ) ( iptr ) # define ASN1_ITEM_ref ( iptr ) ( & ( iptr ## _it ) ) # define ASN1_ITEM_rptr ( ref ) ( & ( ref ## _it ) ) # define DECLARE_ASN1_ITEM ( name ) OPENSSL_EXTERN const ASN1_ITEM name ## _it ;
# else typedef const ASN1_ITEM * ASN1_ITEM_EXP ( void ) ;
# define ASN1_ITEM_ptr ( iptr ) ( iptr ( ) ) # define ASN1_ITEM_ref ( iptr ) ( iptr ## _it ) # define ASN1_ITEM_rptr ( ref ) ( ref ## _it ( ) ) # define DECLARE_ASN1_ITEM ( name ) const ASN1_ITEM * name ## _it ( void ) ;
# endif # define ASN1_STRFLGS_ESC_2253 1 # define ASN1_STRFLGS_ESC_CTRL 2 # define ASN1_STRFLGS_ESC_MSB 4 # define ASN1_STRFLGS_ESC_QUOTE 8 # define CHARTYPE_PRINTABLESTRING 0x10 # define CHARTYPE_FIRST_ESC_2253 0x20 # define CHARTYPE_LAST_ESC_2253 0x40 # define ASN1_STRFLGS_UTF8_CONVERT 0x10 # define ASN1_STRFLGS_IGNORE_TYPE 0x20 # define ASN1_STRFLGS_SHOW_TYPE 0x40 # define ASN1_STRFLGS_DUMP_ALL 0x80 # define ASN1_STRFLGS_DUMP_UNKNOWN 0x100 # define ASN1_STRFLGS_DUMP_DER 0x200 # define ASN1_STRFLGS_ESC_2254 0x400 # define ASN1_STRFLGS_RFC2253 ( ASN1_STRFLGS_ESC_2253 | ASN1_STRFLGS_ESC_CTRL | ASN1_STRFLGS_ESC_MSB | ASN1_STRFLGS_UTF8_CONVERT | ASN1_STRFLGS_DUMP_UNKNOWN | ASN1_STRFLGS_DUMP_DER ) DEFINE_STACK_OF ( ASN1_INTEGER ) DEFINE_STACK_OF ( ASN1_GENERALSTRING ) DEFINE_STACK_OF ( ASN1_UTF8STRING ) typedef struct asn1_type_st {
int type ;
union {
char * ptr ;
ASN1_BOOLEAN boolean ;
ASN1_STRING * asn1_string ;
ASN1_OBJECT * object ;
ASN1_INTEGER * integer ;
ASN1_ENUMERATED * enumerated ;
ASN1_BIT_STRING * bit_string ;
ASN1_OCTET_STRING * octet_string ;
ASN1_PRINTABLESTRING * printablestring ;
ASN1_T61STRING * t61string ;
ASN1_IA5STRING * ia5string ;
ASN1_GENERALSTRING * generalstring ;
ASN1_BMPSTRING * bmpstring ;
ASN1_UNIVERSALSTRING * universalstring ;
ASN1_UTCTIME * utctime ;
ASN1_GENERALIZEDTIME * generalizedtime ;
ASN1_VISIBLESTRING * visiblestring ;
ASN1_UTF8STRING * utf8string ;
ASN1_STRING * set ;
ASN1_STRING * sequence ;
ASN1_VALUE * asn1_value ;
}
value ;
}
ASN1_TYPE ;
DEFINE_STACK_OF ( ASN1_TYPE ) typedef STACK_OF ( ASN1_TYPE ) ASN1_SEQUENCE_ANY ;
DECLARE_ASN1_ENCODE_FUNCTIONS_const ( ASN1_SEQUENCE_ANY , ASN1_SEQUENCE_ANY ) DECLARE_ASN1_ENCODE_FUNCTIONS_const ( ASN1_SEQUENCE_ANY , ASN1_SET_ANY ) typedef struct BIT_STRING_BITNAME_st {
int bitnum ;
const char * lname ;
const char * sname ;
}
BIT_STRING_BITNAME ;
# define B_ASN1_TIME B_ASN1_UTCTIME | B_ASN1_GENERALIZEDTIME # define B_ASN1_PRINTABLE B_ASN1_NUMERICSTRING | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING | B_ASN1_BIT_STRING | B_ASN1_UNIVERSALSTRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING | B_ASN1_SEQUENCE | B_ASN1_UNKNOWN # define B_ASN1_DIRECTORYSTRING B_ASN1_PRINTABLESTRING | B_ASN1_TELETEXSTRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING | B_ASN1_UTF8STRING # define B_ASN1_DISPLAYTEXT B_ASN1_IA5STRING | B_ASN1_VISIBLESTRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING DECLARE_ASN1_FUNCTIONS_fname ( ASN1_TYPE , ASN1_ANY , ASN1_TYPE ) int ASN1_TYPE_get ( const ASN1_TYPE * a ) ;
void ASN1_TYPE_set ( ASN1_TYPE * a , int type , void * value ) ;
int ASN1_TYPE_set1 ( ASN1_TYPE * a , int type , const void * value ) ;
int ASN1_TYPE_cmp ( const ASN1_TYPE * a , const ASN1_TYPE * b ) ;
ASN1_TYPE * ASN1_TYPE_pack_sequence ( const ASN1_ITEM * it , void * s , ASN1_TYPE * * t ) ;
void * ASN1_TYPE_unpack_sequence ( const ASN1_ITEM * it , const ASN1_TYPE * t ) ;
ASN1_OBJECT * ASN1_OBJECT_new ( void ) ;
void ASN1_OBJECT_free ( ASN1_OBJECT * a ) ;
int i2d_ASN1_OBJECT ( const ASN1_OBJECT * a , unsigned char * * pp ) ;
ASN1_OBJECT * d2i_ASN1_OBJECT ( ASN1_OBJECT * * a , const unsigned char * * pp , long length ) ;
DECLARE_ASN1_ITEM ( ASN1_OBJECT ) DEFINE_STACK_OF ( ASN1_OBJECT ) ASN1_STRING * ASN1_STRING_new ( void ) ;
void ASN1_STRING_free ( ASN1_STRING * a ) ;
void ASN1_STRING_clear_free ( ASN1_STRING * a ) ;
int ASN1_STRING_copy ( ASN1_STRING * dst , const ASN1_STRING * str ) ;
ASN1_STRING * ASN1_STRING_dup ( const ASN1_STRING * a ) ;
ASN1_STRING * ASN1_STRING_type_new ( int type ) ;
int ASN1_STRING_cmp ( const ASN1_STRING * a , const ASN1_STRING * b ) ;
int ASN1_STRING_set ( ASN1_STRING * str , const void * data , int len ) ;
void ASN1_STRING_set0 ( ASN1_STRING * str , void * data , int len ) ;
int ASN1_STRING_length ( const ASN1_STRING * x ) ;
void ASN1_STRING_length_set ( ASN1_STRING * x , int n ) ;
int ASN1_STRING_type ( const ASN1_STRING * x ) ;
DEPRECATEDIN_1_1_0 ( unsigned char * ASN1_STRING_data ( ASN1_STRING * x ) ) const unsigned char * ASN1_STRING_get0_data ( const ASN1_STRING * x ) ;
DECLARE_ASN1_FUNCTIONS ( ASN1_BIT_STRING ) int ASN1_BIT_STRING_set ( ASN1_BIT_STRING * a , unsigned char * d , int length ) ;
int ASN1_BIT_STRING_set_bit ( ASN1_BIT_STRING * a , int n , int value ) ;
int ASN1_BIT_STRING_get_bit ( const ASN1_BIT_STRING * a , int n ) ;
int ASN1_BIT_STRING_check ( const ASN1_BIT_STRING * a , const unsigned char * flags , int flags_len ) ;
int ASN1_BIT_STRING_name_print ( BIO * out , ASN1_BIT_STRING * bs , BIT_STRING_BITNAME * tbl , int indent ) ;
int ASN1_BIT_STRING_num_asc ( const char * name , BIT_STRING_BITNAME * tbl ) ;
int ASN1_BIT_STRING_set_asc ( ASN1_BIT_STRING * bs , const char * name , int value , BIT_STRING_BITNAME * tbl ) ;
DECLARE_ASN1_FUNCTIONS ( ASN1_INTEGER ) ASN1_INTEGER * d2i_ASN1_UINTEGER ( ASN1_INTEGER * * a , const unsigned char * * pp , long length ) ;
ASN1_INTEGER * ASN1_INTEGER_dup ( const ASN1_INTEGER * x ) ;
int ASN1_INTEGER_cmp ( const ASN1_INTEGER * x , const ASN1_INTEGER * y ) ;
DECLARE_ASN1_FUNCTIONS ( ASN1_ENUMERATED ) int ASN1_UTCTIME_check ( const ASN1_UTCTIME * a ) ;
ASN1_UTCTIME * ASN1_UTCTIME_set ( ASN1_UTCTIME * s , time_t t ) ;
ASN1_UTCTIME * ASN1_UTCTIME_adj ( ASN1_UTCTIME * s , time_t t , int offset_day , long offset_sec ) ;
int ASN1_UTCTIME_set_string ( ASN1_UTCTIME * s , const char * str ) ;
int ASN1_UTCTIME_cmp_time_t ( const ASN1_UTCTIME * s , time_t t ) ;
int ASN1_GENERALIZEDTIME_check ( const ASN1_GENERALIZEDTIME * a ) ;
ASN1_GENERALIZEDTIME * ASN1_GENERALIZEDTIME_set ( ASN1_GENERALIZEDTIME * s , time_t t ) ;
ASN1_GENERALIZEDTIME * ASN1_GENERALIZEDTIME_adj ( ASN1_GENERALIZEDTIME * s , time_t t , int offset_day , long offset_sec ) ;
int ASN1_GENERALIZEDTIME_set_string ( ASN1_GENERALIZEDTIME * s , const char * str ) ;
int ASN1_TIME_diff ( int * pday , int * psec , const ASN1_TIME * from , const ASN1_TIME * to ) ;
DECLARE_ASN1_FUNCTIONS ( ASN1_OCTET_STRING ) ASN1_OCTET_STRING * ASN1_OCTET_STRING_dup ( const ASN1_OCTET_STRING * a ) ;
int ASN1_OCTET_STRING_cmp ( const ASN1_OCTET_STRING * a , const ASN1_OCTET_STRING * b ) ;
int ASN1_OCTET_STRING_set ( ASN1_OCTET_STRING * str , const unsigned char * data , int len ) ;
DECLARE_ASN1_FUNCTIONS ( ASN1_VISIBLESTRING ) DECLARE_ASN1_FUNCTIONS ( ASN1_UNIVERSALSTRING ) DECLARE_ASN1_FUNCTIONS ( ASN1_UTF8STRING ) DECLARE_ASN1_FUNCTIONS ( ASN1_NULL ) DECLARE_ASN1_FUNCTIONS ( ASN1_BMPSTRING ) int UTF8_getc ( const unsigned char * str , int len , unsigned long * val ) ;
int UTF8_putc ( unsigned char * str , int len , unsigned long value ) ;
DECLARE_ASN1_FUNCTIONS_name ( ASN1_STRING , ASN1_PRINTABLE ) DECLARE_ASN1_FUNCTIONS_name ( ASN1_STRING , DIRECTORYSTRING ) DECLARE_ASN1_FUNCTIONS_name ( ASN1_STRING , DISPLAYTEXT ) DECLARE_ASN1_FUNCTIONS ( ASN1_PRINTABLESTRING ) DECLARE_ASN1_FUNCTIONS ( ASN1_T61STRING ) DECLARE_ASN1_FUNCTIONS ( ASN1_IA5STRING ) DECLARE_ASN1_FUNCTIONS ( ASN1_GENERALSTRING ) DECLARE_ASN1_FUNCTIONS ( ASN1_UTCTIME )
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
MYSQL_STMT * open_cursor ( const char * query ) {
int rc ;
const ulong type = ( ulong ) CURSOR_TYPE_READ_ONLY ;
MYSQL_STMT * stmt = mysql_stmt_init ( mysql ) ;
rc = mysql_stmt_prepare ( stmt , query , strlen ( query ) ) ;
check_execute ( stmt , rc ) ;
mysql_stmt_attr_set ( stmt , STMT_ATTR_CURSOR_TYPE , ( void * ) & type ) ;
return stmt ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
SPL_METHOD ( SplFileObject , rewind ) {
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_rewind ( getThis ( ) , intern TSRMLS_CC ) ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
int libevt_record_values_read_element_data ( libevt_io_handle_t * io_handle , libbfio_handle_t * file_io_handle , libfdata_list_element_t * element , libfcache_cache_t * cache , int element_file_index LIBEVT_ATTRIBUTE_UNUSED , off64_t element_offset , size64_t element_size LIBEVT_ATTRIBUTE_UNUSED , uint32_t element_flags LIBEVT_ATTRIBUTE_UNUSED , uint8_t read_flags LIBEVT_ATTRIBUTE_UNUSED , libcerror_error_t * * error ) {
libevt_record_values_t * record_values = NULL ;
static char * function = "libevt_record_values_read_element_data" ;
off64_t file_offset = 0 ;
ssize_t read_count = 0 ;
LIBEVT_UNREFERENCED_PARAMETER ( element_size ) LIBEVT_UNREFERENCED_PARAMETER ( element_file_index ) LIBEVT_UNREFERENCED_PARAMETER ( element_flags ) LIBEVT_UNREFERENCED_PARAMETER ( read_flags ) # if defined ( HAVE_DEBUG_OUTPUT ) if ( libcnotify_verbose != 0 ) {
libcnotify_printf ( "%s: reading record at offset: %" PRIi64 " (0x%08" PRIx64 ")\n" , function , element_offset , element_offset ) ;
}
# endif if ( libbfio_handle_seek_offset ( file_io_handle , element_offset , SEEK_SET , error ) == - 1 ) {
libcerror_error_set ( error , LIBCERROR_ERROR_DOMAIN_IO , LIBCERROR_IO_ERROR_SEEK_FAILED , "%s: unable to seek record offset: %" PRIi64 "." , function , element_offset ) ;
goto on_error ;
}
if ( libevt_record_values_initialize ( & record_values , error ) != 1 ) {
libcerror_error_set ( error , LIBCERROR_ERROR_DOMAIN_RUNTIME , LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED , "%s: unable to create record values." , function ) ;
goto on_error ;
}
file_offset = element_offset ;
read_count = libevt_record_values_read ( record_values , file_io_handle , io_handle , & file_offset , 0 , error ) ;
if ( read_count == - 1 ) {
libcerror_error_set ( error , LIBCERROR_ERROR_DOMAIN_IO , LIBCERROR_IO_ERROR_READ_FAILED , "%s: unable to read record at offset: %" PRIi64 "." , function , element_offset ) ;
goto on_error ;
}
if ( libfdata_list_element_set_element_value ( element , ( intptr_t * ) file_io_handle , cache , ( intptr_t * ) record_values , ( int ( * ) ( intptr_t * * , libcerror_error_t * * ) ) & libevt_record_values_free , LIBFDATA_LIST_ELEMENT_VALUE_FLAG_MANAGED , error ) != 1 ) {
libcerror_error_set ( error , LIBCERROR_ERROR_DOMAIN_RUNTIME , LIBCERROR_RUNTIME_ERROR_SET_FAILED , "%s: unable to set record values as element value." , function ) ;
goto on_error ;
}
return ( 1 ) ;
on_error : if ( record_values != NULL ) {
libevt_record_values_free ( & record_values , NULL ) ;
}
return ( - 1 ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int32_t _appendVariantsToLanguageTag ( const char * localeID , char * appendAt , int32_t capacity , UBool strict , UBool * hadPosix , UErrorCode * status ) {
char buf [ ULOC_FULLNAME_CAPACITY ] ;
UErrorCode tmpStatus = U_ZERO_ERROR ;
int32_t len , i ;
int32_t reslen = 0 ;
if ( U_FAILURE ( * status ) ) {
return 0 ;
}
len = uloc_getVariant ( localeID , buf , sizeof ( buf ) , & tmpStatus ) ;
if ( U_FAILURE ( tmpStatus ) || tmpStatus == U_STRING_NOT_TERMINATED_WARNING ) {
if ( strict ) {
* status = U_ILLEGAL_ARGUMENT_ERROR ;
}
return 0 ;
}
if ( len > 0 ) {
char * p , * pVar ;
UBool bNext = TRUE ;
VariantListEntry * var ;
VariantListEntry * varFirst = NULL ;
pVar = NULL ;
p = buf ;
while ( bNext ) {
if ( * p == SEP || * p == LOCALE_SEP || * p == 0 ) {
if ( * p == 0 ) {
bNext = FALSE ;
}
else {
* p = 0 ;
}
if ( pVar == NULL ) {
if ( strict ) {
* status = U_ILLEGAL_ARGUMENT_ERROR ;
break ;
}
}
else {
for ( i = 0 ;
* ( pVar + i ) != 0 ;
i ++ ) {
* ( pVar + i ) = uprv_tolower ( * ( pVar + i ) ) ;
}
if ( _isVariantSubtag ( pVar , - 1 ) ) {
if ( uprv_strcmp ( pVar , POSIX_VALUE ) || len != ( int32_t ) uprv_strlen ( POSIX_VALUE ) ) {
var = ( VariantListEntry * ) uprv_malloc ( sizeof ( VariantListEntry ) ) ;
if ( var == NULL ) {
* status = U_MEMORY_ALLOCATION_ERROR ;
break ;
}
var -> variant = pVar ;
if ( ! _addVariantToList ( & varFirst , var ) ) {
uprv_free ( var ) ;
if ( strict ) {
* status = U_ILLEGAL_ARGUMENT_ERROR ;
break ;
}
}
}
else {
* hadPosix = TRUE ;
}
}
else if ( strict ) {
* status = U_ILLEGAL_ARGUMENT_ERROR ;
break ;
}
else if ( _isPrivateuseValueSubtag ( pVar , - 1 ) ) {
break ;
}
}
pVar = NULL ;
}
else if ( pVar == NULL ) {
pVar = p ;
}
p ++ ;
}
if ( U_SUCCESS ( * status ) ) {
if ( varFirst != NULL ) {
int32_t varLen ;
var = varFirst ;
while ( var != NULL ) {
if ( reslen < capacity ) {
* ( appendAt + reslen ) = SEP ;
}
reslen ++ ;
varLen = ( int32_t ) uprv_strlen ( var -> variant ) ;
if ( reslen < capacity ) {
uprv_memcpy ( appendAt + reslen , var -> variant , uprv_min ( varLen , capacity - reslen ) ) ;
}
reslen += varLen ;
var = var -> next ;
}
}
}
var = varFirst ;
while ( var != NULL ) {
VariantListEntry * tmpVar = var -> next ;
uprv_free ( var ) ;
var = tmpVar ;
}
if ( U_FAILURE ( * status ) ) {
return 0 ;
}
}
u_terminateChars ( appendAt , capacity , reslen , status ) ;
return reslen ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int show_program ( WriterContext * w , InputFile * ifile , AVProgram * program ) {
AVFormatContext * fmt_ctx = ifile -> fmt_ctx ;
int i , ret = 0 ;
writer_print_section_header ( w , SECTION_ID_PROGRAM ) ;
print_int ( "program_id" , program -> id ) ;
print_int ( "program_num" , program -> program_num ) ;
print_int ( "nb_streams" , program -> nb_stream_indexes ) ;
print_int ( "pmt_pid" , program -> pmt_pid ) ;
print_int ( "pcr_pid" , program -> pcr_pid ) ;
print_ts ( "start_pts" , program -> start_time ) ;
print_time ( "start_time" , program -> start_time , & AV_TIME_BASE_Q ) ;
print_ts ( "end_pts" , program -> end_time ) ;
print_time ( "end_time" , program -> end_time , & AV_TIME_BASE_Q ) ;
if ( do_show_program_tags ) ret = show_tags ( w , program -> metadata , SECTION_ID_PROGRAM_TAGS ) ;
if ( ret < 0 ) goto end ;
writer_print_section_header ( w , SECTION_ID_PROGRAM_STREAMS ) ;
for ( i = 0 ;
i < program -> nb_stream_indexes ;
i ++ ) {
if ( selected_streams [ program -> stream_index [ i ] ] ) {
ret = show_stream ( w , fmt_ctx , program -> stream_index [ i ] , & ifile -> streams [ program -> stream_index [ i ] ] , 1 ) ;
if ( ret < 0 ) break ;
}
}
writer_print_section_footer ( w ) ;
end : writer_print_section_footer ( w ) ;
return ret ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int dissect_unknown_ber ( packet_info * pinfo , tvbuff_t * tvb , int offset , proto_tree * tree ) {
return try_dissect_unknown_ber ( pinfo , tvb , offset , tree , 1 ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_h245_H263ModeComboFlags ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h245_H263ModeComboFlags , H263ModeComboFlags_sequence ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int i2d_X509_CRL_bio ( BIO * bp , X509_CRL * crl ) {
return ASN1_item_i2d_bio ( ASN1_ITEM_rptr ( X509_CRL ) , bp , crl ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static cmsBool Type_U16Fixed16_Write ( struct _cms_typehandler_struct * self , cmsIOHANDLER * io , void * Ptr , cmsUInt32Number nItems ) {
cmsFloat64Number * Value = ( cmsFloat64Number * ) Ptr ;
cmsUInt32Number i ;
for ( i = 0 ;
i < nItems ;
i ++ ) {
cmsUInt32Number v = ( cmsUInt32Number ) floor ( Value [ i ] * 65536.0 + 0.5 ) ;
if ( ! _cmsWriteUInt32Number ( io , v ) ) return FALSE ;
}
return TRUE ;
cmsUNUSED_PARAMETER ( self ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static inline void put_dct ( MpegEncContext * s , int16_t * block , int i , uint8_t * dest , int line_size , int qscale ) {
s -> dct_unquantize_intra ( s , block , i , qscale ) ;
s -> dsp . idct_put ( dest , line_size , block ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void vc1_loop_filter_iblk_delayed ( VC1Context * v , int pq ) {
MpegEncContext * s = & v -> s ;
int j ;
if ( ! s -> first_slice_line ) {
if ( s -> mb_x ) {
if ( s -> mb_y >= s -> start_mb_y + 2 ) {
v -> vc1dsp . vc1_v_loop_filter16 ( s -> dest [ 0 ] - 16 * s -> linesize - 16 , s -> linesize , pq ) ;
if ( s -> mb_x >= 2 ) v -> vc1dsp . vc1_h_loop_filter16 ( s -> dest [ 0 ] - 32 * s -> linesize - 16 , s -> linesize , pq ) ;
v -> vc1dsp . vc1_h_loop_filter16 ( s -> dest [ 0 ] - 32 * s -> linesize - 8 , s -> linesize , pq ) ;
for ( j = 0 ;
j < 2 ;
j ++ ) {
v -> vc1dsp . vc1_v_loop_filter8 ( s -> dest [ j + 1 ] - 8 * s -> uvlinesize - 8 , s -> uvlinesize , pq ) ;
if ( s -> mb_x >= 2 ) {
v -> vc1dsp . vc1_h_loop_filter8 ( s -> dest [ j + 1 ] - 16 * s -> uvlinesize - 8 , s -> uvlinesize , pq ) ;
}
}
}
v -> vc1dsp . vc1_v_loop_filter16 ( s -> dest [ 0 ] - 8 * s -> linesize - 16 , s -> linesize , pq ) ;
}
if ( s -> mb_x == s -> mb_width - 1 ) {
if ( s -> mb_y >= s -> start_mb_y + 2 ) {
v -> vc1dsp . vc1_v_loop_filter16 ( s -> dest [ 0 ] - 16 * s -> linesize , s -> linesize , pq ) ;
if ( s -> mb_x ) v -> vc1dsp . vc1_h_loop_filter16 ( s -> dest [ 0 ] - 32 * s -> linesize , s -> linesize , pq ) ;
v -> vc1dsp . vc1_h_loop_filter16 ( s -> dest [ 0 ] - 32 * s -> linesize + 8 , s -> linesize , pq ) ;
for ( j = 0 ;
j < 2 ;
j ++ ) {
v -> vc1dsp . vc1_v_loop_filter8 ( s -> dest [ j + 1 ] - 8 * s -> uvlinesize , s -> uvlinesize , pq ) ;
if ( s -> mb_x >= 2 ) {
v -> vc1dsp . vc1_h_loop_filter8 ( s -> dest [ j + 1 ] - 16 * s -> uvlinesize , s -> uvlinesize , pq ) ;
}
}
}
v -> vc1dsp . vc1_v_loop_filter16 ( s -> dest [ 0 ] - 8 * s -> linesize , s -> linesize , pq ) ;
}
if ( s -> mb_y == s -> end_mb_y ) {
if ( s -> mb_x ) {
if ( s -> mb_x >= 2 ) v -> vc1dsp . vc1_h_loop_filter16 ( s -> dest [ 0 ] - 16 * s -> linesize - 16 , s -> linesize , pq ) ;
v -> vc1dsp . vc1_h_loop_filter16 ( s -> dest [ 0 ] - 16 * s -> linesize - 8 , s -> linesize , pq ) ;
if ( s -> mb_x >= 2 ) {
for ( j = 0 ;
j < 2 ;
j ++ ) {
v -> vc1dsp . vc1_h_loop_filter8 ( s -> dest [ j + 1 ] - 8 * s -> uvlinesize - 8 , s -> uvlinesize , pq ) ;
}
}
}
if ( s -> mb_x == s -> mb_width - 1 ) {
if ( s -> mb_x ) v -> vc1dsp . vc1_h_loop_filter16 ( s -> dest [ 0 ] - 16 * s -> linesize , s -> linesize , pq ) ;
v -> vc1dsp . vc1_h_loop_filter16 ( s -> dest [ 0 ] - 16 * s -> linesize + 8 , s -> linesize , pq ) ;
if ( s -> mb_x ) {
for ( j = 0 ;
j < 2 ;
j ++ ) {
v -> vc1dsp . vc1_h_loop_filter8 ( s -> dest [ j + 1 ] - 8 * s -> uvlinesize , s -> uvlinesize , pq ) ;
}
}
}
}
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static TupleDesc get_cached_rowtype ( Oid type_id , int32 typmod , TupleDesc * cache_field , ExprContext * econtext ) {
TupleDesc tupDesc = * cache_field ;
if ( tupDesc == NULL || type_id != tupDesc -> tdtypeid || typmod != tupDesc -> tdtypmod ) {
tupDesc = lookup_rowtype_tupdesc ( type_id , typmod ) ;
if ( * cache_field ) {
ReleaseTupleDesc ( * cache_field ) ;
}
else {
RegisterExprContextCallback ( econtext , ShutdownTupleDescRef , PointerGetDatum ( cache_field ) ) ;
}
* cache_field = tupDesc ;
}
return tupDesc ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void vp9_idct16x16_256_add_sse2 ( const int16_t * input , uint8_t * dest , int stride ) {
const __m128i rounding = _mm_set1_epi32 ( DCT_CONST_ROUNDING ) ;
const __m128i final_rounding = _mm_set1_epi16 ( 1 << 5 ) ;
const __m128i zero = _mm_setzero_si128 ( ) ;
const __m128i stg2_0 = pair_set_epi16 ( cospi_30_64 , - cospi_2_64 ) ;
const __m128i stg2_1 = pair_set_epi16 ( cospi_2_64 , cospi_30_64 ) ;
const __m128i stg2_2 = pair_set_epi16 ( cospi_14_64 , - cospi_18_64 ) ;
const __m128i stg2_3 = pair_set_epi16 ( cospi_18_64 , cospi_14_64 ) ;
const __m128i stg2_4 = pair_set_epi16 ( cospi_22_64 , - cospi_10_64 ) ;
const __m128i stg2_5 = pair_set_epi16 ( cospi_10_64 , cospi_22_64 ) ;
const __m128i stg2_6 = pair_set_epi16 ( cospi_6_64 , - cospi_26_64 ) ;
const __m128i stg2_7 = pair_set_epi16 ( cospi_26_64 , cospi_6_64 ) ;
const __m128i stg3_0 = pair_set_epi16 ( cospi_28_64 , - cospi_4_64 ) ;
const __m128i stg3_1 = pair_set_epi16 ( cospi_4_64 , cospi_28_64 ) ;
const __m128i stg3_2 = pair_set_epi16 ( cospi_12_64 , - cospi_20_64 ) ;
const __m128i stg3_3 = pair_set_epi16 ( cospi_20_64 , cospi_12_64 ) ;
const __m128i stg4_0 = pair_set_epi16 ( cospi_16_64 , cospi_16_64 ) ;
const __m128i stg4_1 = pair_set_epi16 ( cospi_16_64 , - cospi_16_64 ) ;
const __m128i stg4_2 = pair_set_epi16 ( cospi_24_64 , - cospi_8_64 ) ;
const __m128i stg4_3 = pair_set_epi16 ( cospi_8_64 , cospi_24_64 ) ;
const __m128i stg4_4 = pair_set_epi16 ( - cospi_8_64 , cospi_24_64 ) ;
const __m128i stg4_5 = pair_set_epi16 ( cospi_24_64 , cospi_8_64 ) ;
const __m128i stg4_6 = pair_set_epi16 ( - cospi_24_64 , - cospi_8_64 ) ;
const __m128i stg4_7 = pair_set_epi16 ( - cospi_8_64 , cospi_24_64 ) ;
const __m128i stg6_0 = pair_set_epi16 ( - cospi_16_64 , cospi_16_64 ) ;
__m128i in [ 16 ] , l [ 16 ] , r [ 16 ] , * curr1 ;
__m128i stp1_0 , stp1_1 , stp1_2 , stp1_3 , stp1_4 , stp1_5 , stp1_6 , stp1_7 , stp1_8 , stp1_9 , stp1_10 , stp1_11 , stp1_12 , stp1_13 , stp1_14 , stp1_15 , stp1_8_0 , stp1_12_0 ;
__m128i stp2_0 , stp2_1 , stp2_2 , stp2_3 , stp2_4 , stp2_5 , stp2_6 , stp2_7 , stp2_8 , stp2_9 , stp2_10 , stp2_11 , stp2_12 , stp2_13 , stp2_14 , stp2_15 ;
__m128i tmp0 , tmp1 , tmp2 , tmp3 , tmp4 , tmp5 , tmp6 , tmp7 ;
int i ;
curr1 = l ;
for ( i = 0 ;
i < 2 ;
i ++ ) {
in [ 0 ] = _mm_load_si128 ( ( const __m128i * ) input ) ;
in [ 8 ] = _mm_load_si128 ( ( const __m128i * ) ( input + 8 * 1 ) ) ;
in [ 1 ] = _mm_load_si128 ( ( const __m128i * ) ( input + 8 * 2 ) ) ;
in [ 9 ] = _mm_load_si128 ( ( const __m128i * ) ( input + 8 * 3 ) ) ;
in [ 2 ] = _mm_load_si128 ( ( const __m128i * ) ( input + 8 * 4 ) ) ;
in [ 10 ] = _mm_load_si128 ( ( const __m128i * ) ( input + 8 * 5 ) ) ;
in [ 3 ] = _mm_load_si128 ( ( const __m128i * ) ( input + 8 * 6 ) ) ;
in [ 11 ] = _mm_load_si128 ( ( const __m128i * ) ( input + 8 * 7 ) ) ;
in [ 4 ] = _mm_load_si128 ( ( const __m128i * ) ( input + 8 * 8 ) ) ;
in [ 12 ] = _mm_load_si128 ( ( const __m128i * ) ( input + 8 * 9 ) ) ;
in [ 5 ] = _mm_load_si128 ( ( const __m128i * ) ( input + 8 * 10 ) ) ;
in [ 13 ] = _mm_load_si128 ( ( const __m128i * ) ( input + 8 * 11 ) ) ;
in [ 6 ] = _mm_load_si128 ( ( const __m128i * ) ( input + 8 * 12 ) ) ;
in [ 14 ] = _mm_load_si128 ( ( const __m128i * ) ( input + 8 * 13 ) ) ;
in [ 7 ] = _mm_load_si128 ( ( const __m128i * ) ( input + 8 * 14 ) ) ;
in [ 15 ] = _mm_load_si128 ( ( const __m128i * ) ( input + 8 * 15 ) ) ;
array_transpose_8x8 ( in , in ) ;
array_transpose_8x8 ( in + 8 , in + 8 ) ;
IDCT16 curr1 [ 0 ] = _mm_add_epi16 ( stp2_0 , stp1_15 ) ;
curr1 [ 1 ] = _mm_add_epi16 ( stp2_1 , stp1_14 ) ;
curr1 [ 2 ] = _mm_add_epi16 ( stp2_2 , stp2_13 ) ;
curr1 [ 3 ] = _mm_add_epi16 ( stp2_3 , stp2_12 ) ;
curr1 [ 4 ] = _mm_add_epi16 ( stp2_4 , stp2_11 ) ;
curr1 [ 5 ] = _mm_add_epi16 ( stp2_5 , stp2_10 ) ;
curr1 [ 6 ] = _mm_add_epi16 ( stp2_6 , stp1_9 ) ;
curr1 [ 7 ] = _mm_add_epi16 ( stp2_7 , stp1_8 ) ;
curr1 [ 8 ] = _mm_sub_epi16 ( stp2_7 , stp1_8 ) ;
curr1 [ 9 ] = _mm_sub_epi16 ( stp2_6 , stp1_9 ) ;
curr1 [ 10 ] = _mm_sub_epi16 ( stp2_5 , stp2_10 ) ;
curr1 [ 11 ] = _mm_sub_epi16 ( stp2_4 , stp2_11 ) ;
curr1 [ 12 ] = _mm_sub_epi16 ( stp2_3 , stp2_12 ) ;
curr1 [ 13 ] = _mm_sub_epi16 ( stp2_2 , stp2_13 ) ;
curr1 [ 14 ] = _mm_sub_epi16 ( stp2_1 , stp1_14 ) ;
curr1 [ 15 ] = _mm_sub_epi16 ( stp2_0 , stp1_15 ) ;
curr1 = r ;
input += 128 ;
}
for ( i = 0 ;
i < 2 ;
i ++ ) {
array_transpose_8x8 ( l + i * 8 , in ) ;
array_transpose_8x8 ( r + i * 8 , in + 8 ) ;
IDCT16 in [ 0 ] = _mm_add_epi16 ( stp2_0 , stp1_15 ) ;
in [ 1 ] = _mm_add_epi16 ( stp2_1 , stp1_14 ) ;
in [ 2 ] = _mm_add_epi16 ( stp2_2 , stp2_13 ) ;
in [ 3 ] = _mm_add_epi16 ( stp2_3 , stp2_12 ) ;
in [ 4 ] = _mm_add_epi16 ( stp2_4 , stp2_11 ) ;
in [ 5 ] = _mm_add_epi16 ( stp2_5 , stp2_10 ) ;
in [ 6 ] = _mm_add_epi16 ( stp2_6 , stp1_9 ) ;
in [ 7 ] = _mm_add_epi16 ( stp2_7 , stp1_8 ) ;
in [ 8 ] = _mm_sub_epi16 ( stp2_7 , stp1_8 ) ;
in [ 9 ] = _mm_sub_epi16 ( stp2_6 , stp1_9 ) ;
in [ 10 ] = _mm_sub_epi16 ( stp2_5 , stp2_10 ) ;
in [ 11 ] = _mm_sub_epi16 ( stp2_4 , stp2_11 ) ;
in [ 12 ] = _mm_sub_epi16 ( stp2_3 , stp2_12 ) ;
in [ 13 ] = _mm_sub_epi16 ( stp2_2 , stp2_13 ) ;
in [ 14 ] = _mm_sub_epi16 ( stp2_1 , stp1_14 ) ;
in [ 15 ] = _mm_sub_epi16 ( stp2_0 , stp1_15 ) ;
in [ 0 ] = _mm_adds_epi16 ( in [ 0 ] , final_rounding ) ;
in [ 1 ] = _mm_adds_epi16 ( in [ 1 ] , final_rounding ) ;
in [ 2 ] = _mm_adds_epi16 ( in [ 2 ] , final_rounding ) ;
in [ 3 ] = _mm_adds_epi16 ( in [ 3 ] , final_rounding ) ;
in [ 4 ] = _mm_adds_epi16 ( in [ 4 ] , final_rounding ) ;
in [ 5 ] = _mm_adds_epi16 ( in [ 5 ] , final_rounding ) ;
in [ 6 ] = _mm_adds_epi16 ( in [ 6 ] , final_rounding ) ;
in [ 7 ] = _mm_adds_epi16 ( in [ 7 ] , final_rounding ) ;
in [ 8 ] = _mm_adds_epi16 ( in [ 8 ] , final_rounding ) ;
in [ 9 ] = _mm_adds_epi16 ( in [ 9 ] , final_rounding ) ;
in [ 10 ] = _mm_adds_epi16 ( in [ 10 ] , final_rounding ) ;
in [ 11 ] = _mm_adds_epi16 ( in [ 11 ] , final_rounding ) ;
in [ 12 ] = _mm_adds_epi16 ( in [ 12 ] , final_rounding ) ;
in [ 13 ] = _mm_adds_epi16 ( in [ 13 ] , final_rounding ) ;
in [ 14 ] = _mm_adds_epi16 ( in [ 14 ] , final_rounding ) ;
in [ 15 ] = _mm_adds_epi16 ( in [ 15 ] , final_rounding ) ;
in [ 0 ] = _mm_srai_epi16 ( in [ 0 ] , 6 ) ;
in [ 1 ] = _mm_srai_epi16 ( in [ 1 ] , 6 ) ;
in [ 2 ] = _mm_srai_epi16 ( in [ 2 ] , 6 ) ;
in [ 3 ] = _mm_srai_epi16 ( in [ 3 ] , 6 ) ;
in [ 4 ] = _mm_srai_epi16 ( in [ 4 ] , 6 ) ;
in [ 5 ] = _mm_srai_epi16 ( in [ 5 ] , 6 ) ;
in [ 6 ] = _mm_srai_epi16 ( in [ 6 ] , 6 ) ;
in [ 7 ] = _mm_srai_epi16 ( in [ 7 ] , 6 ) ;
in [ 8 ] = _mm_srai_epi16 ( in [ 8 ] , 6 ) ;
in [ 9 ] = _mm_srai_epi16 ( in [ 9 ] , 6 ) ;
in [ 10 ] = _mm_srai_epi16 ( in [ 10 ] , 6 ) ;
in [ 11 ] = _mm_srai_epi16 ( in [ 11 ] , 6 ) ;
in [ 12 ] = _mm_srai_epi16 ( in [ 12 ] , 6 ) ;
in [ 13 ] = _mm_srai_epi16 ( in [ 13 ] , 6 ) ;
in [ 14 ] = _mm_srai_epi16 ( in [ 14 ] , 6 ) ;
in [ 15 ] = _mm_srai_epi16 ( in [ 15 ] , 6 ) ;
RECON_AND_STORE ( dest , in [ 0 ] ) ;
RECON_AND_STORE ( dest , in [ 1 ] ) ;
RECON_AND_STORE ( dest , in [ 2 ] ) ;
RECON_AND_STORE ( dest , in [ 3 ] ) ;
RECON_AND_STORE ( dest , in [ 4 ] ) ;
RECON_AND_STORE ( dest , in [ 5 ] ) ;
RECON_AND_STORE ( dest , in [ 6 ] ) ;
RECON_AND_STORE ( dest , in [ 7 ] ) ;
RECON_AND_STORE ( dest , in [ 8 ] ) ;
RECON_AND_STORE ( dest , in [ 9 ] ) ;
RECON_AND_STORE ( dest , in [ 10 ] ) ;
RECON_AND_STORE ( dest , in [ 11 ] ) ;
RECON_AND_STORE ( dest , in [ 12 ] ) ;
RECON_AND_STORE ( dest , in [ 13 ] ) ;
RECON_AND_STORE ( dest , in [ 14 ] ) ;
RECON_AND_STORE ( dest , in [ 15 ] ) ;
dest += 8 - ( stride * 16 ) ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void dtap_bcc_imm_setup ( tvbuff_t * tvb , proto_tree * tree , packet_info * pinfo _U_ , guint32 offset , guint len ) {
guint32 curr_offset ;
guint32 consumed ;
guint curr_len ;
guint8 oct ;
proto_tree * subtree ;
curr_offset = offset ;
curr_len = len ;
oct = tvb_get_guint8 ( tvb , curr_offset ) ;
proto_tree_add_bits_item ( tree , hf_gsm_a_spare_bits , tvb , curr_offset << 3 , 4 , ENC_BIG_ENDIAN ) ;
subtree = proto_tree_add_subtree ( tree , tvb , curr_offset , 1 , ett_gsm_common_elem [ DE_CIPH_KEY_SEQ_NUM ] , NULL , val_to_str_ext_const ( DE_CIPH_KEY_SEQ_NUM , & gsm_common_elem_strings_ext , "" ) ) ;
proto_tree_add_bits_item ( subtree , hf_gsm_a_spare_bits , tvb , ( curr_offset << 3 ) + 4 , 1 , ENC_BIG_ENDIAN ) ;
switch ( oct & 0x07 ) {
case 0x07 : proto_tree_add_uint_format_value ( subtree , hf_gsm_a_dtap_ciphering_key_sequence_number , tvb , curr_offset , 1 , oct , "No key is available" ) ;
break ;
default : proto_tree_add_item ( subtree , hf_gsm_a_dtap_ciphering_key_sequence_number , tvb , curr_offset , 1 , ENC_BIG_ENDIAN ) ;
break ;
}
curr_offset ++ ;
curr_len -- ;
ELEM_MAND_LV ( GSM_A_PDU_TYPE_COMMON , DE_MS_CM_2 , NULL ) ;
ELEM_MAND_LV ( GSM_A_PDU_TYPE_COMMON , DE_MID , NULL ) ;
ELEM_MAND_V ( GSM_A_PDU_TYPE_DTAP , DE_BCC_CALL_REF , "(Broadcast identity)" ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static inline int get_coeff ( GetBitContext * gb , VLC * vlc ) {
int val = get_vlc2 ( gb , vlc -> table , vlc -> bits , 2 ) ;
return get_coeff_bits ( gb , val ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
TSMLoc TSMimeHdrFieldNextDup ( TSMBuffer bufp , TSMLoc hdr , TSMLoc field ) {
sdk_assert ( sdk_sanity_check_mbuffer ( bufp ) == TS_SUCCESS ) ;
sdk_assert ( ( sdk_sanity_check_mime_hdr_handle ( hdr ) == TS_SUCCESS ) || ( sdk_sanity_check_http_hdr_handle ( hdr ) == TS_SUCCESS ) ) ;
sdk_assert ( sdk_sanity_check_field_handle ( field , hdr ) == TS_SUCCESS ) ;
MIMEHdrImpl * mh = _hdr_mloc_to_mime_hdr_impl ( hdr ) ;
MIMEFieldSDKHandle * field_handle = ( MIMEFieldSDKHandle * ) field ;
MIMEField * next = field_handle -> field_ptr -> m_next_dup ;
if ( next == nullptr ) {
return TS_NULL_MLOC ;
}
MIMEFieldSDKHandle * next_handle = sdk_alloc_field_handle ( bufp , mh ) ;
next_handle -> field_ptr = next ;
return ( TSMLoc ) next_handle ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int test_in_memory ( xd3_stream * stream , int ignore ) {
uint8_t ibuf [ sizeof ( test_text ) ] ;
uint8_t dbuf [ sizeof ( test_text ) ] ;
uint8_t obuf [ sizeof ( test_text ) ] ;
usize_t size = sizeof ( test_text ) ;
usize_t dsize , osize ;
int r1 , r2 ;
int eflags = SECONDARY_DJW ? XD3_SEC_DJW : 0 ;
memcpy ( ibuf , test_text , size ) ;
memset ( ibuf + 128 , 0 , 16 ) ;
r1 = xd3_encode_memory ( ibuf , size , test_text , size , dbuf , & dsize , size , eflags ) ;
r2 = xd3_decode_memory ( dbuf , dsize , test_text , size , obuf , & osize , size , 0 ) ;
if ( r1 != 0 || r2 != 0 || dsize >= ( size / 2 ) || dsize < 1 || osize != size ) {
stream -> msg = "encode/decode size error" ;
return XD3_INTERNAL ;
}
if ( memcmp ( obuf , ibuf , size ) != 0 ) {
stream -> msg = "encode/decode data error" ;
return XD3_INTERNAL ;
}
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void test_bug53371 ( ) {
int rc ;
MYSQL_RES * result ;
myheader ( "test_bug53371" ) ;
rc = mysql_query ( mysql , "DROP TABLE IF EXISTS t1" ) ;
myquery ( rc ) ;
rc = mysql_query ( mysql , "DROP DATABASE IF EXISTS bug53371" ) ;
myquery ( rc ) ;
rc = mysql_query ( mysql , "DROP USER 'testbug'@localhost" ) ;
rc = mysql_query ( mysql , "CREATE TABLE t1 (a INT)" ) ;
myquery ( rc ) ;
rc = mysql_query ( mysql , "CREATE DATABASE bug53371" ) ;
myquery ( rc ) ;
rc = mysql_query ( mysql , "GRANT SELECT ON bug53371.* to 'testbug'@localhost" ) ;
myquery ( rc ) ;
rc = mysql_change_user ( mysql , "testbug" , NULL , "bug53371" ) ;
myquery ( rc ) ;
rc = mysql_query ( mysql , "SHOW COLUMNS FROM client_test_db.t1" ) ;
DIE_UNLESS ( rc ) ;
DIE_UNLESS ( mysql_errno ( mysql ) == 1142 ) ;
result = mysql_list_fields ( mysql , "../client_test_db/t1" , NULL ) ;
DIE_IF ( result ) ;
result = mysql_list_fields ( mysql , "#mysql50#/../client_test_db/t1" , NULL ) ;
DIE_IF ( result ) ;
rc = mysql_change_user ( mysql , opt_user , opt_password , current_db ) ;
myquery ( rc ) ;
rc = mysql_query ( mysql , "DROP TABLE t1" ) ;
myquery ( rc ) ;
rc = mysql_query ( mysql , "DROP DATABASE bug53371" ) ;
myquery ( rc ) ;
rc = mysql_query ( mysql , "DROP USER 'testbug'@localhost" ) ;
myquery ( rc ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int ff_mpeg4_set_direct_mv ( MpegEncContext * s , int mx , int my ) {
const int mb_index = s -> mb_x + s -> mb_y * s -> mb_stride ;
const int colocated_mb_type = s -> next_picture . mb_type [ mb_index ] ;
uint16_t time_pp ;
uint16_t time_pb ;
int i ;
if ( IS_8X8 ( colocated_mb_type ) ) {
s -> mv_type = MV_TYPE_8X8 ;
for ( i = 0 ;
i < 4 ;
i ++ ) {
ff_mpeg4_set_one_direct_mv ( s , mx , my , i ) ;
}
return MB_TYPE_DIRECT2 | MB_TYPE_8x8 | MB_TYPE_L0L1 ;
}
else if ( IS_INTERLACED ( colocated_mb_type ) ) {
s -> mv_type = MV_TYPE_FIELD ;
for ( i = 0 ;
i < 2 ;
i ++ ) {
int field_select = s -> next_picture . ref_index [ 0 ] [ 4 * mb_index + 2 * i ] ;
s -> field_select [ 0 ] [ i ] = field_select ;
s -> field_select [ 1 ] [ i ] = i ;
if ( s -> top_field_first ) {
time_pp = s -> pp_field_time - field_select + i ;
time_pb = s -> pb_field_time - field_select + i ;
}
else {
time_pp = s -> pp_field_time + field_select - i ;
time_pb = s -> pb_field_time + field_select - i ;
}
s -> mv [ 0 ] [ i ] [ 0 ] = s -> p_field_mv_table [ i ] [ 0 ] [ mb_index ] [ 0 ] * time_pb / time_pp + mx ;
s -> mv [ 0 ] [ i ] [ 1 ] = s -> p_field_mv_table [ i ] [ 0 ] [ mb_index ] [ 1 ] * time_pb / time_pp + my ;
s -> mv [ 1 ] [ i ] [ 0 ] = mx ? s -> mv [ 0 ] [ i ] [ 0 ] - s -> p_field_mv_table [ i ] [ 0 ] [ mb_index ] [ 0 ] : s -> p_field_mv_table [ i ] [ 0 ] [ mb_index ] [ 0 ] * ( time_pb - time_pp ) / time_pp ;
s -> mv [ 1 ] [ i ] [ 1 ] = my ? s -> mv [ 0 ] [ i ] [ 1 ] - s -> p_field_mv_table [ i ] [ 0 ] [ mb_index ] [ 1 ] : s -> p_field_mv_table [ i ] [ 0 ] [ mb_index ] [ 1 ] * ( time_pb - time_pp ) / time_pp ;
}
return MB_TYPE_DIRECT2 | MB_TYPE_16x8 | MB_TYPE_L0L1 | MB_TYPE_INTERLACED ;
}
else {
ff_mpeg4_set_one_direct_mv ( s , mx , my , 0 ) ;
s -> mv [ 0 ] [ 1 ] [ 0 ] = s -> mv [ 0 ] [ 2 ] [ 0 ] = s -> mv [ 0 ] [ 3 ] [ 0 ] = s -> mv [ 0 ] [ 0 ] [ 0 ] ;
s -> mv [ 0 ] [ 1 ] [ 1 ] = s -> mv [ 0 ] [ 2 ] [ 1 ] = s -> mv [ 0 ] [ 3 ] [ 1 ] = s -> mv [ 0 ] [ 0 ] [ 1 ] ;
s -> mv [ 1 ] [ 1 ] [ 0 ] = s -> mv [ 1 ] [ 2 ] [ 0 ] = s -> mv [ 1 ] [ 3 ] [ 0 ] = s -> mv [ 1 ] [ 0 ] [ 0 ] ;
s -> mv [ 1 ] [ 1 ] [ 1 ] = s -> mv [ 1 ] [ 2 ] [ 1 ] = s -> mv [ 1 ] [ 3 ] [ 1 ] = s -> mv [ 1 ] [ 0 ] [ 1 ] ;
if ( ( s -> avctx -> workaround_bugs & FF_BUG_DIRECT_BLOCKSIZE ) || ! s -> quarter_sample ) s -> mv_type = MV_TYPE_16X16 ;
else s -> mv_type = MV_TYPE_8X8 ;
return MB_TYPE_DIRECT2 | MB_TYPE_16x16 | MB_TYPE_L0L1 ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static cmsBool Type_MPEclut_Write ( struct _cms_typehandler_struct * self , cmsIOHANDLER * io , void * Ptr , cmsUInt32Number nItems ) {
cmsUInt8Number Dimensions8 [ 16 ] ;
cmsUInt32Number i ;
cmsStage * mpe = ( cmsStage * ) Ptr ;
_cmsStageCLutData * clut = ( _cmsStageCLutData * ) mpe -> Data ;
if ( mpe -> InputChannels > MAX_INPUT_DIMENSIONS ) return FALSE ;
if ( clut -> HasFloatValues == FALSE ) return FALSE ;
if ( ! _cmsWriteUInt16Number ( io , ( cmsUInt16Number ) mpe -> InputChannels ) ) return FALSE ;
if ( ! _cmsWriteUInt16Number ( io , ( cmsUInt16Number ) mpe -> OutputChannels ) ) return FALSE ;
memset ( Dimensions8 , 0 , sizeof ( Dimensions8 ) ) ;
for ( i = 0 ;
i < mpe -> InputChannels ;
i ++ ) Dimensions8 [ i ] = ( cmsUInt8Number ) clut -> Params -> nSamples [ i ] ;
if ( ! io -> Write ( io , 16 , Dimensions8 ) ) return FALSE ;
for ( i = 0 ;
i < clut -> nEntries ;
i ++ ) {
if ( ! _cmsWriteFloat32Number ( io , clut -> Tab . TFloat [ i ] ) ) return FALSE ;
}
return TRUE ;
cmsUNUSED_PARAMETER ( nItems ) ;
cmsUNUSED_PARAMETER ( self ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void proto_tree_set_ether_tvb ( field_info * fi , tvbuff_t * tvb , gint start ) {
proto_tree_set_ether ( fi , tvb_get_ptr ( tvb , start , FT_ETHER_LEN ) ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void dissect_u3v_pending_ack ( proto_tree * u3v_telegram_tree , tvbuff_t * tvb , packet_info * pinfo _U_ , gint startoffset , gint length , u3v_conv_info_t * u3v_conv_info _U_ , gencp_transaction_t * gencp_trans _U_ ) {
proto_item * item = NULL ;
guint offset = startoffset ;
col_append_fstr ( pinfo -> cinfo , COL_INFO , " %d ms" , tvb_get_letohs ( tvb , startoffset + 2 ) ) ;
item = proto_tree_add_item ( u3v_telegram_tree , hf_u3v_ccd_pending_ack , tvb , startoffset , length , ENC_NA ) ;
u3v_telegram_tree = proto_item_add_subtree ( item , ett_u3v_payload_cmd ) ;
proto_tree_add_item ( u3v_telegram_tree , hf_u3v_reserved , tvb , offset , 2 , ENC_NA ) ;
offset += 2 ;
proto_tree_add_item ( u3v_telegram_tree , hf_u3v_time_to_completion , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
SPL_METHOD ( SplFileInfo , func_name ) \ {
\ spl_filesystem_object * intern = ( spl_filesystem_object * ) zend_object_store_get_object ( getThis ( ) TSRMLS_CC ) ;
\ zend_error_handling error_handling ;
\ if ( zend_parse_parameters_none ( ) == FAILURE ) {
\ return ;
\ }
\ \ zend_replace_error_handling ( EH_THROW , spl_ce_RuntimeException , & error_handling TSRMLS_CC ) ;
\ spl_filesystem_object_get_file_name ( intern TSRMLS_CC ) ;
\ php_stat ( intern -> file_name , intern -> file_name_len , func_num , return_value TSRMLS_CC ) ;
\ zend_restore_error_handling ( & error_handling TSRMLS_CC ) ;
\ }
FileInfoFunction ( getPerms , FS_PERMS ) FileInfoFunction ( getInode , FS_INODE ) FileInfoFunction ( getSize , FS_SIZE ) FileInfoFunction ( getOwner , FS_OWNER ) FileInfoFunction ( getGroup , FS_GROUP ) FileInfoFunction ( getATime , FS_ATIME ) FileInfoFunction ( getMTime , FS_MTIME ) FileInfoFunction ( getCTime , FS_CTIME ) FileInfoFunction ( getType , FS_TYPE ) FileInfoFunction ( isWritable , FS_IS_W ) FileInfoFunction ( isReadable , FS_IS_R ) FileInfoFunction ( isExecutable , FS_IS_X ) FileInfoFunction ( isFile , FS_IS_FILE ) FileInfoFunction ( isDir , FS_IS_DIR )
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int parse_exthdrs ( struct sk_buff * skb , const struct sadb_msg * hdr , void * * ext_hdrs ) {
const char * p = ( char * ) hdr ;
int len = skb -> len ;
len -= sizeof ( * hdr ) ;
p += sizeof ( * hdr ) ;
while ( len > 0 ) {
const struct sadb_ext * ehdr = ( const struct sadb_ext * ) p ;
uint16_t ext_type ;
int ext_len ;
ext_len = ehdr -> sadb_ext_len ;
ext_len *= sizeof ( uint64_t ) ;
ext_type = ehdr -> sadb_ext_type ;
if ( ext_len < sizeof ( uint64_t ) || ext_len > len || ext_type == SADB_EXT_RESERVED ) return - EINVAL ;
if ( ext_type <= SADB_EXT_MAX ) {
int min = ( int ) sadb_ext_min_len [ ext_type ] ;
if ( ext_len < min ) return - EINVAL ;
if ( ext_hdrs [ ext_type - 1 ] != NULL ) return - EINVAL ;
if ( ext_type == SADB_EXT_ADDRESS_SRC || ext_type == SADB_EXT_ADDRESS_DST || ext_type == SADB_EXT_ADDRESS_PROXY || ext_type == SADB_X_EXT_NAT_T_OA ) {
if ( verify_address_len ( p ) ) return - EINVAL ;
}
if ( ext_type == SADB_X_EXT_SEC_CTX ) {
if ( verify_sec_ctx_len ( p ) ) return - EINVAL ;
}
ext_hdrs [ ext_type - 1 ] = ( void * ) p ;
}
p += ext_len ;
len -= ext_len ;
}
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int64 feGetCurrentTimestamp ( void ) {
int64 result ;
struct timeval tp ;
gettimeofday ( & tp , NULL ) ;
result = ( int64 ) tp . tv_sec - ( ( POSTGRES_EPOCH_JDATE - UNIX_EPOCH_JDATE ) * SECS_PER_DAY ) ;
result = ( result * USECS_PER_SEC ) + tp . tv_usec ;
return result ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static ossl_inline void lh_ ## type ## _free ( LHASH_OF ( type ) * lh ) {
OPENSSL_LH_free ( ( OPENSSL_LHASH * ) lh ) ;
}
static ossl_inline type * lh_ ## type ## _insert ( LHASH_OF ( type ) * lh , type * d ) {
return ( type * ) OPENSSL_LH_insert ( ( OPENSSL_LHASH * ) lh , d ) ;
}
static ossl_inline type * lh_ ## type ## _delete ( LHASH_OF ( type ) * lh , const type * d ) {
return ( type * ) OPENSSL_LH_delete ( ( OPENSSL_LHASH * ) lh , d ) ;
}
static ossl_inline type * lh_ ## type ## _retrieve ( LHASH_OF ( type ) * lh , const type * d ) {
return ( type * ) OPENSSL_LH_retrieve ( ( OPENSSL_LHASH * ) lh , d ) ;
}
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 )
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
char * get_func_name ( Oid funcid ) {
HeapTuple tp ;
tp = SearchSysCache1 ( PROCOID , ObjectIdGetDatum ( funcid ) ) ;
if ( HeapTupleIsValid ( tp ) ) {
Form_pg_proc functup = ( Form_pg_proc ) GETSTRUCT ( tp ) ;
char * result ;
result = pstrdup ( NameStr ( functup -> proname ) ) ;
ReleaseSysCache ( tp ) ;
return result ;
}
else return NULL ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int ff_cavs_next_mb ( AVSContext * h ) {
int i ;
h -> flags |= A_AVAIL ;
h -> cy += 16 ;
h -> cu += 8 ;
h -> cv += 8 ;
for ( i = 0 ;
i <= 20 ;
i += 4 ) h -> mv [ i ] = h -> mv [ i + 2 ] ;
h -> top_mv [ 0 ] [ h -> mbx * 2 + 0 ] = h -> mv [ MV_FWD_X2 ] ;
h -> top_mv [ 0 ] [ h -> mbx * 2 + 1 ] = h -> mv [ MV_FWD_X3 ] ;
h -> top_mv [ 1 ] [ h -> mbx * 2 + 0 ] = h -> mv [ MV_BWD_X2 ] ;
h -> top_mv [ 1 ] [ h -> mbx * 2 + 1 ] = h -> mv [ MV_BWD_X3 ] ;
h -> mbidx ++ ;
h -> mbx ++ ;
if ( h -> mbx == h -> mb_width ) {
/ ew mb line h -> flags = B_AVAIL | C_AVAIL ;
h -> pred_mode_Y [ 3 ] = h -> pred_mode_Y [ 6 ] = NOT_AVAIL ;
for ( i = 0 ;
i <= 20 ;
i += 4 ) h -> mv [ i ] = un_mv ;
h -> mbx = 0 ;
h -> mby ++ ;
h -> cy = h -> cur . f -> data [ 0 ] + h -> mby * 16 * h -> l_stride ;
h -> cu = h -> cur . f -> data [ 1 ] + h -> mby * 8 * h -> c_stride ;
h -> cv = h -> cur . f -> data [ 2 ] + h -> mby * 8 * h -> c_stride ;
if ( h -> mby == h -> mb_height ) {
return 0 ;
}
}
return 1 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int decode_mv_component ( GetBitContext * gb , int v ) {
int mv_diff = get_vlc2 ( gb , h261_mv_vlc . table , H261_MV_VLC_BITS , 2 ) ;
if ( mv_diff < 0 ) return v ;
mv_diff = mvmap [ mv_diff ] ;
if ( mv_diff && ! get_bits1 ( gb ) ) mv_diff = - mv_diff ;
v += mv_diff ;
if ( v <= - 16 ) v += 32 ;
else if ( v >= 16 ) v -= 32 ;
return v ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void ffmpeg_InitCodec ( decoder_t * p_dec ) {
decoder_sys_t * p_sys = p_dec -> p_sys ;
int i_size = p_dec -> fmt_in . i_extra ;
if ( ! i_size ) return ;
if ( p_sys -> i_codec_id == AV_CODEC_ID_SVQ3 ) {
uint8_t * p ;
p_sys -> p_context -> extradata_size = i_size + 12 ;
p = p_sys -> p_context -> extradata = av_malloc ( p_sys -> p_context -> extradata_size + FF_INPUT_BUFFER_PADDING_SIZE ) ;
if ( ! p ) return ;
memcpy ( & p [ 0 ] , "SVQ3" , 4 ) ;
memset ( & p [ 4 ] , 0 , 8 ) ;
memcpy ( & p [ 12 ] , p_dec -> fmt_in . p_extra , i_size ) ;
if ( p_sys -> p_context -> extradata_size > 0x5a && strncmp ( ( char * ) & p [ 0x56 ] , "SMI " , 4 ) ) {
uint8_t * psz = & p [ 0x52 ] ;
while ( psz < & p [ p_sys -> p_context -> extradata_size - 8 ] ) {
int i_size = GetDWBE ( psz ) ;
if ( i_size <= 1 ) {
break ;
}
if ( ! strncmp ( ( char * ) & psz [ 4 ] , "SMI " , 4 ) ) {
memmove ( & p [ 0x52 ] , psz , & p [ p_sys -> p_context -> extradata_size ] - psz ) ;
break ;
}
psz += i_size ;
}
}
}
else {
p_sys -> p_context -> extradata_size = i_size ;
p_sys -> p_context -> extradata = av_malloc ( i_size + FF_INPUT_BUFFER_PADDING_SIZE ) ;
if ( p_sys -> p_context -> extradata ) {
memcpy ( p_sys -> p_context -> extradata , p_dec -> fmt_in . p_extra , i_size ) ;
memset ( p_sys -> p_context -> extradata + i_size , 0 , FF_INPUT_BUFFER_PADDING_SIZE ) ;
}
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void pred_spatial_direct_motion ( H264Context * const h , int * mb_type ) {
int b8_stride = 2 ;
int b4_stride = h -> b_stride ;
int mb_xy = h -> mb_xy , mb_y = h -> mb_y ;
int mb_type_col [ 2 ] ;
const int16_t ( * l1mv0 ) [ 2 ] , ( * l1mv1 ) [ 2 ] ;
const int8_t * l1ref0 , * l1ref1 ;
const int is_b8x8 = IS_8X8 ( * mb_type ) ;
unsigned int sub_mb_type = MB_TYPE_L0L1 ;
int i8 , i4 ;
int ref [ 2 ] ;
int mv [ 2 ] ;
int list ;
assert ( h -> ref_list [ 1 ] [ 0 ] . f . reference & 3 ) ;
await_reference_mb_row ( h , & h -> ref_list [ 1 ] [ 0 ] , h -> mb_y + ! ! IS_INTERLACED ( * mb_type ) ) ;
# define MB_TYPE_16x16_OR_INTRA ( MB_TYPE_16x16 | MB_TYPE_INTRA4x4 | MB_TYPE_INTRA16x16 | MB_TYPE_INTRA_PCM ) for ( list = 0 ;
list < 2 ;
list ++ ) {
int left_ref = h -> ref_cache [ list ] [ scan8 [ 0 ] - 1 ] ;
int top_ref = h -> ref_cache [ list ] [ scan8 [ 0 ] - 8 ] ;
int refc = h -> ref_cache [ list ] [ scan8 [ 0 ] - 8 + 4 ] ;
const int16_t * C = h -> mv_cache [ list ] [ scan8 [ 0 ] - 8 + 4 ] ;
if ( refc == PART_NOT_AVAILABLE ) {
refc = h -> ref_cache [ list ] [ scan8 [ 0 ] - 8 - 1 ] ;
C = h -> mv_cache [ list ] [ scan8 [ 0 ] - 8 - 1 ] ;
}
ref [ list ] = FFMIN3 ( ( unsigned ) left_ref , ( unsigned ) top_ref , ( unsigned ) refc ) ;
if ( ref [ list ] >= 0 ) {
const int16_t * const A = h -> mv_cache [ list ] [ scan8 [ 0 ] - 1 ] ;
const int16_t * const B = h -> mv_cache [ list ] [ scan8 [ 0 ] - 8 ] ;
int match_count = ( left_ref == ref [ list ] ) + ( top_ref == ref [ list ] ) + ( refc == ref [ list ] ) ;
if ( match_count > 1 ) {
mv [ list ] = pack16to32 ( mid_pred ( A [ 0 ] , B [ 0 ] , C [ 0 ] ) , mid_pred ( A [ 1 ] , B [ 1 ] , C [ 1 ] ) ) ;
}
else {
assert ( match_count == 1 ) ;
if ( left_ref == ref [ list ] ) {
mv [ list ] = AV_RN32A ( A ) ;
}
else if ( top_ref == ref [ list ] ) {
mv [ list ] = AV_RN32A ( B ) ;
}
else {
mv [ list ] = AV_RN32A ( C ) ;
}
}
}
else {
int mask = ~ ( MB_TYPE_L0 << ( 2 * list ) ) ;
mv [ list ] = 0 ;
ref [ list ] = - 1 ;
if ( ! is_b8x8 ) * mb_type &= mask ;
sub_mb_type &= mask ;
}
}
if ( ref [ 0 ] < 0 && ref [ 1 ] < 0 ) {
ref [ 0 ] = ref [ 1 ] = 0 ;
if ( ! is_b8x8 ) * mb_type |= MB_TYPE_L0L1 ;
sub_mb_type |= MB_TYPE_L0L1 ;
}
if ( ! ( is_b8x8 | mv [ 0 ] | mv [ 1 ] ) ) {
fill_rectangle ( & h -> ref_cache [ 0 ] [ scan8 [ 0 ] ] , 4 , 4 , 8 , ( uint8_t ) ref [ 0 ] , 1 ) ;
fill_rectangle ( & h -> ref_cache [ 1 ] [ scan8 [ 0 ] ] , 4 , 4 , 8 , ( uint8_t ) ref [ 1 ] , 1 ) ;
fill_rectangle ( & h -> mv_cache [ 0 ] [ scan8 [ 0 ] ] , 4 , 4 , 8 , 0 , 4 ) ;
fill_rectangle ( & h -> mv_cache [ 1 ] [ scan8 [ 0 ] ] , 4 , 4 , 8 , 0 , 4 ) ;
* mb_type = ( * mb_type & ~ ( MB_TYPE_8x8 | MB_TYPE_16x8 | MB_TYPE_8x16 | MB_TYPE_P1L0 | MB_TYPE_P1L1 ) ) | MB_TYPE_16x16 | MB_TYPE_DIRECT2 ;
return ;
}
if ( IS_INTERLACED ( h -> ref_list [ 1 ] [ 0 ] . f . mb_type [ mb_xy ] ) ) {
if ( ! IS_INTERLACED ( * mb_type ) ) {
mb_y = ( h -> mb_y & ~ 1 ) + h -> col_parity ;
mb_xy = h -> mb_x + ( ( h -> mb_y & ~ 1 ) + h -> col_parity ) * h -> mb_stride ;
b8_stride = 0 ;
}
else {
mb_y += h -> col_fieldoff ;
mb_xy += h -> mb_stride * h -> col_fieldoff ;
}
goto single_col ;
}
else {
if ( IS_INTERLACED ( * mb_type ) ) {
mb_y = h -> mb_y & ~ 1 ;
mb_xy = h -> mb_x + ( h -> mb_y & ~ 1 ) * h -> mb_stride ;
mb_type_col [ 0 ] = h -> ref_list [ 1 ] [ 0 ] . f . mb_type [ mb_xy ] ;
mb_type_col [ 1 ] = h -> ref_list [ 1 ] [ 0 ] . f . mb_type [ mb_xy + h -> mb_stride ] ;
b8_stride = 2 + 4 * h -> mb_stride ;
b4_stride *= 6 ;
if ( IS_INTERLACED ( mb_type_col [ 0 ] ) != IS_INTERLACED ( mb_type_col [ 1 ] ) ) {
mb_type_col [ 0 ] &= ~ MB_TYPE_INTERLACED ;
mb_type_col [ 1 ] &= ~ MB_TYPE_INTERLACED ;
}
sub_mb_type |= MB_TYPE_16x16 | MB_TYPE_DIRECT2 ;
if ( ( mb_type_col [ 0 ] & MB_TYPE_16x16_OR_INTRA ) && ( mb_type_col [ 1 ] & MB_TYPE_16x16_OR_INTRA ) && ! is_b8x8 ) {
* mb_type |= MB_TYPE_16x8 | MB_TYPE_DIRECT2 ;
}
else {
* mb_type |= MB_TYPE_8x8 ;
}
}
else {
single_col : mb_type_col [ 0 ] = mb_type_col [ 1 ] = h -> ref_list [ 1 ] [ 0 ] . f . mb_type [ mb_xy ] ;
sub_mb_type |= MB_TYPE_16x16 | MB_TYPE_DIRECT2 ;
if ( ! is_b8x8 && ( mb_type_col [ 0 ] & MB_TYPE_16x16_OR_INTRA ) ) {
* mb_type |= MB_TYPE_16x16 | MB_TYPE_DIRECT2 ;
}
else if ( ! is_b8x8 && ( mb_type_col [ 0 ] & ( MB_TYPE_16x8 | MB_TYPE_8x16 ) ) ) {
* mb_type |= MB_TYPE_DIRECT2 | ( mb_type_col [ 0 ] & ( MB_TYPE_16x8 | MB_TYPE_8x16 ) ) ;
}
else {
if ( ! h -> sps . direct_8x8_inference_flag ) {
sub_mb_type += ( MB_TYPE_8x8 - MB_TYPE_16x16 ) ;
}
* mb_type |= MB_TYPE_8x8 ;
}
}
}
await_reference_mb_row ( h , & h -> ref_list [ 1 ] [ 0 ] , mb_y ) ;
l1mv0 = & h -> ref_list [ 1 ] [ 0 ] . f . motion_val [ 0 ] [ h -> mb2b_xy [ mb_xy ] ] ;
l1mv1 = & h -> ref_list [ 1 ] [ 0 ] . f . motion_val [ 1 ] [ h -> mb2b_xy [ mb_xy ] ] ;
l1ref0 = & h -> ref_list [ 1 ] [ 0 ] . f . ref_index [ 0 ] [ 4 * mb_xy ] ;
l1ref1 = & h -> ref_list [ 1 ] [ 0 ] . f . ref_index [ 1 ] [ 4 * mb_xy ] ;
if ( ! b8_stride ) {
if ( h -> mb_y & 1 ) {
l1ref0 += 2 ;
l1ref1 += 2 ;
l1mv0 += 2 * b4_stride ;
l1mv1 += 2 * b4_stride ;
}
}
if ( IS_INTERLACED ( * mb_type ) != IS_INTERLACED ( mb_type_col [ 0 ] ) ) {
int n = 0 ;
for ( i8 = 0 ;
i8 < 4 ;
i8 ++ ) {
int x8 = i8 & 1 ;
int y8 = i8 >> 1 ;
int xy8 = x8 + y8 * b8_stride ;
int xy4 = 3 * x8 + y8 * b4_stride ;
int a , b ;
if ( is_b8x8 && ! IS_DIRECT ( h -> sub_mb_type [ i8 ] ) ) continue ;
h -> sub_mb_type [ i8 ] = sub_mb_type ;
fill_rectangle ( & h -> ref_cache [ 0 ] [ scan8 [ i8 * 4 ] ] , 2 , 2 , 8 , ( uint8_t ) ref [ 0 ] , 1 ) ;
fill_rectangle ( & h -> ref_cache [ 1 ] [ scan8 [ i8 * 4 ] ] , 2 , 2 , 8 , ( uint8_t ) ref [ 1 ] , 1 ) ;
if ( ! IS_INTRA ( mb_type_col [ y8 ] ) && ! h -> ref_list [ 1 ] [ 0 ] . long_ref && ( ( l1ref0 [ xy8 ] == 0 && FFABS ( l1mv0 [ xy4 ] [ 0 ] ) <= 1 && FFABS ( l1mv0 [ xy4 ] [ 1 ] ) <= 1 ) || ( l1ref0 [ xy8 ] < 0 && l1ref1 [ xy8 ] == 0 && FFABS ( l1mv1 [ xy4 ] [ 0 ] ) <= 1 && FFABS ( l1mv1 [ xy4 ] [ 1 ] ) <= 1 ) ) ) {
a = b = 0 ;
if ( ref [ 0 ] > 0 ) a = mv [ 0 ] ;
if ( ref [ 1 ] > 0 ) b = mv [ 1 ] ;
n ++ ;
}
else {
a = mv [ 0 ] ;
b = mv [ 1 ] ;
}
fill_rectangle ( & h -> mv_cache [ 0 ] [ scan8 [ i8 * 4 ] ] , 2 , 2 , 8 , a , 4 ) ;
fill_rectangle ( & h -> mv_cache [ 1 ] [ scan8 [ i8 * 4 ] ] , 2 , 2 , 8 , b , 4 ) ;
}
if ( ! is_b8x8 && ! ( n & 3 ) ) * mb_type = ( * mb_type & ~ ( MB_TYPE_8x8 | MB_TYPE_16x8 | MB_TYPE_8x16 | MB_TYPE_P1L0 | MB_TYPE_P1L1 ) ) | MB_TYPE_16x16 | MB_TYPE_DIRECT2 ;
}
else if ( IS_16X16 ( * mb_type ) ) {
int a , b ;
fill_rectangle ( & h -> ref_cache [ 0 ] [ scan8 [ 0 ] ] , 4 , 4 , 8 , ( uint8_t ) ref [ 0 ] , 1 ) ;
fill_rectangle ( & h -> ref_cache [ 1 ] [ scan8 [ 0 ] ] , 4 , 4 , 8 , ( uint8_t ) ref [ 1 ] , 1 ) ;
if ( ! IS_INTRA ( mb_type_col [ 0 ] ) && ! h -> ref_list [ 1 ] [ 0 ] . long_ref && ( ( l1ref0 [ 0 ] == 0 && FFABS ( l1mv0 [ 0 ] [ 0 ] ) <= 1 && FFABS ( l1mv0 [ 0 ] [ 1 ] ) <= 1 ) || ( l1ref0 [ 0 ] < 0 && l1ref1 [ 0 ] == 0 && FFABS ( l1mv1 [ 0 ] [ 0 ] ) <= 1 && FFABS ( l1mv1 [ 0 ] [ 1 ] ) <= 1 && h -> x264_build > 33U ) ) ) {
a = b = 0 ;
if ( ref [ 0 ] > 0 ) a = mv [ 0 ] ;
if ( ref [ 1 ] > 0 ) b = mv [ 1 ] ;
}
else {
a = mv [ 0 ] ;
b = mv [ 1 ] ;
}
fill_rectangle ( & h -> mv_cache [ 0 ] [ scan8 [ 0 ] ] , 4 , 4 , 8 , a , 4 ) ;
fill_rectangle ( & h -> mv_cache [ 1 ] [ scan8 [ 0 ] ] , 4 , 4 , 8 , b , 4 ) ;
}
else {
int n = 0 ;
for ( i8 = 0 ;
i8 < 4 ;
i8 ++ ) {
const int x8 = i8 & 1 ;
const int y8 = i8 >> 1 ;
if ( is_b8x8 && ! IS_DIRECT ( h -> sub_mb_type [ i8 ] ) ) continue ;
h -> sub_mb_type [ i8 ] = sub_mb_type ;
fill_rectangle ( & h -> mv_cache [ 0 ] [ scan8 [ i8 * 4 ] ] , 2 , 2 , 8 , mv [ 0 ] , 4 ) ;
fill_rectangle ( & h -> mv_cache [ 1 ] [ scan8 [ i8 * 4 ] ] , 2 , 2 , 8 , mv [ 1 ] , 4 ) ;
fill_rectangle ( & h -> ref_cache [ 0 ] [ scan8 [ i8 * 4 ] ] , 2 , 2 , 8 , ( uint8_t ) ref [ 0 ] , 1 ) ;
fill_rectangle ( & h -> ref_cache [ 1 ] [ scan8 [ i8 * 4 ] ] , 2 , 2 , 8 , ( uint8_t ) ref [ 1 ] , 1 ) ;
assert ( b8_stride == 2 ) ;
if ( ! IS_INTRA ( mb_type_col [ 0 ] ) && ! h -> ref_list [ 1 ] [ 0 ] . long_ref && ( l1ref0 [ i8 ] == 0 || ( l1ref0 [ i8 ] < 0 && l1ref1 [ i8 ] == 0 && h -> x264_build > 33U ) ) ) {
const int16_t ( * l1mv ) [ 2 ] = l1ref0 [ i8 ] == 0 ? l1mv0 : l1mv1 ;
if ( IS_SUB_8X8 ( sub_mb_type ) ) {
const int16_t * mv_col = l1mv [ x8 * 3 + y8 * 3 * b4_stride ] ;
if ( FFABS ( mv_col [ 0 ] ) <= 1 && FFABS ( mv_col [ 1 ] ) <= 1 ) {
if ( ref [ 0 ] == 0 ) fill_rectangle ( & h -> mv_cache [ 0 ] [ scan8 [ i8 * 4 ] ] , 2 , 2 , 8 , 0 , 4 ) ;
if ( ref [ 1 ] == 0 ) fill_rectangle ( & h -> mv_cache [ 1 ] [ scan8 [ i8 * 4 ] ] , 2 , 2 , 8 , 0 , 4 ) ;
n += 4 ;
}
}
else {
int m = 0 ;
for ( i4 = 0 ;
i4 < 4 ;
i4 ++ ) {
const int16_t * mv_col = l1mv [ x8 * 2 + ( i4 & 1 ) + ( y8 * 2 + ( i4 >> 1 ) ) * b4_stride ] ;
if ( FFABS ( mv_col [ 0 ] ) <= 1 && FFABS ( mv_col [ 1 ] ) <= 1 ) {
if ( ref [ 0 ] == 0 ) AV_ZERO32 ( h -> mv_cache [ 0 ] [ scan8 [ i8 * 4 + i4 ] ] ) ;
if ( ref [ 1 ] == 0 ) AV_ZERO32 ( h -> mv_cache [ 1 ] [ scan8 [ i8 * 4 + i4 ] ] ) ;
m ++ ;
}
}
if ( ! ( m & 3 ) ) h -> sub_mb_type [ i8 ] += MB_TYPE_16x16 - MB_TYPE_8x8 ;
n += m ;
}
}
}
if ( ! is_b8x8 && ! ( n & 15 ) ) * mb_type = ( * mb_type & ~ ( MB_TYPE_8x8 | MB_TYPE_16x8 | MB_TYPE_8x16 | MB_TYPE_P1L0 | MB_TYPE_P1L1 ) ) | MB_TYPE_16x16 | MB_TYPE_DIRECT2 ;
}
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static gint handle_message_body_parameters ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * header_tree , guint encoding , gint offset , gint32 body_length , guint8 * signature , guint8 signature_length ) {
gint packet_length , end_of_body ;
proto_tree * tree ;
proto_item * item ;
const gint starting_offset = offset ;
packet_length = tvb_reported_length ( tvb ) ;
item = proto_tree_add_item ( header_tree , hf_alljoyn_mess_body_parameters , tvb , offset , body_length , ENC_NA ) ;
tree = proto_item_add_subtree ( item , ett_alljoyn_mess_body_parameters ) ;
end_of_body = offset + body_length ;
if ( end_of_body > packet_length ) {
end_of_body = packet_length ;
}
while ( offset < end_of_body && signature && * signature ) {
offset = parse_arg ( tvb , pinfo , NULL , encoding , offset , tree , FALSE , * signature , HDR_INVALID , & signature , & signature_length , starting_offset ) ;
}
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
proto_item * proto_tree_add_time_item ( proto_tree * tree , int hfindex , tvbuff_t * tvb , const gint start , gint length , const guint encoding , nstime_t * retval , gint * endoff , gint * err ) {
field_info * new_fi ;
nstime_t time_stamp ;
gint saved_err = 0 ;
header_field_info * hfinfo ;
PROTO_REGISTRAR_GET_NTH ( hfindex , hfinfo ) ;
DISSECTOR_ASSERT_HINT ( hfinfo != NULL , "Not passed hfi!" ) ;
DISSECTOR_ASSERT_FIELD_TYPE_IS_TIME ( hfinfo ) ;
if ( length < - 1 || length == 0 ) {
REPORT_DISSECTOR_BUG ( wmem_strdup_printf ( wmem_packet_scope ( ) , "Invalid length %d passed to proto_tree_add_time_item" , length ) ) ;
}
time_stamp . secs = 0 ;
time_stamp . nsecs = 0 ;
if ( encoding & ENC_STR_TIME_MASK ) {
tvb_get_string_time ( tvb , start , length , encoding , & time_stamp , endoff ) ;
saved_err = errno ;
}
else {
const gboolean is_relative = ( hfinfo -> type == FT_RELATIVE_TIME ) ? TRUE : FALSE ;
if ( length != 8 && length != 4 ) {
const gboolean length_error = length < 4 ? TRUE : FALSE ;
if ( is_relative ) report_type_length_mismatch ( tree , "a relative time value" , length , length_error ) ;
else report_type_length_mismatch ( tree , "an absolute time value" , length , length_error ) ;
}
tvb_ensure_bytes_exist ( tvb , start , length ) ;
get_time_value ( tvb , start , length , encoding , & time_stamp , is_relative ) ;
if ( endoff ) * endoff = length ;
}
if ( err ) * err = saved_err ;
if ( retval ) {
retval -> secs = time_stamp . secs ;
retval -> nsecs = time_stamp . nsecs ;
}
CHECK_FOR_NULL_TREE ( tree ) ;
TRY_TO_FAKE_THIS_ITEM ( tree , hfinfo -> id , hfinfo ) ;
new_fi = new_field_info ( tree , hfinfo , tvb , start , length ) ;
proto_tree_set_time ( new_fi , & time_stamp ) ;
if ( encoding & ENC_STRING ) {
if ( saved_err == ERANGE ) expert_add_info ( NULL , tree , & ei_number_string_decoding_erange_error ) ;
else if ( saved_err == EDOM ) expert_add_info ( NULL , tree , & ei_number_string_decoding_failed_error ) ;
}
else {
FI_SET_FLAG ( new_fi , ( encoding & ENC_LITTLE_ENDIAN ) ? FI_LITTLE_ENDIAN : FI_BIG_ENDIAN ) ;
}
return proto_tree_add_node ( tree , new_fi ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_h245_FECC_rfc2733 ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h245_FECC_rfc2733 , FECC_rfc2733_sequence ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static inline int l1_unscale ( int n , int mant , int scale_factor ) {
int shift , mod ;
int64_t val ;
shift = scale_factor_modshift [ scale_factor ] ;
mod = shift & 3 ;
shift >>= 2 ;
val = MUL64 ( mant + ( - 1 << n ) + 1 , scale_factor_mult [ n - 1 ] [ mod ] ) ;
shift += n ;
return ( int ) ( ( val + ( 1LL << ( shift - 1 ) ) ) >> shift ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
struct istream * i_stream_create_attachment_extractor ( struct istream * input , struct istream_attachment_settings * set , void * context ) {
struct attachment_istream * astream ;
i_assert ( set -> min_size > 0 ) ;
i_assert ( set -> hash_format != NULL ) ;
i_assert ( set -> open_attachment_ostream != NULL ) ;
i_assert ( set -> close_attachment_ostream != NULL ) ;
astream = i_new ( struct attachment_istream , 1 ) ;
astream -> part . temp_fd = - 1 ;
astream -> set = * set ;
astream -> context = context ;
astream -> retry_read = TRUE ;
set -> hash_format = NULL ;
astream -> istream . max_buffer_size = input -> real_stream -> max_buffer_size ;
astream -> istream . read = i_stream_attachment_extractor_read ;
astream -> istream . iostream . close = i_stream_attachment_extractor_close ;
astream -> istream . istream . readable_fd = FALSE ;
astream -> istream . istream . blocking = input -> blocking ;
astream -> istream . istream . seekable = FALSE ;
astream -> pool = pool_alloconly_create ( "istream attachment" , 1024 ) ;
astream -> parser = message_parser_init ( astream -> pool , input , 0 , MESSAGE_PARSER_FLAG_INCLUDE_MULTIPART_BLOCKS | MESSAGE_PARSER_FLAG_INCLUDE_BOUNDARIES ) ;
return i_stream_create ( & astream -> istream , input , i_stream_get_fd ( input ) ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
TEST_F ( ScoredHistoryMatchTest , GetTopicalityScore ) {
base : : string16 url = ASCIIToUTF16 ( "http://abc.def.com/path1/path2?" "arg1=val1&arg2=val2#hash_component" ) ;
base : : string16 title = ASCIIToUTF16 ( "here is a title" ) ;
const float hostname_score = GetTopicalityScoreOfTermAgainstURLAndTitle ( ASCIIToUTF16 ( "abc" ) , url , title ) ;
const float hostname_mid_word_score = GetTopicalityScoreOfTermAgainstURLAndTitle ( ASCIIToUTF16 ( "bc" ) , url , title ) ;
const float domain_name_score = GetTopicalityScoreOfTermAgainstURLAndTitle ( ASCIIToUTF16 ( "def" ) , url , title ) ;
const float domain_name_mid_word_score = GetTopicalityScoreOfTermAgainstURLAndTitle ( ASCIIToUTF16 ( "ef" ) , url , title ) ;
const float tld_score = GetTopicalityScoreOfTermAgainstURLAndTitle ( ASCIIToUTF16 ( "com" ) , url , title ) ;
const float tld_mid_word_score = GetTopicalityScoreOfTermAgainstURLAndTitle ( ASCIIToUTF16 ( "om" ) , url , title ) ;
const float path_score = GetTopicalityScoreOfTermAgainstURLAndTitle ( ASCIIToUTF16 ( "path1" ) , url , title ) ;
const float path_mid_word_score = GetTopicalityScoreOfTermAgainstURLAndTitle ( ASCIIToUTF16 ( "ath1" ) , url , title ) ;
const float arg_score = GetTopicalityScoreOfTermAgainstURLAndTitle ( ASCIIToUTF16 ( "arg2" ) , url , title ) ;
const float arg_mid_word_score = GetTopicalityScoreOfTermAgainstURLAndTitle ( ASCIIToUTF16 ( "rg2" ) , url , title ) ;
const float protocol_score = GetTopicalityScoreOfTermAgainstURLAndTitle ( ASCIIToUTF16 ( "htt" ) , url , title ) ;
const float protocol_mid_word_score = GetTopicalityScoreOfTermAgainstURLAndTitle ( ASCIIToUTF16 ( "tt" ) , url , title ) ;
const float title_score = GetTopicalityScoreOfTermAgainstURLAndTitle ( ASCIIToUTF16 ( "her" ) , url , title ) ;
const float title_mid_word_score = GetTopicalityScoreOfTermAgainstURLAndTitle ( ASCIIToUTF16 ( "er" ) , url , title ) ;
EXPECT_GT ( hostname_score , path_score ) ;
EXPECT_GT ( domain_name_score , path_score ) ;
EXPECT_GT ( path_score , arg_score ) ;
EXPECT_GT ( hostname_mid_word_score , path_mid_word_score ) ;
EXPECT_GT ( domain_name_mid_word_score , path_mid_word_score ) ;
EXPECT_GT ( domain_name_mid_word_score , arg_mid_word_score ) ;
EXPECT_GT ( hostname_mid_word_score , arg_mid_word_score ) ;
EXPECT_GT ( arg_score , hostname_mid_word_score ) ;
EXPECT_GT ( arg_score , domain_name_mid_word_score ) ;
EXPECT_GT ( title_score , title_mid_word_score ) ;
EXPECT_GT ( title_score , arg_score ) ;
EXPECT_GT ( arg_score , title_mid_word_score ) ;
EXPECT_GT ( hostname_mid_word_score , protocol_score ) ;
EXPECT_GT ( hostname_mid_word_score , protocol_mid_word_score ) ;
EXPECT_GT ( hostname_mid_word_score , tld_score ) ;
EXPECT_GT ( hostname_mid_word_score , tld_mid_word_score ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void qtrle_decode_1bpp ( QtrleContext * s , int row_ptr , int lines_to_change ) {
int rle_code ;
int pixel_ptr ;
int row_inc = s -> frame . linesize [ 0 ] ;
unsigned char pi0 , pi1 ;
unsigned char * rgb = s -> frame . data [ 0 ] ;
int pixel_limit = s -> frame . linesize [ 0 ] * s -> avctx -> height ;
int skip ;
row_ptr -= row_inc ;
pixel_ptr = row_ptr ;
lines_to_change ++ ;
while ( lines_to_change ) {
skip = bytestream2_get_byte ( & s -> g ) ;
rle_code = ( signed char ) bytestream2_get_byte ( & s -> g ) ;
if ( rle_code == 0 ) break ;
if ( skip & 0x80 ) {
lines_to_change -- ;
row_ptr += row_inc ;
pixel_ptr = row_ptr + 2 * ( skip & 0x7f ) ;
}
else pixel_ptr += 2 * skip ;
CHECK_PIXEL_PTR ( 0 ) ;
if ( rle_code < 0 ) {
rle_code = - rle_code ;
pi0 = bytestream2_get_byte ( & s -> g ) ;
pi1 = bytestream2_get_byte ( & s -> g ) ;
CHECK_PIXEL_PTR ( rle_code * 2 ) ;
while ( rle_code -- ) {
rgb [ pixel_ptr ++ ] = pi0 ;
rgb [ pixel_ptr ++ ] = pi1 ;
}
}
else {
rle_code *= 2 ;
CHECK_PIXEL_PTR ( rle_code ) ;
while ( rle_code -- ) rgb [ pixel_ptr ++ ] = bytestream2_get_byte ( & s -> g ) ;
}
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int kvm_arch_insert_sw_breakpoint ( CPUState * cs , struct kvm_sw_breakpoint * bp ) {
static const uint8_t int3 = 0xcc ;
if ( cpu_memory_rw_debug ( cs , bp -> pc , ( uint8_t * ) & bp -> saved_insn , 1 , 0 ) || cpu_memory_rw_debug ( cs , bp -> pc , ( uint8_t * ) & int3 , 1 , 1 ) ) {
return - EINVAL ;
}
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int frame_max_bits ( const RATE_CONTROL * rc , const VP9EncoderConfig * oxcf ) {
int64_t max_bits = ( ( int64_t ) rc -> avg_frame_bandwidth * ( int64_t ) oxcf -> two_pass_vbrmax_section ) / 100 ;
if ( max_bits < 0 ) max_bits = 0 ;
else if ( max_bits > rc -> max_frame_bandwidth ) max_bits = rc -> max_frame_bandwidth ;
return ( int ) max_bits ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static vpx_codec_err_t parse_scale_factors ( SvcContext * svc_ctx , const char * scale_factors ) {
char * input_string ;
char * token ;
const char * delim = "," ;
char * save_ptr ;
int found = 0 ;
int i ;
int64_t num , den ;
vpx_codec_err_t res = VPX_CODEC_OK ;
SvcInternal * const si = get_svc_internal ( svc_ctx ) ;
if ( scale_factors == NULL || strlen ( scale_factors ) == 0 ) {
input_string = strdup ( DEFAULT_SCALE_FACTORS ) ;
}
else {
input_string = strdup ( scale_factors ) ;
}
token = strtok_r ( input_string , delim , & save_ptr ) ;
for ( i = 0 ;
i < svc_ctx -> spatial_layers ;
++ i ) {
num = den = 0 ;
if ( token != NULL ) {
num = strtol ( token , & token , 10 ) ;
if ( num <= 0 ) {
log_invalid_scale_factor ( svc_ctx , token ) ;
res = VPX_CODEC_INVALID_PARAM ;
break ;
}
if ( * token ++ != '/' ) {
log_invalid_scale_factor ( svc_ctx , token ) ;
res = VPX_CODEC_INVALID_PARAM ;
break ;
}
den = strtol ( token , & token , 10 ) ;
if ( den <= 0 ) {
log_invalid_scale_factor ( svc_ctx , token ) ;
res = VPX_CODEC_INVALID_PARAM ;
break ;
}
token = strtok_r ( NULL , delim , & save_ptr ) ;
found = i + 1 ;
}
si -> scaling_factor_num [ i + VPX_SS_MAX_LAYERS - svc_ctx -> spatial_layers ] = ( int ) num ;
si -> scaling_factor_den [ i + VPX_SS_MAX_LAYERS - svc_ctx -> spatial_layers ] = ( int ) den ;
}
if ( res == VPX_CODEC_OK && found != svc_ctx -> spatial_layers ) {
svc_log ( svc_ctx , SVC_LOG_ERROR , "svc: scale-factors: %d values required, but only %d specified\n" , svc_ctx -> spatial_layers , found ) ;
res = VPX_CODEC_INVALID_PARAM ;
}
free ( input_string ) ;
return res ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_h245_T_extendedAlphanumeric ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h245_T_extendedAlphanumeric , T_extendedAlphanumeric_sequence ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int mime_hdr_field_slotnum ( MIMEHdrImpl * mh , MIMEField * field ) {
int slots_so_far ;
MIMEFieldBlockImpl * fblock ;
slots_so_far = 0 ;
for ( fblock = & ( mh -> m_first_fblock ) ;
fblock != nullptr ;
fblock = fblock -> m_next ) {
if ( fblock -> contains ( field ) ) {
MIMEField * first = & ( fblock -> m_field_slots [ 0 ] ) ;
ptrdiff_t block_slot = field - first ;
return slots_so_far + block_slot ;
}
slots_so_far += MIME_FIELD_BLOCK_SLOTS ;
}
return - 1 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void test_fetch_bigint ( ) {
int rc ;
myheader ( "test_fetch_bigint" ) ;
rc = mysql_query ( mysql , "DROP TABLE IF EXISTS test_bind_fetch" ) ;
myquery ( rc ) ;
rc = mysql_query ( mysql , "CREATE TABLE test_bind_fetch(c1 bigint, \ c2 bigint, \ c3 bigint unsigned, \ c4 bigint unsigned, \ c5 bigint unsigned, \ c6 bigint unsigned, \ c7 bigint unsigned)" ) ;
myquery ( rc ) ;
bind_fetch ( 2 ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static inline void fl6_sock_release ( struct ip6_flowlabel * fl ) {
if ( fl ) atomic_dec ( & fl -> users ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void slavio_misc_init ( hwaddr base , hwaddr aux1_base , hwaddr aux2_base , qemu_irq irq , qemu_irq fdc_tc ) {
DeviceState * dev ;
SysBusDevice * s ;
dev = qdev_create ( NULL , "slavio_misc" ) ;
qdev_init_nofail ( dev ) ;
s = SYS_BUS_DEVICE ( dev ) ;
if ( base ) {
sysbus_mmio_map ( s , 0 , base + MISC_CFG ) ;
sysbus_mmio_map ( s , 1 , base + MISC_DIAG ) ;
sysbus_mmio_map ( s , 2 , base + MISC_MDM ) ;
sysbus_mmio_map ( s , 3 , base + MISC_LEDS ) ;
sysbus_mmio_map ( s , 4 , base + MISC_SYS ) ;
}
if ( aux1_base ) {
sysbus_mmio_map ( s , 5 , aux1_base ) ;
}
if ( aux2_base ) {
sysbus_mmio_map ( s , 6 , aux2_base ) ;
}
sysbus_connect_irq ( s , 0 , irq ) ;
sysbus_connect_irq ( s , 1 , fdc_tc ) ;
slavio_system_powerdown = qdev_get_gpio_in ( dev , 0 ) ;
qemu_register_powerdown_notifier ( & slavio_system_powerdown_notifier ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void extend_to_full_distribution ( vp9_prob * probs , vp9_prob p ) {
vpx_memcpy ( probs , vp9_pareto8_full [ p = 0 ? 0 : p - 1 ] , MODEL_NODES * sizeof ( vp9_prob ) ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
TEST_F ( UsbBlocklistTest , StringsWithOneValidEntry ) {
SetDynamicBlocklist ( "18D1:58F0:0101" ) ;
EXPECT_EQ ( 1u , list ( ) . GetDynamicEntryCountForTest ( ) ) ;
EXPECT_TRUE ( list ( ) . IsExcluded ( {
0x18D1 , 0x58F0 , 0x0101 }
) ) ;
SetDynamicBlocklist ( " 18D1:58F0:0200 " ) ;
EXPECT_EQ ( 1u , list ( ) . GetDynamicEntryCountForTest ( ) ) ;
EXPECT_TRUE ( list ( ) . IsExcluded ( {
0x18D1 , 0x58F0 , 0x0200 }
) ) ;
SetDynamicBlocklist ( ", 18D1:58F0:0201, " ) ;
EXPECT_EQ ( 1u , list ( ) . GetDynamicEntryCountForTest ( ) ) ;
EXPECT_TRUE ( list ( ) . IsExcluded ( {
0x18D1 , 0x58F0 , 0x0201 }
) ) ;
SetDynamicBlocklist ( "18D1:58F0:0202, 0000:1:0000" ) ;
EXPECT_EQ ( 1u , list ( ) . GetDynamicEntryCountForTest ( ) ) ;
EXPECT_TRUE ( list ( ) . IsExcluded ( {
0x18D1 , 0x58F0 , 0x0202 }
) ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
inline void mime_hdr_reset_accelerators_and_presence_bits ( MIMEHdrImpl * mh ) {
mime_hdr_init_accelerators_and_presence_bits ( mh ) ;
for ( MIMEFieldBlockImpl * fblock = & ( mh -> m_first_fblock ) ;
fblock != nullptr ;
fblock = fblock -> m_next ) {
for ( MIMEField * field = fblock -> m_field_slots , * limit = field + fblock -> m_freetop ;
field < limit ;
++ field ) {
if ( field -> is_live ( ) ) {
field -> m_wks_idx = hdrtoken_tokenize ( field -> m_ptr_name , field -> m_len_name ) ;
if ( field -> is_dup_head ( ) ) {
mime_hdr_set_accelerators_and_presence_bits ( mh , field ) ;
}
}
}
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static uint64_t pxa2xx_i2s_read ( void * opaque , hwaddr addr , unsigned size ) {
PXA2xxI2SState * s = ( PXA2xxI2SState * ) opaque ;
switch ( addr ) {
case SACR0 : return s -> control [ 0 ] ;
case SACR1 : return s -> control [ 1 ] ;
case SASR0 : return s -> status ;
case SAIMR : return s -> mask ;
case SAICR : return 0 ;
case SADIV : return s -> clk ;
case SADR : if ( s -> rx_len > 0 ) {
s -> rx_len -- ;
pxa2xx_i2s_update ( s ) ;
return s -> codec_in ( s -> opaque ) ;
}
return 0 ;
default : printf ( "%s: Bad register " REG_FMT "\n" , __FUNCTION__ , addr ) ;
break ;
}
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
const char * TSMimeHdrFieldNameGet ( TSMBuffer bufp , TSMLoc hdr , TSMLoc field , int * length ) {
sdk_assert ( sdk_sanity_check_mbuffer ( bufp ) == TS_SUCCESS ) ;
sdk_assert ( ( sdk_sanity_check_mime_hdr_handle ( hdr ) == TS_SUCCESS ) || ( sdk_sanity_check_http_hdr_handle ( hdr ) == TS_SUCCESS ) ) ;
sdk_assert ( sdk_sanity_check_field_handle ( field , hdr ) == TS_SUCCESS ) ;
sdk_assert ( sdk_sanity_check_null_ptr ( ( void * ) length ) == TS_SUCCESS ) ;
MIMEFieldSDKHandle * handle = ( MIMEFieldSDKHandle * ) field ;
return mime_field_name_get ( handle -> field_ptr , length ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void model_rd_for_sb_y ( VP9_COMP * cpi , BLOCK_SIZE bsize , MACROBLOCK * x , MACROBLOCKD * xd , int * out_rate_sum , int64_t * out_dist_sum , unsigned int * var_y , unsigned int * sse_y ) {
unsigned int sse ;
int rate ;
int64_t dist ;
struct macroblock_plane * const p = & x -> plane [ 0 ] ;
struct macroblockd_plane * const pd = & xd -> plane [ 0 ] ;
const uint32_t dc_quant = pd -> dequant [ 0 ] ;
const uint32_t ac_quant = pd -> dequant [ 1 ] ;
unsigned int var = cpi -> fn_ptr [ bsize ] . vf ( p -> src . buf , p -> src . stride , pd -> dst . buf , pd -> dst . stride , & sse ) ;
* var_y = var ;
* sse_y = sse ;
if ( sse < dc_quant * dc_quant >> 6 ) x -> skip_txfm [ 0 ] = 1 ;
else if ( var < ac_quant * ac_quant >> 6 ) x -> skip_txfm [ 0 ] = 2 ;
else x -> skip_txfm [ 0 ] = 0 ;
if ( cpi -> common . tx_mode == TX_MODE_SELECT ) {
if ( sse > ( var << 2 ) ) xd -> mi [ 0 ] . src_mi -> mbmi . tx_size = MIN ( max_txsize_lookup [ bsize ] , tx_mode_to_biggest_tx_size [ cpi -> common . tx_mode ] ) ;
else xd -> mi [ 0 ] . src_mi -> mbmi . tx_size = TX_8X8 ;
}
else {
xd -> mi [ 0 ] . src_mi -> mbmi . tx_size = MIN ( max_txsize_lookup [ bsize ] , tx_mode_to_biggest_tx_size [ cpi -> common . tx_mode ] ) ;
}
vp9_model_rd_from_var_lapndz ( sse - var , 1 << num_pels_log2_lookup [ bsize ] , dc_quant >> 3 , & rate , & dist ) ;
* out_rate_sum = rate >> 1 ;
* out_dist_sum = dist << 3 ;
vp9_model_rd_from_var_lapndz ( var , 1 << num_pels_log2_lookup [ bsize ] , ac_quant >> 3 , & rate , & dist ) ;
* out_rate_sum += rate ;
* out_dist_sum += dist << 4 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static kadm5_ret_t get_policy ( kadm5_server_handle_t handle , const char * name , kadm5_policy_ent_t policy_out , krb5_boolean * have_pol_out ) {
kadm5_ret_t ret ;
* have_pol_out = FALSE ;
if ( name == NULL ) return 0 ;
ret = kadm5_get_policy ( handle -> lhandle , ( char * ) name , policy_out ) ;
if ( ret == 0 ) * have_pol_out = TRUE ;
return ( ret == KADM5_UNK_POLICY ) ? 0 : ret ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void dumpDatabases ( PGconn * conn ) {
PGresult * res ;
int i ;
if ( server_version >= 70100 ) res = executeQuery ( conn , "SELECT datname FROM pg_database WHERE datallowconn ORDER BY 1" ) ;
else res = executeQuery ( conn , "SELECT datname FROM pg_database ORDER BY 1" ) ;
for ( i = 0 ;
i < PQntuples ( res ) ;
i ++ ) {
int ret ;
char * dbname = PQgetvalue ( res , i , 0 ) ;
if ( verbose ) fprintf ( stderr , _ ( "%s: dumping database \"%s\"...\n" ) , progname , dbname ) ;
fprintf ( OPF , "\\connect %s\n\n" , fmtId ( dbname ) ) ;
fprintf ( OPF , "SET default_transaction_read_only = off;
\n\n" ) ;
if ( filename ) fclose ( OPF ) ;
ret = runPgDump ( dbname ) ;
if ( ret != 0 ) {
fprintf ( stderr , _ ( "%s: pg_dump failed on database \"%s\", exiting\n" ) , progname , dbname ) ;
exit_nicely ( 1 ) ;
}
if ( filename ) {
OPF = fopen ( filename , PG_BINARY_A ) ;
if ( ! OPF ) {
fprintf ( stderr , _ ( "%s: could not re-open the output file \"%s\": %s\n" ) , progname , filename , strerror ( errno ) ) ;
exit_nicely ( 1 ) ;
}
}
}
PQclear ( res ) ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
int xmlListPushFront ( xmlListPtr l , void * data ) {
xmlLinkPtr lkPlace , lkNew ;
if ( l == NULL ) return ( 0 ) ;
lkPlace = l -> sentinel ;
lkNew = ( xmlLinkPtr ) xmlMalloc ( sizeof ( xmlLink ) ) ;
if ( lkNew == NULL ) {
xmlGenericError ( xmlGenericErrorContext , "Cannot initialize memory for new link" ) ;
return ( 0 ) ;
}
lkNew -> data = data ;
lkNew -> next = lkPlace -> next ;
( lkPlace -> next ) -> prev = lkNew ;
lkPlace -> next = lkNew ;
lkNew -> prev = lkPlace ;
return 1 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void vp9_change_config ( struct VP9_COMP * cpi , const VP9EncoderConfig * oxcf ) {
VP9_COMMON * const cm = & cpi -> common ;
RATE_CONTROL * const rc = & cpi -> rc ;
if ( cm -> profile != oxcf -> profile ) cm -> profile = oxcf -> profile ;
cm -> bit_depth = oxcf -> bit_depth ;
if ( cm -> profile <= PROFILE_1 ) assert ( cm -> bit_depth == VPX_BITS_8 ) ;
else assert ( cm -> bit_depth > VPX_BITS_8 ) ;
cpi -> oxcf = * oxcf ;
rc -> baseline_gf_interval = DEFAULT_GF_INTERVAL ;
cpi -> refresh_golden_frame = 0 ;
cpi -> refresh_last_frame = 1 ;
cm -> refresh_frame_context = 1 ;
cm -> reset_frame_context = 0 ;
vp9_reset_segment_features ( & cm -> seg ) ;
vp9_set_high_precision_mv ( cpi , 0 ) ;
{
int i ;
for ( i = 0 ;
i < MAX_SEGMENTS ;
i ++ ) cpi -> segment_encode_breakout [ i ] = cpi -> oxcf . encode_breakout ;
}
cpi -> encode_breakout = cpi -> oxcf . encode_breakout ;
set_rc_buffer_sizes ( rc , & cpi -> oxcf ) ;
rc -> bits_off_target = MIN ( rc -> bits_off_target , rc -> maximum_buffer_size ) ;
rc -> buffer_level = MIN ( rc -> buffer_level , rc -> maximum_buffer_size ) ;
vp9_new_framerate ( cpi , cpi -> framerate ) ;
rc -> worst_quality = cpi -> oxcf . worst_allowed_q ;
rc -> best_quality = cpi -> oxcf . best_allowed_q ;
cm -> interp_filter = cpi -> sf . default_interp_filter ;
cm -> display_width = cpi -> oxcf . width ;
cm -> display_height = cpi -> oxcf . height ;
if ( cpi -> initial_width ) {
assert ( cm -> width <= cpi -> initial_width ) ;
assert ( cm -> height <= cpi -> initial_height ) ;
}
update_frame_size ( cpi ) ;
if ( ( cpi -> svc . number_temporal_layers > 1 && cpi -> oxcf . rc_mode == VPX_CBR ) || ( ( cpi -> svc . number_temporal_layers > 1 || cpi -> svc . number_spatial_layers > 1 ) && cpi -> oxcf . pass == 2 ) ) {
vp9_update_layer_context_change_config ( cpi , ( int ) cpi -> oxcf . target_bandwidth ) ;
}
cpi -> alt_ref_source = NULL ;
rc -> is_src_frame_alt_ref = 0 ;
# if 0 cpi -> frame_distortion = 0 ;
cpi -> last_frame_distortion = 0 ;
# endif set_tile_limits ( cpi ) ;
cpi -> ext_refresh_frame_flags_pending = 0 ;
cpi -> ext_refresh_frame_context_pending = 0 ;
# if CONFIG_VP9_TEMPORAL_DENOISING if ( cpi -> oxcf . noise_sensitivity > 0 ) {
vp9_denoiser_alloc ( & ( cpi -> denoiser ) , cm -> width , cm -> height , cm -> subsampling_x , cm -> subsampling_y , # if CONFIG_VP9_HIGHBITDEPTH cm -> use_highbitdepth , # endif VP9_ENC_BORDER_IN_PIXELS ) ;
}
# endif }
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_h245_ResponseMessage ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
# line 407 "../../asn1/h245/h245.cnf" gint32 value ;
offset = dissect_per_choice ( tvb , offset , actx , tree , hf_index , ett_h245_ResponseMessage , ResponseMessage_choice , & value ) ;
if ( h245_shorttypes == TRUE ) {
col_prepend_fstr ( actx -> pinfo -> cinfo , COL_INFO , "%s " , val_to_str ( value , h245_ResponseMessage_short_vals , "<unknown>" ) ) ;
}
else {
col_prepend_fstr ( actx -> pinfo -> cinfo , COL_INFO , "%s " , val_to_str ( value , h245_ResponseMessage_vals , "<unknown>" ) ) ;
}
col_set_fence ( actx -> pinfo -> cinfo , COL_INFO ) ;
if ( h245_pi != NULL ) {
if ( strlen ( h245_pi -> frame_label ) == 0 ) {
g_snprintf ( h245_pi -> frame_label , 50 , "%s" , val_to_str ( value , h245_ResponseMessage_short_vals , "UKN" ) ) ;
}
g_strlcat ( h245_pi -> comment , val_to_str ( value , h245_ResponseMessage_vals , "<unknown>" ) , 50 ) ;
}
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void proto_register_cipsafety ( void ) {
static hf_register_info hf [ ] = {
{
& hf_cip_reqrsp , {
"Request/Response" , "cip.rr" , FT_UINT8 , BASE_HEX , VALS ( cip_sc_rr ) , 0x80 , "Request or Response message" , HFILL }
}
, {
& hf_cip_data , {
"Data" , "cip.data" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cipsafety_data , {
"Data" , "enip.connection_transport_data" , FT_BYTES , BASE_NONE , NULL , 0 , "Connection Transport Data" , HFILL }
}
, {
& hf_cipsafety_mode_byte , {
"Mode Byte" , "cipsafety.mode_byte" , FT_UINT8 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cipsafety_mode_byte_ping_count , {
"Ping Count" , "cipsafety.mode_byte.ping_count" , FT_UINT8 , BASE_DEC , NULL , 0x03 , NULL , HFILL }
}
, {
& hf_cipsafety_mode_byte_not_tbd , {
"Not TBD Bit" , "cipsafety.mode_byte.not_tbd" , FT_BOOLEAN , 8 , NULL , 0x04 , NULL , HFILL }
}
, {
& hf_cipsafety_mode_byte_tbd_2_copy , {
"TBD 2 Bit Copy" , "cipsafety.mode_byte.tbd_2_copy" , FT_BOOLEAN , 8 , NULL , 0x08 , NULL , HFILL }
}
, {
& hf_cipsafety_mode_byte_not_run_idle , {
"Not Run/Idle" , "cipsafety.mode_byte.not_run_idle" , FT_BOOLEAN , 8 , NULL , 0x10 , NULL , HFILL }
}
, {
& hf_cipsafety_mode_byte_tbd , {
"TBD Bit" , "cipsafety.mode_byte.tbd" , FT_BOOLEAN , 8 , NULL , 0x20 , NULL , HFILL }
}
, {
& hf_cipsafety_mode_byte_tbd_2_bit , {
"TBD 2 Bit" , "cipsafety.mode_byte.tbd_2_bit" , FT_BOOLEAN , 8 , NULL , 0x40 , NULL , HFILL }
}
, {
& hf_cipsafety_mode_byte_run_idle , {
"Run/Idle" , "cipsafety.mode_byte.run_idle" , FT_BOOLEAN , 8 , NULL , 0x80 , NULL , HFILL }
}
, {
& hf_cipsafety_crc_s1 , {
"CRC S1" , "cipsafety.crc_s1" , FT_UINT8 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cipsafety_crc_s2 , {
"CRC S2" , "cipsafety.crc_s2" , FT_UINT8 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cipsafety_crc_s3 , {
"CRC S3" , "cipsafety.crc_s3" , FT_UINT16 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cipsafety_timestamp , {
"Timestamp" , "cipsafety.timestamp" , FT_UINT16 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cipsafety_ack_byte , {
"ACK Byte" , "cipsafety.ack_byte" , FT_UINT8 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cipsafety_ack_byte_ping_count_reply , {
"Ping Count Reply" , "cipsafety.ack_byte.ping_count_reply" , FT_UINT8 , BASE_HEX , NULL , 0x03 , NULL , HFILL }
}
, {
& hf_cipsafety_ack_byte_reserved1 , {
"Reserved" , "cipsafety.ack_byte.reserved1" , FT_UINT8 , BASE_HEX , NULL , 0x04 , NULL , HFILL }
}
, {
& hf_cipsafety_ack_byte_ping_response , {
"Ping Response" , "cipsafety.ack_byte.ping_response" , FT_BOOLEAN , 8 , NULL , 0x08 , NULL , HFILL }
}
, {
& hf_cipsafety_ack_byte_reserved2 , {
"Reserved" , "cipsafety.ack_byte.reserved2" , FT_UINT8 , BASE_HEX , NULL , 0x70 , NULL , HFILL }
}
, {
& hf_cipsafety_ack_byte_parity_even , {
"Parity Even" , "cipsafety.ack_byte.parity_even" , FT_BOOLEAN , 8 , NULL , 0x80 , NULL , HFILL }
}
, {
& hf_cipsafety_ack_byte2 , {
"ACK Byte 2" , "cipsafety.ack_byte2" , FT_UINT8 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cipsafety_consumer_time_value , {
"Consumer Time Value" , "cipsafety.consumer_time_value" , FT_UINT16 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cipsafety_mcast_byte , {
"MCAST Byte" , "cipsafety.mcast_byte" , FT_UINT8 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cipsafety_mcast_byte_consumer_num , {
"Consumer #" , "cipsafety.mcast_byte.consumer_num" , FT_UINT8 , BASE_HEX , NULL , 0x0F , NULL , HFILL }
}
, {
& hf_cipsafety_mcast_byte_reserved1 , {
"Reserved" , "cipsafety.mcast_byte.reserved1" , FT_UINT8 , BASE_HEX , NULL , 0x10 , NULL , HFILL }
}
, {
& hf_cipsafety_mcast_byte_mai , {
"Multicast Active/Idle" , "cipsafety.mcast_byte.active_idle" , FT_BOOLEAN , 8 , TFS ( & cip_safety_vals_active_idle ) , 0x20 , NULL , HFILL }
}
, {
& hf_cipsafety_mcast_byte_reserved2 , {
"Reserved" , "cipsafety.mcast_byte.reserved2" , FT_UINT8 , BASE_HEX , NULL , 0x40 , NULL , HFILL }
}
, {
& hf_cipsafety_mcast_byte_parity_even , {
"Parity Even" , "cipsafety.mcast_byte.parity_even" , FT_BOOLEAN , 8 , NULL , 0x80 , NULL , HFILL }
}
, {
& hf_cipsafety_mcast_byte2 , {
"MCAST Byte 2" , "cipsafety.mcast_byte2" , FT_UINT8 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cipsafety_time_correction , {
"Time Correction" , "cipsafety.time_correction" , FT_UINT16 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cipsafety_crc_s5_0 , {
"CRC S5_0" , "cipsafety.crc_s5_0" , FT_UINT8 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cipsafety_crc_s5_1 , {
"CRC S5_1" , "cipsafety.crc_s5_1" , FT_UINT8 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cipsafety_crc_s5_2 , {
"CRC S5_2" , "cipsafety.crc_s5_2" , FT_UINT8 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cipsafety_complement_data , {
"Complement Data" , "cipsafety.complement_data" , FT_BYTES , BASE_NONE , NULL , 0 , "Connection Transport Data" , HFILL }
}
, {
& hf_cip_sercosiii_link_snn , {
"Data" , "cipsafety.sercosiii_link.snn" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_sercosiii_link_communication_cycle_time , {
"Communication Cycle Time" , "cipsafety.sercosiii_link.communication_cycle_time" , FT_INT32 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_sercosiii_link_interface_status , {
"Communication Cycle Time" , "cipsafety.sercosiii_link.interface_status" , FT_UINT16 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_sercosiii_link_error_count_mstps , {
"Error Counter MST-P/S" , "cipsafety.sercosiii_link.error_count_mstps" , FT_INT16 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_sercosiii_link_error_count_p1 , {
"Error Count Port 1" , "cipsafety.sercosiii_link.error_count_p1" , FT_INT16 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_sercosiii_link_error_count_p2 , {
"Error Count Port 2" , "cipsafety.sercosiii_link.error_count_p2" , FT_INT16 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_sercosiii_link_sercos_address , {
"SERCOS Address" , "cipsafety.sercosiii_link.sercos_address" , FT_INT16 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, }
;
static hf_register_info hf_ssupervisor [ ] = {
{
& hf_cip_ssupervisor_sc , {
"Service" , "cipsafety.ssupervisor.sc" , FT_UINT8 , BASE_HEX , VALS ( cip_sc_vals_ssupervisor ) , 0x7F , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_recover_data , {
"Data" , "cipsafety.ssupervisor.recover.data" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_perform_diag_data , {
"Data" , "cipsafety.ssupervisor.perform_diag.data" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_configure_request_password , {
"Password" , "cipsafety.ssupervisor.configure_request.password" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_configure_request_tunid , {
"Target UNID" , "cipsafety.ssupervisor.configure_request.tunid" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_configure_request_tunid_ssn_timestamp , {
"TUNID SSN Timestamp" , "cipsafety.ssupervisor.configure_request.tunid.ssn.timestamp" , FT_ABSOLUTE_TIME , ABSOLUTE_TIME_UTC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_configure_request_tunid_ssn_date , {
"TUNID SSN (Manual) Date" , "cipsafety.ssupervisor.configure_request.tunid.ssn.date" , FT_UINT16 , BASE_HEX , VALS ( cipsafety_ssn_date_vals ) , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_configure_request_tunid_ssn_time , {
"TUNID SSN (Manual) Time" , "cipsafety.ssupervisor.configure_request.tunid.ssn.time" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_configure_request_tunid_macid , {
"MAC ID" , "cipsafety.ssupervisor.configure_request.tunid.macid" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_configure_request_ounid , {
"Originator UNID" , "cipsafety.ssupervisor.configure_request.ounid" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_configure_request_ounid_ssn_timestamp , {
"OUNID SSN Timestamp" , "cipsafety.ssupervisor.configure_request.ounid.ssn.timestamp" , FT_ABSOLUTE_TIME , ABSOLUTE_TIME_UTC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_configure_request_ounid_ssn_date , {
"OUNID SSN (Manual) Date" , "cipsafety.ssupervisor.configure_request.ounid.ssn.date" , FT_UINT16 , BASE_HEX , VALS ( cipsafety_ssn_date_vals ) , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_configure_request_ounid_ssn_time , {
"OUNID SSN (Manual) Time" , "cipsafety.ssupervisor.configure_request.ounid.ssn.time" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_configure_request_ounid_macid , {
"MAC ID" , "cipsafety.ssupervisor.configure_request.ounid.macid" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_validate_configuration_sccrc , {
"SCCRC" , "cipsafety.ssupervisor.validate_configuration.sccrc" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_validate_configuration_scts_timestamp , {
"SCTS (Timestamp)" , "cipsafety.ssupervisor.validate_configuration.scts.timestamp" , FT_ABSOLUTE_TIME , ABSOLUTE_TIME_UTC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_validate_configuration_scts_date , {
"SCTS (Manual) Date" , "cipsafety.ssupervisor.validate_configuration.scts.date" , FT_UINT16 , BASE_HEX , VALS ( cipsafety_ssn_date_vals ) , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_validate_configuration_scts_time , {
"SCTS (Manual) Time" , "cipsafety.ssupervisor.validate_configuration.scts.time" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_validate_configuration_ext_error , {
"Extended Error" , "cipsafety.ssupervisor.validate_configuration.ext_error" , FT_UINT16 , BASE_DEC , VALS ( cip_ssupervisor_validate_configuration_ext_error_vals ) , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_set_password_current_password , {
"Current Password" , "cipsafety.ssupervisor.set_password.current_pass" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_set_password_new_password , {
"New Password" , "cipsafety.ssupervisor.set_password.new_pass" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_configure_lock_value , {
"Lock Value" , "cipsafety.ssupervisor.configure_lock.lock" , FT_UINT8 , BASE_DEC , VALS ( cip_ssupervisor_lock_vals ) , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_configure_lock_password , {
"Password" , "cipsafety.ssupervisor.configure_lock.password" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_configure_lock_tunid , {
"Target UNID" , "cipsafety.ssupervisor.configure_lock.tunid" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_configure_lock_tunid_ssn_timestamp , {
"TUNID SSN Timestamp" , "cipsafety.ssupervisor.configure_lock.tunid.ssn.timestamp" , FT_ABSOLUTE_TIME , ABSOLUTE_TIME_UTC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_configure_lock_tunid_ssn_date , {
"TUNID SSN (Manual) Date" , "cipsafety.ssupervisor.configure_lock.tunid.ssn.date" , FT_UINT16 , BASE_HEX , VALS ( cipsafety_ssn_date_vals ) , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_configure_lock_tunid_ssn_time , {
"TUNID SSN (Manual) Time" , "cipsafety.ssupervisor.configure_lock.tunid.ssn.time" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_configure_lock_tunid_macid , {
"MAC ID" , "cipsafety.ssupervisor.configure_lock.tunid.macid" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_mode_change_value , {
"Value" , "cipsafety.ssupervisor.mode_change.value" , FT_UINT8 , BASE_DEC , VALS ( cip_ssupervisor_change_mode_vals ) , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_mode_change_password , {
"Password" , "cipsafety.ssupervisor.mode_change.password" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_reset_type , {
"Reset Type" , "cipsafety.ssupervisor.reset.type" , FT_UINT8 , BASE_DEC , VALS ( cip_reset_type_vals ) , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_reset_password , {
"Password" , "cipsafety.ssupervisor.reset.password" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_reset_tunid , {
"Target UNID" , "cipsafety.ssupervisor.reset.tunid" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_reset_tunid_tunid_ssn_timestamp , {
"TUNID SSN Timestamp" , "cipsafety.ssupervisor.reset.tunid.ssn.timestamp" , FT_ABSOLUTE_TIME , ABSOLUTE_TIME_UTC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_reset_tunid_tunid_ssn_date , {
"TUNID SSN (Manual) Date" , "cipsafety.ssupervisor.reset.tunid.ssn.date" , FT_UINT16 , BASE_HEX , VALS ( cipsafety_ssn_date_vals ) , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_reset_tunid_tunid_ssn_time , {
"TUNID SSN (Manual) Time" , "cipsafety.ssupervisor.reset.tunid.ssn.time" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_reset_tunid_macid , {
"MAC ID" , "cipsafety.ssupervisor.reset.tunid.macid" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_reset_attr_bitmap , {
"Attribute Bit Map" , "cipsafety.ssupervisor.reset.attr_bitmap" , FT_UINT8 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_reset_attr_bitmap_macid , {
"Preserve MacID" , "cipsafety.ssupervisor.reset.attr_bitmap.macid" , FT_BOOLEAN , 8 , TFS ( & tfs_true_false ) , 0x01 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_reset_attr_bitmap_baudrate , {
"Preserve Baud Rate" , "cipsafety.ssupervisor.reset.attr_bitmap.baudrate" , FT_BOOLEAN , 8 , TFS ( & tfs_true_false ) , 0x02 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_reset_attr_bitmap_tunid , {
"Preserve TUNID" , "cipsafety.ssupervisor.reset.attr_bitmap.tunid" , FT_BOOLEAN , 8 , TFS ( & tfs_true_false ) , 0x04 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_reset_attr_bitmap_password , {
"Preserve Password" , "cipsafety.ssupervisor.reset.attr_bitmap.password" , FT_BOOLEAN , 8 , TFS ( & tfs_true_false ) , 0x08 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_reset_attr_bitmap_cfunid , {
"Preserve CFUNID" , "cipsafety.ssupervisor.reset.attr_bitmap.cfunid" , FT_BOOLEAN , 8 , TFS ( & tfs_true_false ) , 0x10 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_reset_attr_bitmap_ocpunid , {
"Preserve OPCUNID" , "cipsafety.ssupervisor.reset.attr_bitmap.ocpunid" , FT_BOOLEAN , 8 , TFS ( & tfs_true_false ) , 0x20 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_reset_attr_bitmap_reserved , {
"Reserved" , "cipsafety.ssupervisor.reset.attr_bitmap.reserved" , FT_BOOLEAN , 8 , TFS ( & tfs_true_false ) , 0x40 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_reset_attr_bitmap_extended , {
"Use Extended Map" , "cipsafety.ssupervisor.reset.attr_bitmap.extended" , FT_BOOLEAN , 8 , TFS ( & tfs_true_false ) , 0x80 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_reset_password_data_size , {
"Data Size" , "cipsafety.ssupervisor.reset_password.data_size" , FT_UINT8 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_reset_password_data , {
"Password Data" , "cipsafety.ssupervisor.reset_password.password_data" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_propose_tunid_tunid , {
"Target UNID" , "cipsafety.ssupervisor.propose_tunid.tunid" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_propose_tunid_tunid_ssn_timestamp , {
"TUNID SSN Timestamp" , "cipsafety.ssupervisor.propose_tunid.tunid.ssn.timestamp" , FT_ABSOLUTE_TIME , ABSOLUTE_TIME_UTC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_propose_tunid_tunid_ssn_date , {
"TUNID SSN (Manual) Date" , "cipsafety.ssupervisor.propose_tunid.tunid.ssn.date" , FT_UINT16 , BASE_HEX , VALS ( cipsafety_ssn_date_vals ) , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_propose_tunid_tunid_ssn_time , {
"TUNID SSN (Manual) Time" , "cipsafety.ssupervisor.propose_tunid.tunid.ssn.time" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_propose_tunid_tunid_macid , {
"MAC ID" , "cipsafety.ssupervisor.propose_tunid.tunid.macid" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_apply_tunid_tunid , {
"Target UNID" , "cipsafety.ssupervisor.apply_tunid.tunid" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_apply_tunid_tunid_ssn_timestamp , {
"TUNID SSN Timestamp" , "cipsafety.ssupervisor.apply_tunid.tunid.ssn.timestamp" , FT_ABSOLUTE_TIME , ABSOLUTE_TIME_UTC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_apply_tunid_tunid_ssn_date , {
"TUNID SSN (Manual) Date" , "cipsafety.ssupervisor.apply_tunid.tunid.ssn.date" , FT_UINT16 , BASE_HEX , VALS ( cipsafety_ssn_date_vals ) , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_apply_tunid_tunid_ssn_time , {
"TUNID SSN (Manual) Time" , "cipsafety.ssupervisor.apply_tunid.tunid.ssn.time" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_apply_tunid_tunid_macid , {
"MAC ID" , "cipsafety.ssupervisor.apply_tunid.tunid.macid" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_class_subclass , {
"Subclass" , "cipsafety.ssupervisor.class_subclass" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_num_attr , {
"Number of Attributes" , "cipsafety.ssupervisor.num_attr" , FT_UINT8 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_attr_list , {
"Attributes List Item" , "cipsafety.ssupervisor.attr_item" , FT_UINT8 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_manufacture_name , {
"Manufacturer Name" , "cipsafety.ssupervisor.manufacture_name" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_manufacture_model_number , {
"Manufacturer Model Number" , "cipsafety.ssupervisor.manufacture_model_number" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_sw_rev_level , {
"Software Revision Level" , "cipsafety.ssupervisor.sw_rev_level" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_hw_rev_level , {
"Hardware Revision Level" , "cipsafety.ssupervisor.hw_rev_level" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_manufacture_serial_number , {
"Manufacturer Serial Number" , "cipsafety.ssupervisor.manufacture_serial_number" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_device_config , {
"Device Configuration" , "cipsafety.ssupervisor.device_config" , FT_STRING , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_device_status , {
"Device Status" , "cipsafety.ssupervisor.device_status" , FT_UINT8 , BASE_DEC , VALS ( cip_ssupervisor_device_status_type_vals ) , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_exception_status , {
"Exception Status" , "cipsafety.ssupervisor.exception_status" , FT_UINT8 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_exception_detail_alarm_ced_size , {
"Common Exeception Detail Size" , "cipsafety.ssupervisor.exception_detail_alarm.ced.size" , FT_UINT8 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_exception_detail_alarm_ced_detail , {
"Common Exeception Detail Data" , "cipsafety.ssupervisor.exception_detail_alarm.ced.detail" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_exception_detail_alarm_ded_size , {
"Device Exeception Detail Size" , "cipsafety.ssupervisor.exception_detail_alarm.ded.size" , FT_UINT8 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_exception_detail_alarm_ded_detail , {
"Device Exeception Detail Data" , "cipsafety.ssupervisor.exception_detail_alarm.ded.detail" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_exception_detail_alarm_med_size , {
"Manufacturer Exeception Detail Size" , "cipsafety.ssupervisor.exception_detail_alarm.med.size" , FT_UINT8 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_exception_detail_alarm_med_detail , {
"Manufacturer Exeception Detail Data" , "cipsafety.ssupervisor.exception_detail_alarm.med.detail" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_exception_detail_warning_ced_size , {
"Common Exeception Detail Size" , "cipsafety.ssupervisor.exception_detail_warning.ced.size" , FT_UINT8 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_exception_detail_warning_ced_detail , {
"Common Exeception Detail Data" , "cipsafety.ssupervisor.exception_detail_warning.ced.detail" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_exception_detail_warning_ded_size , {
"Device Exeception Detail Size" , "cipsafety.ssupervisor.exception_detail_warning.ded.size" , FT_UINT8 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_exception_detail_warning_ded_detail , {
"Device Exeception Detail Data" , "cipsafety.ssupervisor.exception_detail_warning.ded.detail" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_exception_detail_warning_med_size , {
"Manufacturer Exeception Detail Size" , "cipsafety.ssupervisor.exception_detail_warning.med.size" , FT_UINT8 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_exception_detail_warning_med_detail , {
"Manufacturer Exeception Detail Data" , "cipsafety.ssupervisor.exception_detail_warning.med.detail" , FT_BYTES , BASE_NONE , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_alarm_enable , {
"Exception Detail Alarm" , "cipsafety.ssupervisor.alarm_enable" , FT_BOOLEAN , BASE_NONE , TFS ( & tfs_true_false ) , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_warning_enable , {
"Exception Detail Warning" , "cipsafety.ssupervisor.warning_enable" , FT_BOOLEAN , BASE_NONE , TFS ( & tfs_true_false ) , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_time , {
"Time" , "cipsafety.ssupervisor.time" , FT_ABSOLUTE_TIME , ABSOLUTE_TIME_UTC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_clock_power_cycle_behavior , {
"Clock Power Cycle Behavior" , "cipsafety.ssupervisor.clock_power_cycle_behavior" , FT_UINT8 , BASE_DEC , VALS ( cip_ssupervisor_clock_power_cycle_type_vals ) , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_last_maintenance_date , {
"Last Maintenance Date" , "cipsafety.ssupervisor.last_maintenance_date" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_next_scheduled_maintenance_date , {
"Next Scheduled Maintenance Date" , "cipsafety.ssupervisor.next_scheduled_maintenance_date" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_scheduled_maintenance_expiration_timer , {
"Scheduled Maintenance Expiration Timer" , "cipsafety.ssupervisor.scheduled_maintenance_expiration_timer" , FT_INT16 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_scheduled_maintenance_expiration_warning_enable , {
"Scheduled Maintenance Expiration Warning Enable" , "cipsafety.ssupervisor.scheduled_maintenance_expiration_warning" , FT_BOOLEAN , BASE_NONE , TFS ( & tfs_enabled_disabled ) , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_run_hours , {
"Run Hours" , "cipsafety.ssupervisor.run_hours" , FT_UINT32 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_configuration_lock , {
"Configuration Lock" , "cipsafety.ssupervisor.configuration_lock" , FT_UINT8 , BASE_DEC , VALS ( cip_ssupervisor_lock_vals ) , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_configuration_unid_ssn_timestamp , {
"Configuration UNID SSN Timestamp" , "cipsafety.ssupervisor.configuration_unid.ssn.timestamp" , FT_ABSOLUTE_TIME , ABSOLUTE_TIME_UTC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_configuration_unid_ssn_date , {
"Configuration UNID SSN (Manual) Date" , "cipsafety.ssupervisor.configuration_unid.ssn.date" , FT_UINT16 , BASE_HEX , VALS ( cipsafety_ssn_date_vals ) , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_configuration_unid_ssn_time , {
"Configuration UNID SSN (Manual) Time" , "cipsafety.ssupervisor.configuration_unid.ssn.time" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_configuration_unid_macid , {
"Configuration UNID MAC ID" , "cipsafety.ssupervisor.configuration_unid.macid" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_safety_configuration_id_ssn_timestamp , {
"Safety Configuration ID SSN Timestamp" , "cipsafety.ssupervisor.safety_configuration_id.ssn.timestamp" , FT_ABSOLUTE_TIME , ABSOLUTE_TIME_UTC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_safety_configuration_id_ssn_date , {
"Safety Configuration ID SSN (Manual) Date" , "cipsafety.ssupervisor.safety_configuration_id.ssn.date" , FT_UINT16 , BASE_HEX , VALS ( cipsafety_ssn_date_vals ) , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_safety_configuration_id_ssn_time , {
"Safety Configuration ID SSN (Manual) Time" , "cipsafety.ssupervisor.safety_configuration_id.ssn.time" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_safety_configuration_id_macid , {
"Safety Configuration ID MAC ID" , "cipsafety.ssupervisor.safety_configuration_id.macid" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_target_unid_ssn_timestamp , {
"Target UNID SSN Timestamp" , "cipsafety.ssupervisor.target_unid.ssn.timestamp" , FT_ABSOLUTE_TIME , ABSOLUTE_TIME_UTC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_target_unid_ssn_date , {
"Target UNID SSN (Manual) Date" , "cipsafety.ssupervisor.target_unid.ssn.date" , FT_UINT16 , BASE_HEX , VALS ( cipsafety_ssn_date_vals ) , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_target_unid_ssn_time , {
"Target UNID SSN (Manual) Time" , "cipsafety.ssupervisor.target_unid.ssn.time" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_target_unid_macid , {
"Target UNID MAC ID" , "cipsafety.ssupervisor.target_unid.macid" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_cp_owners_num_entries , {
"Number of Array Entries" , "cipsafety.ssupervisor.cp_owners.num_entries" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_output_cp_owners_ocpunid_ssn_timestamp , {
"OCPUNID SSN Timestamp" , "cipsafety.ssupervisor.cp_owners.ssn.timestamp" , FT_ABSOLUTE_TIME , ABSOLUTE_TIME_UTC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_output_cp_owners_ocpunid_ssn_date , {
"OCPUNID SSN (Manual) Date" , "cipsafety.ssupervisor.cp_owners.ssn.date" , FT_UINT16 , BASE_HEX , VALS ( cipsafety_ssn_date_vals ) , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_output_cp_owners_ocpunid_ssn_time , {
"OCPUNID SSN (Manual) Time" , "cipsafety.ssupervisor.cp_owners.ssn.time" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_output_cp_owners_ocpunid_macid , {
"OCPUNID MAC ID" , "cipsafety.ssupervisor.cp_owners.ocpunid.macid" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_cp_owners_app_path_size , {
"EPATH Size" , "cipsafety.ssupervisor.cp_owners.epath_size" , FT_UINT8 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_proposed_tunid_ssn_timestamp , {
"Proposed TUNID SSN Timestamp" , "cipsafety.ssupervisor.proposed_tunid.ssn.timestamp" , FT_ABSOLUTE_TIME , ABSOLUTE_TIME_UTC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_proposed_tunid_ssn_date , {
"Proposed TUNID SSN (Manual) Date" , "cipsafety.ssupervisor.proposed_tunid.ssn.date" , FT_UINT16 , BASE_HEX , VALS ( cipsafety_ssn_date_vals ) , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_proposed_tunid_ssn_time , {
"Proposed TUNID SSN (Manual) Time" , "cipsafety.ssupervisor.proposed_tunid.ssn.time" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_proposed_tunid_macid , {
"Proposed TUNID MAC ID" , "cipsafety.ssupervisor.proposed_tunid.macid" , FT_UINT32 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_ssupervisor_instance_subclass , {
"Subclass" , "cipsafety.ssupervisor.instance_subclass" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
}
;
static hf_register_info hf_svalidator [ ] = {
{
& hf_cip_svalidator_sc , {
"Service" , "cipsafety.svalidator.sc" , FT_UINT8 , BASE_HEX , VALS ( cip_sc_vals_svalidator ) , 0x7F , NULL , HFILL }
}
, {
& hf_cip_svalidator_sconn_fault_count , {
"Safety Connection Fault Count" , "cipsafety.svalidator.sconn_fault_count" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_svalidator_state , {
"Safety Validator State" , "cipsafety.svalidator.state" , FT_UINT8 , BASE_DEC , VALS ( cip_svalidator_state_vals ) , 0 , NULL , HFILL }
}
, {
& hf_cip_svalidator_type , {
"Safety Validator Type" , "cipsafety.svalidator.type" , FT_UINT8 , BASE_HEX , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_svalidator_type_pc , {
"Producer/Consumer" , "cipsafety.svalidator.type.pc" , FT_UINT8 , BASE_HEX , VALS ( cip_svalidator_type_pc_vals ) , 0x80 , NULL , HFILL }
}
, {
& hf_cip_svalidator_type_conn_type , {
"Safety Connection Type" , "cipsafety.svalidator.type.conn_type" , FT_UINT8 , BASE_DEC , VALS ( cip_svalidator_type_conn_type_vals ) , 0x7F , NULL , HFILL }
}
, {
& hf_cip_svalidator_ping_eri , {
"Ping Interval EPI Multipler" , "cipsafety.svalidator.ping_eri" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_svalidator_time_coord_msg_min_mult_size , {
"Time Coord Msg Min Multiplier Size" , "cipsafety.svalidator.time_coord_msg_min_mult.size" , FT_UINT8 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_svalidator_time_coord_msg_min_mult_item , {
"Time Coord Msg Min Multiplier Item" , "cipsafety.svalidator.time_coord_msg_min_mult.item" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_svalidator_network_time_multiplier_size , {
"Network Time Expectation Multipler Size" , "cipsafety.svalidator.network_time_multiplier.size" , FT_UINT8 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_svalidator_network_time_multiplier_item , {
"Network Time Expectation Multipler Item" , "cipsafety.svalidator.network_time_multiplier.item" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_svalidator_timeout_multiplier_size , {
"Timeout Multiplier Size" , "cipsafety.svalidator.timeout_multiplier.size" , FT_UINT8 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_svalidator_timeout_multiplier_item , {
"Timeout Multiplier Item" , "cipsafety.svalidator.timeout_multiplier.item" , FT_UINT8 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_svalidator_max_consumer_num , {
"Max Consumer Number" , "cipsafety.svalidator.max_consumer_num" , FT_UINT8 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_svalidator_data_conn_inst , {
"Data Connection Instance" , "cipsafety.svalidator.data_conn_inst" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_svalidator_coordination_conn_inst_size , {
"Coordination Connection Instance Size" , "cipsafety.svalidator.coordination_conn_inst.size" , FT_UINT8 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_svalidator_coordination_conn_inst_item , {
"Coordination Connection Instance Item" , "cipsafety.svalidator.coordination_conn_inst.item" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_svalidator_correction_conn_inst , {
"Correction Connection Instance" , "cipsafety.svalidator.correction_conn_inst" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_svalidator_cco_binding , {
"CCO Binding" , "cipsafety.svalidator.cco_binding" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_svalidator_max_data_age , {
"Max Data Age" , "cipsafety.svalidator.max_data_age" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_svalidator_error_code , {
"Error Code" , "cipsafety.svalidator.error_code" , FT_UINT16 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_svalidator_prod_cons_fault_count_size , {
"Producer/Consumer Counter Size" , "cipsafety.svalidator.prod_cons_fault_count.size" , FT_UINT8 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
, {
& hf_cip_svalidator_prod_cons_fault_count_item , {
"Producer/Consumer Counter Item" , "cipsafety.svalidator.prod_cons_fault_count.item" , FT_UINT8 , BASE_DEC , NULL , 0 , NULL , HFILL }
}
}
;
static gint * ett [ ] = {
& ett_cip_safety , & ett_path , & ett_cipsafety_mode_byte , & ett_cipsafety_ack_byte , & ett_cipsafety_mcast_byte }
;
static gint * ett_ssupervisor [ ] = {
& ett_cip_class_s_supervisor , & ett_ssupervisor_rrsc , & ett_ssupervisor_cmd_data , & ett_ssupervisor_propose_tunid , & ett_ssupervisor_propose_tunid_ssn , & ett_ssupervisor_configure_request_tunid , & ett_ssupervisor_configure_request_tunid_ssn , & ett_ssupervisor_configure_request_ounid , & ett_ssupervisor_configure_request_ounid_ssn , & ett_ssupervisor_configure_lock_tunid , & ett_ssupervisor_configure_lock_tunid_ssn , & ett_ssupervisor_reset_tunid , & ett_ssupervisor_reset_tunid_ssn , & ett_ssupervisor_apply_tunid , & ett_ssupervisor_apply_tunid_ssn , & ett_exception_detail_alarm_common , & ett_exception_detail_alarm_device , & ett_exception_detail_alarm_manufacturer , & ett_exception_detail_warning_common , & ett_exception_detail_warning_device , & ett_exception_detail_warning_manufacturer , & ett_ssupervisor_configuration_unid , & ett_ssupervisor_configuration_unid_ssn , & ett_ssupervisor_safety_configuration_id , & ett_ssupervisor_safety_configuration_id_ssn , & ett_ssupervisor_target_unid , & ett_ssupervisor_target_unid_ssn , & ett_ssupervisor_output_cp_owners , & ett_ssupervisor_output_cp_owners_ocpunid , & ett_ssupervisor_output_cp_owners_ocpunid_ssn , & ett_ssupervisor_proposed_tunid , & ett_ssupervisor_proposed_tunid_ssn , & ett_cip_ssupervisor_reset_attr_bitmap }
;
static gint * ett_svalidator [ ] = {
& ett_cip_class_s_validator , & ett_svalidator_rrsc , & ett_svalidator_cmd_data , & ett_svalidator_type }
;
static ei_register_info ei [ ] = {
{
& ei_cipsafety_tbd2_not_complemented , {
"cipsafety.tbd2_not_complemented" , PI_PROTOCOL , PI_WARN , "TBD_2_bit not complemented" , EXPFILL }
}
, {
& ei_cipsafety_tbd_not_copied , {
"cipsafety.tbd_not_copied" , PI_PROTOCOL , PI_WARN , "TBD bit not copied" , EXPFILL }
}
, {
& ei_cipsafety_run_idle_not_complemented , {
"cipsafety.run_idle_not_complemented" , PI_PROTOCOL , PI_WARN , "Run/Idle bit not complemented" , EXPFILL }
}
, {
& ei_mal_io , {
"cipsafety.malformed.io" , PI_MALFORMED , PI_ERROR , "Malformed CIP Safety I/O packet" , EXPFILL }
}
, {
& ei_mal_sercosiii_link_error_count_p1p2 , {
"cipsafety.malformed.sercosiii_link.error_count_p1p2" , PI_MALFORMED , PI_ERROR , "Malformed SERCOS III Attribute 5" , EXPFILL }
}
, }
;
static ei_register_info ei_ssupervisor [ ] = {
{
& ei_mal_ssupervisor_exception_detail_alarm_ced , {
"cipsafety.ssupervisor.malformed.exception_detail_alarm.ced" , PI_MALFORMED , PI_ERROR , "Malformed Safety Supervisor Exception Detail Alarm (Common Exception Detail)" , EXPFILL }
}
, {
& ei_mal_ssupervisor_exception_detail_alarm_ded , {
"cipsafety.ssupervisor.malformed.exception_detail_alarm.ded" , PI_MALFORMED , PI_ERROR , "Malformed Safety Supervisor Exception Detail Alarm (Device Exception Detail)" , EXPFILL }
}
, {
& ei_mal_ssupervisor_exception_detail_alarm_med , {
"cipsafety.ssupervisor.malformed.exception_detail_alarm.med" , PI_MALFORMED , PI_ERROR , "Malformed Safety Supervisor Exception Detail Alarm (Manufacturer Exception Detail)" , EXPFILL }
}
, {
& ei_mal_ssupervisor_detail_warning_ced , {
"cipsafety.ssupervisor.malformed.detail_warning.ced" , PI_MALFORMED , PI_ERROR , "Malformed Safety Supervisor Exception Detail Warning (Common Exception Detail)" , EXPFILL }
}
, {
& ei_mal_ssupervisor_detail_warning_ded , {
"cipsafety.ssupervisor.malformed.detail_warning.ded" , PI_MALFORMED , PI_ERROR , "Malformed Safety Supervisor Exception Detail Warning (Device Exception Detail)" , EXPFILL }
}
, {
& ei_mal_ssupervisor_detail_warning_med , {
"cipsafety.ssupervisor.malformed.detail_warning.med" , PI_MALFORMED , PI_ERROR , "Malformed Safety Supervisor Exception Detail Warning (Manufacturer Exception Detail)" , EXPFILL }
}
, {
& ei_mal_ssupervisor_configuration_unid , {
"cipsafety.ssupervisor.malformed.configuration_unid" , PI_MALFORMED , PI_ERROR , "Malformed Safety Supervisor Configuration UNID" , EXPFILL }
}
, {
& ei_mal_ssupervisor_safety_configuration_id , {
"cipsafety.ssupervisor.malformed.safety_configuration_id" , PI_MALFORMED , PI_ERROR , "Malformed Safety Supervisor Safety Configuration Identifier" , EXPFILL }
}
, {
& ei_mal_ssupervisor_target_unid , {
"cipsafety.ssupervisor.malformed.target_unid" , PI_MALFORMED , PI_ERROR , "Malformed Safety Supervisor Target UNID" , EXPFILL }
}
, {
& ei_mal_ssupervisor_cp_owners , {
"cipsafety.ssupervisor.malformed.cp_owners" , PI_MALFORMED , PI_ERROR , "Malformed Safety Supervisor Output Connection Point Owners" , EXPFILL }
}
, {
& ei_mal_ssupervisor_cp_owners_entry , {
"cipsafety.ssupervisor.malformed.cp_owners.entry" , PI_MALFORMED , PI_ERROR , "Malformed Safety Supervisor Output Connection Point Owners (UNID)" , EXPFILL }
}
, {
& ei_mal_ssupervisor_cp_owners_app_path_size , {
"cipsafety.ssupervisor.malformed.cp_owners.app_path_size" , PI_MALFORMED , PI_ERROR , "Malformed Safety Supervisor Output Connection Point Owners (EPATH)" , EXPFILL }
}
, {
& ei_mal_ssupervisor_proposed_tunid , {
"cipsafety.ssupervisor.malformed.proposed_tunid" , PI_MALFORMED , PI_ERROR , "Malformed Safety Supervisor Proposed TUNID" , EXPFILL }
}
, }
;
static ei_register_info ei_svalidator [ ] = {
{
& ei_mal_svalidator_type , {
"cipsafety.ssupervisor.malformed.svalidator.type" , PI_MALFORMED , PI_ERROR , "Malformed Safety Validator Type" , EXPFILL }
}
, {
& ei_mal_svalidator_time_coord_msg_min_mult , {
"cipsafety.ssupervisor.malformed.svalidator.time_coord_msg_min_mult" , PI_MALFORMED , PI_ERROR , "Malformed Safety Validator Time Coord Msg Min Multiplier" , EXPFILL }
}
, {
& ei_mal_svalidator_network_time_multiplier , {
"cipsafety.ssupervisor.malformed.svalidator.network_time_multiplier" , PI_MALFORMED , PI_ERROR , "Malformed Safety Validator Network Time Expectation Multiplier" , EXPFILL }
}
, {
& ei_mal_svalidator_timeout_multiplier , {
"cipsafety.ssupervisor.malformed.svalidator.timeout_multiplier" , PI_MALFORMED , PI_ERROR , "Malformed Safety Validator Timeout Multiplier" , EXPFILL }
}
, {
& ei_mal_svalidator_coordination_conn_inst , {
"cipsafety.ssupervisor.malformed.svalidator.coordination_conn_inst" , PI_MALFORMED , PI_ERROR , "Malformed Safety Validator Coordination Connection Instance" , EXPFILL }
}
, {
& ei_mal_svalidator_prod_cons_fault_count , {
"cipsafety.ssupervisor.malformed.svalidator.prod_cons_fault_count" , PI_MALFORMED , PI_ERROR , "Malformed Safety Validator Produce/Consume Fault Counters" , EXPFILL }
}
, }
;
expert_module_t * expert_cip_safety ;
expert_module_t * expert_cip_class_s_supervisor ;
expert_module_t * expert_cip_class_s_validator ;
proto_cipsafety = proto_register_protocol ( "Common Industrial Protocol, Safety" , "CIP Safety" , "cipsafety" ) ;
proto_register_field_array ( proto_cipsafety , hf , array_length ( hf ) ) ;
proto_register_subtree_array ( ett , array_length ( ett ) ) ;
expert_cip_safety = expert_register_protocol ( proto_cipsafety ) ;
expert_register_field_array ( expert_cip_safety , ei , array_length ( ei ) ) ;
cipsafety_handle = register_dissector ( "cipsafety" , dissect_cipsafety , proto_cipsafety ) ;
proto_cip_class_s_supervisor = proto_register_protocol ( "CIP Safety Supervisor" , "CIPSSupervisor" , "cipssupervisor" ) ;
proto_register_field_array ( proto_cip_class_s_supervisor , hf_ssupervisor , array_length ( hf_ssupervisor ) ) ;
proto_register_subtree_array ( ett_ssupervisor , array_length ( ett_ssupervisor ) ) ;
expert_cip_class_s_supervisor = expert_register_protocol ( proto_cip_class_s_supervisor ) ;
expert_register_field_array ( expert_cip_class_s_supervisor , ei_ssupervisor , array_length ( ei_ssupervisor ) ) ;
proto_cip_class_s_validator = proto_register_protocol ( "CIP Safety Validator" , "CIPSValidator" , "cipsvalidator" ) ;
proto_register_field_array ( proto_cip_class_s_validator , hf_svalidator , array_length ( hf_svalidator ) ) ;
proto_register_subtree_array ( ett_svalidator , array_length ( ett_svalidator ) ) ;
expert_cip_class_s_validator = expert_register_protocol ( proto_cip_class_s_validator ) ;
expert_register_field_array ( expert_cip_class_s_validator , ei_svalidator , array_length ( ei_svalidator ) ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int linux_udev_scan_devices ( struct libusb_context * ctx ) {
struct udev_enumerate * enumerator ;
struct udev_list_entry * devices , * entry ;
struct udev_device * udev_dev ;
const char * sys_name ;
int r ;
assert ( udev_ctx != NULL ) ;
enumerator = udev_enumerate_new ( udev_ctx ) ;
if ( NULL == enumerator ) {
usbi_err ( ctx , "error creating udev enumerator" ) ;
return LIBUSB_ERROR_OTHER ;
}
udev_enumerate_add_match_subsystem ( enumerator , "usb" ) ;
udev_enumerate_scan_devices ( enumerator ) ;
devices = udev_enumerate_get_list_entry ( enumerator ) ;
udev_list_entry_foreach ( entry , devices ) {
const char * path = udev_list_entry_get_name ( entry ) ;
uint8_t busnum = 0 , devaddr = 0 ;
udev_dev = udev_device_new_from_syspath ( udev_ctx , path ) ;
r = udev_device_info ( ctx , 0 , udev_dev , & busnum , & devaddr , & sys_name ) ;
if ( r ) {
udev_device_unref ( udev_dev ) ;
continue ;
}
linux_enumerate_device ( ctx , busnum , devaddr , sys_name ) ;
udev_device_unref ( udev_dev ) ;
}
udev_enumerate_unref ( enumerator ) ;
return LIBUSB_SUCCESS ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void rac_init ( RangeCoder * c , const uint8_t * src , int size ) {
int i ;
c -> src = src ;
c -> src_end = src + size ;
c -> low = 0 ;
for ( i = 0 ;
i < FFMIN ( size , 4 ) ;
i ++ ) c -> low = ( c -> low << 8 ) | * c -> src ++ ;
c -> range = 0xFFFFFFFF ;
c -> got_error = 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int decode_frame ( AVCodecContext * avctx , void * data , int * got_frame , AVPacket * avpkt ) {
uint8_t ctable [ 128 ] ;
QpegContext * const a = avctx -> priv_data ;
AVFrame * const p = & a -> pic ;
uint8_t * outdata ;
int delta , ret ;
const uint8_t * pal = av_packet_get_side_data ( avpkt , AV_PKT_DATA_PALETTE , NULL ) ;
if ( avpkt -> size < 0x86 ) {
av_log ( avctx , AV_LOG_ERROR , "Packet is too small\n" ) ;
return AVERROR_INVALIDDATA ;
}
bytestream2_init ( & a -> buffer , avpkt -> data , avpkt -> size ) ;
if ( ( ret = ff_reget_buffer ( avctx , p ) ) < 0 ) {
av_log ( avctx , AV_LOG_ERROR , "reget_buffer() failed\n" ) ;
return ret ;
}
outdata = a -> pic . data [ 0 ] ;
bytestream2_skip ( & a -> buffer , 4 ) ;
bytestream2_get_buffer ( & a -> buffer , ctable , 128 ) ;
bytestream2_skip ( & a -> buffer , 1 ) ;
delta = bytestream2_get_byte ( & a -> buffer ) ;
if ( delta == 0x10 ) {
qpeg_decode_intra ( a , outdata , a -> pic . linesize [ 0 ] , avctx -> width , avctx -> height ) ;
}
else {
qpeg_decode_inter ( a , outdata , a -> pic . linesize [ 0 ] , avctx -> width , avctx -> height , delta , ctable , a -> refdata ) ;
}
if ( pal ) {
a -> pic . palette_has_changed = 1 ;
memcpy ( a -> pal , pal , AVPALETTE_SIZE ) ;
}
memcpy ( a -> pic . data [ 1 ] , a -> pal , AVPALETTE_SIZE ) ;
if ( ( ret = av_frame_ref ( data , & a -> pic ) ) < 0 ) return ret ;
* got_frame = 1 ;
return avpkt -> size ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int rawv6_push_pending_frames ( struct sock * sk , struct flowi * fl , struct raw6_sock * rp ) {
struct sk_buff * skb ;
int err = 0 ;
int offset ;
int len ;
int total_len ;
__wsum tmp_csum ;
__sum16 csum ;
if ( ! rp -> checksum ) goto send ;
if ( ( skb = skb_peek ( & sk -> sk_write_queue ) ) == NULL ) goto out ;
offset = rp -> offset ;
total_len = inet_sk ( sk ) -> cork . length - ( skb_network_header ( skb ) - skb -> data ) ;
if ( offset >= total_len - 1 ) {
err = - EINVAL ;
ip6_flush_pending_frames ( sk ) ;
goto out ;
}
if ( skb_queue_len ( & sk -> sk_write_queue ) == 1 ) {
tmp_csum = skb -> csum ;
}
else {
struct sk_buff * csum_skb = NULL ;
tmp_csum = 0 ;
skb_queue_walk ( & sk -> sk_write_queue , skb ) {
tmp_csum = csum_add ( tmp_csum , skb -> csum ) ;
if ( csum_skb ) continue ;
len = skb -> len - skb_transport_offset ( skb ) ;
if ( offset >= len ) {
offset -= len ;
continue ;
}
csum_skb = skb ;
}
skb = csum_skb ;
}
offset += skb_transport_offset ( skb ) ;
if ( skb_copy_bits ( skb , offset , & csum , 2 ) ) BUG ( ) ;
if ( unlikely ( csum ) ) tmp_csum = csum_sub ( tmp_csum , csum_unfold ( csum ) ) ;
csum = csum_ipv6_magic ( & fl -> fl6_src , & fl -> fl6_dst , total_len , fl -> proto , tmp_csum ) ;
if ( csum == 0 && fl -> proto == IPPROTO_UDP ) csum = CSUM_MANGLED_0 ;
if ( skb_store_bits ( skb , offset , & csum , 2 ) ) BUG ( ) ;
send : err = ip6_push_pending_frames ( sk ) ;
out : return err ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_h245_ServicePriority ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h245_ServicePriority , ServicePriority_sequence ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static VALUE ossl_asn1_ ## klass ( int argc , VALUE * argv , VALUE self ) \ {
return rb_funcall3 ( cASN1 ## klass , rb_intern ( "new" ) , argc , argv ) ;
}
OSSL_ASN1_IMPL_FACTORY_METHOD ( Boolean ) OSSL_ASN1_IMPL_FACTORY_METHOD ( Integer ) OSSL_ASN1_IMPL_FACTORY_METHOD ( Enumerated ) OSSL_ASN1_IMPL_FACTORY_METHOD ( BitString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( OctetString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( UTF8String ) OSSL_ASN1_IMPL_FACTORY_METHOD ( NumericString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( PrintableString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( T61String ) OSSL_ASN1_IMPL_FACTORY_METHOD ( VideotexString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( IA5String ) OSSL_ASN1_IMPL_FACTORY_METHOD ( GraphicString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( ISO64String ) OSSL_ASN1_IMPL_FACTORY_METHOD ( GeneralString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( UniversalString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( BMPString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( Null )
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_h225_T_pdu ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence_of ( tvb , offset , actx , tree , hf_index , ett_h225_T_pdu , T_pdu_sequence_of ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int rtp_packetize_mpv ( sout_stream_id_sys_t * id , block_t * in ) {
int i_max = rtp_mtu ( id ) - 4 ;
int i_count = ( in -> i_buffer + i_max - 1 ) / i_max ;
uint8_t * p_data = in -> p_buffer ;
int i_data = in -> i_buffer ;
int i ;
int b_sequence_start = 0 ;
int i_temporal_ref = 0 ;
int i_picture_coding_type = 0 ;
int i_fbv = 0 , i_bfc = 0 , i_ffv = 0 , i_ffc = 0 ;
int b_start_slice = 0 ;
if ( in -> i_buffer > 4 ) {
uint8_t * p = p_data ;
int i_rest = in -> i_buffer ;
for ( ;
;
) {
while ( i_rest > 4 && ( p [ 0 ] != 0x00 || p [ 1 ] != 0x00 || p [ 2 ] != 0x01 ) ) {
p ++ ;
i_rest -- ;
}
if ( i_rest <= 4 ) {
break ;
}
p += 3 ;
i_rest -= 4 ;
if ( * p == 0xb3 ) {
b_sequence_start = 1 ;
}
else if ( * p == 0x00 && i_rest >= 4 ) {
i_temporal_ref = ( p [ 1 ] << 2 ) | ( ( p [ 2 ] >> 6 ) & 0x03 ) ;
i_picture_coding_type = ( p [ 2 ] >> 3 ) & 0x07 ;
if ( i_rest >= 4 && ( i_picture_coding_type == 2 || i_picture_coding_type == 3 ) ) {
i_ffv = ( p [ 3 ] >> 2 ) & 0x01 ;
i_ffc = ( ( p [ 3 ] & 0x03 ) << 1 ) | ( ( p [ 4 ] >> 7 ) & 0x01 ) ;
if ( i_rest > 4 && i_picture_coding_type == 3 ) {
i_fbv = ( p [ 4 ] >> 6 ) & 0x01 ;
i_bfc = ( p [ 4 ] >> 3 ) & 0x07 ;
}
}
}
else if ( * p <= 0xaf ) {
b_start_slice = 1 ;
}
}
}
for ( i = 0 ;
i < i_count ;
i ++ ) {
int i_payload = __MIN ( i_max , i_data ) ;
block_t * out = block_Alloc ( 16 + i_payload ) ;
uint32_t h = ( i_temporal_ref << 16 ) | ( b_sequence_start << 13 ) | ( b_start_slice << 12 ) | ( i == i_count - 1 ? 1 << 11 : 0 ) | ( i_picture_coding_type << 8 ) | ( i_fbv << 7 ) | ( i_bfc << 4 ) | ( i_ffv << 3 ) | i_ffc ;
rtp_packetize_common ( id , out , ( i == i_count - 1 ) ? 1 : 0 , in -> i_pts > VLC_TS_INVALID ? in -> i_pts : in -> i_dts ) ;
SetDWBE ( out -> p_buffer + 12 , h ) ;
memcpy ( & out -> p_buffer [ 16 ] , p_data , i_payload ) ;
out -> i_dts = in -> i_dts + i * in -> i_length / i_count ;
out -> i_length = in -> i_length / i_count ;
rtp_packetize_send ( id , out ) ;
p_data += i_payload ;
i_data -= i_payload ;
}
block_Release ( in ) ;
return VLC_SUCCESS ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int cgroup_read_from_file ( const char * fn , char buf [ ] , size_t bufsize ) {
int ret = lxc_read_from_file ( fn , buf , bufsize ) ;
if ( ret < 0 ) {
SYSERROR ( "failed to read %s" , fn ) ;
return ret ;
}
if ( ret == bufsize ) {
if ( bufsize > 0 ) {
buf [ bufsize - 1 ] = '\0' ;
return ret ;
}
ERROR ( "%s: was not expecting 0 bufsize" , __func__ ) ;
return - 1 ;
}
buf [ ret ] = '\0' ;
return ret ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static const char * name ## _get_name ( void * ctx ) \ {
return # name ;
\ }
static const AVClass name ## _class = {
. class_name = # name , . item_name = name ## _get_name , . option = name ## _options \ }
typedef struct DefaultContext {
const AVClass * class ;
int nokey ;
int noprint_wrappers ;
int nested_section [ SECTION_MAX_NB_LEVELS ] ;
}
DefaultContext ;
# undef OFFSET # define OFFSET ( x ) offsetof ( DefaultContext , x ) static const AVOption default_options [ ] = {
{
"noprint_wrappers" , "do not print headers and footers" , OFFSET ( noprint_wrappers ) , AV_OPT_TYPE_BOOL , {
. i64 = 0 }
, 0 , 1 }
, {
"nw" , "do not print headers and footers" , OFFSET ( noprint_wrappers ) , AV_OPT_TYPE_BOOL , {
. i64 = 0 }
, 0 , 1 }
, {
"nokey" , "force no key printing" , OFFSET ( nokey ) , AV_OPT_TYPE_BOOL , {
. i64 = 0 }
, 0 , 1 }
, {
"nk" , "force no key printing" , OFFSET ( nokey ) , AV_OPT_TYPE_BOOL , {
. i64 = 0 }
, 0 , 1 }
, {
NULL }
, }
;
DEFINE_WRITER_CLASS ( default ) ;
static inline char * upcase_string ( char * dst , size_t dst_size , const char * src ) {
int i ;
for ( i = 0 ;
src [ i ] && i < dst_size - 1 ;
i ++ ) dst [ i ] = av_toupper ( src [ i ] ) ;
dst [ i ] = 0 ;
return dst ;
}
static void default_print_section_header ( WriterContext * wctx ) {
DefaultContext * def = wctx -> priv ;
char buf [ 32 ] ;
const struct section * section = wctx -> section [ wctx -> level ] ;
const struct section * parent_section = wctx -> level ? wctx -> section [ wctx -> level - 1 ] : NULL ;
av_bprint_clear ( & wctx -> section_pbuf [ wctx -> level ] ) ;
if ( parent_section && ! ( parent_section -> flags & ( SECTION_FLAG_IS_WRAPPER | SECTION_FLAG_IS_ARRAY ) ) ) {
def -> nested_section [ wctx -> level ] = 1 ;
av_bprintf ( & wctx -> section_pbuf [ wctx -> level ] , "%s%s:" , wctx -> section_pbuf [ wctx -> level - 1 ] . str , upcase_string ( buf , sizeof ( buf ) , av_x_if_null ( section -> element_name , section -> name ) ) ) ;
}
if ( def -> noprint_wrappers || def -> nested_section [ wctx -> level ] ) return ;
if ( ! ( section -> flags & ( SECTION_FLAG_IS_WRAPPER | SECTION_FLAG_IS_ARRAY ) ) ) printf ( "[%s]\n" , upcase_string ( buf , sizeof ( buf ) , section -> name ) ) ;
}
static void default_print_section_footer ( WriterContext * wctx ) {
DefaultContext * def = wctx -> priv ;
const struct section * section = wctx -> section [ wctx -> level ] ;
char buf [ 32 ] ;
if ( def -> noprint_wrappers || def -> nested_section [ wctx -> level ] ) return ;
if ( ! ( section -> flags & ( SECTION_FLAG_IS_WRAPPER | SECTION_FLAG_IS_ARRAY ) ) ) printf ( "[/%s]\n" , upcase_string ( buf , sizeof ( buf ) , section -> name ) ) ;
}
static void default_print_str ( WriterContext * wctx , const char * key , const char * value ) {
DefaultContext * def = wctx -> priv ;
if ( ! def -> nokey ) printf ( "%s%s=" , wctx -> section_pbuf [ wctx -> level ] . str , key ) ;
printf ( "%s\n" , value ) ;
}
static void default_print_int ( WriterContext * wctx , const char * key , long long int value ) {
DefaultContext * def = wctx -> priv ;
if ( ! def -> nokey ) printf ( "%s%s=" , wctx -> section_pbuf [ wctx -> level ] . str , key ) ;
printf ( "%lld\n" , value ) ;
}
static const Writer default_writer = {
. name = "default" , . priv_size = sizeof ( DefaultContext ) , . print_section_header = default_print_section_header , . print_section_footer = default_print_section_footer , . print_integer = default_print_int , . print_string = default_print_str , . flags = WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS , . priv_class = & default_class , }
;
static const char * c_escape_str ( AVBPrint * dst , const char * src , const char sep , void * log_ctx ) {
const char * p ;
for ( p = src ;
* p ;
p ++ ) {
switch ( * p ) {
case '\b' : av_bprintf ( dst , "%s" , "\\b" ) ;
break ;
case '\f' : av_bprintf ( dst , "%s" , "\\f" ) ;
break ;
case '\n' : av_bprintf ( dst , "%s" , "\\n" ) ;
break ;
case '\r' : av_bprintf ( dst , "%s" , "\\r" ) ;
break ;
case '\\' : av_bprintf ( dst , "%s" , "\\\\" ) ;
break ;
default : if ( * p == sep ) av_bprint_chars ( dst , '\\' , 1 ) ;
av_bprint_chars ( dst , * p , 1 ) ;
}
}
return dst -> str ;
}
static const char * csv_escape_str ( AVBPrint * dst , const char * src , const char sep , void * log_ctx ) {
char meta_chars [ ] = {
sep , '"' , '\n' , '\r' , '\0' }
;
int needs_quoting = ! ! src [ strcspn ( src , meta_chars ) ] ;
if ( needs_quoting ) av_bprint_chars ( dst , '"' , 1 ) ;
for ( ;
* src ;
src ++ ) {
if ( * src == '"' ) av_bprint_chars ( dst , '"' , 1 ) ;
av_bprint_chars ( dst , * src , 1 ) ;
}
if ( needs_quoting ) av_bprint_chars ( dst , '"' , 1 ) ;
return dst -> str ;
}
static const char * none_escape_str ( AVBPrint * dst , const char * src , const char sep , void * log_ctx ) {
return src ;
}
typedef struct CompactContext {
const AVClass * class ;
char * item_sep_str ;
char item_sep ;
int nokey ;
int print_section ;
char * escape_mode_str ;
const char * ( * escape_str ) ( AVBPrint * dst , const char * src , const char sep , void * log_ctx ) ;
int nested_section [ SECTION_MAX_NB_LEVELS ] ;
int has_nested_elems [ SECTION_MAX_NB_LEVELS ] ;
int terminate_line [ SECTION_MAX_NB_LEVELS ] ;
}
CompactContext ;
# undef OFFSET # define OFFSET ( x ) offsetof ( CompactContext , x ) static const AVOption compact_options [ ] = {
{
"item_sep" , "set item separator" , OFFSET ( item_sep_str ) , AV_OPT_TYPE_STRING , {
. str = "|" }
, CHAR_MIN , CHAR_MAX }
, {
"s" , "set item separator" , OFFSET ( item_sep_str ) , AV_OPT_TYPE_STRING , {
. str = "|" }
, CHAR_MIN , CHAR_MAX }
, {
"nokey" , "force no key printing" , OFFSET ( nokey ) , AV_OPT_TYPE_BOOL , {
. i64 = 0 }
, 0 , 1 }
, {
"nk" , "force no key printing" , OFFSET ( nokey ) , AV_OPT_TYPE_BOOL , {
. i64 = 0 }
, 0 , 1 }
, {
"escape" , "set escape mode" , OFFSET ( escape_mode_str ) , AV_OPT_TYPE_STRING , {
. str = "c" }
, CHAR_MIN , CHAR_MAX }
, {
"e" , "set escape mode" , OFFSET ( escape_mode_str ) , AV_OPT_TYPE_STRING , {
. str = "c" }
, CHAR_MIN , CHAR_MAX }
, {
"print_section" , "print section name" , OFFSET ( print_section ) , AV_OPT_TYPE_BOOL , {
. i64 = 1 }
, 0 , 1 }
, {
"p" , "print section name" , OFFSET ( print_section ) , AV_OPT_TYPE_BOOL , {
. i64 = 1 }
, 0 , 1 }
, {
NULL }
, }
;
DEFINE_WRITER_CLASS ( compact ) ;
static av_cold int compact_init ( WriterContext * wctx ) {
CompactContext * compact = wctx -> priv ;
if ( strlen ( compact -> item_sep_str ) != 1 ) {
av_log ( wctx , AV_LOG_ERROR , "Item separator '%s' specified, but must contain a single character\n" , compact -> item_sep_str ) ;
return AVERROR ( EINVAL ) ;
}
compact -> item_sep = compact -> item_sep_str [ 0 ] ;
if ( ! strcmp ( compact -> escape_mode_str , "none" ) ) compact -> escape_str = none_escape_str ;
else if ( ! strcmp ( compact -> escape_mode_str , "c" ) ) compact -> escape_str = c_escape_str ;
else if ( ! strcmp ( compact -> escape_mode_str , "csv" ) ) compact -> escape_str = csv_escape_str ;
else {
av_log ( wctx , AV_LOG_ERROR , "Unknown escape mode '%s'\n" , compact -> escape_mode_str ) ;
return AVERROR ( EINVAL ) ;
}
return 0 ;
}
static void compact_print_section_header ( WriterContext * wctx ) {
CompactContext * compact = wctx -> priv ;
const struct section * section = wctx -> section [ wctx -> level ] ;
const struct section * parent_section = wctx -> level ? wctx -> section [ wctx -> level - 1 ] : NULL ;
compact -> terminate_line [ wctx -> level ] = 1 ;
compact -> has_nested_elems [ wctx -> level ] = 0 ;
av_bprint_clear ( & wctx -> section_pbuf [ wctx -> level ] ) ;
if ( ! ( section -> flags & SECTION_FLAG_IS_ARRAY ) && parent_section && ! ( parent_section -> flags & ( SECTION_FLAG_IS_WRAPPER | SECTION_FLAG_IS_ARRAY ) ) ) {
compact -> nested_section [ wctx -> level ] = 1 ;
compact -> has_nested_elems [ wctx -> level - 1 ] = 1 ;
av_bprintf ( & wctx -> section_pbuf [ wctx -> level ] , "%s%s:" , wctx -> section_pbuf [ wctx -> level - 1 ] . str , ( char * ) av_x_if_null ( section -> element_name , section -> name ) ) ;
wctx -> nb_item [ wctx -> level ] = wctx -> nb_item [ wctx -> level - 1 ] ;
}
else {
if ( parent_section && compact -> has_nested_elems [ wctx -> level - 1 ] && ( section -> flags & SECTION_FLAG_IS_ARRAY ) ) {
compact -> terminate_line [ wctx -> level - 1 ] = 0 ;
printf ( "\n" ) ;
}
if ( compact -> print_section && ! ( section -> flags & ( SECTION_FLAG_IS_WRAPPER | SECTION_FLAG_IS_ARRAY ) ) ) printf ( "%s%c" , section -> name , compact -> item_sep ) ;
}
}
static void compact_print_section_footer ( WriterContext * wctx ) {
CompactContext * compact = wctx -> priv ;
if ( ! compact -> nested_section [ wctx -> level ] && compact -> terminate_line [ wctx -> level ] && ! ( wctx -> section [ wctx -> level ] -> flags & ( SECTION_FLAG_IS_WRAPPER | SECTION_FLAG_IS_ARRAY ) ) ) printf ( "\n" ) ;
}
static void compact_print_str ( WriterContext * wctx , const char * key , const char * value ) {
CompactContext * compact = wctx -> priv ;
AVBPrint buf ;
if ( wctx -> nb_item [ wctx -> level ] ) printf ( "%c" , compact -> item_sep ) ;
if ( ! compact -> nokey ) printf ( "%s%s=" , wctx -> section_pbuf [ wctx -> level ] . str , key ) ;
av_bprint_init ( & buf , 1 , AV_BPRINT_SIZE_UNLIMITED ) ;
printf ( "%s" , compact -> escape_str ( & buf , value , compact -> item_sep , wctx ) ) ;
av_bprint_finalize ( & buf , NULL ) ;
}
static void compact_print_int ( WriterContext * wctx , const char * key , long long int value ) {
CompactContext * compact = wctx -> priv ;
if ( wctx -> nb_item [ wctx -> level ] ) printf ( "%c" , compact -> item_sep ) ;
if ( ! compact -> nokey ) printf ( "%s%s=" , wctx -> section_pbuf [ wctx -> level ] . str , key ) ;
printf ( "%lld" , value ) ;
}
static const Writer compact_writer = {
. name = "compact" , . priv_size = sizeof ( CompactContext ) , . init = compact_init , . print_section_header = compact_print_section_header , . print_section_footer = compact_print_section_footer , . print_integer = compact_print_int , . print_string = compact_print_str , . flags = WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS , . priv_class = & compact_class , }
;
# undef OFFSET # define OFFSET ( x ) offsetof ( CompactContext , x ) static const AVOption csv_options [ ] = {
{
"item_sep" , "set item separator" , OFFSET ( item_sep_str ) , AV_OPT_TYPE_STRING , {
. str = "," }
, CHAR_MIN , CHAR_MAX }
, {
"s" , "set item separator" , OFFSET ( item_sep_str ) , AV_OPT_TYPE_STRING , {
. str = "," }
, CHAR_MIN , CHAR_MAX }
, {
"nokey" , "force no key printing" , OFFSET ( nokey ) , AV_OPT_TYPE_BOOL , {
. i64 = 1 }
, 0 , 1 }
, {
"nk" , "force no key printing" , OFFSET ( nokey ) , AV_OPT_TYPE_BOOL , {
. i64 = 1 }
, 0 , 1 }
, {
"escape" , "set escape mode" , OFFSET ( escape_mode_str ) , AV_OPT_TYPE_STRING , {
. str = "csv" }
, CHAR_MIN , CHAR_MAX }
, {
"e" , "set escape mode" , OFFSET ( escape_mode_str ) , AV_OPT_TYPE_STRING , {
. str = "csv" }
, CHAR_MIN , CHAR_MAX }
, {
"print_section" , "print section name" , OFFSET ( print_section ) , AV_OPT_TYPE_BOOL , {
. i64 = 1 }
, 0 , 1 }
, {
"p" , "print section name" , OFFSET ( print_section ) , AV_OPT_TYPE_BOOL , {
. i64 = 1 }
, 0 , 1 }
, {
NULL }
, }
;
DEFINE_WRITER_CLASS ( csv ) ;
static const Writer csv_writer = {
. name = "csv" , . priv_size = sizeof ( CompactContext ) , . init = compact_init , . print_section_header = compact_print_section_header , . print_section_footer = compact_print_section_footer , . print_integer = compact_print_int , . print_string = compact_print_str , . flags = WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS , . priv_class = & csv_class , }
;
typedef struct FlatContext {
const AVClass * class ;
const char * sep_str ;
char sep ;
int hierarchical ;
}
FlatContext ;
# undef OFFSET # define OFFSET ( x ) offsetof ( FlatContext , x ) static const AVOption flat_options [ ] = {
{
"sep_char" , "set separator" , OFFSET ( sep_str ) , AV_OPT_TYPE_STRING , {
. str = "." }
, CHAR_MIN , CHAR_MAX }
, {
"s" , "set separator" , OFFSET ( sep_str ) , AV_OPT_TYPE_STRING , {
. str = "." }
, CHAR_MIN , CHAR_MAX }
, {
"hierarchical" , "specify if the section specification should be hierarchical" , OFFSET ( hierarchical ) , AV_OPT_TYPE_BOOL , {
. i64 = 1 }
, 0 , 1 }
, {
"h" , "specify if the section specification should be hierarchical" , OFFSET ( hierarchical ) , AV_OPT_TYPE_BOOL , {
. i64 = 1 }
, 0 , 1 }
, {
NULL }
, }
;
DEFINE_WRITER_CLASS ( flat ) ;
static av_cold int flat_init ( WriterContext * wctx ) {
FlatContext * flat = wctx -> priv ;
if ( strlen ( flat -> sep_str ) != 1 ) {
av_log ( wctx , AV_LOG_ERROR , "Item separator '%s' specified, but must contain a single character\n" , flat -> sep_str ) ;
return AVERROR ( EINVAL ) ;
}
flat -> sep = flat -> sep_str [ 0 ] ;
return 0 ;
}
static const char * flat_escape_key_str ( AVBPrint * dst , const char * src , const char sep ) {
const char * p ;
for ( p = src ;
* p ;
p ++ ) {
if ( ! ( ( * p >= '0' && * p <= '9' ) || ( * p >= 'a' && * p <= 'z' ) || ( * p >= 'A' && * p <= 'Z' ) ) ) av_bprint_chars ( dst , '_' , 1 ) ;
else av_bprint_chars ( dst , * p , 1 ) ;
}
return dst -> str ;
}
static const char * flat_escape_value_str ( AVBPrint * dst , const char * src ) {
const char * p ;
for ( p = src ;
* p ;
p ++ ) {
switch ( * p ) {
case '\n' : av_bprintf ( dst , "%s" , "\\n" ) ;
break ;
case '\r' : av_bprintf ( dst , "%s" , "\\r" ) ;
break ;
case '\\' : av_bprintf ( dst , "%s" , "\\\\" ) ;
break ;
case '"' : av_bprintf ( dst , "%s" , "\\\"" ) ;
break ;
case '`' : av_bprintf ( dst , "%s" , "\\`" ) ;
break ;
case '$' : av_bprintf ( dst , "%s" , "\\$" ) ;
break ;
default : av_bprint_chars ( dst , * p , 1 ) ;
break ;
}
}
return dst -> str ;
}
static void flat_print_section_header ( WriterContext * wctx ) {
FlatContext * flat = wctx -> priv ;
AVBPrint * buf = & wctx -> section_pbuf [ wctx -> level ] ;
const struct section * section = wctx -> section [ wctx -> level ] ;
const struct section * parent_section = wctx -> level ? wctx -> section [ wctx -> level - 1 ] : NULL ;
av_bprint_clear ( buf ) ;
if ( ! parent_section ) return ;
av_bprintf ( buf , "%s" , wctx -> section_pbuf [ wctx -> level - 1 ] . str ) ;
if ( flat -> hierarchical || ! ( section -> flags & ( SECTION_FLAG_IS_ARRAY | SECTION_FLAG_IS_WRAPPER ) ) ) {
av_bprintf ( buf , "%s%s" , wctx -> section [ wctx -> level ] -> name , flat -> sep_str ) ;
if ( parent_section -> flags & SECTION_FLAG_IS_ARRAY ) {
int n = parent_section -> id == SECTION_ID_PACKETS_AND_FRAMES ? wctx -> nb_section_packet_frame : wctx -> nb_item [ wctx -> level - 1 ] ;
av_bprintf ( buf , "%d%s" , n , flat -> sep_str ) ;
}
}
}
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 ) ;
}
static void flat_print_str ( WriterContext * wctx , const char * key , const char * value ) {
FlatContext * flat = wctx -> priv ;
AVBPrint buf ;
printf ( "%s" , wctx -> section_pbuf [ wctx -> level ] . str ) ;
av_bprint_init ( & buf , 1 , AV_BPRINT_SIZE_UNLIMITED ) ;
printf ( "%s=" , flat_escape_key_str ( & buf , key , flat -> sep ) ) ;
av_bprint_clear ( & buf ) ;
printf ( "\"%s\"\n" , flat_escape_value_str ( & buf , value ) ) ;
av_bprint_finalize ( & buf , NULL ) ;
}
static const Writer flat_writer = {
. name = "flat" , . priv_size = sizeof ( FlatContext ) , . init = flat_init , . print_section_header = flat_print_section_header , . print_integer = flat_print_int , . print_string = flat_print_str , . flags = WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS | WRITER_FLAG_PUT_PACKETS_AND_FRAMES_IN_SAME_CHAPTER , . priv_class = & flat_class , }
;
typedef struct INIContext {
const AVClass * class ;
int hierarchical ;
}
INIContext ;
# undef OFFSET # define OFFSET ( x ) offsetof ( INIContext , x ) static const AVOption ini_options [ ] = {
{
"hierarchical" , "specify if the section specification should be hierarchical" , OFFSET ( hierarchical ) , AV_OPT_TYPE_BOOL , {
. i64 = 1 }
, 0 , 1 }
, {
"h" , "specify if the section specification should be hierarchical" , OFFSET ( hierarchical ) , AV_OPT_TYPE_BOOL , {
. i64 = 1 }
, 0 , 1 }
, {
NULL }
, }
;
DEFINE_WRITER_CLASS ( ini )
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_h225_T_h245Ip6 ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
# line 348 "./asn1/h225/h225.cnf" tvbuff_t * value_tvb ;
ipv6_address = ipv6_address_zeros ;
offset = dissect_per_octet_string ( tvb , offset , actx , tree , hf_index , 16 , 16 , FALSE , & value_tvb ) ;
if ( value_tvb ) tvb_get_ipv6 ( value_tvb , 0 , & ipv6_address ) ;
return offset ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void switch_sql_mode ( FILE * sql_file , const char * delimiter , const char * sql_mode ) {
fprintf ( sql_file , "/*!50003 SET @saved_sql_mode = @@sql_mode */ %s\n" "/*!50003 SET sql_mode = '%s' */ %s\n" , ( const char * ) delimiter , ( const char * ) sql_mode , ( const char * ) delimiter ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void cirrus_init_common ( CirrusVGAState * s , Object * owner , int device_id , int is_pci , MemoryRegion * system_memory , MemoryRegion * system_io ) {
int i ;
static int inited ;
if ( ! inited ) {
inited = 1 ;
for ( i = 0 ;
i < 256 ;
i ++ ) rop_to_index [ i ] = CIRRUS_ROP_NOP_INDEX ;
rop_to_index [ CIRRUS_ROP_0 ] = 0 ;
rop_to_index [ CIRRUS_ROP_SRC_AND_DST ] = 1 ;
rop_to_index [ CIRRUS_ROP_NOP ] = 2 ;
rop_to_index [ CIRRUS_ROP_SRC_AND_NOTDST ] = 3 ;
rop_to_index [ CIRRUS_ROP_NOTDST ] = 4 ;
rop_to_index [ CIRRUS_ROP_SRC ] = 5 ;
rop_to_index [ CIRRUS_ROP_1 ] = 6 ;
rop_to_index [ CIRRUS_ROP_NOTSRC_AND_DST ] = 7 ;
rop_to_index [ CIRRUS_ROP_SRC_XOR_DST ] = 8 ;
rop_to_index [ CIRRUS_ROP_SRC_OR_DST ] = 9 ;
rop_to_index [ CIRRUS_ROP_NOTSRC_OR_NOTDST ] = 10 ;
rop_to_index [ CIRRUS_ROP_SRC_NOTXOR_DST ] = 11 ;
rop_to_index [ CIRRUS_ROP_SRC_OR_NOTDST ] = 12 ;
rop_to_index [ CIRRUS_ROP_NOTSRC ] = 13 ;
rop_to_index [ CIRRUS_ROP_NOTSRC_OR_DST ] = 14 ;
rop_to_index [ CIRRUS_ROP_NOTSRC_AND_NOTDST ] = 15 ;
s -> device_id = device_id ;
if ( is_pci ) s -> bustype = CIRRUS_BUSTYPE_PCI ;
else s -> bustype = CIRRUS_BUSTYPE_ISA ;
}
memory_region_init_io ( & s -> cirrus_vga_io , owner , & cirrus_vga_io_ops , s , "cirrus-io" , 0x30 ) ;
memory_region_set_flush_coalesced ( & s -> cirrus_vga_io ) ;
memory_region_add_subregion ( system_io , 0x3b0 , & s -> cirrus_vga_io ) ;
memory_region_init ( & s -> low_mem_container , owner , "cirrus-lowmem-container" , 0x20000 ) ;
memory_region_init_io ( & s -> low_mem , owner , & cirrus_vga_mem_ops , s , "cirrus-low-memory" , 0x20000 ) ;
memory_region_add_subregion ( & s -> low_mem_container , 0 , & s -> low_mem ) ;
for ( i = 0 ;
i < 2 ;
++ i ) {
static const char * names [ ] = {
"vga.bank0" , "vga.bank1" }
;
MemoryRegion * bank = & s -> cirrus_bank [ i ] ;
memory_region_init_alias ( bank , owner , names [ i ] , & s -> vga . vram , 0 , 0x8000 ) ;
memory_region_set_enabled ( bank , false ) ;
memory_region_add_subregion_overlap ( & s -> low_mem_container , i * 0x8000 , bank , 1 ) ;
}
memory_region_add_subregion_overlap ( system_memory , 0x000a0000 , & s -> low_mem_container , 1 ) ;
memory_region_set_coalescing ( & s -> low_mem ) ;
memory_region_init_io ( & s -> cirrus_linear_io , owner , & cirrus_linear_io_ops , s , "cirrus-linear-io" , s -> vga . vram_size_mb * 1024 * 1024 ) ;
memory_region_set_flush_coalesced ( & s -> cirrus_linear_io ) ;
memory_region_init_io ( & s -> cirrus_linear_bitblt_io , owner , & cirrus_linear_bitblt_io_ops , s , "cirrus-bitblt-mmio" , 0x400000 ) ;
memory_region_set_flush_coalesced ( & s -> cirrus_linear_bitblt_io ) ;
memory_region_init_io ( & s -> cirrus_mmio_io , owner , & cirrus_mmio_io_ops , s , "cirrus-mmio" , CIRRUS_PNPMMIO_SIZE ) ;
memory_region_set_flush_coalesced ( & s -> cirrus_mmio_io ) ;
s -> real_vram_size = ( s -> device_id == CIRRUS_ID_CLGD5446 ) ? 4096 * 1024 : 2048 * 1024 ;
s -> cirrus_addr_mask = s -> real_vram_size - 1 ;
s -> linear_mmio_mask = s -> real_vram_size - 256 ;
s -> vga . get_bpp = cirrus_get_bpp ;
s -> vga . get_offsets = cirrus_get_offsets ;
s -> vga . get_resolution = cirrus_get_resolution ;
s -> vga . cursor_invalidate = cirrus_cursor_invalidate ;
s -> vga . cursor_draw_line = cirrus_cursor_draw_line ;
qemu_register_reset ( cirrus_reset , s ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
enum ImapAuthRes imap_auth_cram_md5 ( struct ImapData * idata , const char * method ) {
char ibuf [ LONG_STRING * 2 ] , obuf [ LONG_STRING ] ;
unsigned char hmac_response [ MD5_DIGEST_LEN ] ;
int len ;
int rc ;
if ( ! mutt_bit_isset ( idata -> capabilities , ACRAM_MD5 ) ) return IMAP_AUTH_UNAVAIL ;
mutt_message ( _ ( "Authenticating (CRAM-MD5)..." ) ) ;
if ( mutt_account_getlogin ( & idata -> conn -> account ) < 0 ) return IMAP_AUTH_FAILURE ;
if ( mutt_account_getpass ( & idata -> conn -> account ) < 0 ) return IMAP_AUTH_FAILURE ;
imap_cmd_start ( idata , "AUTHENTICATE CRAM-MD5" ) ;
do rc = imap_cmd_step ( idata ) ;
while ( rc == IMAP_CMD_CONTINUE ) ;
if ( rc != IMAP_CMD_RESPOND ) {
mutt_debug ( 1 , "Invalid response from server: %s\n" , ibuf ) ;
goto bail ;
}
len = mutt_b64_decode ( obuf , idata -> buf + 2 , sizeof ( obuf ) ) ;
if ( len == - 1 ) {
mutt_debug ( 1 , "Error decoding base64 response.\n" ) ;
goto bail ;
}
obuf [ len ] = '\0' ;
mutt_debug ( 2 , "CRAM challenge: %s\n" , obuf ) ;
hmac_md5 ( idata -> conn -> account . pass , obuf , hmac_response ) ;
int off = snprintf ( obuf , sizeof ( obuf ) , "%s " , idata -> conn -> account . user ) ;
mutt_md5_toascii ( hmac_response , obuf + off ) ;
mutt_debug ( 2 , "CRAM response: %s\n" , obuf ) ;
mutt_b64_encode ( ibuf , obuf , strlen ( obuf ) , sizeof ( ibuf ) - 2 ) ;
mutt_str_strcat ( ibuf , sizeof ( ibuf ) , "\r\n" ) ;
mutt_socket_send ( idata -> conn , ibuf ) ;
do rc = imap_cmd_step ( idata ) ;
while ( rc == IMAP_CMD_CONTINUE ) ;
if ( rc != IMAP_CMD_OK ) {
mutt_debug ( 1 , "Error receiving server response.\n" ) ;
goto bail ;
}
if ( imap_code ( idata -> buf ) ) return IMAP_AUTH_SUCCESS ;
bail : mutt_error ( _ ( "CRAM-MD5 authentication failed." ) ) ;
return IMAP_AUTH_FAILURE ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
proto_item * proto_item_get_parent_nth ( proto_item * ti , int gen ) {
if ( ! ti ) return NULL ;
while ( gen -- ) {
ti = ti -> parent ;
if ( ! ti ) return NULL ;
}
return ti ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void initial_reordering_consonant_syllable ( hb_buffer_t * buffer , unsigned int start , unsigned int end ) {
hb_glyph_info_t * info = buffer -> info ;
unsigned int base = end ;
bool has_reph = false ;
{
unsigned int limit = start ;
if ( start + 3 <= end && info [ start ] . myanmar_category ( ) == OT_Ra && info [ start + 1 ] . myanmar_category ( ) == OT_As && info [ start + 2 ] . myanmar_category ( ) == OT_H ) {
limit += 3 ;
base = start ;
has_reph = true ;
}
{
if ( ! has_reph ) base = limit ;
for ( unsigned int i = limit ;
i < end ;
i ++ ) if ( is_consonant ( info [ i ] ) ) {
base = i ;
break ;
}
}
}
{
unsigned int i = start ;
for ( ;
i < start + ( has_reph ? 3 : 0 ) ;
i ++ ) info [ i ] . myanmar_position ( ) = POS_AFTER_MAIN ;
for ( ;
i < base ;
i ++ ) info [ i ] . myanmar_position ( ) = POS_PRE_C ;
if ( i < end ) {
info [ i ] . myanmar_position ( ) = POS_BASE_C ;
i ++ ;
}
indic_position_t pos = POS_AFTER_MAIN ;
for ( ;
i < end ;
i ++ ) {
if ( info [ i ] . myanmar_category ( ) == OT_MR ) {
info [ i ] . myanmar_position ( ) = POS_PRE_C ;
continue ;
}
if ( info [ i ] . myanmar_position ( ) < POS_BASE_C ) {
continue ;
}
if ( pos == POS_AFTER_MAIN && info [ i ] . myanmar_category ( ) == OT_VBlw ) {
pos = POS_BELOW_C ;
info [ i ] . myanmar_position ( ) = pos ;
continue ;
}
if ( pos == POS_BELOW_C && info [ i ] . myanmar_category ( ) == OT_A ) {
info [ i ] . myanmar_position ( ) = POS_BEFORE_SUB ;
continue ;
}
if ( pos == POS_BELOW_C && info [ i ] . myanmar_category ( ) == OT_VBlw ) {
info [ i ] . myanmar_position ( ) = pos ;
continue ;
}
if ( pos == POS_BELOW_C && info [ i ] . myanmar_category ( ) != OT_A ) {
pos = POS_AFTER_SUB ;
info [ i ] . myanmar_position ( ) = pos ;
continue ;
}
info [ i ] . myanmar_position ( ) = pos ;
}
}
buffer -> merge_clusters ( start , end ) ;
hb_bubble_sort ( info + start , end - start , compare_myanmar_order ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int relpTcpWaitWriteable ( relpTcp_t * const pThis , struct timespec * const tTimeout ) {
int r ;
struct timespec tCurr ;
struct pollfd pfd ;
clock_gettime ( CLOCK_REALTIME , & tCurr ) ;
const int timeout = ( tTimeout -> tv_sec - tCurr . tv_sec ) * 1000 + ( tTimeout -> tv_nsec - tCurr . tv_nsec ) / 1000000000 ;
if ( timeout < 0 ) {
r = 0 ;
goto done ;
}
pThis -> pEngine -> dbgprint ( "librelp: telpTcpWaitWritable doing poll() " "on fd %d, timoeut %d\n" , pThis -> sock , timeout ) ;
pfd . fd = pThis -> sock ;
pfd . events = POLLOUT ;
r = poll ( & pfd , 1 , timeout ) ;
done : return r ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void _clear_rpc_stats ( void ) {
int i ;
slurm_mutex_lock ( & rpc_mutex ) ;
for ( i = 0 ;
i < rpc_type_size ;
i ++ ) {
rpc_type_cnt [ i ] = 0 ;
rpc_type_id [ i ] = 0 ;
rpc_type_time [ i ] = 0 ;
}
for ( i = 0 ;
i < rpc_user_size ;
i ++ ) {
rpc_user_cnt [ i ] = 0 ;
rpc_user_id [ i ] = 0 ;
rpc_user_time [ i ] = 0 ;
}
slurm_mutex_unlock ( & rpc_mutex ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int mimic_decode_update_thread_context ( AVCodecContext * avctx , const AVCodecContext * avctx_from ) {
MimicContext * dst = avctx -> priv_data , * src = avctx_from -> priv_data ;
if ( avctx == avctx_from ) return 0 ;
dst -> cur_index = src -> next_cur_index ;
dst -> prev_index = src -> next_prev_index ;
memcpy ( dst -> buf_ptrs , src -> buf_ptrs , sizeof ( src -> buf_ptrs ) ) ;
memcpy ( dst -> flipped_ptrs , src -> flipped_ptrs , sizeof ( src -> flipped_ptrs ) ) ;
memset ( & dst -> buf_ptrs [ dst -> cur_index ] , 0 , sizeof ( AVFrame ) ) ;
return 0 ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_btgatt_nordic_dfu_control_point ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * data ) {
gint offset = 0 ;
guint8 opcode ;
guint8 request_opcode ;
guint8 status ;
btatt_data_t * att_data = ( btatt_data_t * ) data ;
if ( bluetooth_gatt_has_no_parameter ( att_data -> opcode ) ) return - 1 ;
proto_tree_add_item ( tree , hf_gatt_nordic_dfu_control_point_opcode , tvb , offset , 1 , ENC_NA ) ;
opcode = tvb_get_guint8 ( tvb , offset ) ;
offset += 1 ;
switch ( opcode ) {
case 0x01 : proto_tree_add_item ( tree , hf_gatt_nordic_dfu_control_point_image_type , tvb , offset , 1 , ENC_NA ) ;
offset += 1 ;
break ;
case 0x02 : if ( tvb_reported_length_remaining ( tvb , offset ) > 0 ) {
proto_tree_add_item ( tree , hf_gatt_nordic_dfu_control_point_init_packet , tvb , offset , 1 , ENC_NA ) ;
offset += 1 ;
}
break ;
case 0x03 : case 0x04 : case 0x05 : case 0x06 : case 0x07 : break ;
case 0x08 : proto_tree_add_item ( tree , hf_gatt_nordic_dfu_control_point_number_of_packets , tvb , offset , 2 , ENC_LITTLE_ENDIAN ) ;
offset += 2 ;
break ;
case 0x10 : proto_tree_add_item ( tree , hf_gatt_nordic_dfu_control_point_request_opcode , tvb , offset , 1 , ENC_NA ) ;
request_opcode = tvb_get_guint8 ( tvb , offset ) ;
offset += 1 ;
proto_tree_add_item ( tree , hf_gatt_nordic_dfu_control_point_response_value , tvb , offset , 1 , ENC_NA ) ;
status = tvb_get_guint8 ( tvb , offset ) ;
offset += 1 ;
if ( request_opcode == 0x07 && status == 0x01 ) {
proto_tree_add_item ( tree , hf_gatt_nordic_dfu_control_point_number_of_bytes , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
offset += 4 ;
}
break ;
case 0x11 : proto_tree_add_item ( tree , hf_gatt_nordic_dfu_control_point_number_of_bytes , tvb , offset , 4 , ENC_LITTLE_ENDIAN ) ;
offset += 4 ;
break ;
}
if ( tvb_captured_length_remaining ( tvb , offset ) > 0 ) {
proto_tree_add_expert ( tree , pinfo , & ei_btatt_unexpected_data , tvb , offset , - 1 ) ;
offset = tvb_captured_length ( tvb ) ;
}
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
TEST_F ( TemplateURLParserTest , FailOnPost ) {
ASSERT_NO_FATAL_FAILURE ( ParseFile ( "post.xml" , nullptr ) ) ;
EXPECT_FALSE ( template_url_ ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dump_sa ( struct xfrm_state * x , int count , void * ptr ) {
struct pfkey_sock * pfk = ptr ;
struct sk_buff * out_skb ;
struct sadb_msg * out_hdr ;
if ( ! pfkey_can_dump ( & pfk -> sk ) ) return - ENOBUFS ;
out_skb = pfkey_xfrm_state2msg ( x ) ;
if ( IS_ERR ( out_skb ) ) return PTR_ERR ( out_skb ) ;
out_hdr = ( struct sadb_msg * ) out_skb -> data ;
out_hdr -> sadb_msg_version = pfk -> dump . msg_version ;
out_hdr -> sadb_msg_type = SADB_DUMP ;
out_hdr -> sadb_msg_satype = pfkey_proto2satype ( x -> id . proto ) ;
out_hdr -> sadb_msg_errno = 0 ;
out_hdr -> sadb_msg_reserved = 0 ;
out_hdr -> sadb_msg_seq = count + 1 ;
out_hdr -> sadb_msg_pid = pfk -> dump . msg_portid ;
if ( pfk -> dump . skb ) pfkey_broadcast ( pfk -> dump . skb , GFP_ATOMIC , BROADCAST_ONE , & pfk -> sk , sock_net ( & pfk -> sk ) ) ;
pfk -> dump . skb = out_skb ;
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static ossl_inline t2 * sk_ ## t1 ## _set ( STACK_OF ( t1 ) * sk , int idx , t2 * ptr ) {
return ( t2 * ) OPENSSL_sk_set ( ( OPENSSL_STACK * ) sk , idx , ( const void * ) ptr ) ;
}
static ossl_inline int sk_ ## t1 ## _find ( STACK_OF ( t1 ) * sk , t2 * ptr ) {
return OPENSSL_sk_find ( ( OPENSSL_STACK * ) sk , ( const void * ) ptr ) ;
}
static ossl_inline int sk_ ## t1 ## _find_ex ( STACK_OF ( t1 ) * sk , t2 * ptr ) {
return OPENSSL_sk_find_ex ( ( OPENSSL_STACK * ) sk , ( const void * ) ptr ) ;
}
static ossl_inline void sk_ ## t1 ## _sort ( STACK_OF ( t1 ) * sk ) {
OPENSSL_sk_sort ( ( OPENSSL_STACK * ) sk ) ;
}
static ossl_inline int sk_ ## t1 ## _is_sorted ( const STACK_OF ( t1 ) * sk ) {
return OPENSSL_sk_is_sorted ( ( const OPENSSL_STACK * ) sk ) ;
}
static ossl_inline STACK_OF ( t1 ) * sk_ ## t1 ## _dup ( const STACK_OF ( t1 ) * sk ) {
return ( STACK_OF ( t1 ) * ) OPENSSL_sk_dup ( ( const OPENSSL_STACK * ) sk ) ;
}
static ossl_inline STACK_OF ( t1 ) * sk_ ## t1 ## _deep_copy ( const STACK_OF ( t1 ) * sk , sk_ ## t1 ## _copyfunc copyfunc , sk_ ## t1 ## _freefunc freefunc ) {
return ( STACK_OF ( t1 ) * ) OPENSSL_sk_deep_copy ( ( const OPENSSL_STACK * ) sk , ( OPENSSL_sk_copyfunc ) copyfunc , ( OPENSSL_sk_freefunc ) freefunc ) ;
}
static ossl_inline sk_ ## t1 ## _compfunc sk_ ## t1 ## _set_cmp_func ( STACK_OF ( t1 ) * sk , sk_ ## t1 ## _compfunc compare ) {
return ( sk_ ## t1 ## _compfunc ) OPENSSL_sk_set_cmp_func ( ( OPENSSL_STACK * ) sk , ( OPENSSL_sk_compfunc ) compare ) ;
}
# define DEFINE_SPECIAL_STACK_OF ( t1 , t2 ) SKM_DEFINE_STACK_OF ( t1 , t2 , t2 ) # define DEFINE_STACK_OF ( t ) SKM_DEFINE_STACK_OF ( t , t , t ) # define DEFINE_SPECIAL_STACK_OF_CONST ( t1 , t2 ) SKM_DEFINE_STACK_OF ( t1 , const t2 , t2 ) # define DEFINE_STACK_OF_CONST ( t ) SKM_DEFINE_STACK_OF ( t , const t , t ) typedef char * OPENSSL_STRING ;
typedef const char * OPENSSL_CSTRING ;
DEFINE_SPECIAL_STACK_OF ( OPENSSL_STRING , char )
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
void close_files ( ) {
DBUG_ENTER ( "close_files" ) ;
for ( ;
cur_file >= file_stack ;
cur_file -- ) {
if ( cur_file -> file && cur_file -> file != stdin ) {
DBUG_PRINT ( "info" , ( "closing file: %s" , cur_file -> file_name ) ) ;
fclose ( cur_file -> file ) ;
}
my_free ( cur_file -> file_name ) ;
cur_file -> file_name = 0 ;
}
DBUG_VOID_RETURN ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
unsigned int vp8_variance_halfpixvar16x16_hv_neon ( const unsigned char * src_ptr , int source_stride , const unsigned char * ref_ptr , int recon_stride , unsigned int * sse ) {
int i ;
uint8x8_t d0u8 , d1u8 , d2u8 , d3u8 , d4u8 , d5u8 , d6u8 , d7u8 ;
int16x4_t d0s16 , d1s16 , d2s16 , d3s16 , d10s16 , d11s16 , d12s16 , d13s16 ;
int16x4_t d18s16 , d19s16 , d20s16 , d21s16 , d22s16 , d23s16 , d24s16 , d25s16 ;
uint32x2_t d0u32 , d10u32 ;
int64x1_t d0s64 , d1s64 , d2s64 , d3s64 ;
uint8x16_t q0u8 , q1u8 , q2u8 , q3u8 , q4u8 , q5u8 , q6u8 , q7u8 , q8u8 , q9u8 ;
uint16x8_t q0u16 , q1u16 , q5u16 , q6u16 , q9u16 , q10u16 , q11u16 , q12u16 ;
int32x4_t q13s32 , q14s32 , q15s32 ;
int64x2_t q0s64 , q1s64 , q5s64 ;
q13s32 = vdupq_n_s32 ( 0 ) ;
q14s32 = vdupq_n_s32 ( 0 ) ;
q15s32 = vdupq_n_s32 ( 0 ) ;
q0u8 = vld1q_u8 ( src_ptr ) ;
q1u8 = vld1q_u8 ( src_ptr + 16 ) ;
src_ptr += source_stride ;
q1u8 = vextq_u8 ( q0u8 , q1u8 , 1 ) ;
q0u8 = vrhaddq_u8 ( q0u8 , q1u8 ) ;
for ( i = 0 ;
i < 4 ;
i ++ ) {
q2u8 = vld1q_u8 ( src_ptr ) ;
q3u8 = vld1q_u8 ( src_ptr + 16 ) ;
src_ptr += source_stride ;
q4u8 = vld1q_u8 ( src_ptr ) ;
q5u8 = vld1q_u8 ( src_ptr + 16 ) ;
src_ptr += source_stride ;
q6u8 = vld1q_u8 ( src_ptr ) ;
q7u8 = vld1q_u8 ( src_ptr + 16 ) ;
src_ptr += source_stride ;
q8u8 = vld1q_u8 ( src_ptr ) ;
q9u8 = vld1q_u8 ( src_ptr + 16 ) ;
src_ptr += source_stride ;
q3u8 = vextq_u8 ( q2u8 , q3u8 , 1 ) ;
q5u8 = vextq_u8 ( q4u8 , q5u8 , 1 ) ;
q7u8 = vextq_u8 ( q6u8 , q7u8 , 1 ) ;
q9u8 = vextq_u8 ( q8u8 , q9u8 , 1 ) ;
q1u8 = vrhaddq_u8 ( q2u8 , q3u8 ) ;
q2u8 = vrhaddq_u8 ( q4u8 , q5u8 ) ;
q3u8 = vrhaddq_u8 ( q6u8 , q7u8 ) ;
q4u8 = vrhaddq_u8 ( q8u8 , q9u8 ) ;
q0u8 = vrhaddq_u8 ( q0u8 , q1u8 ) ;
q1u8 = vrhaddq_u8 ( q1u8 , q2u8 ) ;
q2u8 = vrhaddq_u8 ( q2u8 , q3u8 ) ;
q3u8 = vrhaddq_u8 ( q3u8 , q4u8 ) ;
q5u8 = vld1q_u8 ( ref_ptr ) ;
ref_ptr += recon_stride ;
q6u8 = vld1q_u8 ( ref_ptr ) ;
ref_ptr += recon_stride ;
q7u8 = vld1q_u8 ( ref_ptr ) ;
ref_ptr += recon_stride ;
q8u8 = vld1q_u8 ( ref_ptr ) ;
ref_ptr += recon_stride ;
d0u8 = vget_low_u8 ( q0u8 ) ;
d1u8 = vget_high_u8 ( q0u8 ) ;
d2u8 = vget_low_u8 ( q1u8 ) ;
d3u8 = vget_high_u8 ( q1u8 ) ;
d4u8 = vget_low_u8 ( q2u8 ) ;
d5u8 = vget_high_u8 ( q2u8 ) ;
d6u8 = vget_low_u8 ( q3u8 ) ;
d7u8 = vget_high_u8 ( q3u8 ) ;
q9u16 = vsubl_u8 ( d0u8 , vget_low_u8 ( q5u8 ) ) ;
q10u16 = vsubl_u8 ( d1u8 , vget_high_u8 ( q5u8 ) ) ;
q11u16 = vsubl_u8 ( d2u8 , vget_low_u8 ( q6u8 ) ) ;
q12u16 = vsubl_u8 ( d3u8 , vget_high_u8 ( q6u8 ) ) ;
q0u16 = vsubl_u8 ( d4u8 , vget_low_u8 ( q7u8 ) ) ;
q1u16 = vsubl_u8 ( d5u8 , vget_high_u8 ( q7u8 ) ) ;
q5u16 = vsubl_u8 ( d6u8 , vget_low_u8 ( q8u8 ) ) ;
q6u16 = vsubl_u8 ( d7u8 , vget_high_u8 ( q8u8 ) ) ;
d18s16 = vreinterpret_s16_u16 ( vget_low_u16 ( q9u16 ) ) ;
d19s16 = vreinterpret_s16_u16 ( vget_high_u16 ( q9u16 ) ) ;
q13s32 = vpadalq_s16 ( q13s32 , vreinterpretq_s16_u16 ( q9u16 ) ) ;
q14s32 = vmlal_s16 ( q14s32 , d18s16 , d18s16 ) ;
q15s32 = vmlal_s16 ( q15s32 , d19s16 , d19s16 ) ;
d20s16 = vreinterpret_s16_u16 ( vget_low_u16 ( q10u16 ) ) ;
d21s16 = vreinterpret_s16_u16 ( vget_high_u16 ( q10u16 ) ) ;
q13s32 = vpadalq_s16 ( q13s32 , vreinterpretq_s16_u16 ( q10u16 ) ) ;
q14s32 = vmlal_s16 ( q14s32 , d20s16 , d20s16 ) ;
q15s32 = vmlal_s16 ( q15s32 , d21s16 , d21s16 ) ;
d22s16 = vreinterpret_s16_u16 ( vget_low_u16 ( q11u16 ) ) ;
d23s16 = vreinterpret_s16_u16 ( vget_high_u16 ( q11u16 ) ) ;
q13s32 = vpadalq_s16 ( q13s32 , vreinterpretq_s16_u16 ( q11u16 ) ) ;
q14s32 = vmlal_s16 ( q14s32 , d22s16 , d22s16 ) ;
q15s32 = vmlal_s16 ( q15s32 , d23s16 , d23s16 ) ;
d24s16 = vreinterpret_s16_u16 ( vget_low_u16 ( q12u16 ) ) ;
d25s16 = vreinterpret_s16_u16 ( vget_high_u16 ( q12u16 ) ) ;
q13s32 = vpadalq_s16 ( q13s32 , vreinterpretq_s16_u16 ( q12u16 ) ) ;
q14s32 = vmlal_s16 ( q14s32 , d24s16 , d24s16 ) ;
q15s32 = vmlal_s16 ( q15s32 , d25s16 , d25s16 ) ;
d0s16 = vreinterpret_s16_u16 ( vget_low_u16 ( q0u16 ) ) ;
d1s16 = vreinterpret_s16_u16 ( vget_high_u16 ( q0u16 ) ) ;
q13s32 = vpadalq_s16 ( q13s32 , vreinterpretq_s16_u16 ( q0u16 ) ) ;
q14s32 = vmlal_s16 ( q14s32 , d0s16 , d0s16 ) ;
q15s32 = vmlal_s16 ( q15s32 , d1s16 , d1s16 ) ;
d2s16 = vreinterpret_s16_u16 ( vget_low_u16 ( q1u16 ) ) ;
d3s16 = vreinterpret_s16_u16 ( vget_high_u16 ( q1u16 ) ) ;
q13s32 = vpadalq_s16 ( q13s32 , vreinterpretq_s16_u16 ( q1u16 ) ) ;
q14s32 = vmlal_s16 ( q14s32 , d2s16 , d2s16 ) ;
q15s32 = vmlal_s16 ( q15s32 , d3s16 , d3s16 ) ;
d10s16 = vreinterpret_s16_u16 ( vget_low_u16 ( q5u16 ) ) ;
d11s16 = vreinterpret_s16_u16 ( vget_high_u16 ( q5u16 ) ) ;
q13s32 = vpadalq_s16 ( q13s32 , vreinterpretq_s16_u16 ( q5u16 ) ) ;
q14s32 = vmlal_s16 ( q14s32 , d10s16 , d10s16 ) ;
q15s32 = vmlal_s16 ( q15s32 , d11s16 , d11s16 ) ;
d12s16 = vreinterpret_s16_u16 ( vget_low_u16 ( q6u16 ) ) ;
d13s16 = vreinterpret_s16_u16 ( vget_high_u16 ( q6u16 ) ) ;
q13s32 = vpadalq_s16 ( q13s32 , vreinterpretq_s16_u16 ( q6u16 ) ) ;
q14s32 = vmlal_s16 ( q14s32 , d12s16 , d12s16 ) ;
q15s32 = vmlal_s16 ( q15s32 , d13s16 , d13s16 ) ;
q0u8 = q4u8 ;
}
q15s32 = vaddq_s32 ( q14s32 , q15s32 ) ;
q0s64 = vpaddlq_s32 ( q13s32 ) ;
q1s64 = vpaddlq_s32 ( q15s32 ) ;
d0s64 = vget_low_s64 ( q0s64 ) ;
d1s64 = vget_high_s64 ( q0s64 ) ;
d2s64 = vget_low_s64 ( q1s64 ) ;
d3s64 = vget_high_s64 ( q1s64 ) ;
d0s64 = vadd_s64 ( d0s64 , d1s64 ) ;
d1s64 = vadd_s64 ( d2s64 , d3s64 ) ;
q5s64 = vmull_s32 ( vreinterpret_s32_s64 ( d0s64 ) , vreinterpret_s32_s64 ( d0s64 ) ) ;
vst1_lane_u32 ( ( uint32_t * ) sse , vreinterpret_u32_s64 ( d1s64 ) , 0 ) ;
d10u32 = vshr_n_u32 ( vreinterpret_u32_s64 ( vget_low_s64 ( q5s64 ) ) , 8 ) ;
d0u32 = vsub_u32 ( vreinterpret_u32_s64 ( d1s64 ) , d10u32 ) ;
return vget_lane_u32 ( d0u32 , 0 ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void prepare_avpic ( MimicContext * ctx , AVPicture * dst , AVFrame * src ) {
int i ;
dst -> data [ 0 ] = src -> data [ 0 ] + ( ctx -> avctx -> height - 1 ) * src -> linesize [ 0 ] ;
dst -> data [ 1 ] = src -> data [ 2 ] + ( ( ctx -> avctx -> height >> 1 ) - 1 ) * src -> linesize [ 2 ] ;
dst -> data [ 2 ] = src -> data [ 1 ] + ( ( ctx -> avctx -> height >> 1 ) - 1 ) * src -> linesize [ 1 ] ;
for ( i = 0 ;
i < 3 ;
i ++ ) dst -> linesize [ i ] = - src -> linesize [ i ] ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int x ( struct vcache * avc , int afun , struct vrequest * areq , \ struct afs_pdata * ain , struct afs_pdata * aout , \ afs_ucred_t * * acred ) DECL_PIOCTL ( PGetFID ) ;
DECL_PIOCTL ( PSetAcl ) ;
DECL_PIOCTL ( PStoreBehind ) ;
DECL_PIOCTL ( PGCPAGs ) ;
DECL_PIOCTL ( PGetAcl ) ;
DECL_PIOCTL ( PNoop ) ;
DECL_PIOCTL ( PBogus ) ;
DECL_PIOCTL ( PGetFileCell ) ;
DECL_PIOCTL ( PGetWSCell ) ;
DECL_PIOCTL ( PGetUserCell ) ;
DECL_PIOCTL ( PSetTokens ) ;
DECL_PIOCTL ( PGetVolumeStatus ) ;
DECL_PIOCTL ( PSetVolumeStatus ) ;
DECL_PIOCTL ( PFlush ) ;
DECL_PIOCTL ( PNewStatMount ) ;
DECL_PIOCTL ( PGetTokens ) ;
DECL_PIOCTL ( PUnlog ) ;
DECL_PIOCTL ( PMariner ) ;
DECL_PIOCTL ( PCheckServers ) ;
DECL_PIOCTL ( PCheckVolNames ) ;
DECL_PIOCTL ( PCheckAuth ) ;
DECL_PIOCTL ( PFindVolume ) ;
DECL_PIOCTL ( PViceAccess ) ;
DECL_PIOCTL ( PSetCacheSize ) ;
DECL_PIOCTL ( PGetCacheSize ) ;
DECL_PIOCTL ( PRemoveCallBack ) ;
DECL_PIOCTL ( PNewCell ) ;
DECL_PIOCTL ( PNewAlias ) ;
DECL_PIOCTL ( PListCells ) ;
DECL_PIOCTL ( PListAliases ) ;
DECL_PIOCTL ( PRemoveMount ) ;
DECL_PIOCTL ( PGetCellStatus ) ;
DECL_PIOCTL ( PSetCellStatus ) ;
DECL_PIOCTL ( PFlushVolumeData ) ;
DECL_PIOCTL ( PFlushAllVolumeData ) ;
DECL_PIOCTL ( PGetVnodeXStatus ) ;
DECL_PIOCTL ( PGetVnodeXStatus2 ) ;
DECL_PIOCTL ( PSetSysName ) ;
DECL_PIOCTL ( PSetSPrefs ) ;
DECL_PIOCTL ( PSetSPrefs33 ) ;
DECL_PIOCTL ( PGetSPrefs ) ;
DECL_PIOCTL ( PExportAfs ) ;
DECL_PIOCTL ( PGag ) ;
DECL_PIOCTL ( PTwiddleRx )
| 0False
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.