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 | TSMLoc TSMimeHdrFieldFind ( TSMBuffer bufp , TSMLoc hdr_obj , const char * name , int length ) {
sdk_assert ( sdk_sanity_check_mbuffer ( bufp ) == TS_SUCCESS ) ;
sdk_assert ( ( sdk_sanity_check_mime_hdr_handle ( hdr_obj ) == TS_SUCCESS ) || ( sdk_sanity_check_http_hdr_handle ( hdr_obj ) == TS_SUCCESS ) ) ;
sdk_assert ( sdk_sanity_check_null_ptr ( ( void * ) name ) == TS_SUCCESS ) ;
if ( length == - 1 ) {
length = strlen ( name ) ;
}
MIMEHdrImpl * mh = _hdr_mloc_to_mime_hdr_impl ( hdr_obj ) ;
MIMEField * f = mime_hdr_field_find ( mh , name , length ) ;
if ( f == nullptr ) {
return TS_NULL_MLOC ;
}
MIMEFieldSDKHandle * h = sdk_alloc_field_handle ( bufp , mh ) ;
h -> field_ptr = f ;
return reinterpret_cast < TSMLoc > ( h ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static int update_rom_mapping ( VAPICROMState * s , CPUX86State * env , target_ulong ip ) {
hwaddr paddr ;
uint32_t rom_state_vaddr ;
uint32_t pos , patch , offset ;
if ( s -> state == VAPIC_ACTIVE ) {
return 0 ;
}
if ( s -> state == VAPIC_INACTIVE ) {
return - 1 ;
}
rom_state_vaddr = s -> rom_state_paddr + ( ip & 0xf0000000 ) ;
paddr = cpu_get_phys_page_debug ( env , rom_state_vaddr ) ;
if ( paddr == - 1 ) {
return - 1 ;
}
paddr += rom_state_vaddr & ~ TARGET_PAGE_MASK ;
if ( paddr != s -> rom_state_paddr ) {
return - 1 ;
}
read_guest_rom_state ( s ) ;
if ( memcmp ( s -> rom_state . signature , "kvm aPiC" , 8 ) != 0 ) {
return - 1 ;
}
s -> rom_state_vaddr = rom_state_vaddr ;
if ( rom_state_vaddr == le32_to_cpu ( s -> rom_state . vaddr ) ) {
return 0 ;
}
for ( pos = le32_to_cpu ( s -> rom_state . fixup_start ) ;
pos < le32_to_cpu ( s -> rom_state . fixup_end ) ;
pos += 4 ) {
cpu_physical_memory_rw ( paddr + pos - s -> rom_state . vaddr , ( void * ) & offset , sizeof ( offset ) , 0 ) ;
offset = le32_to_cpu ( offset ) ;
cpu_physical_memory_rw ( paddr + offset , ( void * ) & patch , sizeof ( patch ) , 0 ) ;
patch = le32_to_cpu ( patch ) ;
patch += rom_state_vaddr - le32_to_cpu ( s -> rom_state . vaddr ) ;
patch = cpu_to_le32 ( patch ) ;
cpu_physical_memory_rw ( paddr + offset , ( void * ) & patch , sizeof ( patch ) , 1 ) ;
}
read_guest_rom_state ( s ) ;
s -> vapic_paddr = paddr + le32_to_cpu ( s -> rom_state . vapic_vaddr ) - le32_to_cpu ( s -> rom_state . vaddr ) ;
return 0 ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static int get_dimension ( GetBitContext * gb , const int * dim ) {
int t = get_bits ( gb , 3 ) ;
int val = dim [ t ] ;
if ( val < 0 ) val = dim [ get_bits1 ( gb ) - val ] ;
if ( ! val ) {
do {
t = get_bits ( gb , 8 ) ;
val += t << 2 ;
}
while ( t == 0xFF ) ;
}
return val ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | TEST_F ( ExternalProtocolHandlerTest , TestGetBlockStateDefaultDontBlock ) {
ExternalProtocolHandler : : BlockState block_state = ExternalProtocolHandler : : GetBlockState ( "mailto" , profile_ . get ( ) ) ;
EXPECT_EQ ( ExternalProtocolHandler : : DONT_BLOCK , block_state ) ;
EXPECT_TRUE ( local_state_ -> GetDictionary ( prefs : : kExcludedSchemes ) -> empty ( ) ) ;
EXPECT_TRUE ( profile_ -> GetPrefs ( ) -> GetDictionary ( prefs : : kExcludedSchemes ) -> empty ( ) ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void send_ifstats_entry ( endpt * la , u_int ifnum ) {
const char addr_fmtu [ ] = "addr.%u" ;
const char bcast_fmt [ ] = "bcast.%u" ;
const char en_fmt [ ] = "en.%u" ;
const char name_fmt [ ] = "name.%u" ;
const char flags_fmt [ ] = "flags.%u" ;
const char tl_fmt [ ] = "tl.%u" ;
const char mc_fmt [ ] = "mc.%u" ;
const char rx_fmt [ ] = "rx.%u" ;
const char tx_fmt [ ] = "tx.%u" ;
const char txerr_fmt [ ] = "txerr.%u" ;
const char pc_fmt [ ] = "pc.%u" ;
const char up_fmt [ ] = "up.%u" ;
char tag [ 32 ] ;
u_char sent [ IFSTATS_FIELDS ] ;
int noisebits ;
u_int32 noise ;
u_int which ;
u_int remaining ;
const char * pch ;
remaining = COUNTOF ( sent ) ;
ZERO ( sent ) ;
noise = 0 ;
noisebits = 0 ;
while ( remaining > 0 ) {
if ( noisebits < 4 ) {
noise = rand ( ) ^ ( rand ( ) << 16 ) ;
noisebits = 31 ;
}
which = ( noise & 0xf ) % COUNTOF ( sent ) ;
noise >>= 4 ;
noisebits -= 4 ;
while ( sent [ which ] ) which = ( which + 1 ) % COUNTOF ( sent ) ;
switch ( which ) {
case 0 : snprintf ( tag , sizeof ( tag ) , addr_fmtu , ifnum ) ;
pch = sptoa ( & la -> sin ) ;
ctl_putunqstr ( tag , pch , strlen ( pch ) ) ;
break ;
case 1 : snprintf ( tag , sizeof ( tag ) , bcast_fmt , ifnum ) ;
if ( INT_BCASTOPEN & la -> flags ) pch = sptoa ( & la -> bcast ) ;
else pch = "" ;
ctl_putunqstr ( tag , pch , strlen ( pch ) ) ;
break ;
case 2 : snprintf ( tag , sizeof ( tag ) , en_fmt , ifnum ) ;
ctl_putint ( tag , ! la -> ignore_packets ) ;
break ;
case 3 : snprintf ( tag , sizeof ( tag ) , name_fmt , ifnum ) ;
ctl_putstr ( tag , la -> name , strlen ( la -> name ) ) ;
break ;
case 4 : snprintf ( tag , sizeof ( tag ) , flags_fmt , ifnum ) ;
ctl_puthex ( tag , ( u_int ) la -> flags ) ;
break ;
case 5 : snprintf ( tag , sizeof ( tag ) , tl_fmt , ifnum ) ;
ctl_putint ( tag , la -> last_ttl ) ;
break ;
case 6 : snprintf ( tag , sizeof ( tag ) , mc_fmt , ifnum ) ;
ctl_putint ( tag , la -> num_mcast ) ;
break ;
case 7 : snprintf ( tag , sizeof ( tag ) , rx_fmt , ifnum ) ;
ctl_putint ( tag , la -> received ) ;
break ;
case 8 : snprintf ( tag , sizeof ( tag ) , tx_fmt , ifnum ) ;
ctl_putint ( tag , la -> sent ) ;
break ;
case 9 : snprintf ( tag , sizeof ( tag ) , txerr_fmt , ifnum ) ;
ctl_putint ( tag , la -> notsent ) ;
break ;
case 10 : snprintf ( tag , sizeof ( tag ) , pc_fmt , ifnum ) ;
ctl_putuint ( tag , la -> peercnt ) ;
break ;
case 11 : snprintf ( tag , sizeof ( tag ) , up_fmt , ifnum ) ;
ctl_putuint ( tag , current_time - la -> starttime ) ;
break ;
}
sent [ which ] = TRUE ;
remaining -- ;
}
send_random_tag_value ( ( int ) ifnum ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void set_state_ivars ( VALUE hash , VALUE state ) {
VALUE ivars = rb_obj_instance_variables ( state ) ;
int i = 0 ;
for ( i = 0 ;
i < RARRAY_LEN ( ivars ) ;
i ++ ) {
VALUE key = rb_funcall ( rb_ary_entry ( ivars , i ) , i_to_s , 0 ) ;
long key_len = RSTRING_LEN ( key ) ;
VALUE value = rb_iv_get ( state , StringValueCStr ( key ) ) ;
rb_hash_aset ( hash , rb_str_intern ( rb_str_substr ( key , 1 , key_len - 1 ) ) , value ) ;
}
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static ossl_inline STACK_OF ( t1 ) * sk_ ## t1 ## _new_reserve ( sk_ ## t1 ## _compfunc compare , int n ) {
return ( STACK_OF ( t1 ) * ) OPENSSL_sk_new_reserve ( ( OPENSSL_sk_compfunc ) compare , n ) ;
}
static ossl_inline int sk_ ## t1 ## _reserve ( STACK_OF ( t1 ) * sk , int n ) {
return OPENSSL_sk_reserve ( ( OPENSSL_STACK * ) sk , n ) ;
}
static ossl_inline void sk_ ## t1 ## _free ( STACK_OF ( t1 ) * sk ) {
OPENSSL_sk_free ( ( OPENSSL_STACK * ) sk ) ;
}
static ossl_inline void sk_ ## t1 ## _zero ( STACK_OF ( t1 ) * sk ) {
OPENSSL_sk_zero ( ( OPENSSL_STACK * ) sk ) ;
}
static ossl_inline t2 * sk_ ## t1 ## _delete ( STACK_OF ( t1 ) * sk , int i ) {
return ( t2 * ) OPENSSL_sk_delete ( ( OPENSSL_STACK * ) sk , i ) ;
}
static ossl_inline t2 * sk_ ## t1 ## _delete_ptr ( STACK_OF ( t1 ) * sk , t2 * ptr ) {
return ( t2 * ) OPENSSL_sk_delete_ptr ( ( OPENSSL_STACK * ) sk , ( const void * ) ptr ) ;
}
static ossl_inline int sk_ ## t1 ## _push ( STACK_OF ( t1 ) * sk , t2 * ptr ) {
return OPENSSL_sk_push ( ( OPENSSL_STACK * ) sk , ( const void * ) ptr ) ;
}
static ossl_inline int sk_ ## t1 ## _unshift ( STACK_OF ( t1 ) * sk , t2 * ptr ) {
return OPENSSL_sk_unshift ( ( OPENSSL_STACK * ) sk , ( const void * ) ptr ) ;
}
static ossl_inline t2 * sk_ ## t1 ## _pop ( STACK_OF ( t1 ) * sk ) {
return ( t2 * ) OPENSSL_sk_pop ( ( OPENSSL_STACK * ) sk ) ;
}
static ossl_inline t2 * sk_ ## t1 ## _shift ( STACK_OF ( t1 ) * sk ) {
return ( t2 * ) OPENSSL_sk_shift ( ( OPENSSL_STACK * ) sk ) ;
}
static ossl_inline void sk_ ## t1 ## _pop_free ( STACK_OF ( t1 ) * sk , sk_ ## t1 ## _freefunc freefunc ) {
OPENSSL_sk_pop_free ( ( OPENSSL_STACK * ) sk , ( OPENSSL_sk_freefunc ) freefunc ) ;
}
static ossl_inline int sk_ ## t1 ## _insert ( STACK_OF ( t1 ) * sk , t2 * ptr , int idx ) {
return OPENSSL_sk_insert ( ( OPENSSL_STACK * ) sk , ( const void * ) ptr , idx ) ;
}
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 ) DEFINE_SPECIAL_STACK_OF_CONST ( OPENSSL_CSTRING , char ) typedef void * OPENSSL_BLOCK ;
DEFINE_SPECIAL_STACK_OF ( OPENSSL_BLOCK , void ) | 1True
|
Categorize the following code snippet as vulnerable or not. True or False | PHP_MINIT_FUNCTION ( spl_directory ) {
REGISTER_SPL_STD_CLASS_EX ( SplFileInfo , spl_filesystem_object_new , spl_SplFileInfo_functions ) ;
memcpy ( & spl_filesystem_object_handlers , zend_get_std_object_handlers ( ) , sizeof ( zend_object_handlers ) ) ;
spl_filesystem_object_handlers . clone_obj = spl_filesystem_object_clone ;
spl_filesystem_object_handlers . cast_object = spl_filesystem_object_cast ;
spl_filesystem_object_handlers . get_debug_info = spl_filesystem_object_get_debug_info ;
spl_ce_SplFileInfo -> serialize = zend_class_serialize_deny ;
spl_ce_SplFileInfo -> unserialize = zend_class_unserialize_deny ;
REGISTER_SPL_SUB_CLASS_EX ( DirectoryIterator , SplFileInfo , spl_filesystem_object_new , spl_DirectoryIterator_functions ) ;
zend_class_implements ( spl_ce_DirectoryIterator TSRMLS_CC , 1 , zend_ce_iterator ) ;
REGISTER_SPL_IMPLEMENTS ( DirectoryIterator , SeekableIterator ) ;
spl_ce_DirectoryIterator -> get_iterator = spl_filesystem_dir_get_iterator ;
REGISTER_SPL_SUB_CLASS_EX ( FilesystemIterator , DirectoryIterator , spl_filesystem_object_new , spl_FilesystemIterator_functions ) ;
REGISTER_SPL_CLASS_CONST_LONG ( FilesystemIterator , "CURRENT_MODE_MASK" , SPL_FILE_DIR_CURRENT_MODE_MASK ) ;
REGISTER_SPL_CLASS_CONST_LONG ( FilesystemIterator , "CURRENT_AS_PATHNAME" , SPL_FILE_DIR_CURRENT_AS_PATHNAME ) ;
REGISTER_SPL_CLASS_CONST_LONG ( FilesystemIterator , "CURRENT_AS_FILEINFO" , SPL_FILE_DIR_CURRENT_AS_FILEINFO ) ;
REGISTER_SPL_CLASS_CONST_LONG ( FilesystemIterator , "CURRENT_AS_SELF" , SPL_FILE_DIR_CURRENT_AS_SELF ) ;
REGISTER_SPL_CLASS_CONST_LONG ( FilesystemIterator , "KEY_MODE_MASK" , SPL_FILE_DIR_KEY_MODE_MASK ) ;
REGISTER_SPL_CLASS_CONST_LONG ( FilesystemIterator , "KEY_AS_PATHNAME" , SPL_FILE_DIR_KEY_AS_PATHNAME ) ;
REGISTER_SPL_CLASS_CONST_LONG ( FilesystemIterator , "FOLLOW_SYMLINKS" , SPL_FILE_DIR_FOLLOW_SYMLINKS ) ;
REGISTER_SPL_CLASS_CONST_LONG ( FilesystemIterator , "KEY_AS_FILENAME" , SPL_FILE_DIR_KEY_AS_FILENAME ) ;
REGISTER_SPL_CLASS_CONST_LONG ( FilesystemIterator , "NEW_CURRENT_AND_KEY" , SPL_FILE_DIR_KEY_AS_FILENAME | SPL_FILE_DIR_CURRENT_AS_FILEINFO ) ;
REGISTER_SPL_CLASS_CONST_LONG ( FilesystemIterator , "OTHER_MODE_MASK" , SPL_FILE_DIR_OTHERS_MASK ) ;
REGISTER_SPL_CLASS_CONST_LONG ( FilesystemIterator , "SKIP_DOTS" , SPL_FILE_DIR_SKIPDOTS ) ;
REGISTER_SPL_CLASS_CONST_LONG ( FilesystemIterator , "UNIX_PATHS" , SPL_FILE_DIR_UNIXPATHS ) ;
spl_ce_FilesystemIterator -> get_iterator = spl_filesystem_tree_get_iterator ;
REGISTER_SPL_SUB_CLASS_EX ( RecursiveDirectoryIterator , FilesystemIterator , spl_filesystem_object_new , spl_RecursiveDirectoryIterator_functions ) ;
REGISTER_SPL_IMPLEMENTS ( RecursiveDirectoryIterator , RecursiveIterator ) ;
memcpy ( & spl_filesystem_object_check_handlers , & spl_filesystem_object_handlers , sizeof ( zend_object_handlers ) ) ;
spl_filesystem_object_check_handlers . get_method = spl_filesystem_object_get_method_check ;
# ifdef HAVE_GLOB REGISTER_SPL_SUB_CLASS_EX ( GlobIterator , FilesystemIterator , spl_filesystem_object_new_check , spl_GlobIterator_functions ) ;
REGISTER_SPL_IMPLEMENTS ( GlobIterator , Countable ) ;
# endif REGISTER_SPL_SUB_CLASS_EX ( SplFileObject , SplFileInfo , spl_filesystem_object_new_check , spl_SplFileObject_functions ) ;
REGISTER_SPL_IMPLEMENTS ( SplFileObject , RecursiveIterator ) ;
REGISTER_SPL_IMPLEMENTS ( SplFileObject , SeekableIterator ) ;
REGISTER_SPL_CLASS_CONST_LONG ( SplFileObject , "DROP_NEW_LINE" , SPL_FILE_OBJECT_DROP_NEW_LINE ) ;
REGISTER_SPL_CLASS_CONST_LONG ( SplFileObject , "READ_AHEAD" , SPL_FILE_OBJECT_READ_AHEAD ) ;
REGISTER_SPL_CLASS_CONST_LONG ( SplFileObject , "SKIP_EMPTY" , SPL_FILE_OBJECT_SKIP_EMPTY ) ;
REGISTER_SPL_CLASS_CONST_LONG ( SplFileObject , "READ_CSV" , SPL_FILE_OBJECT_READ_CSV ) ;
REGISTER_SPL_SUB_CLASS_EX ( SplTempFileObject , SplFileObject , spl_filesystem_object_new_check , spl_SplTempFileObject_functions ) ;
return SUCCESS ;
} | 1True
|
Categorize the following code snippet as vulnerable or not. True or False | void proto_cleanup ( void ) {
if ( gpa_name_map ) {
g_hash_table_destroy ( gpa_name_map ) ;
gpa_name_map = NULL ;
}
g_free ( last_field_name ) ;
last_field_name = NULL ;
while ( protocols ) {
protocol_t * protocol = ( protocol_t * ) protocols -> data ;
header_field_info * hfinfo ;
PROTO_REGISTRAR_GET_NTH ( protocol -> proto_id , hfinfo ) ;
DISSECTOR_ASSERT ( protocol -> proto_id == hfinfo -> id ) ;
g_slice_free ( header_field_info , hfinfo ) ;
g_ptr_array_free ( protocol -> fields , TRUE ) ;
g_list_free ( protocol -> heur_list ) ;
protocols = g_list_remove ( protocols , protocol ) ;
g_free ( protocol ) ;
}
if ( proto_names ) {
g_hash_table_destroy ( proto_names ) ;
proto_names = NULL ;
}
if ( proto_short_names ) {
g_hash_table_destroy ( proto_short_names ) ;
proto_short_names = NULL ;
}
if ( proto_filter_names ) {
g_hash_table_destroy ( proto_filter_names ) ;
proto_filter_names = NULL ;
}
if ( gpa_hfinfo . allocated_len ) {
gpa_hfinfo . len = 0 ;
gpa_hfinfo . allocated_len = 0 ;
g_free ( gpa_hfinfo . hfi ) ;
gpa_hfinfo . hfi = NULL ;
}
if ( deregistered_fields ) {
g_ptr_array_free ( deregistered_fields , FALSE ) ;
deregistered_fields = NULL ;
}
if ( deregistered_data ) {
g_ptr_array_free ( deregistered_data , FALSE ) ;
deregistered_data = NULL ;
}
g_free ( tree_is_expanded ) ;
tree_is_expanded = NULL ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | bool CreateReplicationSlot ( PGconn * conn , const char * slot_name , const char * plugin , bool is_physical , bool slot_exists_ok ) {
PQExpBuffer query ;
PGresult * res ;
query = createPQExpBuffer ( ) ;
Assert ( ( is_physical && plugin == NULL ) || ( ! is_physical && plugin != NULL ) ) ;
Assert ( slot_name != NULL ) ;
if ( is_physical ) appendPQExpBuffer ( query , "CREATE_REPLICATION_SLOT \"%s\" PHYSICAL" , slot_name ) ;
else appendPQExpBuffer ( query , "CREATE_REPLICATION_SLOT \"%s\" LOGICAL \"%s\"" , slot_name , plugin ) ;
res = PQexec ( conn , query -> data ) ;
if ( PQresultStatus ( res ) != PGRES_TUPLES_OK ) {
const char * sqlstate = PQresultErrorField ( res , PG_DIAG_SQLSTATE ) ;
if ( slot_exists_ok && sqlstate && strcmp ( sqlstate , ERRCODE_DUPLICATE_OBJECT ) == 0 ) {
destroyPQExpBuffer ( query ) ;
PQclear ( res ) ;
return true ;
}
else {
fprintf ( stderr , _ ( "%s: could not send replication command \"%s\": %s" ) , progname , query -> data , PQerrorMessage ( conn ) ) ;
destroyPQExpBuffer ( query ) ;
PQclear ( res ) ;
return false ;
}
}
if ( PQntuples ( res ) != 1 || PQnfields ( res ) != 4 ) {
fprintf ( stderr , _ ( "%s: could not create replication slot \"%s\": got %d rows and %d fields, expected %d rows and %d fields\n" ) , progname , slot_name , PQntuples ( res ) , PQnfields ( res ) , 1 , 4 ) ;
destroyPQExpBuffer ( query ) ;
PQclear ( res ) ;
return false ;
}
destroyPQExpBuffer ( query ) ;
PQclear ( res ) ;
return true ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void proto_tree_set_bytes ( field_info * fi , const guint8 * start_ptr , gint length ) {
GByteArray * bytes ;
DISSECTOR_ASSERT ( start_ptr != NULL || length == 0 ) ;
bytes = g_byte_array_new ( ) ;
if ( length > 0 ) {
g_byte_array_append ( bytes , start_ptr , length ) ;
}
fvalue_set_byte_array ( & fi -> value , bytes ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | fz_rect * pdf_xobject_bbox ( fz_context * ctx , pdf_xobject * xobj , fz_rect * bbox ) {
return pdf_to_rect ( ctx , pdf_dict_get ( ctx , xobj -> obj , PDF_NAME_BBox ) , bbox ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | void mime_hdr_presence_unset ( MIMEHdrImpl * h , int well_known_str_index ) {
const char * wks = hdrtoken_index_to_wks ( well_known_str_index ) ;
mime_hdr_presence_unset ( h , wks ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | IN_PROC_BROWSER_TEST_F ( DownloadNotificationTest , InterruptDownload ) {
CreateDownload ( ) ;
InterruptTheDownload ( ) ;
EXPECT_EQ ( 1u , GetDownloadNotifications ( ) . size ( ) ) ;
ASSERT_TRUE ( notification ( ) ) ;
EXPECT_EQ ( l10n_util : : GetStringFUTF16 ( IDS_DOWNLOAD_STATUS_DOWNLOAD_FAILED_TITLE , download_item ( ) -> GetFileNameToReportUser ( ) . LossyDisplayName ( ) ) , notification ( ) -> title ( ) ) ;
EXPECT_NE ( notification ( ) -> message ( ) . find ( l10n_util : : GetStringFUTF16 ( IDS_DOWNLOAD_STATUS_INTERRUPTED , l10n_util : : GetStringUTF16 ( IDS_DOWNLOAD_INTERRUPTED_DESCRIPTION_NETWORK_ERROR ) ) ) , std : : string : : npos ) ;
EXPECT_EQ ( message_center : : NOTIFICATION_TYPE_BASE_FORMAT , notification ( ) -> type ( ) ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | bool cpu_is_stopped ( CPUState * cpu ) {
return ! runstate_is_running ( ) || cpu -> stopped ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static struct async * async_getcompleted ( struct usb_dev_state * ps ) {
unsigned long flags ;
struct async * as = NULL ;
spin_lock_irqsave ( & ps -> lock , flags ) ;
if ( ! list_empty ( & ps -> async_completed ) ) {
as = list_entry ( ps -> async_completed . next , struct async , asynclist ) ;
list_del_init ( & as -> asynclist ) ;
}
spin_unlock_irqrestore ( & ps -> lock , flags ) ;
return as ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | void vp9_idct8x8_1_add_sse2 ( const int16_t * input , uint8_t * dest , int stride ) {
__m128i dc_value ;
const __m128i zero = _mm_setzero_si128 ( ) ;
int a ;
a = dct_const_round_shift ( input [ 0 ] * cospi_16_64 ) ;
a = dct_const_round_shift ( a * cospi_16_64 ) ;
a = ROUND_POWER_OF_TWO ( a , 5 ) ;
dc_value = _mm_set1_epi16 ( a ) ;
RECON_AND_STORE ( dest , dc_value ) ;
RECON_AND_STORE ( dest , dc_value ) ;
RECON_AND_STORE ( dest , dc_value ) ;
RECON_AND_STORE ( dest , dc_value ) ;
RECON_AND_STORE ( dest , dc_value ) ;
RECON_AND_STORE ( dest , dc_value ) ;
RECON_AND_STORE ( dest , dc_value ) ;
RECON_AND_STORE ( dest , dc_value ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void test_bug1664 ( ) {
MYSQL_STMT * stmt ;
int rc , int_data ;
const char * data ;
const char * str_data = "Simple string" ;
MYSQL_BIND my_bind [ 2 ] ;
const char * query = "INSERT INTO test_long_data(col2, col1) VALUES(?, ?)" ;
myheader ( "test_bug1664" ) ;
rc = mysql_query ( mysql , "DROP TABLE IF EXISTS test_long_data" ) ;
myquery ( rc ) ;
rc = mysql_query ( mysql , "CREATE TABLE test_long_data(col1 int, col2 long varchar)" ) ;
myquery ( rc ) ;
stmt = mysql_stmt_init ( mysql ) ;
check_stmt ( stmt ) ;
rc = mysql_stmt_prepare ( stmt , query , strlen ( query ) ) ;
check_execute ( stmt , rc ) ;
verify_param_count ( stmt , 2 ) ;
memset ( my_bind , 0 , sizeof ( my_bind ) ) ;
my_bind [ 0 ] . buffer_type = MYSQL_TYPE_STRING ;
my_bind [ 0 ] . buffer = ( void * ) str_data ;
my_bind [ 0 ] . buffer_length = strlen ( str_data ) ;
my_bind [ 1 ] . buffer = ( void * ) & int_data ;
my_bind [ 1 ] . buffer_type = MYSQL_TYPE_LONG ;
rc = mysql_stmt_bind_param ( stmt , my_bind ) ;
check_execute ( stmt , rc ) ;
int_data = 1 ;
data = "" ;
rc = mysql_stmt_send_long_data ( stmt , 0 , data , strlen ( data ) ) ;
check_execute ( stmt , rc ) ;
rc = mysql_stmt_execute ( stmt ) ;
check_execute ( stmt , rc ) ;
verify_col_data ( "test_long_data" , "col1" , "1" ) ;
verify_col_data ( "test_long_data" , "col2" , "" ) ;
rc = mysql_query ( mysql , "DELETE FROM test_long_data" ) ;
myquery ( rc ) ;
data = ( char * ) "Data" ;
rc = mysql_stmt_send_long_data ( stmt , 0 , data , strlen ( data ) ) ;
check_execute ( stmt , rc ) ;
rc = mysql_stmt_execute ( stmt ) ;
check_execute ( stmt , rc ) ;
verify_col_data ( "test_long_data" , "col1" , "1" ) ;
verify_col_data ( "test_long_data" , "col2" , "Data" ) ;
rc = mysql_query ( mysql , "DELETE FROM test_long_data" ) ;
myquery ( rc ) ;
int_data = 2 ;
rc = mysql_stmt_execute ( stmt ) ;
check_execute ( stmt , rc ) ;
verify_col_data ( "test_long_data" , "col1" , "2" ) ;
verify_col_data ( "test_long_data" , "col2" , str_data ) ;
rc = mysql_query ( mysql , "DELETE FROM test_long_data" ) ;
myquery ( rc ) ;
data = ( char * ) "SomeOtherData" ;
rc = mysql_stmt_send_long_data ( stmt , 0 , data , strlen ( data ) ) ;
check_execute ( stmt , rc ) ;
rc = mysql_stmt_execute ( stmt ) ;
check_execute ( stmt , rc ) ;
verify_col_data ( "test_long_data" , "col1" , "2" ) ;
verify_col_data ( "test_long_data" , "col2" , "SomeOtherData" ) ;
mysql_stmt_close ( stmt ) ;
rc = mysql_query ( mysql , "DELETE FROM test_long_data" ) ;
myquery ( rc ) ;
stmt = mysql_stmt_init ( mysql ) ;
check_stmt ( stmt ) ;
rc = mysql_stmt_prepare ( stmt , query , strlen ( query ) ) ;
check_execute ( stmt , rc ) ;
rc = mysql_stmt_bind_param ( stmt , my_bind ) ;
check_execute ( stmt , rc ) ;
data = ( char * ) "SomeData" ;
rc = mysql_stmt_send_long_data ( stmt , 0 , data , strlen ( data ) ) ;
check_execute ( stmt , rc ) ;
rc = mysql_stmt_reset ( stmt ) ;
check_execute ( stmt , rc ) ;
rc = mysql_stmt_execute ( stmt ) ;
check_execute ( stmt , rc ) ;
verify_col_data ( "test_long_data" , "col1" , "2" ) ;
verify_col_data ( "test_long_data" , "col2" , str_data ) ;
mysql_stmt_close ( stmt ) ;
rc = mysql_query ( mysql , "DROP TABLE test_long_data" ) ;
myquery ( rc ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static int pfkey_xfrm_policy2msg_size ( const struct xfrm_policy * xp ) {
const struct xfrm_tmpl * t ;
int sockaddr_size = pfkey_sockaddr_size ( xp -> family ) ;
int socklen = 0 ;
int i ;
for ( i = 0 ;
i < xp -> xfrm_nr ;
i ++ ) {
t = xp -> xfrm_vec + i ;
socklen += pfkey_sockaddr_len ( t -> encap_family ) ;
}
return sizeof ( struct sadb_msg ) + ( sizeof ( struct sadb_lifetime ) * 3 ) + ( sizeof ( struct sadb_address ) * 2 ) + ( sockaddr_size * 2 ) + sizeof ( struct sadb_x_policy ) + ( xp -> xfrm_nr * sizeof ( struct sadb_x_ipsecrequest ) ) + ( socklen * 2 ) + pfkey_xfrm_policy2sec_ctx_size ( xp ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | 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 | static void get_system_identitier ( char * system_id , size_t size ) {
# if defined ( HAVE_SYS_UTSNAME_H ) struct utsname u ;
uname ( & u ) ;
strncpy ( system_id , u . sysname , size - 1 ) ;
system_id [ size - 1 ] = '\0' ;
# elif defined ( _WIN32 ) && ! defined ( __CYGWIN__ ) strncpy ( system_id , "Windows" , size - 1 ) ;
system_id [ size - 1 ] = '\0' ;
# else # error no way to get the system identifier on your platform . # endif } | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void prplcb_conn_report_disconnect_reason ( PurpleConnection * gc , PurpleConnectionError reason , const char * text ) {
struct im_connection * ic = purple_ic_by_gc ( gc ) ;
if ( ic != NULL ) {
imcb_error ( ic , "%s" , text ) ;
}
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | TEST_F ( SSLErrorAssistantTest , DynamicInterstitialListMatchUnknownCertError ) {
ASSERT_TRUE ( embedded_test_server ( ) -> Start ( ) ) ;
EXPECT_EQ ( 1u , ssl_info ( ) . public_key_hashes . size ( ) ) ;
auto config_proto = std : : make_unique < chrome_browser_ssl : : SSLErrorAssistantConfig > ( ) ;
config_proto -> set_version_id ( kLargeVersionId ) ;
chrome_browser_ssl : : DynamicInterstitial * filter = config_proto -> add_dynamic_interstitial ( ) ;
filter -> set_interstitial_type ( chrome_browser_ssl : : DynamicInterstitial : : INTERSTITIAL_PAGE_CAPTIVE_PORTAL ) ;
filter -> set_cert_error ( chrome_browser_ssl : : DynamicInterstitial : : UNKNOWN_CERT_ERROR ) ;
filter -> add_sha256_hash ( "sha256ightjar" ) ;
filter -> add_sha256_hash ( "sha256/frogmouth" ) ;
filter -> add_sha256_hash ( "sha256/poorwill" ) ;
filter = config_proto -> add_dynamic_interstitial ( ) ;
filter -> set_interstitial_type ( chrome_browser_ssl : : DynamicInterstitial : : INTERSTITIAL_PAGE_SSL ) ;
filter -> set_cert_error ( chrome_browser_ssl : : DynamicInterstitial : : UNKNOWN_CERT_ERROR ) ;
filter -> add_sha256_hash ( "sha256uthatch" ) ;
filter -> add_sha256_hash ( ssl_info ( ) . public_key_hashes [ 0 ] . ToString ( ) ) ;
filter -> add_sha256_hash ( "sha256/treecreeper" ) ;
filter -> set_issuer_common_name_regex ( issuer_common_name ( ) ) ;
filter -> set_issuer_organization_regex ( issuer_organization_name ( ) ) ;
filter -> set_mitm_software_name ( "UwS" ) ;
error_assistant ( ) -> SetErrorAssistantProto ( std : : move ( config_proto ) ) ;
base : : Optional < DynamicInterstitialInfo > dynamic_interstitial = error_assistant ( ) -> MatchDynamicInterstitial ( ssl_info ( ) ) ;
EXPECT_TRUE ( dynamic_interstitial ) ;
EXPECT_EQ ( chrome_browser_ssl : : DynamicInterstitial : : INTERSTITIAL_PAGE_SSL , dynamic_interstitial -> interstitial_type ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | int qemuAgentSuspend ( qemuAgentPtr mon , unsigned int target ) {
int ret = - 1 ;
virJSONValuePtr cmd ;
virJSONValuePtr reply = NULL ;
cmd = qemuAgentMakeCommand ( qemuAgentSuspendModeTypeToString ( target ) , NULL ) ;
if ( ! cmd ) return - 1 ;
mon -> await_event = QEMU_AGENT_EVENT_SUSPEND ;
ret = qemuAgentCommand ( mon , cmd , & reply , false , VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK ) ;
virJSONValueFree ( cmd ) ;
virJSONValueFree ( reply ) ;
return ret ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static gint dissect_rtp ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * data _U_ ) {
proto_item * ti = NULL ;
proto_tree * volatile rtp_tree = NULL ;
proto_tree * rtp_csrc_tree = NULL ;
proto_tree * rtp_hext_tree = NULL ;
guint8 octet1 , octet2 ;
unsigned int version ;
gboolean padding_set ;
gboolean extension_set ;
unsigned int csrc_count ;
gboolean marker_set ;
unsigned int payload_type ;
gchar * payload_type_str = NULL ;
gboolean is_srtp = FALSE ;
unsigned int i = 0 ;
unsigned int hdr_extension_len = 0 ;
unsigned int hdr_extension_id = 0 ;
volatile unsigned int padding_count ;
gint length , reported_length ;
int data_len ;
volatile unsigned int offset = 0 ;
guint16 seq_num ;
guint32 timestamp ;
guint32 sync_src ;
guint32 csrc_item ;
struct _rtp_conversation_info * p_conv_data = NULL ;
unsigned int hdrext_offset = 0 ;
tvbuff_t * newtvb = NULL ;
const char * pt = NULL ;
static struct _rtp_info rtp_info_arr [ 4 ] ;
static int rtp_info_current = 0 ;
struct _rtp_info * rtp_info ;
rtp_info_current ++ ;
if ( rtp_info_current == 4 ) {
rtp_info_current = 0 ;
}
rtp_info = & rtp_info_arr [ rtp_info_current ] ;
octet1 = tvb_get_guint8 ( tvb , offset ) ;
version = RTP_VERSION ( octet1 ) ;
if ( version == 0 ) {
switch ( global_rtp_version0_type ) {
case RTP0_STUN : call_dissector ( stun_handle , tvb , pinfo , tree ) ;
return tvb_length ( tvb ) ;
case RTP0_CLASSICSTUN : call_dissector ( classicstun_handle , tvb , pinfo , tree ) ;
return tvb_length ( tvb ) ;
case RTP0_T38 : call_dissector ( t38_handle , tvb , pinfo , tree ) ;
return tvb_length ( tvb ) ;
case RTP0_SPRT : call_dissector ( sprt_handle , tvb , pinfo , tree ) ;
return tvb_length ( tvb ) ;
case RTP0_INVALID : if ( ! ( tvb_memeql ( tvb , 4 , "ZRTP" , 4 ) ) ) {
call_dissector ( zrtp_handle , tvb , pinfo , tree ) ;
return tvb_length ( tvb ) ;
}
default : ;
}
}
rtp_info -> info_version = version ;
if ( version != 2 ) {
col_set_str ( pinfo -> cinfo , COL_PROTOCOL , "RTP" ) ;
col_add_fstr ( pinfo -> cinfo , COL_INFO , "Unknown RTP version %u" , version ) ;
if ( tree ) {
ti = proto_tree_add_item ( tree , proto_rtp , tvb , offset , - 1 , ENC_NA ) ;
rtp_tree = proto_item_add_subtree ( ti , ett_rtp ) ;
proto_tree_add_uint ( rtp_tree , hf_rtp_version , tvb , offset , 1 , octet1 ) ;
}
return offset ;
}
padding_set = RTP_PADDING ( octet1 ) ;
extension_set = RTP_EXTENSION ( octet1 ) ;
csrc_count = RTP_CSRC_COUNT ( octet1 ) ;
octet2 = tvb_get_guint8 ( tvb , offset + 1 ) ;
marker_set = RTP_MARKER ( octet2 ) ;
payload_type = RTP_PAYLOAD_TYPE ( octet2 ) ;
if ( marker_set && payload_type >= FIRST_RTCP_CONFLICT_PAYLOAD_TYPE && payload_type <= LAST_RTCP_CONFLICT_PAYLOAD_TYPE ) {
call_dissector ( rtcp_handle , tvb , pinfo , tree ) ;
return tvb_length ( tvb ) ;
}
seq_num = tvb_get_ntohs ( tvb , offset + 2 ) ;
timestamp = tvb_get_ntohl ( tvb , offset + 4 ) ;
sync_src = tvb_get_ntohl ( tvb , offset + 8 ) ;
rtp_info -> info_padding_set = padding_set ;
rtp_info -> info_padding_count = 0 ;
rtp_info -> info_marker_set = marker_set ;
rtp_info -> info_is_video = FALSE ;
rtp_info -> info_payload_type = payload_type ;
rtp_info -> info_seq_num = seq_num ;
rtp_info -> info_timestamp = timestamp ;
rtp_info -> info_sync_src = sync_src ;
rtp_info -> info_is_srtp = FALSE ;
rtp_info -> info_setup_frame_num = 0 ;
rtp_info -> info_payload_type_str = NULL ;
rtp_info -> info_payload_rate = 0 ;
length = tvb_length_remaining ( tvb , offset ) ;
reported_length = tvb_reported_length_remaining ( tvb , offset ) ;
if ( reported_length >= 0 && length >= reported_length ) {
rtp_info -> info_all_data_present = TRUE ;
rtp_info -> info_data_len = reported_length ;
rtp_info -> info_data = tvb_get_ptr ( tvb , 0 , - 1 ) ;
}
else {
rtp_info -> info_all_data_present = FALSE ;
rtp_info -> info_data_len = 0 ;
rtp_info -> info_data = NULL ;
}
get_conv_info ( pinfo , rtp_info ) ;
p_conv_data = ( struct _rtp_conversation_info * ) p_get_proto_data ( wmem_file_scope ( ) , pinfo , proto_rtp , 0 ) ;
if ( p_conv_data ) rtp_info -> info_is_video = p_conv_data -> is_video ;
if ( p_conv_data && p_conv_data -> srtp_info ) is_srtp = TRUE ;
rtp_info -> info_is_srtp = is_srtp ;
col_set_str ( pinfo -> cinfo , COL_PROTOCOL , ( is_srtp ) ? "SRTP" : "RTP" ) ;
p_conv_data = ( struct _rtp_conversation_info * ) p_get_proto_data ( wmem_file_scope ( ) , pinfo , proto_rtp , 0 ) ;
# if 0 if ( p_conv_data && p_conv_data -> srtp_info ) {
srtp_info = p_conv_data -> srtp_info ;
if ( rtp_info -> info_all_data_present ) {
srtp_offset = rtp_info -> info_data_len - srtp_info -> mki_len - srtp_info -> auth_tag_len ;
}
}
# endif if ( p_conv_data && p_conv_data -> bta2dp_info && p_conv_data -> bta2dp_info -> codec_dissector ) {
rtp_info -> info_payload_type_str = ( const char * ) dissector_handle_get_short_name ( p_conv_data -> bta2dp_info -> codec_dissector ) ;
}
else if ( p_conv_data && p_conv_data -> btvdp_info && p_conv_data -> btvdp_info -> codec_dissector ) {
rtp_info -> info_payload_type_str = ( const char * ) dissector_handle_get_short_name ( p_conv_data -> btvdp_info -> codec_dissector ) ;
}
if ( ( payload_type > 95 ) && ( payload_type < 128 ) ) {
if ( p_conv_data && p_conv_data -> rtp_dyn_payload ) {
encoding_name_and_rate_t * encoding_name_and_rate_pt = NULL ;
# ifdef DEBUG_CONVERSATION rtp_dump_dyn_payload ( p_conv_data -> rtp_dyn_payload ) ;
# endif DPRINT ( ( "looking up conversation data for dyn_pt=%d" , payload_type ) ) ;
encoding_name_and_rate_pt = ( encoding_name_and_rate_t * ) g_hash_table_lookup ( p_conv_data -> rtp_dyn_payload , & payload_type ) ;
DPRINT ( ( "did %sfind conversation data for dyn_pt=%d" , encoding_name_and_rate_pt ? "" : "not " , payload_type ) ) ;
if ( encoding_name_and_rate_pt ) {
DPRINT ( ( "found conversation data for dyn_pt=%d, enc_name=%s" , payload_type , encoding_name_and_rate_pt -> encoding_name ) ) ;
rtp_info -> info_payload_type_str = payload_type_str = encoding_name_and_rate_pt -> encoding_name ;
rtp_info -> info_payload_rate = encoding_name_and_rate_pt -> sample_rate ;
}
}
}
if ( p_conv_data && p_conv_data -> bta2dp_info ) {
pt = ( p_conv_data -> bta2dp_info -> codec_dissector ) ? dissector_handle_get_short_name ( p_conv_data -> bta2dp_info -> codec_dissector ) : "Unknown" ;
}
else if ( p_conv_data && p_conv_data -> btvdp_info ) {
pt = ( p_conv_data -> btvdp_info -> codec_dissector ) ? dissector_handle_get_short_name ( p_conv_data -> btvdp_info -> codec_dissector ) : "Unknown" ;
}
else {
pt = ( payload_type_str ? payload_type_str : val_to_str_ext ( payload_type , & rtp_payload_type_vals_ext , "Unknown (%u)" ) ) ;
}
col_add_fstr ( pinfo -> cinfo , COL_INFO , "PT=%s, SSRC=0x%X, Seq=%u, Time=%u%s" , pt , sync_src , seq_num , timestamp , marker_set ? ", Mark" : "" ) ;
if ( tree ) {
proto_tree * item ;
ti = proto_tree_add_item ( tree , proto_rtp , tvb , offset , - 1 , ENC_NA ) ;
rtp_tree = proto_item_add_subtree ( ti , ett_rtp ) ;
if ( global_rtp_show_setup_info ) {
show_setup_info ( tvb , pinfo , rtp_tree ) ;
}
proto_tree_add_uint ( rtp_tree , hf_rtp_version , tvb , offset , 1 , octet1 ) ;
proto_tree_add_boolean ( rtp_tree , hf_rtp_padding , tvb , offset , 1 , octet1 ) ;
proto_tree_add_boolean ( rtp_tree , hf_rtp_extension , tvb , offset , 1 , octet1 ) ;
proto_tree_add_uint ( rtp_tree , hf_rtp_csrc_count , tvb , offset , 1 , octet1 ) ;
offset ++ ;
proto_tree_add_boolean ( rtp_tree , hf_rtp_marker , tvb , offset , 1 , octet2 ) ;
proto_tree_add_uint_format ( rtp_tree , hf_rtp_payload_type , tvb , offset , 1 , octet2 , "Payload type: %s (%u)" , pt , payload_type ) ;
offset ++ ;
proto_tree_add_uint ( rtp_tree , hf_rtp_seq_nr , tvb , offset , 2 , seq_num ) ;
if ( p_conv_data != NULL ) {
item = proto_tree_add_uint ( rtp_tree , hf_rtp_ext_seq_nr , tvb , offset , 2 , p_conv_data -> extended_seqno ) ;
PROTO_ITEM_SET_GENERATED ( item ) ;
}
offset += 2 ;
proto_tree_add_uint ( rtp_tree , hf_rtp_timestamp , tvb , offset , 4 , timestamp ) ;
offset += 4 ;
proto_tree_add_uint ( rtp_tree , hf_rtp_ssrc , tvb , offset , 4 , sync_src ) ;
offset += 4 ;
}
else {
offset += 12 ;
}
if ( csrc_count > 0 ) {
ti = proto_tree_add_item ( rtp_tree , hf_rtp_csrc_items , tvb , offset , csrc_count * 4 , ENC_NA ) ;
proto_item_append_text ( ti , " (%u items)" , csrc_count ) ;
rtp_csrc_tree = proto_item_add_subtree ( ti , ett_csrc_list ) ;
for ( i = 0 ;
i < csrc_count ;
i ++ ) {
csrc_item = tvb_get_ntohl ( tvb , offset ) ;
proto_tree_add_uint_format ( rtp_csrc_tree , hf_rtp_csrc_item , tvb , offset , 4 , csrc_item , "CSRC item %d: 0x%X" , i , csrc_item ) ;
offset += 4 ;
}
}
if ( extension_set ) {
hdr_extension_id = tvb_get_ntohs ( tvb , offset ) ;
if ( tree ) proto_tree_add_uint ( rtp_tree , hf_rtp_prof_define , tvb , offset , 2 , hdr_extension_id ) ;
offset += 2 ;
hdr_extension_len = tvb_get_ntohs ( tvb , offset ) ;
if ( tree ) proto_tree_add_uint ( rtp_tree , hf_rtp_length , tvb , offset , 2 , hdr_extension_len ) ;
offset += 2 ;
if ( hdr_extension_len > 0 ) {
if ( tree ) {
ti = proto_tree_add_item ( rtp_tree , hf_rtp_hdr_exts , tvb , offset , hdr_extension_len * 4 , ENC_NA ) ;
rtp_hext_tree = proto_item_add_subtree ( ti , ett_hdr_ext ) ;
}
newtvb = tvb_new_subset ( tvb , offset , hdr_extension_len * 4 , hdr_extension_len * 4 ) ;
if ( hdr_extension_id == RTP_RFC5215_ONE_BYTE_SIG ) {
dissect_rtp_hext_rfc5215_onebyte ( newtvb , pinfo , rtp_hext_tree ) ;
}
else if ( ( hdr_extension_id & RTP_RFC5215_TWO_BYTE_MASK ) == RTP_RFC5215_TWO_BYTE_SIG ) {
dissect_rtp_hext_rfc5215_twobytes ( tvb , offset - 4 , hdr_extension_id , newtvb , pinfo , rtp_hext_tree ) ;
}
else {
if ( ! ( dissector_try_uint ( rtp_hdr_ext_dissector_table , hdr_extension_id , newtvb , pinfo , rtp_hext_tree ) ) ) {
hdrext_offset = offset ;
for ( i = 0 ;
i < hdr_extension_len ;
i ++ ) {
if ( tree ) proto_tree_add_uint ( rtp_hext_tree , hf_rtp_hdr_ext , tvb , hdrext_offset , 4 , tvb_get_ntohl ( tvb , hdrext_offset ) ) ;
hdrext_offset += 4 ;
}
}
}
}
offset += hdr_extension_len * 4 ;
}
if ( padding_set ) {
if ( tvb_length ( tvb ) < tvb_reported_length ( tvb ) ) {
if ( tree ) proto_tree_add_text ( rtp_tree , tvb , 0 , 0 , "Frame has padding, but not all the frame data was captured" ) ;
call_dissector ( data_handle , tvb_new_subset_remaining ( tvb , offset ) , pinfo , rtp_tree ) ;
return tvb_length ( tvb ) ;
}
padding_count = tvb_get_guint8 ( tvb , tvb_reported_length ( tvb ) - 1 ) ;
data_len = tvb_reported_length_remaining ( tvb , offset ) - padding_count ;
rtp_info -> info_payload_offset = offset ;
rtp_info -> info_payload_len = tvb_length_remaining ( tvb , offset ) ;
rtp_info -> info_padding_count = padding_count ;
if ( p_conv_data && p_conv_data -> bta2dp_info ) {
if ( p_conv_data -> bta2dp_info -> codec_dissector == sbc_handle ) {
rtp_info -> info_payload_offset += 1 ;
rtp_info -> info_payload_len -= 1 ;
}
if ( p_conv_data -> bta2dp_info -> content_protection_type == BTAVDTP_CONTENT_PROTECTION_TYPE_SCMS_T ) {
rtp_info -> info_payload_offset += 1 ;
rtp_info -> info_payload_len -= 1 ;
}
}
if ( p_conv_data && p_conv_data -> btvdp_info && p_conv_data -> bta2dp_info -> content_protection_type == BTAVDTP_CONTENT_PROTECTION_TYPE_SCMS_T ) {
rtp_info -> info_payload_offset += 1 ;
rtp_info -> info_payload_len -= 1 ;
}
if ( data_len > 0 ) {
TRY {
dissect_rtp_data ( tvb , pinfo , tree , rtp_tree , offset , data_len , data_len , payload_type ) ;
}
CATCH_ALL {
if ( ! pinfo -> flags . in_error_pkt ) tap_queue_packet ( rtp_tap , pinfo , rtp_info ) ;
RETHROW ;
}
ENDTRY ;
offset += data_len ;
}
else if ( data_len < 0 ) {
padding_count = tvb_reported_length_remaining ( tvb , offset ) ;
}
if ( padding_count > 1 ) {
if ( tree ) proto_tree_add_item ( rtp_tree , hf_rtp_padding_data , tvb , offset , padding_count - 1 , ENC_NA ) ;
offset += padding_count - 1 ;
}
if ( tree ) proto_tree_add_item ( rtp_tree , hf_rtp_padding_count , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
}
else {
rtp_info -> info_payload_offset = offset ;
rtp_info -> info_payload_len = tvb_length_remaining ( tvb , offset ) ;
if ( p_conv_data && p_conv_data -> bta2dp_info ) {
if ( p_conv_data -> bta2dp_info -> codec_dissector == sbc_handle ) {
rtp_info -> info_payload_offset += 1 ;
rtp_info -> info_payload_len -= 1 ;
}
if ( p_conv_data -> bta2dp_info -> content_protection_type == BTAVDTP_CONTENT_PROTECTION_TYPE_SCMS_T ) {
rtp_info -> info_payload_offset += 1 ;
rtp_info -> info_payload_len -= 1 ;
}
}
if ( p_conv_data && p_conv_data -> btvdp_info && p_conv_data -> bta2dp_info -> content_protection_type == BTAVDTP_CONTENT_PROTECTION_TYPE_SCMS_T ) {
rtp_info -> info_payload_offset += 1 ;
rtp_info -> info_payload_len -= 1 ;
}
if ( tvb_reported_length_remaining ( tvb , offset ) > 0 ) {
TRY {
dissect_rtp_data ( tvb , pinfo , tree , rtp_tree , offset , tvb_length_remaining ( tvb , offset ) , tvb_reported_length_remaining ( tvb , offset ) , payload_type ) ;
}
CATCH_ALL {
if ( ! pinfo -> flags . in_error_pkt ) tap_queue_packet ( rtp_tap , pinfo , rtp_info ) ;
RETHROW ;
}
ENDTRY ;
}
}
if ( ! pinfo -> flags . in_error_pkt ) tap_queue_packet ( rtp_tap , pinfo , rtp_info ) ;
return offset ;
} | 1True
|
Categorize the following code snippet as vulnerable or not. True or False | static int lms_predict ( WmallDecodeCtx * s , int ich , int ilms ) {
int pred = 0 , icoef ;
int recent = s -> cdlms [ ich ] [ ilms ] . recent ;
for ( icoef = 0 ;
icoef < s -> cdlms [ ich ] [ ilms ] . order ;
icoef ++ ) pred += s -> cdlms [ ich ] [ ilms ] . coefs [ icoef ] * s -> cdlms [ ich ] [ ilms ] . lms_prevvalues [ icoef + recent ] ;
return pred ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static int check_vcdiff_header ( xd3_stream * stream , const char * input , const char * line_start , const char * matches , int yes_or_no ) {
int ret ;
char vcmd [ TESTBUFSIZE ] , gcmd [ TESTBUFSIZE ] ;
snprintf_func ( vcmd , TESTBUFSIZE , "%s printhdr -f %s %s" , program_name , input , TEST_RECON2_FILE ) ;
if ( ( ret = system ( vcmd ) ) != 0 ) {
XPR ( NT "printhdr command: %s\n" , vcmd ) ;
stream -> msg = "printhdr cmd failed" ;
return XD3_INTERNAL ;
}
snprintf_func ( gcmd , TESTBUFSIZE , "grep \"%s.*%s.*\" %s > /devull" , line_start , matches , TEST_RECON2_FILE ) ;
if ( yes_or_no ) {
if ( ( ret = do_cmd ( stream , gcmd ) ) ) {
XPR ( NT "%s\n" , gcmd ) ;
return ret ;
}
}
else {
if ( ( ret = do_fail ( stream , gcmd ) ) ) {
XPR ( NT "%s\n" , gcmd ) ;
return ret ;
}
}
return 0 ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static inline void e1000e_rx_fix_l4_csum ( E1000ECore * core , struct NetRxPkt * pkt ) {
if ( net_rx_pkt_has_virt_hdr ( pkt ) ) {
struct virtio_net_hdr * vhdr = net_rx_pkt_get_vhdr ( pkt ) ;
if ( vhdr -> flags & VIRTIO_NET_HDR_F_NEEDS_CSUM ) {
net_rx_pkt_fix_l4_csum ( pkt ) ;
}
}
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void cirrus_mem_writeb_mode4and5_16bpp ( CirrusVGAState * s , unsigned mode , unsigned offset , uint32_t mem_value ) {
int x ;
unsigned val = mem_value ;
uint8_t * dst ;
for ( x = 0 ;
x < 8 ;
x ++ ) {
dst = s -> vga . vram_ptr + ( ( offset + 2 * x ) & s -> cirrus_addr_mask & ~ 1 ) ;
if ( val & 0x80 ) {
* dst = s -> cirrus_shadow_gr1 ;
* ( dst + 1 ) = s -> vga . gr [ 0x11 ] ;
}
else if ( mode == 5 ) {
* dst = s -> cirrus_shadow_gr0 ;
* ( dst + 1 ) = s -> vga . gr [ 0x10 ] ;
}
val <<= 1 ;
}
memory_region_set_dirty ( & s -> vga . vram , offset , 16 ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static inline void tm2_low_res_block ( TM2Context * ctx , AVFrame * pic , int bx , int by ) {
int i ;
int t1 , t2 ;
int deltas [ 16 ] ;
TM2_INIT_POINTERS ( ) ;
deltas [ 0 ] = GET_TOK ( ctx , TM2_C_LO ) ;
deltas [ 1 ] = deltas [ 2 ] = deltas [ 3 ] = 0 ;
tm2_low_chroma ( U , Ustride , clast , ctx -> CD , deltas , bx ) ;
deltas [ 0 ] = GET_TOK ( ctx , TM2_C_LO ) ;
deltas [ 1 ] = deltas [ 2 ] = deltas [ 3 ] = 0 ;
tm2_low_chroma ( V , Vstride , clast + 2 , ctx -> CD + 2 , deltas , bx ) ;
for ( i = 0 ;
i < 16 ;
i ++ ) deltas [ i ] = 0 ;
deltas [ 0 ] = GET_TOK ( ctx , TM2_L_LO ) ;
deltas [ 2 ] = GET_TOK ( ctx , TM2_L_LO ) ;
deltas [ 8 ] = GET_TOK ( ctx , TM2_L_LO ) ;
deltas [ 10 ] = GET_TOK ( ctx , TM2_L_LO ) ;
if ( bx > 0 ) last [ 0 ] = ( last [ - 1 ] - ctx -> D [ 0 ] - ctx -> D [ 1 ] - ctx -> D [ 2 ] - ctx -> D [ 3 ] + last [ 1 ] ) >> 1 ;
else last [ 0 ] = ( last [ 1 ] - ctx -> D [ 0 ] - ctx -> D [ 1 ] - ctx -> D [ 2 ] - ctx -> D [ 3 ] ) >> 1 ;
last [ 2 ] = ( last [ 1 ] + last [ 3 ] ) >> 1 ;
t1 = ctx -> D [ 0 ] + ctx -> D [ 1 ] ;
ctx -> D [ 0 ] = t1 >> 1 ;
ctx -> D [ 1 ] = t1 - ( t1 >> 1 ) ;
t2 = ctx -> D [ 2 ] + ctx -> D [ 3 ] ;
ctx -> D [ 2 ] = t2 >> 1 ;
ctx -> D [ 3 ] = t2 - ( t2 >> 1 ) ;
tm2_apply_deltas ( ctx , Y , Ystride , deltas , last ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static inline uint32_t read_IRQreg_idr ( OpenPICState * opp , int n_IRQ ) {
return opp -> src [ n_IRQ ] . idr ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static int zloop ( i_ctx_t * i_ctx_p ) {
os_ptr op = osp ;
check_proc ( * op ) ;
check_estack ( 4 ) ;
push_mark_estack ( es_for , no_cleanup ) ;
* ++ esp = * op ;
make_op_estack ( esp + 1 , loop_continue ) ;
pop ( 1 ) ;
return loop_continue ( i_ctx_p ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static int x_set_buffer ( gx_device_X * xdev ) {
gs_memory_t * mem = gs_memory_stable ( xdev -> memory ) ;
bool buffered = xdev -> space_params . MaxBitmap > 0 ;
const gx_device_procs * procs ;
setup : if ( buffered ) {
gx_device_memory * mdev = ( gx_device_memory * ) xdev -> target ;
if ( mdev == 0 || mdev -> color_info . depth != xdev -> orig_color_info . depth ) {
const gx_device_memory * mdproto = gdev_mem_device_for_bits ( xdev -> orig_color_info . depth ) ;
if ( ! mdproto ) {
buffered = false ;
goto setup ;
}
if ( mdev ) {
gx_device_set_target ( ( gx_device_forward * ) mdev , NULL ) ;
}
else {
mdev = gs_alloc_struct ( mem , gx_device_memory , & st_device_memory , "memory device" ) ;
if ( mdev == 0 ) {
buffered = false ;
goto setup ;
}
}
gs_make_mem_device ( mdev , mdproto , mem , 0 , ( gx_device * ) xdev ) ;
gx_device_set_target ( ( gx_device_forward * ) xdev , ( gx_device * ) mdev ) ;
xdev -> is_buffered = true ;
}
if ( mdev -> width != xdev -> width || mdev -> height != xdev -> height ) {
byte * buffer ;
ulong space ;
if ( gdev_mem_data_size ( mdev , xdev -> width , xdev -> height , & space ) < 0 || space > xdev -> space_params . MaxBitmap ) {
buffered = false ;
goto setup ;
}
buffer = ( xdev -> buffer ? ( byte * ) gs_resize_object ( mem , xdev -> buffer , space , "buffer" ) : gs_alloc_bytes ( mem , space , "buffer" ) ) ;
if ( ! buffer ) {
buffered = false ;
goto setup ;
}
xdev -> buffer_size = space ;
xdev -> buffer = buffer ;
mdev -> width = xdev -> width ;
mdev -> height = xdev -> height ;
mdev -> icc_struct = xdev -> icc_struct ;
rc_increment ( xdev -> icc_struct ) ;
mdev -> color_info = xdev -> orig_color_info ;
mdev -> base = xdev -> buffer ;
gdev_mem_open_scan_lines ( mdev , xdev -> height ) ;
}
xdev -> white = gx_device_white ( ( gx_device * ) xdev ) ;
xdev -> black = gx_device_black ( ( gx_device * ) xdev ) ;
procs = & gs_bbox_device . procs ;
}
else {
gs_free_object ( mem , xdev -> buffer , "buffer" ) ;
xdev -> buffer = 0 ;
xdev -> buffer_size = 0 ;
if ( ! xdev -> is_buffered ) return 0 ;
gx_device_set_target ( ( gx_device_forward * ) xdev -> target , NULL ) ;
gx_device_set_target ( ( gx_device_forward * ) xdev , NULL ) ;
xdev -> is_buffered = false ;
procs = & gs_x11_device . procs ;
}
if ( dev_proc ( xdev , fill_rectangle ) != procs -> fill_rectangle ) {
# define COPY_PROC ( p ) set_dev_proc ( xdev , p , procs -> p ) COPY_PROC ( fill_rectangle ) ;
COPY_PROC ( copy_mono ) ;
COPY_PROC ( copy_color ) ;
COPY_PROC ( copy_alpha ) ;
COPY_PROC ( fill_path ) ;
COPY_PROC ( stroke_path ) ;
COPY_PROC ( fill_mask ) ;
COPY_PROC ( fill_trapezoid ) ;
COPY_PROC ( fill_parallelogram ) ;
COPY_PROC ( fill_triangle ) ;
COPY_PROC ( draw_thin_line ) ;
COPY_PROC ( strip_tile_rectangle ) ;
COPY_PROC ( strip_copy_rop ) ;
COPY_PROC ( begin_typed_image ) ;
COPY_PROC ( text_begin ) ;
# undef COPY_PROC if ( xdev -> is_buffered ) {
check_device_separable ( ( gx_device * ) xdev ) ;
gx_device_forward_fill_in_procs ( ( gx_device_forward * ) xdev ) ;
xdev -> box_procs = gdev_x_box_procs ;
xdev -> box_proc_data = xdev ;
}
else {
check_device_separable ( ( gx_device * ) xdev ) ;
gx_device_fill_in_procs ( ( gx_device * ) xdev ) ;
}
}
return 0 ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void setup_display_size ( VP9_COMMON * cm , struct vp9_read_bit_buffer * rb ) {
cm -> display_width = cm -> width ;
cm -> display_height = cm -> height ;
if ( vp9_rb_read_bit ( rb ) ) vp9_read_frame_size ( rb , & cm -> display_width , & cm -> display_height ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | int remoteSerializeReplyError ( struct qemud_client * client , remote_error * rerr , remote_message_header * req ) {
return remoteSerializeError ( client , rerr , req -> prog , req -> vers , req -> proc , req -> type == REMOTE_STREAM ? REMOTE_STREAM : REMOTE_REPLY , req -> serial ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void virtio_balloon_set_config ( VirtIODevice * vdev , const uint8_t * config_data ) {
VirtIOBalloon * dev = to_virtio_balloon ( vdev ) ;
struct virtio_balloon_config config ;
memcpy ( & config , config_data , 8 ) ;
dev -> actual = le32_to_cpu ( config . actual ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void virtio_net_set_config ( VirtIODevice * vdev , const uint8_t * config ) {
VirtIONet * n = to_virtio_net ( vdev ) ;
struct virtio_net_config netcfg ;
memcpy ( & netcfg , config , sizeof ( netcfg ) ) ;
if ( memcmp ( netcfg . mac , n -> mac , ETH_ALEN ) ) {
memcpy ( n -> mac , netcfg . mac , ETH_ALEN ) ;
qemu_format_nic_info_str ( & n -> nic -> nc , n -> mac ) ;
}
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void _fromUnicodeWithCallback ( UConverterFromUnicodeArgs * pArgs , UErrorCode * err ) {
UConverterFromUnicode fromUnicode ;
UConverter * cnv ;
const UChar * s ;
char * t ;
int32_t * offsets ;
int32_t sourceIndex ;
int32_t errorInputLength ;
UBool converterSawEndOfInput , calledCallback ;
UChar replay [ UCNV_EXT_MAX_UCHARS ] ;
const UChar * realSource , * realSourceLimit ;
int32_t realSourceIndex ;
UBool realFlush ;
cnv = pArgs -> converter ;
s = pArgs -> source ;
t = pArgs -> target ;
offsets = pArgs -> offsets ;
sourceIndex = 0 ;
if ( offsets == NULL ) {
fromUnicode = cnv -> sharedData -> impl -> fromUnicode ;
}
else {
fromUnicode = cnv -> sharedData -> impl -> fromUnicodeWithOffsets ;
if ( fromUnicode == NULL ) {
fromUnicode = cnv -> sharedData -> impl -> fromUnicode ;
sourceIndex = - 1 ;
}
}
if ( cnv -> preFromULength >= 0 ) {
realSource = NULL ;
realSourceLimit = NULL ;
realFlush = FALSE ;
realSourceIndex = 0 ;
}
else {
realSource = pArgs -> source ;
realSourceLimit = pArgs -> sourceLimit ;
realFlush = pArgs -> flush ;
realSourceIndex = sourceIndex ;
uprv_memcpy ( replay , cnv -> preFromU , - cnv -> preFromULength * U_SIZEOF_UCHAR ) ;
pArgs -> source = replay ;
pArgs -> sourceLimit = replay - cnv -> preFromULength ;
pArgs -> flush = FALSE ;
sourceIndex = - 1 ;
cnv -> preFromULength = 0 ;
}
for ( ;
;
) {
if ( U_SUCCESS ( * err ) ) {
fromUnicode ( pArgs , err ) ;
converterSawEndOfInput = ( UBool ) ( U_SUCCESS ( * err ) && pArgs -> flush && pArgs -> source == pArgs -> sourceLimit && cnv -> fromUChar32 == 0 ) ;
}
else {
converterSawEndOfInput = FALSE ;
}
calledCallback = FALSE ;
errorInputLength = 0 ;
for ( ;
;
) {
if ( offsets != NULL ) {
int32_t length = ( int32_t ) ( pArgs -> target - t ) ;
if ( length > 0 ) {
_updateOffsets ( offsets , length , sourceIndex , errorInputLength ) ;
pArgs -> offsets = offsets += length ;
}
if ( sourceIndex >= 0 ) {
sourceIndex += ( int32_t ) ( pArgs -> source - s ) ;
}
}
if ( cnv -> preFromULength < 0 ) {
if ( realSource == NULL ) {
realSource = pArgs -> source ;
realSourceLimit = pArgs -> sourceLimit ;
realFlush = pArgs -> flush ;
realSourceIndex = sourceIndex ;
uprv_memcpy ( replay , cnv -> preFromU , - cnv -> preFromULength * U_SIZEOF_UCHAR ) ;
pArgs -> source = replay ;
pArgs -> sourceLimit = replay - cnv -> preFromULength ;
pArgs -> flush = FALSE ;
if ( ( sourceIndex += cnv -> preFromULength ) < 0 ) {
sourceIndex = - 1 ;
}
cnv -> preFromULength = 0 ;
}
else {
U_ASSERT ( realSource == NULL ) ;
* err = U_INTERNAL_PROGRAM_ERROR ;
}
}
s = pArgs -> source ;
t = pArgs -> target ;
if ( U_SUCCESS ( * err ) ) {
if ( s < pArgs -> sourceLimit ) {
break ;
}
else if ( realSource != NULL ) {
pArgs -> source = realSource ;
pArgs -> sourceLimit = realSourceLimit ;
pArgs -> flush = realFlush ;
sourceIndex = realSourceIndex ;
realSource = NULL ;
break ;
}
else if ( pArgs -> flush && cnv -> fromUChar32 != 0 ) {
* err = U_TRUNCATED_CHAR_FOUND ;
calledCallback = FALSE ;
}
else {
if ( pArgs -> flush ) {
if ( ! converterSawEndOfInput ) {
break ;
}
_reset ( cnv , UCNV_RESET_FROM_UNICODE , FALSE ) ;
}
return ;
}
}
{
UErrorCode e ;
if ( calledCallback || ( e = * err ) == U_BUFFER_OVERFLOW_ERROR || ( e != U_INVALID_CHAR_FOUND && e != U_ILLEGAL_CHAR_FOUND && e != U_TRUNCATED_CHAR_FOUND ) ) {
if ( realSource != NULL ) {
int32_t length ;
U_ASSERT ( cnv -> preFromULength == 0 ) ;
length = ( int32_t ) ( pArgs -> sourceLimit - pArgs -> source ) ;
if ( length > 0 ) {
u_memcpy ( cnv -> preFromU , pArgs -> source , length ) ;
cnv -> preFromULength = ( int8_t ) - length ;
}
pArgs -> source = realSource ;
pArgs -> sourceLimit = realSourceLimit ;
pArgs -> flush = realFlush ;
}
return ;
}
}
{
UChar32 codePoint ;
codePoint = cnv -> fromUChar32 ;
errorInputLength = 0 ;
U16_APPEND_UNSAFE ( cnv -> invalidUCharBuffer , errorInputLength , codePoint ) ;
cnv -> invalidUCharLength = ( int8_t ) errorInputLength ;
cnv -> fromUChar32 = 0 ;
cnv -> fromUCharErrorBehaviour ( cnv -> fromUContext , pArgs , cnv -> invalidUCharBuffer , errorInputLength , codePoint , * err == U_INVALID_CHAR_FOUND ? UCNV_UNASSIGNED : UCNV_ILLEGAL , err ) ;
}
calledCallback = TRUE ;
}
}
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void pk_transaction_get_packages ( PkTransaction * transaction , GVariant * params , GDBusMethodInvocation * context ) {
PkBitfield filter ;
g_autoptr ( GError ) error = NULL ;
g_return_if_fail ( PK_IS_TRANSACTION ( transaction ) ) ;
g_return_if_fail ( transaction -> priv -> tid != NULL ) ;
g_variant_get ( params , "(t)" , & filter ) ;
g_debug ( "GetPackages method called: %" G_GUINT64_FORMAT , filter ) ;
if ( ! pk_backend_is_implemented ( transaction -> priv -> backend , PK_ROLE_ENUM_GET_PACKAGES ) ) {
g_set_error ( & error , PK_TRANSACTION_ERROR , PK_TRANSACTION_ERROR_NOT_SUPPORTED , "GetPackages not supported by backend" ) ;
pk_transaction_set_state ( transaction , PK_TRANSACTION_STATE_ERROR ) ;
goto out ;
}
transaction -> priv -> cached_filters = filter ;
pk_transaction_set_role ( transaction , PK_ROLE_ENUM_GET_PACKAGES ) ;
pk_transaction_set_state ( transaction , PK_TRANSACTION_STATE_READY ) ;
out : pk_transaction_dbus_return ( context , error ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void encode_block_intra ( int plane , int block , BLOCK_SIZE plane_bsize , TX_SIZE tx_size , void * arg ) {
struct encode_b_args * const args = arg ;
MACROBLOCK * const x = args -> x ;
MACROBLOCKD * const xd = & x -> e_mbd ;
MB_MODE_INFO * mbmi = & xd -> mi [ 0 ] -> mbmi ;
struct macroblock_plane * const p = & x -> plane [ plane ] ;
struct macroblockd_plane * const pd = & xd -> plane [ plane ] ;
int16_t * coeff = BLOCK_OFFSET ( p -> coeff , block ) ;
int16_t * qcoeff = BLOCK_OFFSET ( p -> qcoeff , block ) ;
int16_t * dqcoeff = BLOCK_OFFSET ( pd -> dqcoeff , block ) ;
const scan_order * scan_order ;
TX_TYPE tx_type ;
PREDICTION_MODE mode ;
const int bwl = b_width_log2 ( plane_bsize ) ;
const int diff_stride = 4 * ( 1 << bwl ) ;
uint8_t * src , * dst ;
int16_t * src_diff ;
uint16_t * eob = & p -> eobs [ block ] ;
const int src_stride = p -> src . stride ;
const int dst_stride = pd -> dst . stride ;
int i , j ;
txfrm_block_to_raster_xy ( plane_bsize , tx_size , block , & i , & j ) ;
dst = & pd -> dst . buf [ 4 * ( j * dst_stride + i ) ] ;
src = & p -> src . buf [ 4 * ( j * src_stride + i ) ] ;
src_diff = & p -> src_diff [ 4 * ( j * diff_stride + i ) ] ;
switch ( tx_size ) {
case TX_32X32 : scan_order = & vp9_default_scan_orders [ TX_32X32 ] ;
mode = plane == 0 ? mbmi -> mode : mbmi -> uv_mode ;
vp9_predict_intra_block ( xd , block >> 6 , bwl , TX_32X32 , mode , x -> skip_encode ? src : dst , x -> skip_encode ? src_stride : dst_stride , dst , dst_stride , i , j , plane ) ;
if ( ! x -> skip_recode ) {
vp9_subtract_block ( 32 , 32 , src_diff , diff_stride , src , src_stride , dst , dst_stride ) ;
fdct32x32 ( x -> use_lp32x32fdct , src_diff , coeff , diff_stride ) ;
vp9_quantize_b_32x32 ( coeff , 1024 , x -> skip_block , p -> zbin , p -> round , p -> quant , p -> quant_shift , qcoeff , dqcoeff , pd -> dequant , p -> zbin_extra , eob , scan_order -> scan , scan_order -> iscan ) ;
}
if ( ! x -> skip_encode && * eob ) vp9_idct32x32_add ( dqcoeff , dst , dst_stride , * eob ) ;
break ;
case TX_16X16 : tx_type = get_tx_type ( pd -> plane_type , xd ) ;
scan_order = & vp9_scan_orders [ TX_16X16 ] [ tx_type ] ;
mode = plane == 0 ? mbmi -> mode : mbmi -> uv_mode ;
vp9_predict_intra_block ( xd , block >> 4 , bwl , TX_16X16 , mode , x -> skip_encode ? src : dst , x -> skip_encode ? src_stride : dst_stride , dst , dst_stride , i , j , plane ) ;
if ( ! x -> skip_recode ) {
vp9_subtract_block ( 16 , 16 , src_diff , diff_stride , src , src_stride , dst , dst_stride ) ;
vp9_fht16x16 ( src_diff , coeff , diff_stride , tx_type ) ;
vp9_quantize_b ( coeff , 256 , x -> skip_block , p -> zbin , p -> round , p -> quant , p -> quant_shift , qcoeff , dqcoeff , pd -> dequant , p -> zbin_extra , eob , scan_order -> scan , scan_order -> iscan ) ;
}
if ( ! x -> skip_encode && * eob ) vp9_iht16x16_add ( tx_type , dqcoeff , dst , dst_stride , * eob ) ;
break ;
case TX_8X8 : tx_type = get_tx_type ( pd -> plane_type , xd ) ;
scan_order = & vp9_scan_orders [ TX_8X8 ] [ tx_type ] ;
mode = plane == 0 ? mbmi -> mode : mbmi -> uv_mode ;
vp9_predict_intra_block ( xd , block >> 2 , bwl , TX_8X8 , mode , x -> skip_encode ? src : dst , x -> skip_encode ? src_stride : dst_stride , dst , dst_stride , i , j , plane ) ;
if ( ! x -> skip_recode ) {
vp9_subtract_block ( 8 , 8 , src_diff , diff_stride , src , src_stride , dst , dst_stride ) ;
vp9_fht8x8 ( src_diff , coeff , diff_stride , tx_type ) ;
vp9_quantize_b ( coeff , 64 , x -> skip_block , p -> zbin , p -> round , p -> quant , p -> quant_shift , qcoeff , dqcoeff , pd -> dequant , p -> zbin_extra , eob , scan_order -> scan , scan_order -> iscan ) ;
}
if ( ! x -> skip_encode && * eob ) vp9_iht8x8_add ( tx_type , dqcoeff , dst , dst_stride , * eob ) ;
break ;
case TX_4X4 : tx_type = get_tx_type_4x4 ( pd -> plane_type , xd , block ) ;
scan_order = & vp9_scan_orders [ TX_4X4 ] [ tx_type ] ;
mode = plane == 0 ? get_y_mode ( xd -> mi [ 0 ] , block ) : mbmi -> uv_mode ;
vp9_predict_intra_block ( xd , block , bwl , TX_4X4 , mode , x -> skip_encode ? src : dst , x -> skip_encode ? src_stride : dst_stride , dst , dst_stride , i , j , plane ) ;
if ( ! x -> skip_recode ) {
vp9_subtract_block ( 4 , 4 , src_diff , diff_stride , src , src_stride , dst , dst_stride ) ;
if ( tx_type != DCT_DCT ) vp9_fht4x4 ( src_diff , coeff , diff_stride , tx_type ) ;
else x -> fwd_txm4x4 ( src_diff , coeff , diff_stride ) ;
vp9_quantize_b ( coeff , 16 , x -> skip_block , p -> zbin , p -> round , p -> quant , p -> quant_shift , qcoeff , dqcoeff , pd -> dequant , p -> zbin_extra , eob , scan_order -> scan , scan_order -> iscan ) ;
}
if ( ! x -> skip_encode && * eob ) {
if ( tx_type == DCT_DCT ) x -> itxm_add ( dqcoeff , dst , dst_stride , * eob ) ;
else vp9_iht4x4_16_add ( dqcoeff , dst , dst_stride , tx_type ) ;
}
break ;
default : assert ( 0 ) ;
break ;
}
if ( * eob ) * ( args -> skip ) = 0 ;
} | 1True
|
Categorize the following code snippet as vulnerable or not. True or False | static void pk_transaction_repair_system ( PkTransaction * transaction , GVariant * params , GDBusMethodInvocation * context ) {
gboolean ret ;
PkBitfield transaction_flags ;
g_autoptr ( GError ) error = NULL ;
g_autofree gchar * transaction_flags_temp = NULL ;
g_return_if_fail ( PK_IS_TRANSACTION ( transaction ) ) ;
g_return_if_fail ( transaction -> priv -> tid != NULL ) ;
g_variant_get ( params , "(t)" , & transaction_flags ) ;
transaction_flags_temp = pk_transaction_flag_bitfield_to_string ( transaction_flags ) ;
g_debug ( "RepairSystem method called (transaction_flags: %s)" , transaction_flags_temp ) ;
if ( ! pk_backend_is_implemented ( transaction -> priv -> backend , PK_ROLE_ENUM_REPAIR_SYSTEM ) ) {
g_set_error ( & error , PK_TRANSACTION_ERROR , PK_TRANSACTION_ERROR_NOT_SUPPORTED , "RepairSystem not supported by backend" ) ;
pk_transaction_set_state ( transaction , PK_TRANSACTION_STATE_ERROR ) ;
goto out ;
}
transaction -> priv -> cached_transaction_flags = transaction_flags ;
pk_transaction_set_role ( transaction , PK_ROLE_ENUM_REPAIR_SYSTEM ) ;
pk_transaction_emit_property_changed ( transaction , "TransactionFlags" , g_variant_new_uint64 ( transaction_flags ) ) ;
ret = pk_transaction_obtain_authorization ( transaction , PK_ROLE_ENUM_REPAIR_SYSTEM , & error ) ;
if ( ! ret ) {
pk_transaction_set_state ( transaction , PK_TRANSACTION_STATE_ERROR ) ;
goto out ;
}
out : pk_transaction_dbus_return ( context , error ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void config_ntpd ( config_tree * ptree ) {
config_nic_rules ( ptree ) ;
io_open_sockets ( ) ;
config_monitor ( ptree ) ;
config_auth ( ptree ) ;
config_tos ( ptree ) ;
config_access ( ptree ) ;
config_tinker ( ptree ) ;
config_system_opts ( ptree ) ;
config_logconfig ( ptree ) ;
config_phone ( ptree ) ;
config_setvar ( ptree ) ;
config_ttl ( ptree ) ;
config_trap ( ptree ) ;
config_vars ( ptree ) ;
config_other_modes ( ptree ) ;
config_peers ( ptree ) ;
config_unpeers ( ptree ) ;
config_fudge ( ptree ) ;
config_qos ( ptree ) ;
# ifdef TEST_BLOCKING_WORKER {
struct addrinfo hints ;
memset ( & hints , 0 , sizeof ( hints ) ) ;
hints . ai_socktype = SOCK_STREAM ;
hints . ai_protocol = IPPROTO_TCP ;
getaddrinfo_sometime ( "www.cnn.com" , "ntp" , & hints , INITIAL_DNS_RETRY , gai_test_callback , ( void * ) 1 ) ;
hints . ai_family = AF_INET6 ;
getaddrinfo_sometime ( "ipv6.google.com" , "ntp" , & hints , INITIAL_DNS_RETRY , gai_test_callback , ( void * ) 0x600 ) ;
}
# endif } | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | void item_init ( void ) {
item_user_lock_init ( ) ;
uuid_short_init ( ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | SPL_METHOD ( SplDoublyLinkedList , shift ) {
zval * value ;
spl_dllist_object * intern ;
if ( zend_parse_parameters ( ZEND_NUM_ARGS ( ) TSRMLS_CC , "" ) == FAILURE ) {
return ;
}
intern = ( spl_dllist_object * ) zend_object_store_get_object ( getThis ( ) TSRMLS_CC ) ;
value = ( zval * ) spl_ptr_llist_shift ( intern -> llist TSRMLS_CC ) ;
if ( value == NULL ) {
zend_throw_exception ( spl_ce_RuntimeException , "Can't shift from an empty datastructure" , 0 TSRMLS_CC ) ;
return ;
}
RETURN_ZVAL ( value , 1 , 1 ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | bool cpu_restore_state ( CPUArchState * env , uintptr_t retaddr ) {
TranslationBlock * tb ;
tb = tb_find_pc ( retaddr ) ;
if ( tb ) {
cpu_restore_state_from_tb ( tb , env , retaddr ) ;
return true ;
}
return false ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static const char * cmd_audit_log_dirmode ( cmd_parms * cmd , void * _dcfg , const char * p1 ) {
directory_config * dcfg = ( directory_config * ) _dcfg ;
if ( dcfg == NULL ) return NULL ;
if ( strcasecmp ( p1 , "default" ) == 0 ) {
dcfg -> auditlog_dirperms = NOT_SET ;
}
else {
long int mode = strtol ( p1 , NULL , 8 ) ;
if ( ( mode == LONG_MAX ) || ( mode == LONG_MIN ) || ( mode <= 0 ) || ( mode > 07777 ) ) {
return apr_psprintf ( cmd -> pool , "ModSecurity: Invalid value for SecAuditLogDirMode: %s" , p1 ) ;
}
dcfg -> auditlog_dirperms = mode2fileperms ( mode ) ;
}
return NULL ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | TSReturnCode TSHttpHdrReasonSet ( TSMBuffer bufp , TSMLoc obj , const char * value , int length ) {
sdk_assert ( sdk_sanity_check_mbuffer ( bufp ) == TS_SUCCESS ) ;
sdk_assert ( sdk_sanity_check_http_hdr_handle ( obj ) == TS_SUCCESS ) ;
sdk_assert ( sdk_sanity_check_null_ptr ( ( void * ) value ) == TS_SUCCESS ) ;
if ( ! isWriteable ( bufp ) ) {
return TS_ERROR ;
}
HTTPHdr h ;
SET_HTTP_HDR ( h , bufp , obj ) ;
if ( length < 0 ) {
length = strlen ( value ) ;
}
h . reason_set ( value , length ) ;
return TS_SUCCESS ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static int vorbis_decode_frame ( AVCodecContext * avctx , void * data , int * got_frame_ptr , AVPacket * avpkt ) {
const uint8_t * buf = avpkt -> data ;
int buf_size = avpkt -> size ;
vorbis_context * vc = avctx -> priv_data ;
AVFrame * frame = data ;
GetBitContext * gb = & vc -> gb ;
float * channel_ptrs [ 255 ] ;
int i , len , ret ;
av_dlog ( NULL , "packet length %d \n" , buf_size ) ;
frame -> nb_samples = vc -> blocksize [ 1 ] / 2 ;
if ( ( ret = ff_get_buffer ( avctx , frame , 0 ) ) < 0 ) {
av_log ( avctx , AV_LOG_ERROR , "get_buffer() failed\n" ) ;
return ret ;
}
if ( vc -> audio_channels > 8 ) {
for ( i = 0 ;
i < vc -> audio_channels ;
i ++ ) channel_ptrs [ i ] = ( float * ) frame -> extended_data [ i ] ;
}
else {
for ( i = 0 ;
i < vc -> audio_channels ;
i ++ ) {
int ch = ff_vorbis_channel_layout_offsets [ vc -> audio_channels - 1 ] [ i ] ;
channel_ptrs [ ch ] = ( float * ) frame -> extended_data [ i ] ;
}
}
init_get_bits ( gb , buf , buf_size * 8 ) ;
if ( ( len = vorbis_parse_audio_packet ( vc , channel_ptrs ) ) <= 0 ) return len ;
if ( ! vc -> first_frame ) {
vc -> first_frame = 1 ;
* got_frame_ptr = 0 ;
return buf_size ;
}
av_dlog ( NULL , "parsed %d bytes %d bits, returned %d samples (*ch*bits) \n" , get_bits_count ( gb ) / 8 , get_bits_count ( gb ) % 8 , len ) ;
frame -> nb_samples = len ;
* got_frame_ptr = 1 ;
return buf_size ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | TEST_F ( ExternalProtocolHandlerTest , DISABLED_TestLaunchSchemeUnknownChromeOtherModeDefault ) {
DoTest ( ExternalProtocolHandler : : UNKNOWN , shell_integration : : OTHER_MODE_IS_DEFAULT , Action : : PROMPT ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | int i2d_ ## name ( type * a , unsigned char * * out ) ;
DECLARE_ASN1_ITEM ( itname ) # define DECLARE_ASN1_ENCODE_FUNCTIONS_const ( type , name ) type * d2i_ ## name ( type * * a , const unsigned char * * in , long len ) ;
int i2d_ ## name ( const type * a , unsigned char * * out ) ;
DECLARE_ASN1_ITEM ( name ) # define DECLARE_ASN1_NDEF_FUNCTION ( name ) int i2d_ ## name ## _NDEF ( name * a , unsigned char * * out ) ;
# define DECLARE_ASN1_FUNCTIONS_const ( name ) DECLARE_ASN1_ALLOC_FUNCTIONS ( name ) DECLARE_ASN1_ENCODE_FUNCTIONS_const ( name , name ) # define DECLARE_ASN1_ALLOC_FUNCTIONS_name ( type , name ) type * name ## _new ( void ) ;
void name ## _free ( type * a ) ;
# define DECLARE_ASN1_PRINT_FUNCTION ( stname ) DECLARE_ASN1_PRINT_FUNCTION_fname ( stname , stname ) # define DECLARE_ASN1_PRINT_FUNCTION_fname ( stname , fname ) int fname ## _print_ctx ( BIO * out , stname * x , int indent , const ASN1_PCTX * pctx ) ;
# define D2I_OF ( type ) type * ( * ) ( type * * , const unsigned char * * , long ) # define I2D_OF ( type ) int ( * ) ( type * , unsigned char * * ) # define I2D_OF_const ( type ) int ( * ) ( const type * , unsigned char * * ) # define CHECKED_D2I_OF ( type , d2i ) ( ( d2i_of_void * ) ( 1 ? d2i : ( ( D2I_OF ( type ) ) 0 ) ) ) # define CHECKED_I2D_OF ( type , i2d ) ( ( i2d_of_void * ) ( 1 ? i2d : ( ( I2D_OF ( type ) ) 0 ) ) ) # define CHECKED_NEW_OF ( type , xnew ) ( ( void * ( * ) ( void ) ) ( 1 ? xnew : ( ( type * ( * ) ( void ) ) 0 ) ) ) # define CHECKED_PTR_OF ( type , p ) ( ( void * ) ( 1 ? p : ( type * ) 0 ) ) # define CHECKED_PPTR_OF ( type , p ) ( ( void * * ) ( 1 ? p : ( type * * ) 0 ) ) # define TYPEDEF_D2I_OF ( type ) typedef type * d2i_of_ ## type ( type * * , const unsigned char * * , long ) # define TYPEDEF_I2D_OF ( type ) typedef int i2d_of_ ## type ( type * , unsigned char * * ) # define TYPEDEF_D2I2D_OF ( type ) TYPEDEF_D2I_OF ( type ) ;
TYPEDEF_I2D_OF ( type ) TYPEDEF_D2I2D_OF ( void ) ;
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION typedef const ASN1_ITEM ASN1_ITEM_EXP ;
# define ASN1_ITEM_ptr ( iptr ) ( iptr ) # define ASN1_ITEM_ref ( iptr ) ( & ( iptr ## _it ) ) # define ASN1_ITEM_rptr ( ref ) ( & ( ref ## _it ) ) # define DECLARE_ASN1_ITEM ( name ) OPENSSL_EXTERN const ASN1_ITEM name ## _it ;
# else typedef const ASN1_ITEM * ASN1_ITEM_EXP ( void ) ;
# define ASN1_ITEM_ptr ( iptr ) ( iptr ( ) ) # define ASN1_ITEM_ref ( iptr ) ( iptr ## _it ) # define ASN1_ITEM_rptr ( ref ) ( ref ## _it ( ) ) # define DECLARE_ASN1_ITEM ( name ) const ASN1_ITEM * name ## _it ( void ) ;
# endif # define ASN1_STRFLGS_ESC_2253 1 # define ASN1_STRFLGS_ESC_CTRL 2 # define ASN1_STRFLGS_ESC_MSB 4 # define ASN1_STRFLGS_ESC_QUOTE 8 # define CHARTYPE_PRINTABLESTRING 0x10 # define CHARTYPE_FIRST_ESC_2253 0x20 # define CHARTYPE_LAST_ESC_2253 0x40 # define ASN1_STRFLGS_UTF8_CONVERT 0x10 # define ASN1_STRFLGS_IGNORE_TYPE 0x20 # define ASN1_STRFLGS_SHOW_TYPE 0x40 # define ASN1_STRFLGS_DUMP_ALL 0x80 # define ASN1_STRFLGS_DUMP_UNKNOWN 0x100 # define ASN1_STRFLGS_DUMP_DER 0x200 # define ASN1_STRFLGS_ESC_2254 0x400 # define ASN1_STRFLGS_RFC2253 ( ASN1_STRFLGS_ESC_2253 | ASN1_STRFLGS_ESC_CTRL | ASN1_STRFLGS_ESC_MSB | ASN1_STRFLGS_UTF8_CONVERT | ASN1_STRFLGS_DUMP_UNKNOWN | ASN1_STRFLGS_DUMP_DER ) DEFINE_STACK_OF ( ASN1_INTEGER ) DEFINE_STACK_OF ( ASN1_GENERALSTRING ) DEFINE_STACK_OF ( ASN1_UTF8STRING ) typedef struct asn1_type_st {
int type ;
union {
char * ptr ;
ASN1_BOOLEAN boolean ;
ASN1_STRING * asn1_string ;
ASN1_OBJECT * object ;
ASN1_INTEGER * integer ;
ASN1_ENUMERATED * enumerated ;
ASN1_BIT_STRING * bit_string ;
ASN1_OCTET_STRING * octet_string ;
ASN1_PRINTABLESTRING * printablestring ;
ASN1_T61STRING * t61string ;
ASN1_IA5STRING * ia5string ;
ASN1_GENERALSTRING * generalstring ;
ASN1_BMPSTRING * bmpstring ;
ASN1_UNIVERSALSTRING * universalstring ;
ASN1_UTCTIME * utctime ;
ASN1_GENERALIZEDTIME * generalizedtime ;
ASN1_VISIBLESTRING * visiblestring ;
ASN1_UTF8STRING * utf8string ;
ASN1_STRING * set ;
ASN1_STRING * sequence ;
ASN1_VALUE * asn1_value ;
}
value ;
}
ASN1_TYPE ;
DEFINE_STACK_OF ( ASN1_TYPE ) typedef STACK_OF ( ASN1_TYPE ) ASN1_SEQUENCE_ANY ;
DECLARE_ASN1_ENCODE_FUNCTIONS_const ( ASN1_SEQUENCE_ANY , ASN1_SEQUENCE_ANY ) DECLARE_ASN1_ENCODE_FUNCTIONS_const ( ASN1_SEQUENCE_ANY , ASN1_SET_ANY ) typedef struct BIT_STRING_BITNAME_st {
int bitnum ;
const char * lname ;
const char * sname ;
}
BIT_STRING_BITNAME ;
# define B_ASN1_TIME B_ASN1_UTCTIME | B_ASN1_GENERALIZEDTIME # define B_ASN1_PRINTABLE B_ASN1_NUMERICSTRING | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING | B_ASN1_BIT_STRING | B_ASN1_UNIVERSALSTRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING | B_ASN1_SEQUENCE | B_ASN1_UNKNOWN # define B_ASN1_DIRECTORYSTRING B_ASN1_PRINTABLESTRING | B_ASN1_TELETEXSTRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING | B_ASN1_UTF8STRING # define B_ASN1_DISPLAYTEXT B_ASN1_IA5STRING | B_ASN1_VISIBLESTRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING DECLARE_ASN1_FUNCTIONS_fname ( ASN1_TYPE , ASN1_ANY , ASN1_TYPE ) int ASN1_TYPE_get ( const ASN1_TYPE * a ) ;
void ASN1_TYPE_set ( ASN1_TYPE * a , int type , void * value ) ;
int ASN1_TYPE_set1 ( ASN1_TYPE * a , int type , const void * value ) ;
int ASN1_TYPE_cmp ( const ASN1_TYPE * a , const ASN1_TYPE * b ) ;
ASN1_TYPE * ASN1_TYPE_pack_sequence ( const ASN1_ITEM * it , void * s , ASN1_TYPE * * t ) ;
void * ASN1_TYPE_unpack_sequence ( const ASN1_ITEM * it , const ASN1_TYPE * t ) ;
ASN1_OBJECT * ASN1_OBJECT_new ( void ) ;
void ASN1_OBJECT_free ( ASN1_OBJECT * a ) ;
int i2d_ASN1_OBJECT ( const ASN1_OBJECT * a , unsigned char * * pp ) ;
ASN1_OBJECT * d2i_ASN1_OBJECT ( ASN1_OBJECT * * a , const unsigned char * * pp , long length ) ;
DECLARE_ASN1_ITEM ( ASN1_OBJECT ) DEFINE_STACK_OF ( ASN1_OBJECT ) ASN1_STRING * ASN1_STRING_new ( void ) ;
void ASN1_STRING_free ( ASN1_STRING * a ) ;
void ASN1_STRING_clear_free ( ASN1_STRING * a ) ;
int ASN1_STRING_copy ( ASN1_STRING * dst , const ASN1_STRING * str ) ;
ASN1_STRING * ASN1_STRING_dup ( const ASN1_STRING * a ) ;
ASN1_STRING * ASN1_STRING_type_new ( int type ) ;
int ASN1_STRING_cmp ( const ASN1_STRING * a , const ASN1_STRING * b ) ;
int ASN1_STRING_set ( ASN1_STRING * str , const void * data , int len ) ;
void ASN1_STRING_set0 ( ASN1_STRING * str , void * data , int len ) ;
int ASN1_STRING_length ( const ASN1_STRING * x ) ;
void ASN1_STRING_length_set ( ASN1_STRING * x , int n ) ;
int ASN1_STRING_type ( const ASN1_STRING * x ) ;
DEPRECATEDIN_1_1_0 ( unsigned char * ASN1_STRING_data ( ASN1_STRING * x ) ) const unsigned char * ASN1_STRING_get0_data ( const ASN1_STRING * x ) ;
DECLARE_ASN1_FUNCTIONS ( ASN1_BIT_STRING ) int ASN1_BIT_STRING_set ( ASN1_BIT_STRING * a , unsigned char * d , int length ) ;
int ASN1_BIT_STRING_set_bit ( ASN1_BIT_STRING * a , int n , int value ) ;
int ASN1_BIT_STRING_get_bit ( const ASN1_BIT_STRING * a , int n ) ;
int ASN1_BIT_STRING_check ( const ASN1_BIT_STRING * a , const unsigned char * flags , int flags_len ) ;
int ASN1_BIT_STRING_name_print ( BIO * out , ASN1_BIT_STRING * bs , BIT_STRING_BITNAME * tbl , int indent ) ;
int ASN1_BIT_STRING_num_asc ( const char * name , BIT_STRING_BITNAME * tbl ) ;
int ASN1_BIT_STRING_set_asc ( ASN1_BIT_STRING * bs , const char * name , int value , BIT_STRING_BITNAME * tbl ) ;
DECLARE_ASN1_FUNCTIONS ( ASN1_INTEGER ) ASN1_INTEGER * d2i_ASN1_UINTEGER ( ASN1_INTEGER * * a , const unsigned char * * pp , long length ) ;
ASN1_INTEGER * ASN1_INTEGER_dup ( const ASN1_INTEGER * x ) ;
int ASN1_INTEGER_cmp ( const ASN1_INTEGER * x , const ASN1_INTEGER * y ) ;
DECLARE_ASN1_FUNCTIONS ( ASN1_ENUMERATED ) int ASN1_UTCTIME_check ( const ASN1_UTCTIME * a ) ;
ASN1_UTCTIME * ASN1_UTCTIME_set ( ASN1_UTCTIME * s , time_t t ) ;
ASN1_UTCTIME * ASN1_UTCTIME_adj ( ASN1_UTCTIME * s , time_t t , int offset_day , long offset_sec ) ;
int ASN1_UTCTIME_set_string ( ASN1_UTCTIME * s , const char * str ) ;
int ASN1_UTCTIME_cmp_time_t ( const ASN1_UTCTIME * s , time_t t ) ;
int ASN1_GENERALIZEDTIME_check ( const ASN1_GENERALIZEDTIME * a ) ;
ASN1_GENERALIZEDTIME * ASN1_GENERALIZEDTIME_set ( ASN1_GENERALIZEDTIME * s , time_t t ) ;
ASN1_GENERALIZEDTIME * ASN1_GENERALIZEDTIME_adj ( ASN1_GENERALIZEDTIME * s , time_t t , int offset_day , long offset_sec ) ;
int ASN1_GENERALIZEDTIME_set_string ( ASN1_GENERALIZEDTIME * s , const char * str ) ;
int ASN1_TIME_diff ( int * pday , int * psec , const ASN1_TIME * from , const ASN1_TIME * to ) ;
DECLARE_ASN1_FUNCTIONS ( ASN1_OCTET_STRING ) ASN1_OCTET_STRING * ASN1_OCTET_STRING_dup ( const ASN1_OCTET_STRING * a ) ;
int ASN1_OCTET_STRING_cmp ( const ASN1_OCTET_STRING * a , const ASN1_OCTET_STRING * b ) ;
int ASN1_OCTET_STRING_set ( ASN1_OCTET_STRING * str , const unsigned char * data , int len ) ;
DECLARE_ASN1_FUNCTIONS ( ASN1_VISIBLESTRING ) | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void short_usage ( FILE * f ) {
short_usage_sub ( f ) ;
fprintf ( f , "For more options, use %s --help\n" , my_progname_short ) ;
} | 1True
|
Categorize the following code snippet as vulnerable or not. True or False | static void print_var_int ( const char * var , int val ) {
printf ( "%s=%d\n" , var , val ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | void ff_init_qscale_tab ( MpegEncContext * s ) {
int8_t * const qscale_table = s -> current_picture . qscale_table ;
int i ;
for ( i = 0 ;
i < s -> mb_num ;
i ++ ) {
unsigned int lam = s -> lambda_table [ s -> mb_index2xy [ i ] ] ;
int qp = ( lam * 139 + FF_LAMBDA_SCALE * 64 ) >> ( FF_LAMBDA_SHIFT + 7 ) ;
qscale_table [ s -> mb_index2xy [ i ] ] = av_clip ( qp , s -> avctx -> qmin , s -> avctx -> qmax ) ;
}
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | TEST_F ( ProtocolHandlerRegistryTest , TestEnabledDisabled ) {
registry ( ) -> Disable ( ) ;
ASSERT_FALSE ( registry ( ) -> enabled ( ) ) ;
registry ( ) -> Enable ( ) ;
ASSERT_TRUE ( registry ( ) -> enabled ( ) ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static __always_inline __be32 __cpu_to_be32p ( const __u32 * p ) {
return ( __be32 ) __swab32p ( p ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | int main ( int argc , char * * argv ) {
char * analyze_script_file_name = NULL ;
char * deletion_script_file_name = NULL ;
bool live_check = false ;
parseCommandLine ( argc , argv ) ;
get_restricted_token ( os_info . progname ) ;
adjust_data_dir ( & old_cluster ) ;
adjust_data_dir ( & new_cluster ) ;
setup ( argv [ 0 ] , & live_check ) ;
output_check_banner ( live_check ) ;
check_cluster_versions ( ) ;
get_sock_dir ( & old_cluster , live_check ) ;
get_sock_dir ( & new_cluster , false ) ;
check_cluster_compatibility ( live_check ) ;
check_and_dump_old_cluster ( live_check ) ;
start_postmaster ( & new_cluster , true ) ;
check_new_cluster ( ) ;
report_clusters_compatible ( ) ;
pg_log ( PG_REPORT , "\nPerforming Upgrade\n" ) ;
pg_log ( PG_REPORT , "------------------\n" ) ;
prepare_new_cluster ( ) ;
stop_postmaster ( false ) ;
copy_clog_xlog_xid ( ) ;
start_postmaster ( & new_cluster , true ) ;
prepare_new_databases ( ) ;
create_new_objects ( ) ;
stop_postmaster ( false ) ;
if ( user_opts . transfer_mode == TRANSFER_MODE_LINK ) disable_old_cluster ( ) ;
transfer_all_new_tablespaces ( & old_cluster . dbarr , & new_cluster . dbarr , old_cluster . pgdata , new_cluster . pgdata ) ;
prep_status ( "Setting next OID for new cluster" ) ;
exec_prog ( UTILITY_LOG_FILE , NULL , true , "\"%s/pg_resetxlog\" -o %u \"%s\"" , new_cluster . bindir , old_cluster . controldata . chkpnt_nxtoid , new_cluster . pgdata ) ;
check_ok ( ) ;
prep_status ( "Sync data directory to disk" ) ;
exec_prog ( UTILITY_LOG_FILE , NULL , true , "\"%s/initdb\" --sync-only \"%s\"" , new_cluster . bindir , new_cluster . pgdata ) ;
check_ok ( ) ;
create_script_for_cluster_analyze ( & analyze_script_file_name ) ;
create_script_for_old_cluster_deletion ( & deletion_script_file_name ) ;
issue_warnings ( ) ;
pg_log ( PG_REPORT , "\nUpgrade Complete\n" ) ;
pg_log ( PG_REPORT , "----------------\n" ) ;
output_completion_banner ( analyze_script_file_name , deletion_script_file_name ) ;
pg_free ( analyze_script_file_name ) ;
pg_free ( deletion_script_file_name ) ;
cleanup ( ) ;
return 0 ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static int x8_setup_spatial_predictor ( IntraX8Context * const w , const int chroma ) {
MpegEncContext * const s = w -> s ;
int range ;
int sum ;
int quant ;
w -> dsp . setup_spatial_compensation ( s -> dest [ chroma ] , s -> edge_emu_buffer , s -> current_picture . f . linesize [ chroma > 0 ] , & range , & sum , w -> edges ) ;
if ( chroma ) {
w -> orient = w -> chroma_orient ;
quant = w -> quant_dc_chroma ;
}
else {
quant = w -> quant ;
}
w -> flat_dc = 0 ;
if ( range < quant || range < 3 ) {
w -> orient = 0 ;
if ( range < 3 ) {
w -> flat_dc = 1 ;
sum += 9 ;
w -> predicted_dc = ( sum * 6899 ) >> 17 ;
}
}
if ( chroma ) return 0 ;
assert ( w -> orient < 3 ) ;
if ( range < 2 * w -> quant ) {
if ( ( w -> edges & 3 ) == 0 ) {
if ( w -> orient == 1 ) w -> orient = 11 ;
if ( w -> orient == 2 ) w -> orient = 10 ;
}
else {
w -> orient = 0 ;
}
w -> raw_orient = 0 ;
}
else {
static const uint8_t prediction_table [ 3 ] [ 12 ] = {
{
0 , 8 , 4 , 10 , 11 , 2 , 6 , 9 , 1 , 3 , 5 , 7 }
, {
4 , 0 , 8 , 11 , 10 , 3 , 5 , 2 , 6 , 9 , 1 , 7 }
, {
8 , 0 , 4 , 10 , 11 , 1 , 7 , 2 , 6 , 9 , 3 , 5 }
}
;
w -> raw_orient = x8_get_orient_vlc ( w ) ;
if ( w -> raw_orient < 0 ) return - 1 ;
assert ( w -> raw_orient < 12 ) ;
assert ( w -> orient < 3 ) ;
w -> orient = prediction_table [ w -> orient ] [ w -> raw_orient ] ;
}
return 0 ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static int dissect_h245_VideoMode ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
# line 516 "../../asn1/h245/h245.cnf" gint32 value ;
offset = dissect_per_choice ( tvb , offset , actx , tree , hf_index , ett_h245_VideoMode , VideoMode_choice , & value ) ;
codec_type = val_to_str ( value , h245_VideoMode_vals , "<unknown>" ) ;
return offset ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | extern int as_mysql_node_down ( mysql_conn_t * mysql_conn , struct node_record * node_ptr , time_t event_time , char * reason , uint32_t reason_uid ) {
int rc = SLURM_SUCCESS ;
char * query = NULL ;
char * my_reason ;
MYSQL_RES * result = NULL ;
MYSQL_ROW row ;
if ( check_connection ( mysql_conn ) != SLURM_SUCCESS ) return ESLURM_DB_CONNECTION ;
if ( ! mysql_conn -> cluster_name ) {
error ( "%s:%d no cluster name" , THIS_FILE , __LINE__ ) ;
return SLURM_ERROR ;
}
if ( ! node_ptr ) {
error ( "No node_ptr given!" ) ;
return SLURM_ERROR ;
}
if ( ! node_ptr -> tres_str ) {
error ( "node ptr has no tres_list!" ) ;
return SLURM_ERROR ;
}
query = xstrdup_printf ( "select state, reason from \"%s_%s\" where " "time_end=0 and node_name='%s';
" , mysql_conn -> cluster_name , event_table , node_ptr -> name ) ;
result = mysql_db_query_ret ( mysql_conn , query , 0 ) ;
xfree ( query ) ;
if ( ! result ) return SLURM_ERROR ;
if ( reason ) my_reason = reason ;
else my_reason = node_ptr -> reason ;
row = mysql_fetch_row ( result ) ;
if ( row && ( node_ptr -> node_state == slurm_atoul ( row [ 0 ] ) ) && my_reason && row [ 1 ] && ! xstrcasecmp ( my_reason , row [ 1 ] ) ) {
debug ( "as_mysql_node_down: no change needed %u == %s " "and %s == %s" , node_ptr -> node_state , row [ 0 ] , my_reason , row [ 1 ] ) ;
mysql_free_result ( result ) ;
return SLURM_SUCCESS ;
}
mysql_free_result ( result ) ;
debug2 ( "inserting %s(%s) with tres of '%s'" , node_ptr -> name , mysql_conn -> cluster_name , node_ptr -> tres_str ) ;
query = xstrdup_printf ( "update \"%s_%s\" set time_end=%ld where " "time_end=0 and node_name='%s';
" , mysql_conn -> cluster_name , event_table , event_time , node_ptr -> name ) ;
xstrfmtcat ( query , "insert into \"%s_%s\" " "(node_name, state, tres, time_start, " "reason, reason_uid) " "values ('%s', %u, '%s', %ld, '%s', %u) " "on duplicate key update time_end=0;
" , mysql_conn -> cluster_name , event_table , node_ptr -> name , node_ptr -> node_state , node_ptr -> tres_str , event_time , my_reason , reason_uid ) ;
debug2 ( "%d(%s:%d) query\n%s" , mysql_conn -> conn , THIS_FILE , __LINE__ , query ) ;
rc = mysql_db_query ( mysql_conn , query ) ;
xfree ( query ) ;
return rc ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void release_tree_entry ( struct tree_entry * e ) {
if ( e -> tree ) release_tree_content_recursive ( e -> tree ) ;
* ( ( void * * ) e ) = avail_tree_entry ;
avail_tree_entry = e ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | void mainwindow_change_active ( MAIN_WINDOW_REC * mainwin , WINDOW_REC * skip_window ) {
WINDOW_REC * window , * other ;
GSList * tmp ;
mainwin -> active = NULL ;
if ( mainwin -> sticky_windows ) {
tmp = get_sticky_windows_sorted ( mainwin ) ;
window = tmp -> data ;
if ( window == skip_window ) {
window = tmp -> next == NULL ? NULL : tmp -> next -> data ;
}
g_slist_free ( tmp ) ;
if ( window != NULL ) {
window_set_active ( window ) ;
return ;
}
}
other = NULL ;
for ( tmp = windows ;
tmp != NULL ;
tmp = tmp -> next ) {
WINDOW_REC * rec = tmp -> data ;
if ( rec != skip_window ) {
other = rec ;
break ;
}
}
window_set_active ( other ) ;
if ( mainwindows -> next != NULL ) mainwindow_destroy ( mainwin ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | IN_PROC_BROWSER_TEST_P ( BrowserCloseManagerWithDownloadsBrowserTest , DISABLED_TestBeforeUnloadAndDownloads ) {
SetDownloadPathForProfile ( browser ( ) -> profile ( ) ) ;
ASSERT_NO_FATAL_FAILURE ( CreateStalledDownload ( browser ( ) ) ) ;
ASSERT_NO_FATAL_FAILURE ( ui_test_utils : : NavigateToURL ( browser ( ) , embedded_test_server ( ) -> GetURL ( "/beforeunload.html" ) ) ) ;
PrepareForDialog ( browser ( ) ) ;
content : : WindowedNotificationObserver cancel_observer ( chrome : : NOTIFICATION_BROWSER_CLOSE_CANCELLED , content : : NotificationService : : AllSources ( ) ) ;
TestBrowserCloseManager : : AttemptClose ( TestBrowserCloseManager : : USER_CHOICE_USER_CANCELS_CLOSE ) ;
ASSERT_NO_FATAL_FAILURE ( AcceptClose ( ) ) ;
cancel_observer . Wait ( ) ;
EXPECT_FALSE ( browser_shutdown : : IsTryingToQuit ( ) ) ;
RepeatedNotificationObserver close_observer ( chrome : : NOTIFICATION_BROWSER_CLOSED , 1 ) ;
TestBrowserCloseManager : : AttemptClose ( TestBrowserCloseManager : : USER_CHOICE_USER_ALLOWS_CLOSE ) ;
ASSERT_NO_FATAL_FAILURE ( AcceptClose ( ) ) ;
close_observer . Wait ( ) ;
EXPECT_TRUE ( browser_shutdown : : IsTryingToQuit ( ) ) ;
EXPECT_TRUE ( BrowserList : : GetInstance ( ) -> empty ( ) ) ;
} | 1True
|
Categorize the following code snippet as vulnerable or not. True or False | static void ras_call_matching ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , h225_packet_info * pi ) {
proto_item * hidden_item ;
conversation_t * conversation = NULL ;
h225ras_call_info_key h225ras_call_key ;
h225ras_call_t * h225ras_call = NULL ;
nstime_t delta ;
guint msg_category ;
if ( pi -> msg_type == H225_RAS && pi -> msg_tag < 21 ) {
msg_category = pi -> msg_tag / 3 ;
if ( pi -> msg_tag % 3 == 0 ) {
conversation = find_or_create_conversation ( pinfo ) ;
h225ras_call_key . reqSeqNum = pi -> requestSeqNum ;
h225ras_call_key . conversation = conversation ;
h225ras_call = find_h225ras_call ( & h225ras_call_key , msg_category ) ;
if ( h225ras_call != NULL ) {
do {
if ( pinfo -> num == h225ras_call -> req_num ) {
break ;
}
if ( h225ras_call -> next_call == NULL ) {
if ( ( pinfo -> num > h225ras_call -> rsp_num && h225ras_call -> rsp_num != 0 && pinfo -> abs_ts . secs > ( h225ras_call -> req_time . secs + THRESHOLD_REPEATED_RESPONDED_CALL ) ) || ( pinfo -> num > h225ras_call -> req_num && h225ras_call -> rsp_num == 0 && pinfo -> abs_ts . secs > ( h225ras_call -> req_time . secs + THRESHOLD_REPEATED_NOT_RESPONDED_CALL ) ) ) {
h225ras_call = append_h225ras_call ( h225ras_call , pinfo , & pi -> guid , msg_category ) ;
}
else {
pi -> is_duplicate = TRUE ;
hidden_item = proto_tree_add_uint ( tree , hf_h225_ras_dup , tvb , 0 , 0 , pi -> requestSeqNum ) ;
PROTO_ITEM_SET_HIDDEN ( hidden_item ) ;
}
break ;
}
h225ras_call = h225ras_call -> next_call ;
}
while ( h225ras_call != NULL ) ;
}
else {
h225ras_call = new_h225ras_call ( & h225ras_call_key , pinfo , & pi -> guid , msg_category ) ;
}
if ( h225ras_call && h225ras_call -> rsp_num != 0 ) {
proto_item * ti = proto_tree_add_uint_format ( tree , hf_h225_ras_rsp_frame , tvb , 0 , 0 , h225ras_call -> rsp_num , "The response to this request is in frame %u" , h225ras_call -> rsp_num ) ;
PROTO_ITEM_SET_GENERATED ( ti ) ;
}
}
else {
conversation = find_conversation ( pinfo -> num , & pinfo -> src , & pinfo -> dst , pinfo -> ptype , pinfo -> srcport , pinfo -> destport , 0 ) ;
if ( conversation != NULL ) {
h225ras_call_key . reqSeqNum = pi -> requestSeqNum ;
h225ras_call_key . conversation = conversation ;
h225ras_call = find_h225ras_call ( & h225ras_call_key , msg_category ) ;
if ( h225ras_call ) {
do {
if ( pinfo -> num == h225ras_call -> rsp_num ) {
break ;
}
if ( h225ras_call -> next_call == NULL ) {
break ;
}
h225ras_call = h225ras_call -> next_call ;
}
while ( h225ras_call != NULL ) ;
if ( ! h225ras_call ) {
return ;
}
if ( msg_category == 3 || msg_category == 5 ) {
pi -> guid = h225ras_call -> guid ;
hidden_item = proto_tree_add_guid ( tree , hf_h225_guid , tvb , 0 , GUID_LEN , & pi -> guid ) ;
PROTO_ITEM_SET_HIDDEN ( hidden_item ) ;
}
if ( h225ras_call -> rsp_num == 0 ) {
h225ras_call -> rsp_num = pinfo -> num ;
}
else {
if ( h225ras_call -> rsp_num != pinfo -> num ) {
pi -> is_duplicate = TRUE ;
hidden_item = proto_tree_add_uint ( tree , hf_h225_ras_dup , tvb , 0 , 0 , pi -> requestSeqNum ) ;
PROTO_ITEM_SET_HIDDEN ( hidden_item ) ;
}
}
if ( h225ras_call -> req_num != 0 ) {
proto_item * ti ;
h225ras_call -> responded = TRUE ;
pi -> request_available = TRUE ;
ti = proto_tree_add_uint_format ( tree , hf_h225_ras_req_frame , tvb , 0 , 0 , h225ras_call -> req_num , "This is a response to a request in frame %u" , h225ras_call -> req_num ) ;
PROTO_ITEM_SET_GENERATED ( ti ) ;
nstime_delta ( & delta , & pinfo -> abs_ts , & h225ras_call -> req_time ) ;
pi -> delta_time = delta ;
ti = proto_tree_add_time ( tree , hf_h225_ras_deltatime , tvb , 0 , 0 , & ( pi -> delta_time ) ) ;
PROTO_ITEM_SET_GENERATED ( ti ) ;
}
}
}
}
}
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static int rv34_set_deblock_coef ( RV34DecContext * r ) {
MpegEncContext * s = & r -> s ;
int hmvmask = 0 , vmvmask = 0 , i , j ;
int midx = s -> mb_x * 2 + s -> mb_y * 2 * s -> b8_stride ;
int16_t ( * motion_val ) [ 2 ] = & s -> current_picture_ptr -> motion_val [ 0 ] [ midx ] ;
for ( j = 0 ;
j < 16 ;
j += 8 ) {
for ( i = 0 ;
i < 2 ;
i ++ ) {
if ( is_mv_diff_gt_3 ( motion_val + i , 1 ) ) vmvmask |= 0x11 << ( j + i * 2 ) ;
if ( ( j || s -> mb_y ) && is_mv_diff_gt_3 ( motion_val + i , s -> b8_stride ) ) hmvmask |= 0x03 << ( j + i * 2 ) ;
}
motion_val += s -> b8_stride ;
}
if ( s -> first_slice_line ) hmvmask &= ~ 0x000F ;
if ( ! s -> mb_x ) vmvmask &= ~ 0x1111 ;
if ( r -> rv30 ) {
vmvmask |= ( vmvmask & 0x4444 ) >> 1 ;
hmvmask |= ( hmvmask & 0x0F00 ) >> 4 ;
if ( s -> mb_x ) r -> deblock_coefs [ s -> mb_x - 1 + s -> mb_y * s -> mb_stride ] |= ( vmvmask & 0x1111 ) << 3 ;
if ( ! s -> first_slice_line ) r -> deblock_coefs [ s -> mb_x + ( s -> mb_y - 1 ) * s -> mb_stride ] |= ( hmvmask & 0xF ) << 12 ;
}
return hmvmask | vmvmask ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | TEST_F ( ProfileInfoCacheTest , AddProfiles ) {
EXPECT_EQ ( 0u , GetCache ( ) -> GetNumberOfProfiles ( ) ) ;
ui : : ResourceBundle & rb = ui : : ResourceBundle : : GetSharedInstance ( ) ;
for ( uint32 i = 0 ;
i < 4 ;
++ i ) {
base : : FilePath profile_path = GetProfilePath ( base : : StringPrintf ( "path_%ud" , i ) ) ;
base : : string16 profile_name = ASCIIToUTF16 ( base : : StringPrintf ( "name_%ud" , i ) ) ;
const SkBitmap * icon = rb . GetImageNamed ( profiles : : GetDefaultAvatarIconResourceIDAtIndex ( i ) ) . ToSkBitmap ( ) ;
std : : string supervised_user_id = i == 3 ? "TEST_ID" : "" ;
GetCache ( ) -> AddProfileToCache ( profile_path , profile_name , base : : string16 ( ) , i , supervised_user_id ) ;
GetCache ( ) -> SetBackgroundStatusOfProfileAtIndex ( i , true ) ;
base : : string16 gaia_name = ASCIIToUTF16 ( base : : StringPrintf ( "gaia_%ud" , i ) ) ;
GetCache ( ) -> SetGAIANameOfProfileAtIndex ( i , gaia_name ) ;
EXPECT_EQ ( i + 1 , GetCache ( ) -> GetNumberOfProfiles ( ) ) ;
EXPECT_EQ ( profile_name , GetCache ( ) -> GetNameOfProfileAtIndex ( i ) ) ;
EXPECT_EQ ( profile_path , GetCache ( ) -> GetPathOfProfileAtIndex ( i ) ) ;
const SkBitmap * actual_icon = GetCache ( ) -> GetAvatarIconOfProfileAtIndex ( i ) . ToSkBitmap ( ) ;
EXPECT_EQ ( icon -> width ( ) , actual_icon -> width ( ) ) ;
EXPECT_EQ ( icon -> height ( ) , actual_icon -> height ( ) ) ;
EXPECT_EQ ( i == 3 , GetCache ( ) -> ProfileIsSupervisedAtIndex ( i ) ) ;
EXPECT_EQ ( i == 3 , GetCache ( ) -> IsOmittedProfileAtIndex ( i ) ) ;
EXPECT_EQ ( supervised_user_id , GetCache ( ) -> GetSupervisedUserIdOfProfileAtIndex ( i ) ) ;
}
ResetCache ( ) ;
EXPECT_EQ ( 4u , GetCache ( ) -> GetNumberOfProfiles ( ) ) ;
for ( uint32 i = 0 ;
i < 4 ;
++ i ) {
base : : FilePath profile_path = GetProfilePath ( base : : StringPrintf ( "path_%ud" , i ) ) ;
EXPECT_EQ ( i , GetCache ( ) -> GetIndexOfProfileWithPath ( profile_path ) ) ;
base : : string16 profile_name = ASCIIToUTF16 ( base : : StringPrintf ( "name_%ud" , i ) ) ;
EXPECT_EQ ( profile_name , GetCache ( ) -> GetNameOfProfileAtIndex ( i ) ) ;
EXPECT_EQ ( i , GetCache ( ) -> GetAvatarIconIndexOfProfileAtIndex ( i ) ) ;
EXPECT_EQ ( true , GetCache ( ) -> GetBackgroundStatusOfProfileAtIndex ( i ) ) ;
base : : string16 gaia_name = ASCIIToUTF16 ( base : : StringPrintf ( "gaia_%ud" , i ) ) ;
EXPECT_EQ ( gaia_name , GetCache ( ) -> GetGAIANameOfProfileAtIndex ( i ) ) ;
}
} | 1True
|
Categorize the following code snippet as vulnerable or not. True or False | static int dissect_h245_INTEGER_M262144_262143 ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_constrained_integer ( tvb , offset , actx , tree , hf_index , - 262144 , 262143U , NULL , FALSE ) ;
return offset ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | extern int main ( int argc , const char * argv [ ] ) {
TestLenient8Iterator ( ) ;
return 0 ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | TEST_F ( TemplateURLTest , GenerateKeyword ) {
ASSERT_EQ ( ASCIIToUTF16 ( "foo" ) , TemplateURL : : GenerateKeyword ( GURL ( "http://foo" ) ) ) ;
ASSERT_EQ ( ASCIIToUTF16 ( "foo" ) , TemplateURL : : GenerateKeyword ( GURL ( "http://www.foo" ) ) ) ;
ASSERT_EQ ( ASCIIToUTF16 ( "blah" ) , TemplateURL : : GenerateKeyword ( GURL ( "http://blah/" ) ) ) ;
ASSERT_EQ ( ASCIIToUTF16 ( "www" ) , TemplateURL : : GenerateKeyword ( GURL ( "http://www." ) ) ) ;
ASSERT_EQ ( base : : UTF8ToUTF16 ( "\xd0\xb0\xd0\xb1\xd0\xb2" ) , TemplateURL : : GenerateKeyword ( GURL ( "http://xn--80acd" ) ) ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | int authreadkeys ( const char * file ) {
FILE * fp ;
char * line ;
char * token ;
keyid_t keyno ;
int keytype ;
char buf [ 512 ] ;
u_char keystr [ 32 ] ;
size_t len ;
size_t j ;
size_t nerr ;
fp = fopen ( file , "r" ) ;
if ( fp == NULL ) {
msyslog ( LOG_ERR , "authreadkeys: file %s: %m" , file ) ;
return ( 0 ) ;
}
INIT_SSL ( ) ;
auth_delkeys ( ) ;
nerr = 0 ;
while ( ( line = fgets ( buf , sizeof buf , fp ) ) != NULL ) {
if ( nerr > nerr_maxlimit ) break ;
token = nexttok ( & line ) ;
if ( token == NULL ) continue ;
keyno = atoi ( token ) ;
if ( keyno == 0 ) {
log_maybe ( & nerr , "authreadkeys: cannot change key %s" , token ) ;
continue ;
}
if ( keyno > NTP_MAXKEY ) {
log_maybe ( & nerr , "authreadkeys: key %s > %d reserved for Autokey" , token , NTP_MAXKEY ) ;
continue ;
}
token = nexttok ( & line ) ;
if ( token == NULL ) {
log_maybe ( & nerr , "authreadkeys: no key type for key %d" , keyno ) ;
continue ;
}
# ifdef OPENSSL keytype = keytype_from_text ( token , NULL ) ;
if ( keytype == 0 ) {
log_maybe ( & nerr , "authreadkeys: invalid type for key %d" , keyno ) ;
continue ;
}
if ( EVP_get_digestbynid ( keytype ) == NULL ) {
log_maybe ( & nerr , "authreadkeys: no algorithm for key %d" , keyno ) ;
continue ;
}
# else if ( ! ( * token == 'M' || * token == 'm' ) ) {
log_maybe ( & nerr , "authreadkeys: invalid type for key %d" , keyno ) ;
continue ;
}
keytype = KEY_TYPE_MD5 ;
# endif token = nexttok ( & line ) ;
if ( token == NULL ) {
log_maybe ( & nerr , "authreadkeys: no key for key %d" , keyno ) ;
continue ;
}
len = strlen ( token ) ;
if ( len <= 20 ) {
MD5auth_setkey ( keyno , keytype , ( u_char * ) token , len ) ;
}
else {
char hex [ ] = "0123456789abcdef" ;
u_char temp ;
char * ptr ;
size_t jlim ;
jlim = min ( len , 2 * sizeof ( keystr ) ) ;
for ( j = 0 ;
j < jlim ;
j ++ ) {
ptr = strchr ( hex , tolower ( ( unsigned char ) token [ j ] ) ) ;
if ( ptr == NULL ) break ;
temp = ( u_char ) ( ptr - hex ) ;
if ( j & 1 ) keystr [ j / 2 ] |= temp ;
else keystr [ j / 2 ] = temp << 4 ;
}
if ( j < jlim ) {
log_maybe ( & nerr , "authreadkeys: invalid hex digit for key %d" , keyno ) ;
continue ;
}
MD5auth_setkey ( keyno , keytype , keystr , jlim / 2 ) ;
}
}
fclose ( fp ) ;
if ( nerr > nerr_maxlimit ) {
msyslog ( LOG_ERR , "authreadkeys: emergeny break after %u errors" , nerr ) ;
return ( 0 ) ;
}
else if ( nerr > nerr_loglimit ) {
msyslog ( LOG_ERR , "authreadkeys: found %u more error(s)" , nerr - nerr_loglimit ) ;
}
return ( 1 ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | int ParseCaffHeaderConfig ( FILE * infile , char * infilename , char * fourcc , WavpackContext * wpc , WavpackConfig * config ) {
uint32_t chan_chunk = 0 , channel_layout = 0 , bcount ;
unsigned char * channel_identities = NULL ;
unsigned char * channel_reorder = NULL ;
int64_t total_samples = 0 , infilesize ;
CAFFileHeader caf_file_header ;
CAFChunkHeader caf_chunk_header ;
CAFAudioFormat caf_audio_format ;
int i ;
infilesize = DoGetFileSize ( infile ) ;
memcpy ( & caf_file_header , fourcc , 4 ) ;
if ( ( ! DoReadFile ( infile , ( ( char * ) & caf_file_header ) + 4 , sizeof ( CAFFileHeader ) - 4 , & bcount ) || bcount != sizeof ( CAFFileHeader ) - 4 ) ) {
error_line ( "%s is not a valid .CAF file!" , infilename ) ;
return WAVPACK_SOFT_ERROR ;
}
else if ( ! ( config -> qmode & QMODE_NO_STORE_WRAPPER ) && ! WavpackAddWrapper ( wpc , & caf_file_header , sizeof ( CAFFileHeader ) ) ) {
error_line ( "%s" , WavpackGetErrorMessage ( wpc ) ) ;
return WAVPACK_SOFT_ERROR ;
}
WavpackBigEndianToNative ( & caf_file_header , CAFFileHeaderFormat ) ;
if ( caf_file_header . mFileVersion != 1 ) {
error_line ( "%s: can't handle version %d .CAF files!" , infilename , caf_file_header . mFileVersion ) ;
return WAVPACK_SOFT_ERROR ;
}
while ( 1 ) {
if ( ! DoReadFile ( infile , & caf_chunk_header , sizeof ( CAFChunkHeader ) , & bcount ) || bcount != sizeof ( CAFChunkHeader ) ) {
error_line ( "%s is not a valid .CAF file!" , infilename ) ;
return WAVPACK_SOFT_ERROR ;
}
else if ( ! ( config -> qmode & QMODE_NO_STORE_WRAPPER ) && ! WavpackAddWrapper ( wpc , & caf_chunk_header , sizeof ( CAFChunkHeader ) ) ) {
error_line ( "%s" , WavpackGetErrorMessage ( wpc ) ) ;
return WAVPACK_SOFT_ERROR ;
}
WavpackBigEndianToNative ( & caf_chunk_header , CAFChunkHeaderFormat ) ;
if ( ! strncmp ( caf_chunk_header . mChunkType , "desc" , 4 ) ) {
int supported = TRUE ;
if ( caf_chunk_header . mChunkSize != sizeof ( CAFAudioFormat ) || ! DoReadFile ( infile , & caf_audio_format , ( uint32_t ) caf_chunk_header . mChunkSize , & bcount ) || bcount != caf_chunk_header . mChunkSize ) {
error_line ( "%s is not a valid .CAF file!" , infilename ) ;
return WAVPACK_SOFT_ERROR ;
}
else if ( ! ( config -> qmode & QMODE_NO_STORE_WRAPPER ) && ! WavpackAddWrapper ( wpc , & caf_audio_format , ( uint32_t ) caf_chunk_header . mChunkSize ) ) {
error_line ( "%s" , WavpackGetErrorMessage ( wpc ) ) ;
return WAVPACK_SOFT_ERROR ;
}
WavpackBigEndianToNative ( & caf_audio_format , CAFAudioFormatFormat ) ;
if ( debug_logging_mode ) {
char formatstr [ 5 ] ;
memcpy ( formatstr , caf_audio_format . mFormatID , 4 ) ;
formatstr [ 4 ] = 0 ;
error_line ( "format = %s, flags = %x, sampling rate = %g" , formatstr , caf_audio_format . mFormatFlags , caf_audio_format . mSampleRate ) ;
error_line ( "packet = %d bytes and %d frames" , caf_audio_format . mBytesPerPacket , caf_audio_format . mFramesPerPacket ) ;
error_line ( "channels per frame = %d, bits per channel = %d" , caf_audio_format . mChannelsPerFrame , caf_audio_format . mBitsPerChannel ) ;
}
if ( strncmp ( caf_audio_format . mFormatID , "lpcm" , 4 ) || ( caf_audio_format . mFormatFlags & ~ 3 ) ) supported = FALSE ;
else if ( caf_audio_format . mSampleRate < 1.0 || caf_audio_format . mSampleRate > 16777215.0 || caf_audio_format . mSampleRate != floor ( caf_audio_format . mSampleRate ) ) supported = FALSE ;
else if ( ! caf_audio_format . mChannelsPerFrame || caf_audio_format . mChannelsPerFrame > 256 ) supported = FALSE ;
else if ( caf_audio_format . mBitsPerChannel < 1 || caf_audio_format . mBitsPerChannel > 32 || ( ( caf_audio_format . mFormatFlags & CAF_FORMAT_FLOAT ) && caf_audio_format . mBitsPerChannel != 32 ) ) supported = FALSE ;
else if ( caf_audio_format . mFramesPerPacket != 1 || caf_audio_format . mBytesPerPacket / caf_audio_format . mChannelsPerFrame < ( caf_audio_format . mBitsPerChannel + 7 ) / 8 || caf_audio_format . mBytesPerPacket / caf_audio_format . mChannelsPerFrame > 4 || caf_audio_format . mBytesPerPacket % caf_audio_format . mChannelsPerFrame ) supported = FALSE ;
if ( ! supported ) {
error_line ( "%s is an unsupported .CAF format!" , infilename ) ;
return WAVPACK_SOFT_ERROR ;
}
config -> bytes_per_sample = caf_audio_format . mBytesPerPacket / caf_audio_format . mChannelsPerFrame ;
config -> float_norm_exp = ( caf_audio_format . mFormatFlags & CAF_FORMAT_FLOAT ) ? 127 : 0 ;
config -> bits_per_sample = caf_audio_format . mBitsPerChannel ;
config -> num_channels = caf_audio_format . mChannelsPerFrame ;
config -> sample_rate = ( int ) caf_audio_format . mSampleRate ;
if ( ! ( caf_audio_format . mFormatFlags & CAF_FORMAT_LITTLE_ENDIAN ) && config -> bytes_per_sample > 1 ) config -> qmode |= QMODE_BIG_ENDIAN ;
if ( config -> bytes_per_sample == 1 ) config -> qmode |= QMODE_SIGNED_BYTES ;
if ( debug_logging_mode ) {
if ( config -> float_norm_exp == 127 ) error_line ( "data format: 32-bit %s-endian floating point" , ( config -> qmode & QMODE_BIG_ENDIAN ) ? "big" : "little" ) ;
else error_line ( "data format: %d-bit %s-endian integers stored in %d byte(s)" , config -> bits_per_sample , ( config -> qmode & QMODE_BIG_ENDIAN ) ? "big" : "little" , config -> bytes_per_sample ) ;
}
}
else if ( ! strncmp ( caf_chunk_header . mChunkType , "chan" , 4 ) ) {
CAFChannelLayout * caf_channel_layout ;
if ( caf_chunk_header . mChunkSize < sizeof ( CAFChannelLayout ) || caf_chunk_header . mChunkSize > 1024 ) {
error_line ( "this .CAF file has an invalid 'chan' chunk!" ) ;
return WAVPACK_SOFT_ERROR ;
}
if ( debug_logging_mode ) error_line ( "'chan' chunk is %d bytes" , ( int ) caf_chunk_header . mChunkSize ) ;
caf_channel_layout = malloc ( ( size_t ) caf_chunk_header . mChunkSize ) ;
if ( ! DoReadFile ( infile , caf_channel_layout , ( uint32_t ) caf_chunk_header . mChunkSize , & bcount ) || bcount != caf_chunk_header . mChunkSize ) {
error_line ( "%s is not a valid .CAF file!" , infilename ) ;
free ( caf_channel_layout ) ;
return WAVPACK_SOFT_ERROR ;
}
else if ( ! ( config -> qmode & QMODE_NO_STORE_WRAPPER ) && ! WavpackAddWrapper ( wpc , caf_channel_layout , ( uint32_t ) caf_chunk_header . mChunkSize ) ) {
error_line ( "%s" , WavpackGetErrorMessage ( wpc ) ) ;
free ( caf_channel_layout ) ;
return WAVPACK_SOFT_ERROR ;
}
WavpackBigEndianToNative ( caf_channel_layout , CAFChannelLayoutFormat ) ;
chan_chunk = 1 ;
if ( config -> channel_mask || ( config -> qmode & QMODE_CHANS_UNASSIGNED ) ) {
error_line ( "this CAF file already has channel order information!" ) ;
free ( caf_channel_layout ) ;
return WAVPACK_SOFT_ERROR ;
}
switch ( caf_channel_layout -> mChannelLayoutTag ) {
case kCAFChannelLayoutTag_UseChannelDescriptions : {
CAFChannelDescription * descriptions = ( CAFChannelDescription * ) ( caf_channel_layout + 1 ) ;
int num_descriptions = caf_channel_layout -> mNumberChannelDescriptions ;
int label , cindex = 0 , idents = 0 ;
if ( caf_chunk_header . mChunkSize != sizeof ( CAFChannelLayout ) + sizeof ( CAFChannelDescription ) * num_descriptions || num_descriptions != config -> num_channels ) {
error_line ( "channel descriptions in 'chan' chunk are the wrong size!" ) ;
free ( caf_channel_layout ) ;
return WAVPACK_SOFT_ERROR ;
}
if ( num_descriptions >= 256 ) {
error_line ( "%d channel descriptions is more than we can handle...ignoring!" ) ;
break ;
}
channel_reorder = malloc ( num_descriptions ) ;
memset ( channel_reorder , - 1 , num_descriptions ) ;
channel_identities = malloc ( num_descriptions + 1 ) ;
for ( i = 0 ;
i < num_descriptions ;
++ i ) {
WavpackBigEndianToNative ( descriptions + i , CAFChannelDescriptionFormat ) ;
if ( debug_logging_mode ) error_line ( "chan %d --> %d" , i + 1 , descriptions [ i ] . mChannelLabel ) ;
}
for ( label = 1 ;
label <= 18 ;
++ label ) for ( i = 0 ;
i < num_descriptions ;
++ i ) if ( descriptions [ i ] . mChannelLabel == label ) {
config -> channel_mask |= 1 << ( label - 1 ) ;
channel_reorder [ i ] = cindex ++ ;
break ;
}
for ( i = 0 ;
i < num_descriptions ;
++ i ) if ( channel_reorder [ i ] == ( unsigned char ) - 1 ) {
uint32_t clabel = descriptions [ i ] . mChannelLabel ;
if ( clabel == 0 || clabel == 0xffffffff || clabel == 100 ) channel_identities [ idents ++ ] = 0xff ;
else if ( ( clabel >= 33 && clabel <= 44 ) || ( clabel >= 200 && clabel <= 207 ) || ( clabel >= 301 && clabel <= 305 ) ) channel_identities [ idents ++ ] = clabel >= 301 ? clabel - 80 : clabel ;
else {
error_line ( "warning: unknown channel descriptions label: %d" , clabel ) ;
channel_identities [ idents ++ ] = 0xff ;
}
channel_reorder [ i ] = cindex ++ ;
}
for ( i = 0 ;
i < num_descriptions ;
++ i ) if ( channel_reorder [ i ] != i ) break ;
if ( i == num_descriptions ) {
free ( channel_reorder ) ;
channel_reorder = NULL ;
}
else {
config -> qmode |= QMODE_REORDERED_CHANS ;
channel_layout = num_descriptions ;
}
if ( ! idents ) {
free ( channel_identities ) ;
channel_identities = NULL ;
}
else channel_identities [ idents ] = 0 ;
if ( debug_logging_mode ) {
error_line ( "layout_tag = 0x%08x, so generated bitmap of 0x%08x from %d descriptions, %d non-MS" , caf_channel_layout -> mChannelLayoutTag , config -> channel_mask , caf_channel_layout -> mNumberChannelDescriptions , idents ) ;
if ( channel_reorder && num_descriptions <= 8 ) {
char reorder_string [ ] = "12345678" ;
for ( i = 0 ;
i < num_descriptions ;
++ i ) reorder_string [ i ] = channel_reorder [ i ] + '1' ;
reorder_string [ i ] = 0 ;
error_line ( "reordering string = \"%s\"\n" , reorder_string ) ;
}
}
}
break ;
case kCAFChannelLayoutTag_UseChannelBitmap : config -> channel_mask = caf_channel_layout -> mChannelBitmap ;
if ( debug_logging_mode ) error_line ( "layout_tag = 0x%08x, so using supplied bitmap of 0x%08x" , caf_channel_layout -> mChannelLayoutTag , caf_channel_layout -> mChannelBitmap ) ;
break ;
default : for ( i = 0 ;
i < NUM_LAYOUTS ;
++ i ) if ( caf_channel_layout -> mChannelLayoutTag == layouts [ i ] . mChannelLayoutTag ) {
config -> channel_mask = layouts [ i ] . mChannelBitmap ;
channel_layout = layouts [ i ] . mChannelLayoutTag ;
if ( layouts [ i ] . mChannelReorder ) {
channel_reorder = ( unsigned char * ) strdup ( layouts [ i ] . mChannelReorder ) ;
config -> qmode |= QMODE_REORDERED_CHANS ;
}
if ( layouts [ i ] . mChannelIdentities ) channel_identities = ( unsigned char * ) strdup ( layouts [ i ] . mChannelIdentities ) ;
if ( debug_logging_mode ) error_line ( "layout_tag 0x%08x found in table, bitmap = 0x%08x, reorder = %s, identities = %s" , channel_layout , config -> channel_mask , channel_reorder ? "yes" : "no" , channel_identities ? "yes" : "no" ) ;
break ;
}
if ( i == NUM_LAYOUTS && debug_logging_mode ) error_line ( "layout_tag 0x%08x not found in table...all channels unassigned" , caf_channel_layout -> mChannelLayoutTag ) ;
break ;
}
free ( caf_channel_layout ) ;
}
else if ( ! strncmp ( caf_chunk_header . mChunkType , "data" , 4 ) ) {
uint32_t mEditCount ;
if ( ! DoReadFile ( infile , & mEditCount , sizeof ( mEditCount ) , & bcount ) || bcount != sizeof ( mEditCount ) ) {
error_line ( "%s is not a valid .CAF file!" , infilename ) ;
return WAVPACK_SOFT_ERROR ;
}
else if ( ! ( config -> qmode & QMODE_NO_STORE_WRAPPER ) && ! WavpackAddWrapper ( wpc , & mEditCount , sizeof ( mEditCount ) ) ) {
error_line ( "%s" , WavpackGetErrorMessage ( wpc ) ) ;
return WAVPACK_SOFT_ERROR ;
}
if ( ( config -> qmode & QMODE_IGNORE_LENGTH ) || caf_chunk_header . mChunkSize == - 1 ) {
config -> qmode |= QMODE_IGNORE_LENGTH ;
if ( infilesize && DoGetFilePosition ( infile ) != - 1 ) total_samples = ( infilesize - DoGetFilePosition ( infile ) ) / caf_audio_format . mBytesPerPacket ;
else total_samples = - 1 ;
}
else {
if ( infilesize && infilesize - caf_chunk_header . mChunkSize > 16777216 ) {
error_line ( ".CAF file %s has over 16 MB of extra CAFF data, probably is corrupt!" , infilename ) ;
return WAVPACK_SOFT_ERROR ;
}
if ( ( caf_chunk_header . mChunkSize - 4 ) % caf_audio_format . mBytesPerPacket ) {
error_line ( ".CAF file %s has an invalid data chunk size, probably is corrupt!" , infilename ) ;
return WAVPACK_SOFT_ERROR ;
}
total_samples = ( caf_chunk_header . mChunkSize - 4 ) / caf_audio_format . mBytesPerPacket ;
if ( ! total_samples ) {
error_line ( "this .CAF file has no audio samples, probably is corrupt!" ) ;
return WAVPACK_SOFT_ERROR ;
}
if ( total_samples > MAX_WAVPACK_SAMPLES ) {
error_line ( "%s has too many samples for WavPack!" , infilename ) ;
return WAVPACK_SOFT_ERROR ;
}
}
break ;
}
else {
uint32_t bytes_to_copy = ( uint32_t ) caf_chunk_header . mChunkSize ;
char * buff ;
if ( caf_chunk_header . mChunkSize < 0 || caf_chunk_header . mChunkSize > 1048576 ) {
error_line ( "%s is not a valid .CAF file!" , infilename ) ;
return WAVPACK_SOFT_ERROR ;
}
buff = malloc ( bytes_to_copy ) ;
if ( debug_logging_mode ) error_line ( "extra unknown chunk \"%c%c%c%c\" of %d bytes" , caf_chunk_header . mChunkType [ 0 ] , caf_chunk_header . mChunkType [ 1 ] , caf_chunk_header . mChunkType [ 2 ] , caf_chunk_header . mChunkType [ 3 ] , caf_chunk_header . mChunkSize ) ;
if ( ! DoReadFile ( infile , buff , bytes_to_copy , & bcount ) || bcount != bytes_to_copy || ( ! ( config -> qmode & QMODE_NO_STORE_WRAPPER ) && ! WavpackAddWrapper ( wpc , buff , bytes_to_copy ) ) ) {
error_line ( "%s" , WavpackGetErrorMessage ( wpc ) ) ;
free ( buff ) ;
return WAVPACK_SOFT_ERROR ;
}
free ( buff ) ;
}
}
if ( ! chan_chunk && ! config -> channel_mask && config -> num_channels <= 2 && ! ( config -> qmode & QMODE_CHANS_UNASSIGNED ) ) config -> channel_mask = 0x5 - config -> num_channels ;
if ( ! WavpackSetConfiguration64 ( wpc , config , total_samples , channel_identities ) ) {
error_line ( "%s" , WavpackGetErrorMessage ( wpc ) ) ;
return WAVPACK_SOFT_ERROR ;
}
if ( channel_identities ) free ( channel_identities ) ;
if ( channel_layout || channel_reorder ) {
if ( ! WavpackSetChannelLayout ( wpc , channel_layout , channel_reorder ) ) {
error_line ( "problem with setting channel layout (should not happen)" ) ;
return WAVPACK_SOFT_ERROR ;
}
if ( channel_reorder ) free ( channel_reorder ) ;
}
return WAVPACK_NO_ERROR ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static int inflate ( struct mszipd_stream * zip ) {
unsigned int last_block , block_type , distance , length , this_run , i ;
register unsigned int bit_buffer ;
register int bits_left ;
register unsigned short sym ;
unsigned char * i_ptr , * i_end ;
RESTORE_BITS ;
do {
READ_BITS ( last_block , 1 ) ;
READ_BITS ( block_type , 2 ) ;
if ( block_type == 0 ) {
unsigned char lens_buf [ 4 ] ;
i = bits_left & 7 ;
REMOVE_BITS ( i ) ;
for ( i = 0 ;
( bits_left >= 8 ) ;
i ++ ) {
if ( i == 4 ) return INF_ERR_BITBUF ;
lens_buf [ i ] = PEEK_BITS ( 8 ) ;
REMOVE_BITS ( 8 ) ;
}
if ( bits_left != 0 ) return INF_ERR_BITBUF ;
while ( i < 4 ) {
READ_IF_NEEDED ;
lens_buf [ i ++ ] = * i_ptr ++ ;
}
length = lens_buf [ 0 ] | ( lens_buf [ 1 ] << 8 ) ;
i = lens_buf [ 2 ] | ( lens_buf [ 3 ] << 8 ) ;
if ( length != ( ~ i & 0xFFFF ) ) return INF_ERR_COMPLEMENT ;
while ( length > 0 ) {
READ_IF_NEEDED ;
this_run = length ;
if ( this_run > ( unsigned int ) ( i_end - i_ptr ) ) this_run = i_end - i_ptr ;
if ( this_run > ( MSZIP_FRAME_SIZE - zip -> window_posn ) ) this_run = MSZIP_FRAME_SIZE - zip -> window_posn ;
zip -> sys -> copy ( i_ptr , & zip -> window [ zip -> window_posn ] , this_run ) ;
zip -> window_posn += this_run ;
i_ptr += this_run ;
length -= this_run ;
FLUSH_IF_NEEDED ;
}
}
else if ( ( block_type == 1 ) || ( block_type == 2 ) ) {
unsigned int match_posn , code ;
if ( block_type == 1 ) {
i = 0 ;
while ( i < 144 ) zip -> LITERAL_len [ i ++ ] = 8 ;
while ( i < 256 ) zip -> LITERAL_len [ i ++ ] = 9 ;
while ( i < 280 ) zip -> LITERAL_len [ i ++ ] = 7 ;
while ( i < 288 ) zip -> LITERAL_len [ i ++ ] = 8 ;
for ( i = 0 ;
i < 32 ;
i ++ ) zip -> DISTANCE_len [ i ] = 5 ;
}
else {
STORE_BITS ;
if ( ( i = zip_read_lens ( zip ) ) ) return i ;
RESTORE_BITS ;
}
if ( make_decode_table ( MSZIP_LITERAL_MAXSYMBOLS , MSZIP_LITERAL_TABLEBITS , & zip -> LITERAL_len [ 0 ] , & zip -> LITERAL_table [ 0 ] ) ) {
return INF_ERR_LITERALTBL ;
}
if ( make_decode_table ( MSZIP_DISTANCE_MAXSYMBOLS , MSZIP_DISTANCE_TABLEBITS , & zip -> DISTANCE_len [ 0 ] , & zip -> DISTANCE_table [ 0 ] ) ) {
return INF_ERR_DISTANCETBL ;
}
for ( ;
;
) {
READ_HUFFSYM ( LITERAL , code ) ;
if ( code < 256 ) {
zip -> window [ zip -> window_posn ++ ] = ( unsigned char ) code ;
FLUSH_IF_NEEDED ;
}
else if ( code == 256 ) {
break ;
}
else {
code -= 257 ;
if ( code >= 29 ) return INF_ERR_LITCODE ;
READ_BITS_T ( length , lit_extrabits [ code ] ) ;
length += lit_lengths [ code ] ;
READ_HUFFSYM ( DISTANCE , code ) ;
if ( code >= 30 ) return INF_ERR_DISTCODE ;
READ_BITS_T ( distance , dist_extrabits [ code ] ) ;
distance += dist_offsets [ code ] ;
match_posn = ( ( distance > zip -> window_posn ) ? MSZIP_FRAME_SIZE : 0 ) + zip -> window_posn - distance ;
if ( length < 12 ) {
while ( length -- ) {
zip -> window [ zip -> window_posn ++ ] = zip -> window [ match_posn ++ ] ;
match_posn &= MSZIP_FRAME_SIZE - 1 ;
FLUSH_IF_NEEDED ;
}
}
else {
unsigned char * runsrc , * rundest ;
do {
this_run = length ;
if ( ( match_posn + this_run ) > MSZIP_FRAME_SIZE ) this_run = MSZIP_FRAME_SIZE - match_posn ;
if ( ( zip -> window_posn + this_run ) > MSZIP_FRAME_SIZE ) this_run = MSZIP_FRAME_SIZE - zip -> window_posn ;
rundest = & zip -> window [ zip -> window_posn ] ;
zip -> window_posn += this_run ;
runsrc = & zip -> window [ match_posn ] ;
match_posn += this_run ;
length -= this_run ;
while ( this_run -- ) * rundest ++ = * runsrc ++ ;
if ( match_posn == MSZIP_FRAME_SIZE ) match_posn = 0 ;
FLUSH_IF_NEEDED ;
}
while ( length > 0 ) ;
}
}
}
}
else {
return INF_ERR_BLOCKTYPE ;
}
}
while ( ! last_block ) ;
if ( zip -> window_posn ) {
if ( zip -> flush_window ( zip , zip -> window_posn ) ) return INF_ERR_FLUSH ;
}
STORE_BITS ;
return 0 ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static char * cgroup_rename_nsgroup ( const char * mountpath , const char * oldname , pid_t pid , const char * name ) {
char * dir , * fulloldpath ;
char * newname , * fullnewpath ;
int len , newlen , ret ;
dir = alloca ( strlen ( oldname ) + 1 ) ;
strcpy ( dir , oldname ) ;
len = strlen ( oldname ) + strlen ( mountpath ) + 22 ;
fulloldpath = alloca ( len ) ;
ret = snprintf ( fulloldpath , len , "%s/%s/%ld" , mountpath , oldname , ( unsigned long ) pid ) ;
if ( ret < 0 || ret >= len ) return NULL ;
len = strlen ( dir ) + strlen ( name ) + 2 ;
newname = malloc ( len ) ;
if ( ! newname ) {
SYSERROR ( "Out of memory" ) ;
return NULL ;
}
ret = snprintf ( newname , len , "%s/%s" , dir , name ) ;
if ( ret < 0 || ret >= len ) {
free ( newname ) ;
return NULL ;
}
newlen = strlen ( mountpath ) + len + 2 ;
fullnewpath = alloca ( newlen ) ;
ret = snprintf ( fullnewpath , newlen , "%s/%s" , mountpath , newname ) ;
if ( ret < 0 || ret >= newlen ) {
free ( newname ) ;
return NULL ;
}
if ( access ( fullnewpath , F_OK ) == 0 ) {
if ( rmdir ( fullnewpath ) != 0 ) {
SYSERROR ( "container cgroup %s already exists." , fullnewpath ) ;
free ( newname ) ;
return NULL ;
}
}
if ( rename ( fulloldpath , fullnewpath ) ) {
SYSERROR ( "failed to rename cgroup %s->%s" , fulloldpath , fullnewpath ) ;
free ( newname ) ;
return NULL ;
}
DEBUG ( "'%s' renamed to '%s'" , oldname , newname ) ;
return newname ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void cpw_usage ( const char * str ) {
if ( str ) fprintf ( stderr , "%s\n" , str ) ;
fprintf ( stderr , _ ( "usage: change_password [-randkey] [-keepold] " "[-e keysaltlist] [-pw password] principal\n" ) ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void ptvcursor_new_subtree_levels ( ptvcursor_t * ptvc ) {
subtree_lvl * pushed_tree ;
DISSECTOR_ASSERT ( ptvc -> pushed_tree_max <= SUBTREE_MAX_LEVELS - SUBTREE_ONCE_ALLOCATION_NUMBER ) ;
ptvc -> pushed_tree_max += SUBTREE_ONCE_ALLOCATION_NUMBER ;
pushed_tree = ( subtree_lvl * ) wmem_alloc ( wmem_packet_scope ( ) , sizeof ( subtree_lvl ) * ptvc -> pushed_tree_max ) ;
DISSECTOR_ASSERT ( pushed_tree != NULL ) ;
if ( ptvc -> pushed_tree ) memcpy ( pushed_tree , ptvc -> pushed_tree , ptvc -> pushed_tree_max - SUBTREE_ONCE_ALLOCATION_NUMBER ) ;
ptvc -> pushed_tree = pushed_tree ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static int dissect_pvfs_heur ( tvbuff_t * tvb , packet_info * pinfo , proto_tree * tree , void * data ) {
guint32 magic_nr , mode ;
guint64 size ;
if ( tvb_reported_length ( tvb ) < 24 ) {
return 0 ;
}
magic_nr = tvb_get_letohl ( tvb , 0 ) ;
if ( magic_nr != BMI_MAGIC_NR ) {
return 0 ;
}
mode = tvb_get_letohl ( tvb , 4 ) ;
switch ( mode ) {
case TCP_MODE_IMMED : case TCP_MODE_UNEXP : case TCP_MODE_EAGER : case TCP_MODE_REND : break ;
default : return 0 ;
}
size = tvb_get_letohl ( tvb , 20 ) ;
size <<= 32 ;
size |= tvb_get_letohl ( tvb , 16 ) ;
if ( ( size > 1000000 ) || ( size == 0 ) ) {
return 0 ;
}
tcp_dissect_pdus ( tvb , pinfo , tree , pvfs_desegment , 24 , get_pvfs_pdu_len , dissect_pvfs_pdu , data ) ;
return tvb_reported_length ( tvb ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | int gs_main_run_string_with_length ( gs_main_instance * minst , const char * str , uint length , int user_errors , int * pexit_code , ref * perror_object ) {
int code ;
code = gs_main_run_string_begin ( minst , user_errors , pexit_code , perror_object ) ;
if ( code < 0 ) return code ;
code = gs_main_run_string_continue ( minst , str , length , user_errors , pexit_code , perror_object ) ;
if ( code != gs_error_NeedInput ) return code ;
return gs_main_run_string_end ( minst , user_errors , pexit_code , perror_object ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static int cine_read_header ( AVFormatContext * avctx ) {
AVIOContext * pb = avctx -> pb ;
AVStream * st ;
unsigned int version , compression , offImageHeader , offSetup , offImageOffsets , biBitCount , length , CFA ;
int vflip ;
char * description ;
uint64_t i ;
st = avformat_new_stream ( avctx , NULL ) ;
if ( ! st ) return AVERROR ( ENOMEM ) ;
st -> codecpar -> codec_type = AVMEDIA_TYPE_VIDEO ;
st -> codecpar -> codec_id = AV_CODEC_ID_RAWVIDEO ;
st -> codecpar -> codec_tag = 0 ;
avio_skip ( pb , 4 ) ;
compression = avio_rl16 ( pb ) ;
version = avio_rl16 ( pb ) ;
if ( version != 1 ) {
avpriv_request_sample ( avctx , "unknown version %i" , version ) ;
return AVERROR_INVALIDDATA ;
}
avio_skip ( pb , 12 ) ;
st -> duration = avio_rl32 ( pb ) ;
offImageHeader = avio_rl32 ( pb ) ;
offSetup = avio_rl32 ( pb ) ;
offImageOffsets = avio_rl32 ( pb ) ;
avio_skip ( pb , 8 ) ;
avio_seek ( pb , offImageHeader , SEEK_SET ) ;
avio_skip ( pb , 4 ) ;
st -> codecpar -> width = avio_rl32 ( pb ) ;
st -> codecpar -> height = avio_rl32 ( pb ) ;
if ( avio_rl16 ( pb ) != 1 ) return AVERROR_INVALIDDATA ;
biBitCount = avio_rl16 ( pb ) ;
if ( biBitCount != 8 && biBitCount != 16 && biBitCount != 24 && biBitCount != 48 ) {
avpriv_request_sample ( avctx , "unsupported biBitCount %i" , biBitCount ) ;
return AVERROR_INVALIDDATA ;
}
switch ( avio_rl32 ( pb ) ) {
case BMP_RGB : vflip = 0 ;
break ;
case 0x100 : st -> codecpar -> codec_tag = MKTAG ( 'B' , 'I' , 'T' , 0 ) ;
vflip = 1 ;
break ;
default : avpriv_request_sample ( avctx , "unknown bitmap compression" ) ;
return AVERROR_INVALIDDATA ;
}
avio_skip ( pb , 4 ) ;
avio_seek ( pb , offSetup , SEEK_SET ) ;
avio_skip ( pb , 140 ) ;
if ( avio_rl16 ( pb ) != 0x5453 ) return AVERROR_INVALIDDATA ;
length = avio_rl16 ( pb ) ;
if ( length < 0x163C ) {
avpriv_request_sample ( avctx , "short SETUP header" ) ;
return AVERROR_INVALIDDATA ;
}
avio_skip ( pb , 616 ) ;
if ( ! avio_rl32 ( pb ) ^ vflip ) {
st -> codecpar -> extradata = av_strdup ( "BottomUp" ) ;
st -> codecpar -> extradata_size = 9 ;
}
avio_skip ( pb , 4 ) ;
avpriv_set_pts_info ( st , 64 , 1 , avio_rl32 ( pb ) ) ;
avio_skip ( pb , 20 ) ;
set_metadata_int ( & st -> metadata , "camera_version" , avio_rl32 ( pb ) , 0 ) ;
set_metadata_int ( & st -> metadata , "firmware_version" , avio_rl32 ( pb ) , 0 ) ;
set_metadata_int ( & st -> metadata , "software_version" , avio_rl32 ( pb ) , 0 ) ;
set_metadata_int ( & st -> metadata , "recording_timezone" , avio_rl32 ( pb ) , 0 ) ;
CFA = avio_rl32 ( pb ) ;
set_metadata_int ( & st -> metadata , "brightness" , avio_rl32 ( pb ) , 1 ) ;
set_metadata_int ( & st -> metadata , "contrast" , avio_rl32 ( pb ) , 1 ) ;
set_metadata_int ( & st -> metadata , "gamma" , avio_rl32 ( pb ) , 1 ) ;
avio_skip ( pb , 12 + 16 ) ;
set_metadata_float ( & st -> metadata , "wbgain[0].r" , av_int2float ( avio_rl32 ( pb ) ) , 1 ) ;
set_metadata_float ( & st -> metadata , "wbgain[0].b" , av_int2float ( avio_rl32 ( pb ) ) , 1 ) ;
avio_skip ( pb , 36 ) ;
st -> codecpar -> bits_per_coded_sample = avio_rl32 ( pb ) ;
if ( compression == CC_RGB ) {
if ( biBitCount == 8 ) {
st -> codecpar -> format = AV_PIX_FMT_GRAY8 ;
}
else if ( biBitCount == 16 ) {
st -> codecpar -> format = AV_PIX_FMT_GRAY16LE ;
}
else if ( biBitCount == 24 ) {
st -> codecpar -> format = AV_PIX_FMT_BGR24 ;
}
else if ( biBitCount == 48 ) {
st -> codecpar -> format = AV_PIX_FMT_BGR48LE ;
}
else {
avpriv_request_sample ( avctx , "unsupported biBitCount %i" , biBitCount ) ;
return AVERROR_INVALIDDATA ;
}
}
else if ( compression == CC_UNINT ) {
switch ( CFA & 0xFFFFFF ) {
case CFA_BAYER : if ( biBitCount == 8 ) {
st -> codecpar -> format = AV_PIX_FMT_BAYER_GBRG8 ;
}
else if ( biBitCount == 16 ) {
st -> codecpar -> format = AV_PIX_FMT_BAYER_GBRG16LE ;
}
else {
avpriv_request_sample ( avctx , "unsupported biBitCount %i" , biBitCount ) ;
return AVERROR_INVALIDDATA ;
}
break ;
case CFA_BAYERFLIP : if ( biBitCount == 8 ) {
st -> codecpar -> format = AV_PIX_FMT_BAYER_RGGB8 ;
}
else if ( biBitCount == 16 ) {
st -> codecpar -> format = AV_PIX_FMT_BAYER_RGGB16LE ;
}
else {
avpriv_request_sample ( avctx , "unsupported biBitCount %i" , biBitCount ) ;
return AVERROR_INVALIDDATA ;
}
break ;
default : avpriv_request_sample ( avctx , "unsupported Color Field Array (CFA) %i" , CFA & 0xFFFFFF ) ;
return AVERROR_INVALIDDATA ;
}
}
else {
avpriv_request_sample ( avctx , "unsupported compression %i" , compression ) ;
return AVERROR_INVALIDDATA ;
}
avio_skip ( pb , 668 ) ;
set_metadata_int ( & st -> metadata , "shutter_ns" , avio_rl32 ( pb ) , 0 ) ;
avio_skip ( pb , 24 ) ;
# define DESCRIPTION_SIZE 4096 description = av_malloc ( DESCRIPTION_SIZE + 1 ) ;
if ( ! description ) return AVERROR ( ENOMEM ) ;
i = avio_get_str ( pb , DESCRIPTION_SIZE , description , DESCRIPTION_SIZE + 1 ) ;
if ( i < DESCRIPTION_SIZE ) avio_skip ( pb , DESCRIPTION_SIZE - i ) ;
if ( description [ 0 ] ) av_dict_set ( & st -> metadata , "description" , description , AV_DICT_DONT_STRDUP_VAL ) ;
else av_free ( description ) ;
avio_skip ( pb , 1176 ) ;
set_metadata_int ( & st -> metadata , "enable_crop" , avio_rl32 ( pb ) , 1 ) ;
set_metadata_int ( & st -> metadata , "crop_left" , avio_rl32 ( pb ) , 1 ) ;
set_metadata_int ( & st -> metadata , "crop_top" , avio_rl32 ( pb ) , 1 ) ;
set_metadata_int ( & st -> metadata , "crop_right" , avio_rl32 ( pb ) , 1 ) ;
set_metadata_int ( & st -> metadata , "crop_bottom" , avio_rl32 ( pb ) , 1 ) ;
avio_seek ( pb , offImageOffsets , SEEK_SET ) ;
for ( i = 0 ;
i < st -> duration ;
i ++ ) av_add_index_entry ( st , avio_rl64 ( pb ) , i , 0 , 0 , AVINDEX_KEYFRAME ) ;
return 0 ;
} | 1True
|
Categorize the following code snippet as vulnerable or not. True or False | static int dissect_h245_T84Profile ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_choice ( tvb , offset , actx , tree , hf_index , ett_h245_T84Profile , T84Profile_choice , NULL ) ;
return offset ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static int dissect_zbee_zcl_met_idt ( tvbuff_t * tvb _U_ , packet_info * pinfo _U_ , proto_tree * tree _U_ , void * data _U_ ) {
return tvb_captured_length ( tvb ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void xps_draw_arc_segment ( fz_context * doc , fz_path * path , const fz_matrix * mtx , float th0 , float th1 , int iscw ) {
float t , d ;
fz_point p ;
while ( th1 < th0 ) th1 += ( float ) M_PI * 2 ;
d = ( float ) M_PI / 180 ;
if ( iscw ) {
for ( t = th0 + d ;
t < th1 - d / 2 ;
t += d ) {
p . x = cosf ( t ) ;
p . y = sinf ( t ) ;
fz_transform_point ( & p , mtx ) ;
fz_lineto ( doc , path , p . x , p . y ) ;
}
}
else {
th0 += ( float ) M_PI * 2 ;
for ( t = th0 - d ;
t > th1 + d / 2 ;
t -= d ) {
p . x = cosf ( t ) ;
p . y = sinf ( t ) ;
fz_transform_point ( & p , mtx ) ;
fz_lineto ( doc , path , p . x , p . y ) ;
}
}
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void read_ref_frames ( VP9_COMMON * const cm , MACROBLOCKD * const xd , vp9_reader * r , int segment_id , MV_REFERENCE_FRAME ref_frame [ 2 ] ) {
FRAME_CONTEXT * const fc = & cm -> fc ;
FRAME_COUNTS * const counts = & cm -> counts ;
if ( vp9_segfeature_active ( & cm -> seg , segment_id , SEG_LVL_REF_FRAME ) ) {
ref_frame [ 0 ] = ( MV_REFERENCE_FRAME ) vp9_get_segdata ( & cm -> seg , segment_id , SEG_LVL_REF_FRAME ) ;
ref_frame [ 1 ] = NONE ;
}
else {
const REFERENCE_MODE mode = read_block_reference_mode ( cm , xd , r ) ;
if ( mode == COMPOUND_REFERENCE ) {
const int idx = cm -> ref_frame_sign_bias [ cm -> comp_fixed_ref ] ;
const int ctx = vp9_get_pred_context_comp_ref_p ( cm , xd ) ;
const int bit = vp9_read ( r , fc -> comp_ref_prob [ ctx ] ) ;
if ( ! cm -> frame_parallel_decoding_mode ) ++ counts -> comp_ref [ ctx ] [ bit ] ;
ref_frame [ idx ] = cm -> comp_fixed_ref ;
ref_frame [ ! idx ] = cm -> comp_var_ref [ bit ] ;
}
else if ( mode == SINGLE_REFERENCE ) {
const int ctx0 = vp9_get_pred_context_single_ref_p1 ( xd ) ;
const int bit0 = vp9_read ( r , fc -> single_ref_prob [ ctx0 ] [ 0 ] ) ;
if ( ! cm -> frame_parallel_decoding_mode ) ++ counts -> single_ref [ ctx0 ] [ 0 ] [ bit0 ] ;
if ( bit0 ) {
const int ctx1 = vp9_get_pred_context_single_ref_p2 ( xd ) ;
const int bit1 = vp9_read ( r , fc -> single_ref_prob [ ctx1 ] [ 1 ] ) ;
if ( ! cm -> frame_parallel_decoding_mode ) ++ counts -> single_ref [ ctx1 ] [ 1 ] [ bit1 ] ;
ref_frame [ 0 ] = bit1 ? ALTREF_FRAME : GOLDEN_FRAME ;
}
else {
ref_frame [ 0 ] = LAST_FRAME ;
}
ref_frame [ 1 ] = NONE ;
}
else {
assert ( 0 && "Invalid prediction mode." ) ;
}
}
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void draw_char ( AVCodecContext * avctx , int c ) {
AnsiContext * s = avctx -> priv_data ;
int fg = s -> fg ;
int bg = s -> bg ;
if ( ( s -> attributes & ATTR_BOLD ) ) fg += 8 ;
if ( ( s -> attributes & ATTR_BLINK ) ) bg += 8 ;
if ( ( s -> attributes & ATTR_REVERSE ) ) FFSWAP ( int , fg , bg ) ;
if ( ( s -> attributes & ATTR_CONCEALED ) ) fg = bg ;
ff_draw_pc_font ( s -> frame -> data [ 0 ] + s -> y * s -> frame -> linesize [ 0 ] + s -> x , s -> frame -> linesize [ 0 ] , s -> font , s -> font_height , c , fg , bg ) ;
s -> x += FONT_WIDTH ;
if ( s -> x >= avctx -> width ) {
s -> x = 0 ;
hscroll ( avctx ) ;
}
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void pdf_keep_gstate ( fz_context * ctx , pdf_gstate * gs ) {
pdf_keep_material ( ctx , & gs -> stroke ) ;
pdf_keep_material ( ctx , & gs -> fill ) ;
if ( gs -> text . font ) pdf_keep_font ( ctx , gs -> text . font ) ;
if ( gs -> softmask ) pdf_keep_xobject ( ctx , gs -> softmask ) ;
if ( gs -> softmask_resources ) pdf_keep_obj ( ctx , gs -> softmask_resources ) ;
fz_keep_stroke_state ( ctx , gs -> stroke_state ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | int PEM_write_ ## name ( FILE * fp , type * x ) ;
# define DECLARE_PEM_write_fp_const ( name , type ) int PEM_write_ ## name ( FILE * fp , const type * x ) ;
# define DECLARE_PEM_write_cb_fp ( name , type ) int PEM_write_ ## name ( FILE * fp , type * x , const EVP_CIPHER * enc , unsigned char * kstr , int klen , pem_password_cb * cb , void * u ) ;
# endif # define DECLARE_PEM_read_bio ( name , type ) type * PEM_read_bio_ ## name ( BIO * bp , type * * x , pem_password_cb * cb , void * u ) ;
# define DECLARE_PEM_write_bio ( name , type ) int PEM_write_bio_ ## name ( BIO * bp , type * x ) ;
# define DECLARE_PEM_write_bio_const ( name , type ) int PEM_write_bio_ ## name ( BIO * bp , const type * x ) ;
# define DECLARE_PEM_write_cb_bio ( name , type ) int PEM_write_bio_ ## name ( BIO * bp , type * x , const EVP_CIPHER * enc , unsigned char * kstr , int klen , pem_password_cb * cb , void * u ) ;
# define DECLARE_PEM_write ( name , type ) DECLARE_PEM_write_bio ( name , type ) DECLARE_PEM_write_fp ( name , type ) # define DECLARE_PEM_write_const ( name , type ) DECLARE_PEM_write_bio_const ( name , type ) DECLARE_PEM_write_fp_const ( name , type ) # define DECLARE_PEM_write_cb ( name , type ) DECLARE_PEM_write_cb_bio ( name , type ) DECLARE_PEM_write_cb_fp ( name , type ) # define DECLARE_PEM_read ( name , type ) DECLARE_PEM_read_bio ( name , type ) DECLARE_PEM_read_fp ( name , type ) # define DECLARE_PEM_rw ( name , type ) DECLARE_PEM_read ( name , type ) DECLARE_PEM_write ( name , type ) # define DECLARE_PEM_rw_const ( name , type ) DECLARE_PEM_read ( name , type ) DECLARE_PEM_write_const ( name , type ) # define DECLARE_PEM_rw_cb ( name , type ) DECLARE_PEM_read ( name , type ) DECLARE_PEM_write_cb ( name , type ) typedef int pem_password_cb ( char * buf , int size , int rwflag , void * userdata ) ;
int PEM_get_EVP_CIPHER_INFO ( char * header , EVP_CIPHER_INFO * cipher ) ;
int PEM_do_header ( EVP_CIPHER_INFO * cipher , unsigned char * data , long * len , pem_password_cb * callback , void * u ) ;
int PEM_read_bio ( BIO * bp , char * * name , char * * header , unsigned char * * data , long * len ) ;
# define PEM_FLAG_SECURE 0x1 # define PEM_FLAG_EAY_COMPATIBLE 0x2 # define PEM_FLAG_ONLY_B64 0x4 int PEM_read_bio_ex ( BIO * bp , char * * name , char * * header , unsigned char * * data , long * len , unsigned int flags ) ;
int PEM_bytes_read_bio_secmem ( unsigned char * * pdata , long * plen , char * * pnm , const char * name , BIO * bp , pem_password_cb * cb , void * u ) ;
int PEM_write_bio ( BIO * bp , const char * name , const char * hdr , const unsigned char * data , long len ) ;
int PEM_bytes_read_bio ( unsigned char * * pdata , long * plen , char * * pnm , const char * name , BIO * bp , pem_password_cb * cb , void * u ) ;
void * PEM_ASN1_read_bio ( d2i_of_void * d2i , const char * name , BIO * bp , void * * x , pem_password_cb * cb , void * u ) ;
int PEM_ASN1_write_bio ( i2d_of_void * i2d , const char * name , BIO * bp , void * x , const EVP_CIPHER * enc , unsigned char * kstr , int klen , pem_password_cb * cb , void * u ) ;
STACK_OF ( X509_INFO ) * PEM_X509_INFO_read_bio ( BIO * bp , STACK_OF ( X509_INFO ) * sk , pem_password_cb * cb , void * u ) ;
int PEM_X509_INFO_write_bio ( BIO * bp , X509_INFO * xi , EVP_CIPHER * enc , unsigned char * kstr , int klen , pem_password_cb * cd , void * u ) ;
# ifndef OPENSSL_NO_STDIO int PEM_read ( FILE * fp , char * * name , char * * header , unsigned char * * data , long * len ) ;
int PEM_write ( FILE * fp , const char * name , const char * hdr , const unsigned char * data , long len ) ;
void * PEM_ASN1_read ( d2i_of_void * d2i , const char * name , FILE * fp , void * * x , pem_password_cb * cb , void * u ) ;
int PEM_ASN1_write ( i2d_of_void * i2d , const char * name , FILE * fp , void * x , const EVP_CIPHER * enc , unsigned char * kstr , int klen , pem_password_cb * callback , void * u ) ;
STACK_OF ( X509_INFO ) * PEM_X509_INFO_read ( FILE * fp , STACK_OF ( X509_INFO ) * sk , pem_password_cb * cb , void * u ) ;
# endif int PEM_SignInit ( EVP_MD_CTX * ctx , EVP_MD * type ) ;
int PEM_SignUpdate ( EVP_MD_CTX * ctx , unsigned char * d , unsigned int cnt ) ;
int PEM_SignFinal ( EVP_MD_CTX * ctx , unsigned char * sigret , unsigned int * siglen , EVP_PKEY * pkey ) ;
int PEM_def_callback ( char * buf , int num , int rwflag , void * userdata ) ;
void PEM_proc_type ( char * buf , int type ) ;
void PEM_dek_info ( char * buf , const char * type , int len , char * str ) ;
# include < openssl / symhacks . h > DECLARE_PEM_rw ( X509 , X509 ) | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static int output_frame ( H264Context * h , AVFrame * dst , Picture * srcp ) {
AVFrame * src = & srcp -> f ;
int i ;
int ret = av_frame_ref ( dst , src ) ;
if ( ret < 0 ) return ret ;
av_dict_set ( & dst -> metadata , "stereo_mode" , ff_h264_sei_stereo_mode ( h ) , 0 ) ;
if ( ! srcp -> crop ) return 0 ;
for ( i = 0 ;
i < 3 ;
i ++ ) {
int hshift = ( i > 0 ) ? h -> chroma_x_shift : 0 ;
int vshift = ( i > 0 ) ? h -> chroma_y_shift : 0 ;
int off = ( ( srcp -> crop_left >> hshift ) << h -> pixel_shift ) + ( srcp -> crop_top >> vshift ) * dst -> linesize [ i ] ;
dst -> data [ i ] += off ;
}
return 0 ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void dtap_cc_cc_est_conf ( tvbuff_t * tvb , proto_tree * tree , packet_info * pinfo _U_ , guint32 offset , guint len ) {
guint32 curr_offset ;
guint32 consumed ;
guint curr_len ;
curr_offset = offset ;
curr_len = len ;
is_uplink = IS_UPLINK_TRUE ;
ELEM_OPT_TV_SHORT ( 0xd0 , GSM_A_PDU_TYPE_DTAP , DE_REPEAT_IND , " Repeat indicator" ) ;
ELEM_MAND_TLV ( 0x04 , GSM_A_PDU_TYPE_DTAP , DE_BEARER_CAP , " 1" , ei_gsm_a_dtap_missing_mandatory_element ) ;
ELEM_OPT_TLV ( 0x04 , GSM_A_PDU_TYPE_DTAP , DE_BEARER_CAP , " 2" ) ;
ELEM_OPT_TLV ( 0x08 , GSM_A_PDU_TYPE_DTAP , DE_CAUSE , NULL ) ;
ELEM_OPT_TLV ( 0x40 , GSM_A_PDU_TYPE_DTAP , DE_SUP_CODEC_LIST , NULL ) ;
EXTRANEOUS_DATA_CHECK ( curr_len , 0 , pinfo , & ei_gsm_a_dtap_extraneous_data ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void test_nstmts ( ) {
MYSQL_STMT * stmt ;
char query [ 255 ] ;
int rc ;
static uint i , total_stmts = 2000 ;
MYSQL_BIND my_bind [ 1 ] ;
myheader ( "test_nstmts" ) ;
mysql_autocommit ( mysql , TRUE ) ;
rc = mysql_query ( mysql , "DROP TABLE IF EXISTS test_nstmts" ) ;
myquery ( rc ) ;
rc = mysql_query ( mysql , "CREATE TABLE test_nstmts(id int)" ) ;
myquery ( rc ) ;
memset ( my_bind , 0 , sizeof ( my_bind ) ) ;
my_bind [ 0 ] . buffer = ( void * ) & i ;
my_bind [ 0 ] . buffer_type = MYSQL_TYPE_LONG ;
for ( i = 0 ;
i < total_stmts ;
i ++ ) {
if ( ! opt_silent ) fprintf ( stdout , "\r stmt: %d" , i ) ;
strmov ( query , "insert into test_nstmts values(?)" ) ;
stmt = mysql_simple_prepare ( mysql , query ) ;
check_stmt ( stmt ) ;
rc = mysql_stmt_bind_param ( stmt , my_bind ) ;
check_execute ( stmt , rc ) ;
rc = mysql_stmt_execute ( stmt ) ;
check_execute ( stmt , rc ) ;
mysql_stmt_close ( stmt ) ;
}
stmt = mysql_simple_prepare ( mysql , " select count(*) from test_nstmts" ) ;
check_stmt ( stmt ) ;
rc = mysql_stmt_execute ( stmt ) ;
check_execute ( stmt , rc ) ;
i = 0 ;
rc = mysql_stmt_bind_result ( stmt , my_bind ) ;
check_execute ( stmt , rc ) ;
rc = mysql_stmt_fetch ( stmt ) ;
check_execute ( stmt , rc ) ;
if ( ! opt_silent ) fprintf ( stdout , "\n total rows: %d" , i ) ;
DIE_UNLESS ( i == total_stmts ) ;
rc = mysql_stmt_fetch ( stmt ) ;
DIE_UNLESS ( rc == MYSQL_NO_DATA ) ;
mysql_stmt_close ( stmt ) ;
rc = mysql_query ( mysql , "DROP TABLE test_nstmts" ) ;
myquery ( rc ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void prplcb_conn_notice ( PurpleConnection * gc , const char * text ) {
struct im_connection * ic = purple_ic_by_gc ( gc ) ;
if ( ic != NULL ) {
imcb_log ( ic , "%s" , text ) ;
}
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void qio_channel_websock_set_cork ( QIOChannel * ioc , bool enabled ) {
QIOChannelWebsock * tioc = QIO_CHANNEL_WEBSOCK ( ioc ) ;
qio_channel_set_cork ( tioc -> master , enabled ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | void register_stat_callbacks ( ) {
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.background_fill_current_count" , RECD_INT , RECP_NON_PERSISTENT , ( int ) http_background_fill_current_count_stat , RecRawStatSyncSum ) ;
HTTP_CLEAR_DYN_STAT ( http_background_fill_current_count_stat ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.current_client_connections" , RECD_INT , RECP_NON_PERSISTENT , ( int ) http_current_client_connections_stat , RecRawStatSyncSum ) ;
HTTP_CLEAR_DYN_STAT ( http_current_client_connections_stat ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.current_active_client_connections" , RECD_INT , RECP_NON_PERSISTENT , ( int ) http_current_active_client_connections_stat , RecRawStatSyncSum ) ;
HTTP_CLEAR_DYN_STAT ( http_current_active_client_connections_stat ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.websocket.current_active_client_connections" , RECD_INT , RECP_NON_PERSISTENT , ( int ) http_websocket_current_active_client_connections_stat , RecRawStatSyncSum ) ;
HTTP_CLEAR_DYN_STAT ( http_websocket_current_active_client_connections_stat ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.current_client_transactions" , RECD_INT , RECP_NON_PERSISTENT , ( int ) http_current_client_transactions_stat , RecRawStatSyncSum ) ;
HTTP_CLEAR_DYN_STAT ( http_current_client_transactions_stat ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.current_server_transactions" , RECD_INT , RECP_NON_PERSISTENT , ( int ) http_current_server_transactions_stat , RecRawStatSyncSum ) ;
HTTP_CLEAR_DYN_STAT ( http_current_server_transactions_stat ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.completed_requests" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_completed_requests_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.total_incoming_connections" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_total_incoming_connections_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.total_client_connections" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_total_client_connections_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.total_client_connections_ipv4" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_total_client_connections_ipv4_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.total_client_connections_ipv6" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_total_client_connections_ipv6_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.total_server_connections" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_total_server_connections_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.total_parent_proxy_connections" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_total_parent_proxy_connections_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.total_parent_retries" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_total_parent_retries_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.total_parent_switches" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_total_parent_switches_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.total_parent_retries_exhausted" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_total_parent_retries_exhausted_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.total_parent_marked_down_count" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_total_parent_marked_down_count , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.current_parent_proxy_connections" , RECD_INT , RECP_NON_PERSISTENT , ( int ) http_current_parent_proxy_connections_stat , RecRawStatSyncSum ) ;
HTTP_CLEAR_DYN_STAT ( http_current_parent_proxy_connections_stat ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.current_server_connections" , RECD_INT , RECP_NON_PERSISTENT , ( int ) http_current_server_connections_stat , RecRawStatSyncSum ) ;
HTTP_CLEAR_DYN_STAT ( http_current_server_connections_stat ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.current_cache_connections" , RECD_INT , RECP_NON_PERSISTENT , ( int ) http_current_cache_connections_stat , RecRawStatSyncSum ) ;
HTTP_CLEAR_DYN_STAT ( http_current_cache_connections_stat ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.avg_transactions_per_client_connection" , RECD_FLOAT , RECP_PERSISTENT , ( int ) http_transactions_per_client_con , RecRawStatSyncAvg ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.avg_transactions_per_server_connection" , RECD_FLOAT , RECP_PERSISTENT , ( int ) http_transactions_per_server_con , RecRawStatSyncAvg ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_counts.errors.pre_accept_hangups" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_errors_pre_accept_hangups_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_totaltime.errors.pre_accept_hangups" , RECD_FLOAT , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_errors_pre_accept_hangups_stat , RecRawStatSyncIntMsecsToFloatSeconds ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.incoming_requests" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_incoming_requests_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.outgoing_requests" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_outgoing_requests_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.incoming_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_incoming_responses_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.invalid_client_requests" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_invalid_client_requests_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.missing_host_hdr" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_missing_host_hdr_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.get_requests" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_get_requests_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.head_requests" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_head_requests_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.trace_requests" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_trace_requests_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.options_requests" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_options_requests_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.post_requests" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_post_requests_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.put_requests" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_put_requests_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.push_requests" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_push_requests_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.delete_requests" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_delete_requests_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.purge_requests" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_purge_requests_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.connect_requests" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_connect_requests_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.extension_method_requests" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_extension_method_requests_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.broken_server_connections" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_broken_server_connections_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.cache_lookups" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_cache_lookups_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.cache_writes" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_cache_writes_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.cache_updates" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_cache_updates_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.cache_deletes" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_cache_deletes_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tunnels" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_tunnels_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.throttled_proxy_only" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_throttled_proxy_only_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.parent_proxy_transaction_time" , RECD_INT , RECP_PERSISTENT , ( int ) http_parent_proxy_transaction_time_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.user_agent_request_header_total_size" , RECD_INT , RECP_PERSISTENT , ( int ) http_user_agent_request_header_total_size_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.user_agent_response_header_total_size" , RECD_INT , RECP_PERSISTENT , ( int ) http_user_agent_response_header_total_size_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.user_agent_request_document_total_size" , RECD_INT , RECP_PERSISTENT , ( int ) http_user_agent_request_document_total_size_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.user_agent_response_document_total_size" , RECD_INT , RECP_PERSISTENT , ( int ) http_user_agent_response_document_total_size_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.origin_server_request_header_total_size" , RECD_INT , RECP_PERSISTENT , ( int ) http_origin_server_request_header_total_size_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.origin_server_response_header_total_size" , RECD_INT , RECP_PERSISTENT , ( int ) http_origin_server_response_header_total_size_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.origin_server_request_document_total_size" , RECD_INT , RECP_PERSISTENT , ( int ) http_origin_server_request_document_total_size_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.origin_server_response_document_total_size" , RECD_INT , RECP_PERSISTENT , ( int ) http_origin_server_response_document_total_size_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.parent_proxy_request_total_bytes" , RECD_INT , RECP_PERSISTENT , ( int ) http_parent_proxy_request_total_bytes_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.parent_proxy_response_total_bytes" , RECD_INT , RECP_PERSISTENT , ( int ) http_parent_proxy_response_total_bytes_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.pushed_response_header_total_size" , RECD_INT , RECP_PERSISTENT , ( int ) http_pushed_response_header_total_size_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.pushed_document_total_size" , RECD_INT , RECP_PERSISTENT , ( int ) http_pushed_document_total_size_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.response_document_size_100" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_document_size_100_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.response_document_size_1K" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_document_size_1K_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.response_document_size_3K" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_document_size_3K_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.response_document_size_5K" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_document_size_5K_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.response_document_size_10K" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_document_size_10K_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.response_document_size_1M" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_document_size_1M_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.response_document_size_inf" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_document_size_inf_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.request_document_size_100" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_request_document_size_100_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.request_document_size_1K" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_request_document_size_1K_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.request_document_size_3K" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_request_document_size_3K_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.request_document_size_5K" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_request_document_size_5K_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.request_document_size_10K" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_request_document_size_10K_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.request_document_size_1M" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_request_document_size_1M_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.request_document_size_inf" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_request_document_size_inf_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.user_agent_speed_bytes_per_sec_100" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_user_agent_speed_bytes_per_sec_100_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.user_agent_speed_bytes_per_sec_1K" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_user_agent_speed_bytes_per_sec_1K_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.user_agent_speed_bytes_per_sec_10K" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_user_agent_speed_bytes_per_sec_10K_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.user_agent_speed_bytes_per_sec_100K" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_user_agent_speed_bytes_per_sec_100K_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.user_agent_speed_bytes_per_sec_1M" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_user_agent_speed_bytes_per_sec_1M_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.user_agent_speed_bytes_per_sec_10M" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_user_agent_speed_bytes_per_sec_10M_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.user_agent_speed_bytes_per_sec_100M" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_user_agent_speed_bytes_per_sec_100M_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.origin_server_speed_bytes_per_sec_100" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_origin_server_speed_bytes_per_sec_100_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.origin_server_speed_bytes_per_sec_1K" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_origin_server_speed_bytes_per_sec_1K_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.origin_server_speed_bytes_per_sec_10K" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_origin_server_speed_bytes_per_sec_10K_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.origin_server_speed_bytes_per_sec_100K" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_origin_server_speed_bytes_per_sec_100K_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.origin_server_speed_bytes_per_sec_1M" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_origin_server_speed_bytes_per_sec_1M_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.origin_server_speed_bytes_per_sec_10M" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_origin_server_speed_bytes_per_sec_10M_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.origin_server_speed_bytes_per_sec_100M" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_origin_server_speed_bytes_per_sec_100M_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.total_transactions_time" , RECD_INT , RECP_PERSISTENT , ( int ) http_total_transactions_time_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.cache_hit_fresh" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_cache_hit_fresh_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.cache_hit_mem_fresh" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_cache_hit_mem_fresh_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.cache_hit_revalidated" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_cache_hit_reval_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.cache_hit_ims" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_cache_hit_ims_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.cache_hit_stale_served" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_cache_hit_stale_served_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.cache_miss_cold" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_cache_miss_cold_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.cache_miss_changed" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_cache_miss_changed_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.cache_miss_client_no_cache" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_cache_miss_client_no_cache_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.cache_miss_client_not_cacheable" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_cache_miss_uncacheable_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.cache_miss_ims" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_cache_miss_ims_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.cache_read_error" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_cache_read_error_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tcp_hit_count_stat" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_tcp_hit_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tcp_hit_user_agent_bytes_stat" , RECD_INT , RECP_PERSISTENT , ( int ) http_tcp_hit_user_agent_bytes_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tcp_hit_origin_server_bytes_stat" , RECD_INT , RECP_PERSISTENT , ( int ) http_tcp_hit_origin_server_bytes_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tcp_miss_count_stat" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_tcp_miss_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tcp_miss_user_agent_bytes_stat" , RECD_INT , RECP_PERSISTENT , ( int ) http_tcp_miss_user_agent_bytes_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tcp_miss_origin_server_bytes_stat" , RECD_INT , RECP_PERSISTENT , ( int ) http_tcp_miss_origin_server_bytes_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tcp_expired_miss_count_stat" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_tcp_expired_miss_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tcp_expired_miss_user_agent_bytes_stat" , RECD_INT , RECP_PERSISTENT , ( int ) http_tcp_expired_miss_user_agent_bytes_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tcp_expired_miss_origin_server_bytes_stat" , RECD_INT , RECP_PERSISTENT , ( int ) http_tcp_expired_miss_origin_server_bytes_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tcp_refresh_hit_count_stat" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_tcp_refresh_hit_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tcp_refresh_hit_user_agent_bytes_stat" , RECD_INT , RECP_PERSISTENT , ( int ) http_tcp_refresh_hit_user_agent_bytes_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tcp_refresh_hit_origin_server_bytes_stat" , RECD_INT , RECP_PERSISTENT , ( int ) http_tcp_refresh_hit_origin_server_bytes_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tcp_refresh_miss_count_stat" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_tcp_refresh_miss_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tcp_refresh_miss_user_agent_bytes_stat" , RECD_INT , RECP_PERSISTENT , ( int ) http_tcp_refresh_miss_user_agent_bytes_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tcp_refresh_miss_origin_server_bytes_stat" , RECD_INT , RECP_PERSISTENT , ( int ) http_tcp_refresh_miss_origin_server_bytes_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tcp_client_refresh_count_stat" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_tcp_client_refresh_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tcp_client_refresh_user_agent_bytes_stat" , RECD_INT , RECP_PERSISTENT , ( int ) http_tcp_client_refresh_user_agent_bytes_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tcp_client_refresh_origin_server_bytes_stat" , RECD_INT , RECP_PERSISTENT , ( int ) http_tcp_client_refresh_origin_server_bytes_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tcp_ims_hit_count_stat" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_tcp_ims_hit_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tcp_ims_hit_user_agent_bytes_stat" , RECD_INT , RECP_PERSISTENT , ( int ) http_tcp_ims_hit_user_agent_bytes_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tcp_ims_hit_origin_server_bytes_stat" , RECD_INT , RECP_PERSISTENT , ( int ) http_tcp_ims_hit_origin_server_bytes_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tcp_ims_miss_count_stat" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_tcp_ims_miss_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tcp_ims_miss_user_agent_bytes_stat" , RECD_INT , RECP_PERSISTENT , ( int ) http_tcp_ims_miss_user_agent_bytes_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.tcp_ims_miss_origin_server_bytes_stat" , RECD_INT , RECP_PERSISTENT , ( int ) http_tcp_ims_miss_origin_server_bytes_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.err_client_abort_count_stat" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_err_client_abort_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.err_client_abort_user_agent_bytes_stat" , RECD_INT , RECP_PERSISTENT , ( int ) http_err_client_abort_user_agent_bytes_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.err_client_abort_origin_server_bytes_stat" , RECD_INT , RECP_PERSISTENT , ( int ) http_err_client_abort_origin_server_bytes_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.err_connect_fail_count_stat" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_err_connect_fail_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.err_connect_fail_user_agent_bytes_stat" , RECD_INT , RECP_PERSISTENT , ( int ) http_err_connect_fail_user_agent_bytes_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.err_connect_fail_origin_server_bytes_stat" , RECD_INT , RECP_PERSISTENT , ( int ) http_err_connect_fail_origin_server_bytes_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.misc_count_stat" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_misc_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.misc_user_agent_bytes_stat" , RECD_INT , RECP_PERSISTENT , ( int ) http_misc_user_agent_bytes_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.http_misc_origin_server_bytes_stat" , RECD_INT , RECP_PERSISTENT , ( int ) http_misc_origin_server_bytes_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.background_fill_bytes_aborted_stat" , RECD_INT , RECP_PERSISTENT , ( int ) http_background_fill_bytes_aborted_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.background_fill_bytes_completed_stat" , RECD_INT , RECP_PERSISTENT , ( int ) http_background_fill_bytes_completed_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.cache_write_errors" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_cache_write_errors , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.cache_read_errors" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_cache_read_errors , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.100_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_100_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.101_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_101_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.1xx_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_1xx_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.200_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_200_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.201_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_201_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.202_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_202_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.203_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_203_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.204_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_204_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.205_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_205_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.206_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_206_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.2xx_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_2xx_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.300_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_300_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.301_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_301_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.302_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_302_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.303_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_303_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.304_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_304_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.305_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_305_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.307_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_307_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.3xx_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_3xx_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.400_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_400_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.401_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_401_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.402_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_402_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.403_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_403_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.404_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_404_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.405_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_405_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.406_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_406_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.407_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_407_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.408_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_408_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.409_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_409_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.410_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_410_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.411_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_411_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.412_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_412_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.413_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_413_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.414_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_414_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.415_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_415_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.416_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_416_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.4xx_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_4xx_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.500_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_500_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.501_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_501_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.502_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_502_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.503_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_503_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.504_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_504_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.505_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_505_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.5xx_responses" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_response_status_5xx_count_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_counts.hit_fresh" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_hit_fresh_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_totaltime.hit_fresh" , RECD_FLOAT , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_hit_fresh_stat , RecRawStatSyncIntMsecsToFloatSeconds ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_counts.hit_fresh.process" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_hit_fresh_process_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_totaltime.hit_fresh.process" , RECD_FLOAT , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_hit_fresh_process_stat , RecRawStatSyncIntMsecsToFloatSeconds ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_counts.hit_revalidated" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_hit_reval_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_totaltime.hit_revalidated" , RECD_FLOAT , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_hit_reval_stat , RecRawStatSyncIntMsecsToFloatSeconds ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_counts.miss_cold" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_miss_cold_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_totaltime.miss_cold" , RECD_FLOAT , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_miss_cold_stat , RecRawStatSyncIntMsecsToFloatSeconds ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_counts.miss_not_cacheable" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_miss_uncacheable_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_totaltime.miss_not_cacheable" , RECD_FLOAT , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_miss_uncacheable_stat , RecRawStatSyncIntMsecsToFloatSeconds ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_counts.miss_changed" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_miss_changed_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_totaltime.miss_changed" , RECD_FLOAT , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_miss_changed_stat , RecRawStatSyncIntMsecsToFloatSeconds ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_counts.miss_client_no_cache" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_miss_client_no_cache_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_totaltime.miss_client_no_cache" , RECD_FLOAT , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_miss_client_no_cache_stat , RecRawStatSyncIntMsecsToFloatSeconds ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_counts.errors.aborts" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_errors_aborts_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_totaltime.errors.aborts" , RECD_FLOAT , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_errors_aborts_stat , RecRawStatSyncIntMsecsToFloatSeconds ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_counts.errors.possible_aborts" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_errors_possible_aborts_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_totaltime.errors.possible_aborts" , RECD_FLOAT , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_errors_possible_aborts_stat , RecRawStatSyncIntMsecsToFloatSeconds ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_counts.errors.connect_failed" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_errors_connect_failed_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_totaltime.errors.connect_failed" , RECD_FLOAT , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_errors_connect_failed_stat , RecRawStatSyncIntMsecsToFloatSeconds ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_counts.errors.other" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_errors_other_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_totaltime.errors.other" , RECD_FLOAT , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_errors_other_stat , RecRawStatSyncIntMsecsToFloatSeconds ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_counts.other.unclassified" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_other_unclassified_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.transaction_totaltime.other.unclassified" , RECD_FLOAT , RECP_PERSISTENT , ( int ) http_ua_msecs_counts_other_unclassified_stat , RecRawStatSyncIntMsecsToFloatSeconds ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.disallowed_post_100_continue" , RECD_COUNTER , RECP_PERSISTENT , ( int ) disallowed_post_100_continue , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.total_x_redirect_count" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_total_x_redirect_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.https.incoming_requests" , RECD_COUNTER , RECP_PERSISTENT , ( int ) https_incoming_requests_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.https.total_client_connections" , RECD_COUNTER , RECP_PERSISTENT , ( int ) https_total_client_connections_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.origin_connections_throttled_out" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_origin_connections_throttled_stat , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.post_body_too_large" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_post_body_too_large , RecRawStatSyncCount ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.milestone.ua_begin" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_ua_begin_time_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.milestone.ua_first_read" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_ua_first_read_time_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.milestone.ua_read_header_done" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_ua_read_header_done_time_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.milestone.ua_begin_write" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_ua_begin_write_time_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.milestone.ua_close" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_ua_close_time_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.milestone.server_first_connect" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_server_first_connect_time_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.milestone.server_connect" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_server_connect_time_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.milestone.server_connect_end" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_server_connect_end_time_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.milestone.server_begin_write" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_server_begin_write_time_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.milestone.server_first_read" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_server_first_read_time_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.milestone.server_read_header_done" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_server_read_header_done_time_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.milestone.server_close" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_server_close_time_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.milestone.cache_open_read_begin" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_cache_open_read_begin_time_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.milestone.cache_open_read_end" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_cache_open_read_end_time_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.milestone.cache_open_write_begin" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_cache_open_write_begin_time_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.milestone.cache_open_write_end" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_cache_open_write_end_time_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.milestone.dns_lookup_begin" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_dns_lookup_begin_time_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.milestone.dns_lookup_end" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_dns_lookup_end_time_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.milestone.sm_start" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_sm_start_time_stat , RecRawStatSyncSum ) ;
RecRegisterRawStat ( http_rsb , RECT_PROCESS , "proxy.process.http.milestone.sm_finish" , RECD_COUNTER , RECP_PERSISTENT , ( int ) http_sm_finish_time_stat , RecRawStatSyncSum ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static int ready_callback_key_compare_only_active ( gconstpointer a , gconstpointer b ) {
const ReadyCallback * callback_a ;
callback_a = a ;
if ( ! callback_a -> active ) {
return - 1 ;
}
return ready_callback_key_compare ( a , b ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static UBool action_setRunsOnly ( UBiDiTransform * pTransform , UErrorCode * pErrorCode ) {
ubidi_setReorderingMode ( pTransform -> pBidi , UBIDI_REORDER_RUNS_ONLY ) ;
return FALSE ;
} | 1True
|
Categorize the following code snippet as vulnerable or not. True or False | static int escape124_decode_frame ( AVCodecContext * avctx , void * data , int * got_frame , AVPacket * avpkt ) {
const uint8_t * buf = avpkt -> data ;
int buf_size = avpkt -> size ;
Escape124Context * s = avctx -> priv_data ;
AVFrame * frame = data ;
GetBitContext gb ;
unsigned frame_flags , frame_size ;
unsigned i ;
unsigned superblock_index , cb_index = 1 , superblock_col_index = 0 , superblocks_per_row = avctx -> width / 8 , skip = - 1 ;
uint16_t * old_frame_data , * new_frame_data ;
unsigned old_stride , new_stride ;
int ret ;
init_get_bits ( & gb , buf , buf_size * 8 ) ;
if ( ! can_safely_read ( & gb , 64 ) ) return - 1 ;
frame_flags = get_bits_long ( & gb , 32 ) ;
frame_size = get_bits_long ( & gb , 32 ) ;
if ( ! ( frame_flags & 0x114 ) || ! ( frame_flags & 0x7800000 ) ) {
if ( ! s -> frame . data [ 0 ] ) return AVERROR_INVALIDDATA ;
av_log ( NULL , AV_LOG_DEBUG , "Skipping frame\n" ) ;
* got_frame = 1 ;
if ( ( ret = av_frame_ref ( frame , & s -> frame ) ) < 0 ) return ret ;
return frame_size ;
}
for ( i = 0 ;
i < 3 ;
i ++ ) {
if ( frame_flags & ( 1 << ( 17 + i ) ) ) {
unsigned cb_depth , cb_size ;
if ( i == 2 ) {
cb_size = get_bits_long ( & gb , 20 ) ;
cb_depth = av_log2 ( cb_size - 1 ) + 1 ;
}
else {
cb_depth = get_bits ( & gb , 4 ) ;
if ( i == 0 ) {
cb_size = 1 << cb_depth ;
}
else {
cb_size = s -> num_superblocks << cb_depth ;
}
}
av_free ( s -> codebooks [ i ] . blocks ) ;
s -> codebooks [ i ] = unpack_codebook ( & gb , cb_depth , cb_size ) ;
if ( ! s -> codebooks [ i ] . blocks ) return - 1 ;
}
}
if ( ( ret = ff_get_buffer ( avctx , frame , AV_GET_BUFFER_FLAG_REF ) ) < 0 ) {
av_log ( avctx , AV_LOG_ERROR , "get_buffer() failed\n" ) ;
return ret ;
}
new_frame_data = ( uint16_t * ) frame -> data [ 0 ] ;
new_stride = frame -> linesize [ 0 ] / 2 ;
old_frame_data = ( uint16_t * ) s -> frame . data [ 0 ] ;
old_stride = s -> frame . linesize [ 0 ] / 2 ;
for ( superblock_index = 0 ;
superblock_index < s -> num_superblocks ;
superblock_index ++ ) {
MacroBlock mb ;
SuperBlock sb ;
unsigned multi_mask = 0 ;
if ( skip == - 1 ) {
skip = decode_skip_count ( & gb ) ;
}
if ( skip ) {
copy_superblock ( new_frame_data , new_stride , old_frame_data , old_stride ) ;
}
else {
copy_superblock ( sb . pixels , 8 , old_frame_data , old_stride ) ;
while ( can_safely_read ( & gb , 1 ) && ! get_bits1 ( & gb ) ) {
unsigned mask ;
mb = decode_macroblock ( s , & gb , & cb_index , superblock_index ) ;
mask = get_bits ( & gb , 16 ) ;
multi_mask |= mask ;
for ( i = 0 ;
i < 16 ;
i ++ ) {
if ( mask & mask_matrix [ i ] ) {
insert_mb_into_sb ( & sb , mb , i ) ;
}
}
}
if ( can_safely_read ( & gb , 1 ) && ! get_bits1 ( & gb ) ) {
unsigned inv_mask = get_bits ( & gb , 4 ) ;
for ( i = 0 ;
i < 4 ;
i ++ ) {
if ( inv_mask & ( 1 << i ) ) {
multi_mask ^= 0xF << i * 4 ;
}
else {
multi_mask ^= get_bits ( & gb , 4 ) << i * 4 ;
}
}
for ( i = 0 ;
i < 16 ;
i ++ ) {
if ( multi_mask & mask_matrix [ i ] ) {
if ( ! can_safely_read ( & gb , 1 ) ) break ;
mb = decode_macroblock ( s , & gb , & cb_index , superblock_index ) ;
insert_mb_into_sb ( & sb , mb , i ) ;
}
}
}
else if ( frame_flags & ( 1 << 16 ) ) {
while ( can_safely_read ( & gb , 1 ) && ! get_bits1 ( & gb ) ) {
mb = decode_macroblock ( s , & gb , & cb_index , superblock_index ) ;
insert_mb_into_sb ( & sb , mb , get_bits ( & gb , 4 ) ) ;
}
}
copy_superblock ( new_frame_data , new_stride , sb . pixels , 8 ) ;
}
superblock_col_index ++ ;
new_frame_data += 8 ;
if ( old_frame_data ) old_frame_data += 8 ;
if ( superblock_col_index == superblocks_per_row ) {
new_frame_data += new_stride * 8 - superblocks_per_row * 8 ;
if ( old_frame_data ) old_frame_data += old_stride * 8 - superblocks_per_row * 8 ;
superblock_col_index = 0 ;
}
skip -- ;
}
av_log ( NULL , AV_LOG_DEBUG , "Escape sizes: %i, %i, %i\n" , frame_size , buf_size , get_bits_count ( & gb ) / 8 ) ;
av_frame_unref ( & s -> frame ) ;
if ( ( ret = av_frame_ref ( & s -> frame , frame ) ) < 0 ) return ret ;
* got_frame = 1 ;
return frame_size ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static int dissect_h245_EncryptionSync ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
# line 706 "../../asn1/h245/h245.cnf" void * priv_data = actx -> private_data ;
actx -> private_data = gef_ctx_alloc ( NULL , "EncryptionSync" ) ;
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h245_EncryptionSync , EncryptionSync_sequence ) ;
# line 709 "../../asn1/h245/h245.cnf" actx -> private_data = priv_data ;
return offset ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | int qemuMonitorJSONCheckHMP ( qemuMonitorPtr mon ) {
int ret = - 1 ;
virJSONValuePtr cmd = qemuMonitorJSONMakeCommand ( "query-commands" , NULL ) ;
virJSONValuePtr reply = NULL ;
virJSONValuePtr data ;
int i , n ;
if ( ! cmd ) return ret ;
if ( qemuMonitorJSONCommand ( mon , cmd , & reply ) < 0 || qemuMonitorJSONCheckError ( cmd , reply ) < 0 ) goto cleanup ;
if ( ! ( data = virJSONValueObjectGet ( reply , "return" ) ) || data -> type != VIR_JSON_TYPE_ARRAY || ( n = virJSONValueArraySize ( data ) ) <= 0 ) goto cleanup ;
for ( i = 0 ;
i < n ;
i ++ ) {
virJSONValuePtr entry ;
const char * name ;
if ( ! ( entry = virJSONValueArrayGet ( data , i ) ) || ! ( name = virJSONValueObjectGetString ( entry , "name" ) ) ) goto cleanup ;
if ( STREQ ( name , "human-monitor-command" ) ) {
ret = 1 ;
goto cleanup ;
}
}
ret = 0 ;
cleanup : virJSONValueFree ( cmd ) ;
virJSONValueFree ( reply ) ;
return ret ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static const char * cmd_rule_remove_by_msg ( cmd_parms * cmd , void * _dcfg , const char * p1 ) {
directory_config * dcfg = ( directory_config * ) _dcfg ;
rule_exception * re = apr_pcalloc ( cmd -> pool , sizeof ( rule_exception ) ) ;
if ( dcfg == NULL ) return NULL ;
re -> type = RULE_EXCEPTION_REMOVE_MSG ;
re -> param = p1 ;
re -> param_data = msc_pregcomp ( cmd -> pool , p1 , 0 , NULL , NULL ) ;
if ( re -> param_data == NULL ) {
return apr_psprintf ( cmd -> pool , "ModSecurity: Invalid regular expression: %s" , p1 ) ;
}
* ( rule_exception * * ) apr_array_push ( dcfg -> rule_exceptions ) = re ;
msre_ruleset_rule_remove_with_exception ( dcfg -> ruleset , re ) ;
# ifdef DEBUG_CONF ap_log_perror ( APLOG_MARK , APLOG_STARTUP | APLOG_NOERRNO , 0 , cmd -> pool , "Added exception %pp (%d %s) to dcfg %pp." , re , re -> type , re -> param , dcfg ) ;
# endif return NULL ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static void cmd_window_show ( const char * data ) {
_cmd_window_show_opt ( data , FALSE ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | void http_request_done ( struct evhttp_request * req , void * arg ) {
const char * what = "This is funny" ;
if ( req -> response_code != HTTP_OK ) {
fprintf ( stderr , "FAILED\n" ) ;
exit ( 1 ) ;
}
if ( evhttp_find_header ( req -> input_headers , "Content-Type" ) == NULL ) {
fprintf ( stderr , "FAILED\n" ) ;
exit ( 1 ) ;
}
if ( EVBUFFER_LENGTH ( req -> input_buffer ) != strlen ( what ) ) {
fprintf ( stderr , "FAILED\n" ) ;
exit ( 1 ) ;
}
if ( memcmp ( EVBUFFER_DATA ( req -> input_buffer ) , what , strlen ( what ) ) != 0 ) {
fprintf ( stderr , "FAILED\n" ) ;
exit ( 1 ) ;
}
test_ok = 1 ;
event_loopexit ( NULL ) ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | static uint64_t xhci_port_read ( void * ptr , hwaddr reg , unsigned size ) {
XHCIPort * port = ptr ;
uint32_t ret ;
switch ( reg ) {
case 0x00 : ret = port -> portsc ;
break ;
case 0x04 : case 0x08 : ret = 0 ;
break ;
case 0x0c : default : trace_usb_xhci_unimplemented ( "port read" , reg ) ;
ret = 0 ;
}
trace_usb_xhci_port_read ( port -> portnr , reg , ret ) ;
return ret ;
} | 0False
|
Categorize the following code snippet as vulnerable or not. True or False | void virLogOutputListFree ( virLogOutputPtr * list , int count ) {
size_t i ;
if ( ! list || count < 0 ) return ;
for ( i = 0 ;
i < count ;
i ++ ) virLogOutputFree ( list [ i ] ) ;
VIR_FREE ( list ) ;
} | 0False
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.