instruction
stringclasses 1
value | input
stringlengths 31
235k
| output
class label 2
classes |
---|---|---|
Categorize the following code snippet as vulnerable or not. True or False
|
static int store_object ( enum object_type type , struct strbuf * dat , struct last_object * last , unsigned char * sha1out , uintmax_t mark ) {
void * out , * delta ;
struct object_entry * e ;
unsigned char hdr [ 96 ] ;
unsigned char sha1 [ 20 ] ;
unsigned long hdrlen , deltalen ;
git_SHA_CTX c ;
git_zstream s ;
hdrlen = xsnprintf ( ( char * ) hdr , sizeof ( hdr ) , "%s %lu" , typename ( type ) , ( unsigned long ) dat -> len ) + 1 ;
git_SHA1_Init ( & c ) ;
git_SHA1_Update ( & c , hdr , hdrlen ) ;
git_SHA1_Update ( & c , dat -> buf , dat -> len ) ;
git_SHA1_Final ( sha1 , & c ) ;
if ( sha1out ) hashcpy ( sha1out , sha1 ) ;
e = insert_object ( sha1 ) ;
if ( mark ) insert_mark ( mark , e ) ;
if ( e -> idx . offset ) {
duplicate_count_by_type [ type ] ++ ;
return 1 ;
}
else if ( find_sha1_pack ( sha1 , packed_git ) ) {
e -> type = type ;
e -> pack_id = MAX_PACK_ID ;
e -> idx . offset = 1 ;
duplicate_count_by_type [ type ] ++ ;
return 1 ;
}
if ( last && last -> data . buf && last -> depth < max_depth && dat -> len > 20 ) {
delta_count_attempts_by_type [ type ] ++ ;
delta = diff_delta ( last -> data . buf , last -> data . len , dat -> buf , dat -> len , & deltalen , dat -> len - 20 ) ;
}
else delta = NULL ;
git_deflate_init ( & s , pack_compression_level ) ;
if ( delta ) {
s . next_in = delta ;
s . avail_in = deltalen ;
}
else {
s . next_in = ( void * ) dat -> buf ;
s . avail_in = dat -> len ;
}
s . avail_out = git_deflate_bound ( & s , s . avail_in ) ;
s . next_out = out = xmalloc ( s . avail_out ) ;
while ( git_deflate ( & s , Z_FINISH ) == Z_OK ) ;
git_deflate_end ( & s ) ;
if ( ( max_packsize && ( pack_size + 60 + s . total_out ) > max_packsize ) || ( pack_size + 60 + s . total_out ) < pack_size ) {
e -> pack_id = pack_id + 1 ;
cycle_packfile ( ) ;
if ( delta ) {
free ( delta ) ;
delta = NULL ;
git_deflate_init ( & s , pack_compression_level ) ;
s . next_in = ( void * ) dat -> buf ;
s . avail_in = dat -> len ;
s . avail_out = git_deflate_bound ( & s , s . avail_in ) ;
s . next_out = out = xrealloc ( out , s . avail_out ) ;
while ( git_deflate ( & s , Z_FINISH ) == Z_OK ) ;
git_deflate_end ( & s ) ;
}
}
e -> type = type ;
e -> pack_id = pack_id ;
e -> idx . offset = pack_size ;
object_count ++ ;
object_count_by_type [ type ] ++ ;
crc32_begin ( pack_file ) ;
if ( delta ) {
off_t ofs = e -> idx . offset - last -> offset ;
unsigned pos = sizeof ( hdr ) - 1 ;
delta_count_by_type [ type ] ++ ;
e -> depth = last -> depth + 1 ;
hdrlen = encode_in_pack_object_header ( OBJ_OFS_DELTA , deltalen , hdr ) ;
sha1write ( pack_file , hdr , hdrlen ) ;
pack_size += hdrlen ;
hdr [ pos ] = ofs & 127 ;
while ( ofs >>= 7 ) hdr [ -- pos ] = 128 | ( -- ofs & 127 ) ;
sha1write ( pack_file , hdr + pos , sizeof ( hdr ) - pos ) ;
pack_size += sizeof ( hdr ) - pos ;
}
else {
e -> depth = 0 ;
hdrlen = encode_in_pack_object_header ( type , dat -> len , hdr ) ;
sha1write ( pack_file , hdr , hdrlen ) ;
pack_size += hdrlen ;
}
sha1write ( pack_file , out , s . total_out ) ;
pack_size += s . total_out ;
e -> idx . crc32 = crc32_end ( pack_file ) ;
free ( out ) ;
free ( delta ) ;
if ( last ) {
if ( last -> no_swap ) {
last -> data = * dat ;
}
else {
strbuf_swap ( & last -> data , dat ) ;
}
last -> offset = e -> idx . offset ;
last -> depth = e -> depth ;
}
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void dtls1_get_message_header ( unsigned char * data , struct hm_header_st * msg_hdr ) {
memset ( msg_hdr , 0 , sizeof ( * msg_hdr ) ) ;
msg_hdr -> type = * ( data ++ ) ;
n2l3 ( data , msg_hdr -> msg_len ) ;
n2s ( data , msg_hdr -> seq ) ;
n2l3 ( data , msg_hdr -> frag_off ) ;
n2l3 ( data , msg_hdr -> frag_len ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int sapi_uwsgi_ub_write ( const char * str , uint str_length TSRMLS_DC ) # endif {
struct wsgi_request * wsgi_req = ( struct wsgi_request * ) SG ( server_context ) ;
uwsgi_response_write_body_do ( wsgi_req , ( char * ) str , str_length ) ;
if ( wsgi_req -> write_errors > uwsgi . write_errors_tolerance ) {
php_handle_aborted_connection ( ) ;
return - 1 ;
}
return str_length ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static hb_ ## name ## _t * _hb_ ## name ## _reference ( const hb_ ## name ## _t * l ) {
hb_ ## name ## _t * c = ( hb_ ## name ## _t * ) calloc ( 1 , sizeof ( hb_ ## name ## _t ) ) ;
if ( unlikely ( ! c ) ) return NULL ;
* c = * l ;
return c ;
}
static void _hb_ ## name ## _destroy ( hb_ ## name ## _t * l ) {
free ( l ) ;
}
HB_DEFINE_BOXED_TYPE ( name , _hb_ ## name ## _reference , _hb_ ## name ## _destroy ) ;
HB_DEFINE_OBJECT_TYPE ( buffer ) HB_DEFINE_OBJECT_TYPE ( blob ) HB_DEFINE_OBJECT_TYPE ( face ) HB_DEFINE_OBJECT_TYPE ( font ) HB_DEFINE_OBJECT_TYPE ( font_funcs ) HB_DEFINE_OBJECT_TYPE ( set ) HB_DEFINE_OBJECT_TYPE ( shape_plan ) HB_DEFINE_OBJECT_TYPE ( unicode_funcs ) HB_DEFINE_VALUE_TYPE ( feature )
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void * main_alloc ( void * opaque , size_t items , usize_t size ) {
return main_malloc1 ( items * size ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int s302m_decode_frame ( AVCodecContext * avctx , void * data , int * got_frame_ptr , AVPacket * avpkt ) {
AVFrame * frame = data ;
const uint8_t * buf = avpkt -> data ;
int buf_size = avpkt -> size ;
int block_size , ret ;
int frame_size = s302m_parse_frame_header ( avctx , buf , buf_size ) ;
if ( frame_size < 0 ) return frame_size ;
buf_size -= AES3_HEADER_LEN ;
buf += AES3_HEADER_LEN ;
block_size = ( avctx -> bits_per_coded_sample + 4 ) / 4 ;
frame -> nb_samples = 2 * ( buf_size / block_size ) / avctx -> channels ;
if ( ( ret = ff_get_buffer ( avctx , frame , 0 ) ) < 0 ) {
av_log ( avctx , AV_LOG_ERROR , "get_buffer() failed\n" ) ;
return ret ;
}
buf_size = ( frame -> nb_samples * avctx -> channels / 2 ) * block_size ;
if ( avctx -> bits_per_coded_sample == 24 ) {
uint32_t * o = ( uint32_t * ) frame -> data [ 0 ] ;
for ( ;
buf_size > 6 ;
buf_size -= 7 ) {
* o ++ = ( ff_reverse [ buf [ 2 ] ] << 24 ) | ( ff_reverse [ buf [ 1 ] ] << 16 ) | ( ff_reverse [ buf [ 0 ] ] << 8 ) ;
* o ++ = ( ff_reverse [ buf [ 6 ] & 0xf0 ] << 28 ) | ( ff_reverse [ buf [ 5 ] ] << 20 ) | ( ff_reverse [ buf [ 4 ] ] << 12 ) | ( ff_reverse [ buf [ 3 ] & 0x0f ] << 4 ) ;
buf += 7 ;
}
}
else if ( avctx -> bits_per_coded_sample == 20 ) {
uint32_t * o = ( uint32_t * ) frame -> data [ 0 ] ;
for ( ;
buf_size > 5 ;
buf_size -= 6 ) {
* o ++ = ( ff_reverse [ buf [ 2 ] & 0xf0 ] << 28 ) | ( ff_reverse [ buf [ 1 ] ] << 20 ) | ( ff_reverse [ buf [ 0 ] ] << 12 ) ;
* o ++ = ( ff_reverse [ buf [ 5 ] & 0xf0 ] << 28 ) | ( ff_reverse [ buf [ 4 ] ] << 20 ) | ( ff_reverse [ buf [ 3 ] ] << 12 ) ;
buf += 6 ;
}
}
else {
uint16_t * o = ( uint16_t * ) frame -> data [ 0 ] ;
for ( ;
buf_size > 4 ;
buf_size -= 5 ) {
* o ++ = ( ff_reverse [ buf [ 1 ] ] << 8 ) | ff_reverse [ buf [ 0 ] ] ;
* o ++ = ( ff_reverse [ buf [ 4 ] & 0xf0 ] << 12 ) | ( ff_reverse [ buf [ 3 ] ] << 4 ) | ( ff_reverse [ buf [ 2 ] ] >> 4 ) ;
buf += 5 ;
}
}
* got_frame_ptr = 1 ;
return avpkt -> size ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int ASN1_BIT_STRING_set ( ASN1_BIT_STRING * x , unsigned char * d , int len ) {
return M_ASN1_BIT_STRING_set ( x , d , len ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int com_clear ( String * buffer , char * line __attribute__ ( ( unused ) ) ) {
# ifdef HAVE_READLINE if ( status . add_to_history ) fix_history ( buffer ) ;
# endif buffer -> length ( 0 ) ;
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void vp9_setup_mask ( VP9_COMMON * const cm , const int mi_row , const int mi_col , MODE_INFO * * mi , const int mode_info_stride , LOOP_FILTER_MASK * lfm ) {
int idx_32 , idx_16 , idx_8 ;
const loop_filter_info_n * const lfi_n = & cm -> lf_info ;
MODE_INFO * * mip = mi ;
MODE_INFO * * mip2 = mi ;
const int offset_32 [ ] = {
4 , ( mode_info_stride << 2 ) - 4 , 4 , - ( mode_info_stride << 2 ) - 4 }
;
const int offset_16 [ ] = {
2 , ( mode_info_stride << 1 ) - 2 , 2 , - ( mode_info_stride << 1 ) - 2 }
;
const int offset [ ] = {
1 , mode_info_stride - 1 , 1 , - mode_info_stride - 1 }
;
const int shift_32_y [ ] = {
0 , 4 , 32 , 36 }
;
const int shift_16_y [ ] = {
0 , 2 , 16 , 18 }
;
const int shift_8_y [ ] = {
0 , 1 , 8 , 9 }
;
const int shift_32_uv [ ] = {
0 , 2 , 8 , 10 }
;
const int shift_16_uv [ ] = {
0 , 1 , 4 , 5 }
;
int i ;
const int max_rows = ( mi_row + MI_BLOCK_SIZE > cm -> mi_rows ? cm -> mi_rows - mi_row : MI_BLOCK_SIZE ) ;
const int max_cols = ( mi_col + MI_BLOCK_SIZE > cm -> mi_cols ? cm -> mi_cols - mi_col : MI_BLOCK_SIZE ) ;
vp9_zero ( * lfm ) ;
assert ( mip [ 0 ] != NULL ) ;
switch ( mip [ 0 ] -> mbmi . sb_type ) {
case BLOCK_64X64 : build_masks ( lfi_n , mip [ 0 ] , 0 , 0 , lfm ) ;
break ;
case BLOCK_64X32 : build_masks ( lfi_n , mip [ 0 ] , 0 , 0 , lfm ) ;
mip2 = mip + mode_info_stride * 4 ;
if ( 4 >= max_rows ) break ;
build_masks ( lfi_n , mip2 [ 0 ] , 32 , 8 , lfm ) ;
break ;
case BLOCK_32X64 : build_masks ( lfi_n , mip [ 0 ] , 0 , 0 , lfm ) ;
mip2 = mip + 4 ;
if ( 4 >= max_cols ) break ;
build_masks ( lfi_n , mip2 [ 0 ] , 4 , 2 , lfm ) ;
break ;
default : for ( idx_32 = 0 ;
idx_32 < 4 ;
mip += offset_32 [ idx_32 ] , ++ idx_32 ) {
const int shift_y = shift_32_y [ idx_32 ] ;
const int shift_uv = shift_32_uv [ idx_32 ] ;
const int mi_32_col_offset = ( ( idx_32 & 1 ) << 2 ) ;
const int mi_32_row_offset = ( ( idx_32 >> 1 ) << 2 ) ;
if ( mi_32_col_offset >= max_cols || mi_32_row_offset >= max_rows ) continue ;
switch ( mip [ 0 ] -> mbmi . sb_type ) {
case BLOCK_32X32 : build_masks ( lfi_n , mip [ 0 ] , shift_y , shift_uv , lfm ) ;
break ;
case BLOCK_32X16 : build_masks ( lfi_n , mip [ 0 ] , shift_y , shift_uv , lfm ) ;
if ( mi_32_row_offset + 2 >= max_rows ) continue ;
mip2 = mip + mode_info_stride * 2 ;
build_masks ( lfi_n , mip2 [ 0 ] , shift_y + 16 , shift_uv + 4 , lfm ) ;
break ;
case BLOCK_16X32 : build_masks ( lfi_n , mip [ 0 ] , shift_y , shift_uv , lfm ) ;
if ( mi_32_col_offset + 2 >= max_cols ) continue ;
mip2 = mip + 2 ;
build_masks ( lfi_n , mip2 [ 0 ] , shift_y + 2 , shift_uv + 1 , lfm ) ;
break ;
default : for ( idx_16 = 0 ;
idx_16 < 4 ;
mip += offset_16 [ idx_16 ] , ++ idx_16 ) {
const int shift_y = shift_32_y [ idx_32 ] + shift_16_y [ idx_16 ] ;
const int shift_uv = shift_32_uv [ idx_32 ] + shift_16_uv [ idx_16 ] ;
const int mi_16_col_offset = mi_32_col_offset + ( ( idx_16 & 1 ) << 1 ) ;
const int mi_16_row_offset = mi_32_row_offset + ( ( idx_16 >> 1 ) << 1 ) ;
if ( mi_16_col_offset >= max_cols || mi_16_row_offset >= max_rows ) continue ;
switch ( mip [ 0 ] -> mbmi . sb_type ) {
case BLOCK_16X16 : build_masks ( lfi_n , mip [ 0 ] , shift_y , shift_uv , lfm ) ;
break ;
case BLOCK_16X8 : build_masks ( lfi_n , mip [ 0 ] , shift_y , shift_uv , lfm ) ;
if ( mi_16_row_offset + 1 >= max_rows ) continue ;
mip2 = mip + mode_info_stride ;
build_y_mask ( lfi_n , mip2 [ 0 ] , shift_y + 8 , lfm ) ;
break ;
case BLOCK_8X16 : build_masks ( lfi_n , mip [ 0 ] , shift_y , shift_uv , lfm ) ;
if ( mi_16_col_offset + 1 >= max_cols ) continue ;
mip2 = mip + 1 ;
build_y_mask ( lfi_n , mip2 [ 0 ] , shift_y + 1 , lfm ) ;
break ;
default : {
const int shift_y = shift_32_y [ idx_32 ] + shift_16_y [ idx_16 ] + shift_8_y [ 0 ] ;
build_masks ( lfi_n , mip [ 0 ] , shift_y , shift_uv , lfm ) ;
mip += offset [ 0 ] ;
for ( idx_8 = 1 ;
idx_8 < 4 ;
mip += offset [ idx_8 ] , ++ idx_8 ) {
const int shift_y = shift_32_y [ idx_32 ] + shift_16_y [ idx_16 ] + shift_8_y [ idx_8 ] ;
const int mi_8_col_offset = mi_16_col_offset + ( ( idx_8 & 1 ) ) ;
const int mi_8_row_offset = mi_16_row_offset + ( ( idx_8 >> 1 ) ) ;
if ( mi_8_col_offset >= max_cols || mi_8_row_offset >= max_rows ) continue ;
build_y_mask ( lfi_n , mip [ 0 ] , shift_y , lfm ) ;
}
break ;
}
}
}
break ;
}
}
break ;
}
lfm -> left_y [ TX_16X16 ] |= lfm -> left_y [ TX_32X32 ] ;
lfm -> above_y [ TX_16X16 ] |= lfm -> above_y [ TX_32X32 ] ;
lfm -> left_uv [ TX_16X16 ] |= lfm -> left_uv [ TX_32X32 ] ;
lfm -> above_uv [ TX_16X16 ] |= lfm -> above_uv [ TX_32X32 ] ;
lfm -> left_y [ TX_8X8 ] |= lfm -> left_y [ TX_4X4 ] & left_border ;
lfm -> left_y [ TX_4X4 ] &= ~ left_border ;
lfm -> above_y [ TX_8X8 ] |= lfm -> above_y [ TX_4X4 ] & above_border ;
lfm -> above_y [ TX_4X4 ] &= ~ above_border ;
lfm -> left_uv [ TX_8X8 ] |= lfm -> left_uv [ TX_4X4 ] & left_border_uv ;
lfm -> left_uv [ TX_4X4 ] &= ~ left_border_uv ;
lfm -> above_uv [ TX_8X8 ] |= lfm -> above_uv [ TX_4X4 ] & above_border_uv ;
lfm -> above_uv [ TX_4X4 ] &= ~ above_border_uv ;
if ( mi_row + MI_BLOCK_SIZE > cm -> mi_rows ) {
const uint64_t rows = cm -> mi_rows - mi_row ;
const uint64_t mask_y = ( ( ( uint64_t ) 1 << ( rows << 3 ) ) - 1 ) ;
const uint16_t mask_uv = ( ( ( uint16_t ) 1 << ( ( ( rows + 1 ) >> 1 ) << 2 ) ) - 1 ) ;
for ( i = 0 ;
i < TX_32X32 ;
i ++ ) {
lfm -> left_y [ i ] &= mask_y ;
lfm -> above_y [ i ] &= mask_y ;
lfm -> left_uv [ i ] &= mask_uv ;
lfm -> above_uv [ i ] &= mask_uv ;
}
lfm -> int_4x4_y &= mask_y ;
lfm -> int_4x4_uv &= mask_uv ;
if ( rows == 1 ) {
lfm -> above_uv [ TX_8X8 ] |= lfm -> above_uv [ TX_16X16 ] ;
lfm -> above_uv [ TX_16X16 ] = 0 ;
}
if ( rows == 5 ) {
lfm -> above_uv [ TX_8X8 ] |= lfm -> above_uv [ TX_16X16 ] & 0xff00 ;
lfm -> above_uv [ TX_16X16 ] &= ~ ( lfm -> above_uv [ TX_16X16 ] & 0xff00 ) ;
}
}
if ( mi_col + MI_BLOCK_SIZE > cm -> mi_cols ) {
const uint64_t columns = cm -> mi_cols - mi_col ;
const uint64_t mask_y = ( ( ( 1 << columns ) - 1 ) ) * 0x0101010101010101 ;
const uint16_t mask_uv = ( ( 1 << ( ( columns + 1 ) >> 1 ) ) - 1 ) * 0x1111 ;
const uint16_t mask_uv_int = ( ( 1 << ( columns >> 1 ) ) - 1 ) * 0x1111 ;
for ( i = 0 ;
i < TX_32X32 ;
i ++ ) {
lfm -> left_y [ i ] &= mask_y ;
lfm -> above_y [ i ] &= mask_y ;
lfm -> left_uv [ i ] &= mask_uv ;
lfm -> above_uv [ i ] &= mask_uv ;
}
lfm -> int_4x4_y &= mask_y ;
lfm -> int_4x4_uv &= mask_uv_int ;
if ( columns == 1 ) {
lfm -> left_uv [ TX_8X8 ] |= lfm -> left_uv [ TX_16X16 ] ;
lfm -> left_uv [ TX_16X16 ] = 0 ;
}
if ( columns == 5 ) {
lfm -> left_uv [ TX_8X8 ] |= ( lfm -> left_uv [ TX_16X16 ] & 0xcccc ) ;
lfm -> left_uv [ TX_16X16 ] &= ~ ( lfm -> left_uv [ TX_16X16 ] & 0xcccc ) ;
}
}
if ( mi_col == 0 ) {
for ( i = 0 ;
i < TX_32X32 ;
i ++ ) {
lfm -> left_y [ i ] &= 0xfefefefefefefefe ;
lfm -> left_uv [ i ] &= 0xeeee ;
}
}
assert ( ! ( lfm -> left_y [ TX_16X16 ] & lfm -> left_y [ TX_8X8 ] ) ) ;
assert ( ! ( lfm -> left_y [ TX_16X16 ] & lfm -> left_y [ TX_4X4 ] ) ) ;
assert ( ! ( lfm -> left_y [ TX_8X8 ] & lfm -> left_y [ TX_4X4 ] ) ) ;
assert ( ! ( lfm -> int_4x4_y & lfm -> left_y [ TX_16X16 ] ) ) ;
assert ( ! ( lfm -> left_uv [ TX_16X16 ] & lfm -> left_uv [ TX_8X8 ] ) ) ;
assert ( ! ( lfm -> left_uv [ TX_16X16 ] & lfm -> left_uv [ TX_4X4 ] ) ) ;
assert ( ! ( lfm -> left_uv [ TX_8X8 ] & lfm -> left_uv [ TX_4X4 ] ) ) ;
assert ( ! ( lfm -> int_4x4_uv & lfm -> left_uv [ TX_16X16 ] ) ) ;
assert ( ! ( lfm -> above_y [ TX_16X16 ] & lfm -> above_y [ TX_8X8 ] ) ) ;
assert ( ! ( lfm -> above_y [ TX_16X16 ] & lfm -> above_y [ TX_4X4 ] ) ) ;
assert ( ! ( lfm -> above_y [ TX_8X8 ] & lfm -> above_y [ TX_4X4 ] ) ) ;
assert ( ! ( lfm -> int_4x4_y & lfm -> above_y [ TX_16X16 ] ) ) ;
assert ( ! ( lfm -> above_uv [ TX_16X16 ] & lfm -> above_uv [ TX_8X8 ] ) ) ;
assert ( ! ( lfm -> above_uv [ TX_16X16 ] & lfm -> above_uv [ TX_4X4 ] ) ) ;
assert ( ! ( lfm -> above_uv [ TX_8X8 ] & lfm -> above_uv [ TX_4X4 ] ) ) ;
assert ( ! ( lfm -> int_4x4_uv & lfm -> above_uv [ TX_16X16 ] ) ) ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static proto_item * dissect_datetime_ie ( tvbuff_t * tvb , guint32 offset , proto_tree * ies_tree ) {
struct tm tm ;
guint32 ie_val ;
nstime_t datetime ;
proto_tree_add_item ( ies_tree , hf_iax2_ies [ IAX_IE_DATETIME ] , tvb , offset + 2 , 4 , ENC_BIG_ENDIAN ) ;
ie_val = tvb_get_ntohl ( tvb , offset + 2 ) ;
tm . tm_sec = ( ie_val & 0x1f ) << 1 ;
tm . tm_min = ( ie_val >> 5 ) & 0x3f ;
tm . tm_hour = ( ie_val >> 11 ) & 0x1f ;
tm . tm_mday = ( ie_val >> 16 ) & 0x1f ;
tm . tm_mon = ( ( ie_val >> 21 ) & 0x0f ) - 1 ;
tm . tm_year = ( ( ie_val >> 25 ) & 0x7f ) + 100 ;
tm . tm_isdst = - 1 ;
datetime . secs = mktime ( & tm ) ;
datetime . nsecs = 0 ;
return proto_tree_add_time ( ies_tree , hf_iax2_ie_datetime , tvb , offset + 2 , 4 , & datetime ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int xmlThrDefDoValidityCheckingDefaultValue ( int v ) {
int ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlDoValidityCheckingDefaultValueThrDef ;
xmlDoValidityCheckingDefaultValueThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
const char * trunc_left ( const char * src , size_t width ) {
size_t sl ;
char * out ;
sl = strlen ( src ) ;
if ( sl > width && LIB_BUFLENGTH - 1 > width && width > 1 ) {
LIB_GETBUF ( out ) ;
out [ 0 ] = '_' ;
memcpy ( & out [ 1 ] , & src [ sl + 1 - width ] , width ) ;
return out ;
}
return src ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int tls_get_message_body ( SSL * s , unsigned long * len ) {
long n ;
unsigned char * p ;
int i ;
if ( s -> s3 -> tmp . message_type == SSL3_MT_CHANGE_CIPHER_SPEC ) {
* len = ( unsigned long ) s -> init_num ;
return 1 ;
}
p = s -> init_msg ;
n = s -> s3 -> tmp . message_size - s -> init_num ;
while ( n > 0 ) {
i = s -> method -> ssl_read_bytes ( s , SSL3_RT_HANDSHAKE , NULL , & p [ s -> init_num ] , n , 0 ) ;
if ( i <= 0 ) {
s -> rwstate = SSL_READING ;
* len = 0 ;
return 0 ;
}
s -> init_num += i ;
n -= i ;
}
# ifndef OPENSSL_NO_NEXTPROTONEG if ( * s -> init_buf -> data == SSL3_MT_FINISHED ) ssl3_take_mac ( s ) ;
# endif if ( RECORD_LAYER_is_sslv2_record ( & s -> rlayer ) ) {
if ( ! ssl3_finish_mac ( s , ( unsigned char * ) s -> init_buf -> data , s -> init_num ) ) {
SSLerr ( SSL_F_TLS_GET_MESSAGE_BODY , ERR_R_EVP_LIB ) ;
ssl3_send_alert ( s , SSL3_AL_FATAL , SSL_AD_INTERNAL_ERROR ) ;
* len = 0 ;
return 0 ;
}
if ( s -> msg_callback ) s -> msg_callback ( 0 , SSL2_VERSION , 0 , s -> init_buf -> data , ( size_t ) s -> init_num , s , s -> msg_callback_arg ) ;
}
else {
if ( ! ssl3_finish_mac ( s , ( unsigned char * ) s -> init_buf -> data , s -> init_num + SSL3_HM_HEADER_LENGTH ) ) {
SSLerr ( SSL_F_TLS_GET_MESSAGE_BODY , ERR_R_EVP_LIB ) ;
ssl3_send_alert ( s , SSL3_AL_FATAL , SSL_AD_INTERNAL_ERROR ) ;
* len = 0 ;
return 0 ;
}
if ( s -> msg_callback ) s -> msg_callback ( 0 , s -> version , SSL3_RT_HANDSHAKE , s -> init_buf -> data , ( size_t ) s -> init_num + SSL3_HM_HEADER_LENGTH , s , s -> msg_callback_arg ) ;
}
if ( s -> init_num < 0 ) {
SSLerr ( SSL_F_TLS_GET_MESSAGE_BODY , ERR_R_INTERNAL_ERROR ) ;
ssl3_send_alert ( s , SSL3_AL_FATAL , SSL_AD_INTERNAL_ERROR ) ;
* len = 0 ;
return 0 ;
}
* len = ( unsigned long ) s -> init_num ;
return 1 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static const char * cmd_conn_read_state_limit ( cmd_parms * cmd , void * _dcfg , const char * p1 ) {
directory_config * dcfg = ( directory_config * ) _dcfg ;
long int limit ;
if ( dcfg == NULL ) return NULL ;
limit = strtol ( p1 , NULL , 10 ) ;
if ( ( limit == LONG_MAX ) || ( limit == LONG_MIN ) || ( limit <= 0 ) ) {
return apr_psprintf ( cmd -> pool , "ModSecurity: Invalid value for SecReadStateLimit: %s" , p1 ) ;
}
conn_read_state_limit = limit ;
return NULL ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int qemuAgentUpdateCPUInfo ( unsigned int nvcpus , qemuAgentCPUInfoPtr cpuinfo , int ncpuinfo ) {
size_t i ;
int nonline = 0 ;
int nofflinable = 0 ;
ssize_t cpu0 = - 1 ;
for ( i = 0 ;
i < ncpuinfo ;
i ++ ) {
if ( cpuinfo [ i ] . id == 0 ) cpu0 = i ;
if ( cpuinfo [ i ] . online ) nonline ++ ;
if ( cpuinfo [ i ] . offlinable && cpuinfo [ i ] . online ) nofflinable ++ ;
if ( ! cpuinfo [ i ] . online && ! cpuinfo [ i ] . offlinable ) {
virReportError ( VIR_ERR_INTERNAL_ERROR , "%s" , _ ( "Invalid data provided by guest agent" ) ) ;
return - 1 ;
}
}
if ( nofflinable == nonline && cpu0 >= 0 && cpuinfo [ cpu0 ] . online ) {
cpuinfo [ cpu0 ] . offlinable = false ;
nofflinable -- ;
}
if ( nvcpus > ncpuinfo ) {
virReportError ( VIR_ERR_INTERNAL_ERROR , "%s" , _ ( "guest agent reports less cpu than requested" ) ) ;
return - 1 ;
}
if ( nvcpus < nonline - nofflinable ) {
virReportError ( VIR_ERR_INVALID_ARG , "%s" , _ ( "Cannot offline enough CPUs" ) ) ;
return - 1 ;
}
for ( i = 0 ;
i < ncpuinfo ;
i ++ ) {
if ( nvcpus < nonline ) {
if ( cpuinfo [ i ] . offlinable && cpuinfo [ i ] . online ) {
cpuinfo [ i ] . online = false ;
cpuinfo [ i ] . modified = true ;
nonline -- ;
}
}
else if ( nvcpus > nonline ) {
if ( ! cpuinfo [ i ] . online ) {
cpuinfo [ i ] . online = true ;
cpuinfo [ i ] . modified = true ;
nonline ++ ;
}
}
else {
break ;
}
}
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void decode_fixed_vector ( float * fixed_vector , const uint16_t * pulse_hi , const uint16_t * pulse_lo , const enum Mode mode ) {
int sig_pos [ 4 ] [ 6 ] ;
int spacing = ( mode == MODE_6k60 ) ? 2 : 4 ;
int i , j ;
switch ( mode ) {
case MODE_6k60 : for ( i = 0 ;
i < 2 ;
i ++ ) decode_1p_track ( sig_pos [ i ] , pulse_lo [ i ] , 5 , 1 ) ;
break ;
case MODE_8k85 : for ( i = 0 ;
i < 4 ;
i ++ ) decode_1p_track ( sig_pos [ i ] , pulse_lo [ i ] , 4 , 1 ) ;
break ;
case MODE_12k65 : for ( i = 0 ;
i < 4 ;
i ++ ) decode_2p_track ( sig_pos [ i ] , pulse_lo [ i ] , 4 , 1 ) ;
break ;
case MODE_14k25 : for ( i = 0 ;
i < 2 ;
i ++ ) decode_3p_track ( sig_pos [ i ] , pulse_lo [ i ] , 4 , 1 ) ;
for ( i = 2 ;
i < 4 ;
i ++ ) decode_2p_track ( sig_pos [ i ] , pulse_lo [ i ] , 4 , 1 ) ;
break ;
case MODE_15k85 : for ( i = 0 ;
i < 4 ;
i ++ ) decode_3p_track ( sig_pos [ i ] , pulse_lo [ i ] , 4 , 1 ) ;
break ;
case MODE_18k25 : for ( i = 0 ;
i < 4 ;
i ++ ) decode_4p_track ( sig_pos [ i ] , ( int ) pulse_lo [ i ] + ( ( int ) pulse_hi [ i ] << 14 ) , 4 , 1 ) ;
break ;
case MODE_19k85 : for ( i = 0 ;
i < 2 ;
i ++ ) decode_5p_track ( sig_pos [ i ] , ( int ) pulse_lo [ i ] + ( ( int ) pulse_hi [ i ] << 10 ) , 4 , 1 ) ;
for ( i = 2 ;
i < 4 ;
i ++ ) decode_4p_track ( sig_pos [ i ] , ( int ) pulse_lo [ i ] + ( ( int ) pulse_hi [ i ] << 14 ) , 4 , 1 ) ;
break ;
case MODE_23k05 : case MODE_23k85 : for ( i = 0 ;
i < 4 ;
i ++ ) decode_6p_track ( sig_pos [ i ] , ( int ) pulse_lo [ i ] + ( ( int ) pulse_hi [ i ] << 11 ) , 4 , 1 ) ;
break ;
}
memset ( fixed_vector , 0 , sizeof ( float ) * AMRWB_SFR_SIZE ) ;
for ( i = 0 ;
i < 4 ;
i ++ ) for ( j = 0 ;
j < pulses_nb_per_mode_tr [ mode ] [ i ] ;
j ++ ) {
int pos = ( FFABS ( sig_pos [ i ] [ j ] ) - 1 ) * spacing + i ;
fixed_vector [ pos ] += sig_pos [ i ] [ j ] < 0 ? - 1.0 : 1.0 ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
uint64_t TSHttpTxnIdGet ( TSHttpTxn txnp ) {
sdk_assert ( sdk_sanity_check_txn ( txnp ) == TS_SUCCESS ) ;
HttpSM * sm = ( HttpSM * ) txnp ;
return ( uint64_t ) sm -> sm_id ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static struct matrix build_mAB_matrix ( struct lutmABType * lut ) {
struct matrix result ;
if ( lut ) {
result . m [ 0 ] [ 0 ] = s15Fixed16Number_to_float ( lut -> e00 ) ;
result . m [ 0 ] [ 1 ] = s15Fixed16Number_to_float ( lut -> e01 ) ;
result . m [ 0 ] [ 2 ] = s15Fixed16Number_to_float ( lut -> e02 ) ;
result . m [ 1 ] [ 0 ] = s15Fixed16Number_to_float ( lut -> e10 ) ;
result . m [ 1 ] [ 1 ] = s15Fixed16Number_to_float ( lut -> e11 ) ;
result . m [ 1 ] [ 2 ] = s15Fixed16Number_to_float ( lut -> e12 ) ;
result . m [ 2 ] [ 0 ] = s15Fixed16Number_to_float ( lut -> e20 ) ;
result . m [ 2 ] [ 1 ] = s15Fixed16Number_to_float ( lut -> e21 ) ;
result . m [ 2 ] [ 2 ] = s15Fixed16Number_to_float ( lut -> e22 ) ;
result . invalid = false ;
}
else {
memset ( & result , 0 , sizeof ( struct matrix ) ) ;
result . invalid = true ;
}
return result ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int matroska_parse_seekhead_entry ( MatroskaDemuxContext * matroska , int idx ) {
EbmlList * seekhead_list = & matroska -> seekhead ;
uint32_t level_up = matroska -> level_up ;
uint32_t saved_id = matroska -> current_id ;
MatroskaSeekhead * seekhead = seekhead_list -> elem ;
int64_t before_pos = avio_tell ( matroska -> ctx -> pb ) ;
MatroskaLevel level ;
int64_t offset ;
int ret = 0 ;
if ( idx >= seekhead_list -> nb_elem || seekhead [ idx ] . id == MATROSKA_ID_SEEKHEAD || seekhead [ idx ] . id == MATROSKA_ID_CLUSTER ) return 0 ;
offset = seekhead [ idx ] . pos + matroska -> segment_start ;
if ( avio_seek ( matroska -> ctx -> pb , offset , SEEK_SET ) == offset ) {
if ( matroska -> num_levels == EBML_MAX_DEPTH ) {
av_log ( matroska -> ctx , AV_LOG_INFO , "Max EBML element depth (%d) reached, " "cannot parse further.\n" , EBML_MAX_DEPTH ) ;
ret = AVERROR_INVALIDDATA ;
}
else {
level . start = 0 ;
level . length = ( uint64_t ) - 1 ;
matroska -> levels [ matroska -> num_levels ] = level ;
matroska -> num_levels ++ ;
matroska -> current_id = 0 ;
ret = ebml_parse ( matroska , matroska_segment , matroska ) ;
while ( matroska -> num_levels ) {
uint64_t length = matroska -> levels [ -- matroska -> num_levels ] . length ;
if ( length == ( uint64_t ) - 1 ) break ;
}
}
}
avio_seek ( matroska -> ctx -> pb , before_pos , SEEK_SET ) ;
matroska -> level_up = level_up ;
matroska -> current_id = saved_id ;
return ret ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static const char * proc_info_dummy ( void * a __attribute__ ( ( unused ) ) , const char * b __attribute__ ( ( unused ) ) , const char * c __attribute__ ( ( unused ) ) , const char * d __attribute__ ( ( unused ) ) , const unsigned int e __attribute__ ( ( unused ) ) ) {
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void rds_inc_info_copy ( struct rds_incoming * inc , struct rds_info_iterator * iter , __be32 saddr , __be32 daddr , int flip ) {
struct rds_info_message minfo ;
minfo . seq = be64_to_cpu ( inc -> i_hdr . h_sequence ) ;
minfo . len = be32_to_cpu ( inc -> i_hdr . h_len ) ;
if ( flip ) {
minfo . laddr = daddr ;
minfo . faddr = saddr ;
minfo . lport = inc -> i_hdr . h_dport ;
minfo . fport = inc -> i_hdr . h_sport ;
}
else {
minfo . laddr = saddr ;
minfo . faddr = daddr ;
minfo . lport = inc -> i_hdr . h_sport ;
minfo . fport = inc -> i_hdr . h_dport ;
}
rds_info_copy ( iter , & minfo , sizeof ( minfo ) ) ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
TEST_F ( ShortcutsProviderTest , DeleteMatch ) {
TestShortcutData shortcuts_to_test_delete [ ] = {
{
"BD85DBA2-8C29-49F9-84AE-48E1E90881F1" , "delete" , "www.deletetest.com/1" , "http://www.deletetest.com/1" , "http://www.deletetest.com/1" , "0,2" , "Erase this shortcut!" , "0,0" , ui : : PAGE_TRANSITION_TYPED , AutocompleteMatchType : : HISTORY_URL , "" , 1 , 1 }
, {
"BD85DBA2-8C29-49F9-84AE-48E1E90881F2" , "erase" , "www.deletetest.com/1" , "http://www.deletetest.com/1" , "http://www.deletetest.com/1" , "0,2" , "Erase this shortcut!" , "0,0" , ui : : PAGE_TRANSITION_TYPED , AutocompleteMatchType : : HISTORY_TITLE , "" , 1 , 1 }
, {
"BD85DBA2-8C29-49F9-84AE-48E1E90881F3" , "keep" , "www.deletetest.com/1/2" , "http://www.deletetest.com/1/2" , "http://www.deletetest.com/1/2" , "0,2" , "Keep this shortcut!" , "0,0" , ui : : PAGE_TRANSITION_TYPED , AutocompleteMatchType : : HISTORY_TITLE , "" , 1 , 1 }
, {
"BD85DBA2-8C29-49F9-84AE-48E1E90881F4" , "delete" , "www.deletetest.com/2" , "http://www.deletetest.com/2" , "http://www.deletetest.com/2" , "0,2" , "Erase this shortcut!" , "0,0" , ui : : PAGE_TRANSITION_TYPED , AutocompleteMatchType : : HISTORY_URL , "" , 1 , 1 }
, }
;
scoped_refptr < ShortcutsBackend > backend = client_ -> GetShortcutsBackend ( ) ;
size_t original_shortcuts_count = backend -> shortcuts_map ( ) . size ( ) ;
PopulateShortcutsBackendWithTestData ( backend , shortcuts_to_test_delete , arraysize ( shortcuts_to_test_delete ) ) ;
EXPECT_EQ ( original_shortcuts_count + 4 , backend -> shortcuts_map ( ) . size ( ) ) ;
EXPECT_FALSE ( backend -> shortcuts_map ( ) . end ( ) == backend -> shortcuts_map ( ) . find ( ASCIIToUTF16 ( "delete" ) ) ) ;
EXPECT_FALSE ( backend -> shortcuts_map ( ) . end ( ) == backend -> shortcuts_map ( ) . find ( ASCIIToUTF16 ( "erase" ) ) ) ;
AutocompleteMatch match ( provider_ . get ( ) , 1200 , true , AutocompleteMatchType : : HISTORY_TITLE ) ;
match . destination_url = GURL ( shortcuts_to_test_delete [ 0 ] . destination_url ) ;
match . contents = ASCIIToUTF16 ( shortcuts_to_test_delete [ 0 ] . contents ) ;
match . description = ASCIIToUTF16 ( shortcuts_to_test_delete [ 0 ] . description ) ;
provider_ -> DeleteMatch ( match ) ;
EXPECT_EQ ( original_shortcuts_count + 2 , backend -> shortcuts_map ( ) . size ( ) ) ;
EXPECT_FALSE ( backend -> shortcuts_map ( ) . end ( ) == backend -> shortcuts_map ( ) . find ( ASCIIToUTF16 ( "delete" ) ) ) ;
EXPECT_TRUE ( backend -> shortcuts_map ( ) . end ( ) == backend -> shortcuts_map ( ) . find ( ASCIIToUTF16 ( "erase" ) ) ) ;
match . destination_url = GURL ( shortcuts_to_test_delete [ 3 ] . destination_url ) ;
match . contents = ASCIIToUTF16 ( shortcuts_to_test_delete [ 3 ] . contents ) ;
match . description = ASCIIToUTF16 ( shortcuts_to_test_delete [ 3 ] . description ) ;
provider_ -> DeleteMatch ( match ) ;
EXPECT_EQ ( original_shortcuts_count + 1 , backend -> shortcuts_map ( ) . size ( ) ) ;
EXPECT_TRUE ( backend -> shortcuts_map ( ) . end ( ) == backend -> shortcuts_map ( ) . find ( ASCIIToUTF16 ( "delete" ) ) ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void main_cpu_reset ( void * opaque ) {
MIPSCPU * cpu = opaque ;
cpu_reset ( CPU ( cpu ) ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
inline void mime_hdr_set_accelerators_and_presence_bits ( MIMEHdrImpl * mh , MIMEField * field ) {
int slot_id ;
ptrdiff_t slot_num ;
if ( field -> m_wks_idx < 0 ) {
return ;
}
mime_hdr_presence_set ( mh , field -> m_wks_idx ) ;
slot_id = hdrtoken_index_to_slotid ( field -> m_wks_idx ) ;
if ( slot_id != MIME_SLOTID_NONE ) {
if ( mh -> m_first_fblock . contains ( field ) ) {
slot_num = ( field - & ( mh -> m_first_fblock . m_field_slots [ 0 ] ) ) ;
if ( slot_num >= MIME_FIELD_SLOTNUM_UNKNOWN ) {
slot_num = MIME_FIELD_SLOTNUM_UNKNOWN ;
}
}
else {
slot_num = MIME_FIELD_SLOTNUM_UNKNOWN ;
}
mime_hdr_set_accelerator_slotnum ( mh , slot_id , slot_num ) ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int sb_has_motion ( const VP9_COMMON * cm , MODE_INFO * * prev_mi_8x8 , const int motion_thresh ) {
const int mis = cm -> mi_stride ;
int block_row , block_col ;
if ( cm -> prev_mi ) {
for ( block_row = 0 ;
block_row < 8 ;
++ block_row ) {
for ( block_col = 0 ;
block_col < 8 ;
++ block_col ) {
const MODE_INFO * prev_mi = prev_mi_8x8 [ block_row * mis + block_col ] ;
if ( prev_mi ) {
if ( abs ( prev_mi -> mbmi . mv [ 0 ] . as_mv . row ) > motion_thresh || abs ( prev_mi -> mbmi . mv [ 0 ] . as_mv . col ) > motion_thresh ) return 1 ;
}
}
}
}
return 0 ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void tcg_signal_cpu_creation ( CPUState * cpu , void * data ) {
cpu -> thread_id = qemu_get_thread_id ( ) ;
cpu -> created = true ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
ASSERT_TRUE ( WaitFor ( downloads : : OnDeterminingFilename : : kEventName , base : : StringPrintf ( R "([{
" id ": %d, " filename ": " slow . txt "}
])" , result_id ) ) )
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
IN_PROC_BROWSER_TEST_F ( SitePerProcessInteractiveBrowserTest , SequentialFocusNavigation ) {
GURL main_url ( embedded_test_server ( ) -> GetURL ( "a.com" , "/cross_site_iframe_factory.html?a(b,c)" ) ) ;
ui_test_utils : : NavigateToURL ( browser ( ) , main_url ) ;
content : : WebContents * web_contents = browser ( ) -> tab_strip_model ( ) -> GetActiveWebContents ( ) ;
content : : RenderFrameHost * main_frame = web_contents -> GetMainFrame ( ) ;
content : : RenderFrameHost * child1 = ChildFrameAt ( main_frame , 0 ) ;
ASSERT_NE ( nullptr , child1 ) ;
content : : RenderFrameHost * child2 = ChildFrameAt ( main_frame , 1 ) ;
ASSERT_NE ( nullptr , child2 ) ;
EXPECT_TRUE ( ExecuteScript ( main_frame , "window.name = 'root';
" ) ) ;
EXPECT_TRUE ( ExecuteScript ( child1 , "window.name = 'child1';
" ) ) ;
EXPECT_TRUE ( ExecuteScript ( child2 , "window.name = 'child2';
" ) ) ;
std : : string script = "function onFocus(e) {
" " domAutomationController.setAutomationId(0);
" " domAutomationController.send(window.name + '-focused-' + e.target.id);
" "}
" "var input1 = document.createElement('input');
" "input1.id = 'input1';
" "var input2 = document.createElement('input');
" "input2.id = 'input2';
" "document.body.insertBefore(input1, document.body.firstChild);
" "document.body.appendChild(input2);
" "input1.addEventListener('focus', onFocus, false);
" "input2.addEventListener('focus', onFocus, false);
" ;
EXPECT_TRUE ( ExecuteScript ( main_frame , script ) ) ;
EXPECT_TRUE ( ExecuteScript ( child1 , script ) ) ;
EXPECT_TRUE ( ExecuteScript ( child2 , script ) ) ;
auto press_tab_and_wait_for_message = [ web_contents ] ( bool reverse ) {
content : : DOMMessageQueue msg_queue ;
std : : string reply ;
SimulateKeyPress ( web_contents , ui : : DomKey : : TAB , ui : : DomCode : : TAB , ui : : VKEY_TAB , false , reverse , false , false ) ;
EXPECT_TRUE ( msg_queue . WaitForMessage ( & reply ) ) ;
return reply ;
}
;
EXPECT_EQ ( "\"root-focused-input1\"" , press_tab_and_wait_for_message ( false ) ) ;
EXPECT_EQ ( main_frame , web_contents -> GetFocusedFrame ( ) ) ;
EXPECT_EQ ( "\"child1-focused-input1\"" , press_tab_and_wait_for_message ( false ) ) ;
EXPECT_EQ ( child1 , web_contents -> GetFocusedFrame ( ) ) ;
EXPECT_EQ ( "\"child1-focused-input2\"" , press_tab_and_wait_for_message ( false ) ) ;
EXPECT_EQ ( "\"child2-focused-input1\"" , press_tab_and_wait_for_message ( false ) ) ;
EXPECT_EQ ( child2 , web_contents -> GetFocusedFrame ( ) ) ;
EXPECT_EQ ( "\"child2-focused-input2\"" , press_tab_and_wait_for_message ( false ) ) ;
EXPECT_EQ ( "\"root-focused-input2\"" , press_tab_and_wait_for_message ( false ) ) ;
EXPECT_EQ ( main_frame , web_contents -> GetFocusedFrame ( ) ) ;
EXPECT_EQ ( "\"child2-focused-input2\"" , press_tab_and_wait_for_message ( true ) ) ;
EXPECT_EQ ( child2 , web_contents -> GetFocusedFrame ( ) ) ;
EXPECT_EQ ( "\"child2-focused-input1\"" , press_tab_and_wait_for_message ( true ) ) ;
EXPECT_EQ ( "\"child1-focused-input2\"" , press_tab_and_wait_for_message ( true ) ) ;
EXPECT_EQ ( child1 , web_contents -> GetFocusedFrame ( ) ) ;
EXPECT_EQ ( "\"child1-focused-input1\"" , press_tab_and_wait_for_message ( true ) ) ;
EXPECT_EQ ( "\"root-focused-input1\"" , press_tab_and_wait_for_message ( true ) ) ;
EXPECT_EQ ( main_frame , web_contents -> GetFocusedFrame ( ) ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static uint16_t * appendEncodedByte ( uint16_t * buffer , uint16_t * buffLimit , uint8_t value , uint8_t state [ ] , UErrorCode * status ) {
if ( ! status || U_FAILURE ( * status ) ) {
return NULL ;
}
if ( state [ 0 ] != 0 ) {
uint16_t c = ( uint16_t ) ( ( state [ 1 ] << 8 ) | ( ( ( int32_t ) value ) & 0xFF ) ) ;
if ( buffer < buffLimit ) {
* buffer ++ = c ;
}
else {
* status = U_BUFFER_OVERFLOW_ERROR ;
}
state [ 0 ] = 0 ;
return buffer ;
}
else {
state [ 0 ] = 1 ;
state [ 1 ] = value ;
return buffer ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void matroska_parse_cues ( MatroskaDemuxContext * matroska ) {
EbmlList * seekhead_list = & matroska -> seekhead ;
MatroskaSeekhead * seekhead = seekhead_list -> elem ;
EbmlList * index_list ;
MatroskaIndex * index ;
int index_scale = 1 ;
int i , j ;
for ( i = 0 ;
i < seekhead_list -> nb_elem ;
i ++ ) if ( seekhead [ i ] . id == MATROSKA_ID_CUES ) break ;
assert ( i <= seekhead_list -> nb_elem ) ;
matroska_parse_seekhead_entry ( matroska , i ) ;
index_list = & matroska -> index ;
index = index_list -> elem ;
if ( index_list -> nb_elem && index [ 0 ] . time > 1E14 / matroska -> time_scale ) {
av_log ( matroska -> ctx , AV_LOG_WARNING , "Working around broken index.\n" ) ;
index_scale = matroska -> time_scale ;
}
for ( i = 0 ;
i < index_list -> nb_elem ;
i ++ ) {
EbmlList * pos_list = & index [ i ] . pos ;
MatroskaIndexPos * pos = pos_list -> elem ;
for ( j = 0 ;
j < pos_list -> nb_elem ;
j ++ ) {
MatroskaTrack * track = matroska_find_track_by_num ( matroska , pos [ j ] . track ) ;
if ( track && track -> stream ) av_add_index_entry ( track -> stream , pos [ j ] . pos + matroska -> segment_start , index [ i ] . time / index_scale , 0 , 0 , AVINDEX_KEYFRAME ) ;
}
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void xhci_attach ( USBPort * usbport ) {
XHCIState * xhci = usbport -> opaque ;
XHCIPort * port = xhci_lookup_port ( xhci , usbport ) ;
xhci_port_update ( port , 0 ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
uint32_t mime_parse_uint ( const char * buf , const char * end ) {
uint32_t num ;
if ( ! buf || ( buf == end ) ) {
return 0 ;
}
if ( is_digit ( * buf ) ) {
num = * buf ++ - '0' ;
while ( ( buf != end ) && is_digit ( * buf ) ) {
num = ( num * 10 ) + ( * buf ++ - '0' ) ;
}
return num ;
}
else {
num = 0 ;
while ( ( buf != end ) && ParseRules : : is_space ( * buf ) ) {
buf += 1 ;
}
while ( ( buf != end ) && is_digit ( * buf ) ) {
num = ( num * 10 ) + ( * buf ++ - '0' ) ;
}
return num ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void do_diff_files ( struct st_command * command ) {
int error = 0 ;
static DYNAMIC_STRING ds_filename ;
static DYNAMIC_STRING ds_filename2 ;
const struct command_arg diff_file_args [ ] = {
{
"file1" , ARG_STRING , TRUE , & ds_filename , "First file to diff" }
, {
"file2" , ARG_STRING , TRUE , & ds_filename2 , "Second file to diff" }
}
;
DBUG_ENTER ( "do_diff_files" ) ;
check_command_args ( command , command -> first_argument , diff_file_args , sizeof ( diff_file_args ) / sizeof ( struct command_arg ) , ' ' ) ;
if ( access ( ds_filename . str , F_OK ) != 0 ) die ( "command \"diff_files\" failed, file '%s' does not exist" , ds_filename . str ) ;
if ( access ( ds_filename2 . str , F_OK ) != 0 ) die ( "command \"diff_files\" failed, file '%s' does not exist" , ds_filename2 . str ) ;
if ( ( error = compare_files ( ds_filename . str , ds_filename2 . str ) ) && match_expected_error ( command , error , NULL ) < 0 ) {
show_diff ( & ds_res , ds_filename . str , ds_filename2 . str ) ;
log_file . write ( & ds_res ) ;
log_file . flush ( ) ;
dynstr_set ( & ds_res , 0 ) ;
}
dynstr_free ( & ds_filename ) ;
dynstr_free ( & ds_filename2 ) ;
handle_command_error ( command , error , - 1 ) ;
DBUG_VOID_RETURN ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static PGconn * _connectDB ( ArchiveHandle * AH , const char * reqdb , const char * requser ) {
PQExpBufferData connstr ;
PGconn * newConn ;
const char * newdb ;
const char * newuser ;
char * password ;
bool new_pass ;
if ( ! reqdb ) newdb = PQdb ( AH -> connection ) ;
else newdb = reqdb ;
if ( ! requser || strlen ( requser ) == 0 ) newuser = PQuser ( AH -> connection ) ;
else newuser = requser ;
ahlog ( AH , 1 , "connecting to database \"%s\" as user \"%s\"\n" , newdb , newuser ) ;
password = AH -> savedPassword ? pg_strdup ( AH -> savedPassword ) : NULL ;
if ( AH -> promptPassword == TRI_YES && password == NULL ) {
password = simple_prompt ( "Password: " , 100 , false ) ;
if ( password == NULL ) exit_horribly ( modulename , "out of memory\n" ) ;
}
initPQExpBuffer ( & connstr ) ;
appendPQExpBuffer ( & connstr , "dbname=" ) ;
appendConnStrVal ( & connstr , newdb ) ;
do {
const char * keywords [ 7 ] ;
const char * values [ 7 ] ;
keywords [ 0 ] = "host" ;
values [ 0 ] = PQhost ( AH -> connection ) ;
keywords [ 1 ] = "port" ;
values [ 1 ] = PQport ( AH -> connection ) ;
keywords [ 2 ] = "user" ;
values [ 2 ] = newuser ;
keywords [ 3 ] = "password" ;
values [ 3 ] = password ;
keywords [ 4 ] = "dbname" ;
values [ 4 ] = connstr . data ;
keywords [ 5 ] = "fallback_application_name" ;
values [ 5 ] = progname ;
keywords [ 6 ] = NULL ;
values [ 6 ] = NULL ;
new_pass = false ;
newConn = PQconnectdbParams ( keywords , values , true ) ;
if ( ! newConn ) exit_horribly ( modulename , "failed to reconnect to database\n" ) ;
if ( PQstatus ( newConn ) == CONNECTION_BAD ) {
if ( ! PQconnectionNeedsPassword ( newConn ) ) exit_horribly ( modulename , "could not reconnect to database: %s" , PQerrorMessage ( newConn ) ) ;
PQfinish ( newConn ) ;
if ( password ) fprintf ( stderr , "Password incorrect\n" ) ;
fprintf ( stderr , "Connecting to %s as %s\n" , newdb , newuser ) ;
if ( password ) free ( password ) ;
if ( AH -> promptPassword != TRI_NO ) password = simple_prompt ( "Password: " , 100 , false ) ;
else exit_horribly ( modulename , "connection needs password\n" ) ;
if ( password == NULL ) exit_horribly ( modulename , "out of memory\n" ) ;
new_pass = true ;
}
}
while ( new_pass ) ;
if ( PQconnectionUsedPassword ( newConn ) ) {
if ( AH -> savedPassword ) free ( AH -> savedPassword ) ;
AH -> savedPassword = pg_strdup ( PQpass ( newConn ) ) ;
}
if ( password ) free ( password ) ;
termPQExpBuffer ( & connstr ) ;
_check_database_version ( AH ) ;
PQsetNoticeProcessor ( newConn , notice_processor , NULL ) ;
return newConn ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void init_bit_trees ( ) {
init_bit_tree ( cat1 , 1 ) ;
init_bit_tree ( cat2 , 2 ) ;
init_bit_tree ( cat3 , 3 ) ;
init_bit_tree ( cat4 , 4 ) ;
init_bit_tree ( cat5 , 5 ) ;
init_bit_tree ( cat6 , 14 ) ;
# if CONFIG_VP9_HIGHBITDEPTH init_bit_tree ( cat1_high10 , 1 ) ;
init_bit_tree ( cat2_high10 , 2 ) ;
init_bit_tree ( cat3_high10 , 3 ) ;
init_bit_tree ( cat4_high10 , 4 ) ;
init_bit_tree ( cat5_high10 , 5 ) ;
init_bit_tree ( cat6_high10 , 16 ) ;
init_bit_tree ( cat1_high12 , 1 ) ;
init_bit_tree ( cat2_high12 , 2 ) ;
init_bit_tree ( cat3_high12 , 3 ) ;
init_bit_tree ( cat4_high12 , 4 ) ;
init_bit_tree ( cat5_high12 , 5 ) ;
init_bit_tree ( cat6_high12 , 18 ) ;
# endif }
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
PHP_MINIT_FUNCTION ( spl_dllist ) {
REGISTER_SPL_STD_CLASS_EX ( SplDoublyLinkedList , spl_dllist_object_new , spl_funcs_SplDoublyLinkedList ) ;
memcpy ( & spl_handler_SplDoublyLinkedList , zend_get_std_object_handlers ( ) , sizeof ( zend_object_handlers ) ) ;
spl_handler_SplDoublyLinkedList . clone_obj = spl_dllist_object_clone ;
spl_handler_SplDoublyLinkedList . count_elements = spl_dllist_object_count_elements ;
spl_handler_SplDoublyLinkedList . get_debug_info = spl_dllist_object_get_debug_info ;
REGISTER_SPL_CLASS_CONST_LONG ( SplDoublyLinkedList , "IT_MODE_LIFO" , SPL_DLLIST_IT_LIFO ) ;
REGISTER_SPL_CLASS_CONST_LONG ( SplDoublyLinkedList , "IT_MODE_FIFO" , 0 ) ;
REGISTER_SPL_CLASS_CONST_LONG ( SplDoublyLinkedList , "IT_MODE_DELETE" , SPL_DLLIST_IT_DELETE ) ;
REGISTER_SPL_CLASS_CONST_LONG ( SplDoublyLinkedList , "IT_MODE_KEEP" , 0 ) ;
REGISTER_SPL_IMPLEMENTS ( SplDoublyLinkedList , Iterator ) ;
REGISTER_SPL_IMPLEMENTS ( SplDoublyLinkedList , Countable ) ;
REGISTER_SPL_IMPLEMENTS ( SplDoublyLinkedList , ArrayAccess ) ;
REGISTER_SPL_IMPLEMENTS ( SplDoublyLinkedList , Serializable ) ;
spl_ce_SplDoublyLinkedList -> get_iterator = spl_dllist_get_iterator ;
REGISTER_SPL_SUB_CLASS_EX ( SplQueue , SplDoublyLinkedList , spl_dllist_object_new , spl_funcs_SplQueue ) ;
REGISTER_SPL_SUB_CLASS_EX ( SplStack , SplDoublyLinkedList , spl_dllist_object_new , NULL ) ;
spl_ce_SplQueue -> get_iterator = spl_dllist_get_iterator ;
spl_ce_SplStack -> get_iterator = spl_dllist_get_iterator ;
return SUCCESS ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void vp3_decode_flush ( AVCodecContext * avctx ) {
Vp3DecodeContext * s = avctx -> priv_data ;
if ( s -> golden_frame . f ) ff_thread_release_buffer ( avctx , & s -> golden_frame ) ;
if ( s -> last_frame . f ) ff_thread_release_buffer ( avctx , & s -> last_frame ) ;
if ( s -> current_frame . f ) ff_thread_release_buffer ( avctx , & s -> current_frame ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static struct vp9_read_bit_buffer * init_read_bit_buffer ( VP9Decoder * pbi , struct vp9_read_bit_buffer * rb , const uint8_t * data , const uint8_t * data_end , uint8_t * clear_data ) {
rb -> bit_offset = 0 ;
rb -> error_handler = error_handler ;
rb -> error_handler_data = & pbi -> common ;
if ( pbi -> decrypt_cb ) {
const int n = ( int ) MIN ( MAX_VP9_HEADER_SIZE , data_end - data ) ;
pbi -> decrypt_cb ( pbi -> decrypt_state , data , clear_data , n ) ;
rb -> bit_buffer = clear_data ;
rb -> bit_buffer_end = clear_data + n ;
}
else {
rb -> bit_buffer = data ;
rb -> bit_buffer_end = data_end ;
}
return rb ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static splay_app_result_t free_all_allocator ( clump_t * cp , void * arg ) {
struct free_data * fd = ( struct free_data * ) arg ;
if ( cp -> cbase + sizeof ( obj_header_t ) != ( byte * ) fd -> imem ) return SPLAY_APP_CONTINUE ;
fd -> allocator = cp ;
alloc_free_clump ( cp , fd -> imem ) ;
return SPLAY_APP_STOP ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void ef_globals_free ( void ) {
SAFE_FREE ( ef_gbls -> source_file ) ;
SAFE_FREE ( ef_gbls -> output_file ) ;
SAFE_FREE ( ef_gbls ) ;
return ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int ff_get_qtpalette ( int codec_id , AVIOContext * pb , uint32_t * palette ) {
int tmp , bit_depth , color_table_id , greyscale , i ;
avio_seek ( pb , 82 , SEEK_CUR ) ;
tmp = avio_rb16 ( pb ) ;
bit_depth = tmp & 0x1F ;
greyscale = tmp & 0x20 ;
color_table_id = avio_rb16 ( pb ) ;
if ( greyscale && codec_id == AV_CODEC_ID_CINEPAK ) return 0 ;
if ( ( bit_depth == 1 || bit_depth == 2 || bit_depth == 4 || bit_depth == 8 ) ) {
uint32_t color_count , color_start , color_end ;
uint32_t a , r , g , b ;
if ( greyscale && bit_depth > 1 && color_table_id ) {
int color_index , color_dec ;
color_count = 1 << bit_depth ;
color_index = 255 ;
color_dec = 256 / ( color_count - 1 ) ;
for ( i = 0 ;
i < color_count ;
i ++ ) {
r = g = b = color_index ;
palette [ i ] = ( 0xFFU << 24 ) | ( r << 16 ) | ( g << 8 ) | ( b ) ;
color_index -= color_dec ;
if ( color_index < 0 ) color_index = 0 ;
}
}
else if ( color_table_id ) {
const uint8_t * color_table ;
color_count = 1 << bit_depth ;
if ( bit_depth == 1 ) color_table = ff_qt_default_palette_2 ;
else if ( bit_depth == 2 ) color_table = ff_qt_default_palette_4 ;
else if ( bit_depth == 4 ) color_table = ff_qt_default_palette_16 ;
else color_table = ff_qt_default_palette_256 ;
for ( i = 0 ;
i < color_count ;
i ++ ) {
r = color_table [ i * 3 + 0 ] ;
g = color_table [ i * 3 + 1 ] ;
b = color_table [ i * 3 + 2 ] ;
palette [ i ] = ( 0xFFU << 24 ) | ( r << 16 ) | ( g << 8 ) | ( b ) ;
}
}
else {
color_start = avio_rb32 ( pb ) ;
avio_rb16 ( pb ) ;
color_end = avio_rb16 ( pb ) ;
if ( ( color_start <= 255 ) && ( color_end <= 255 ) ) {
for ( i = color_start ;
i <= color_end ;
i ++ ) {
a = avio_r8 ( pb ) ;
avio_r8 ( pb ) ;
r = avio_r8 ( pb ) ;
avio_r8 ( pb ) ;
g = avio_r8 ( pb ) ;
avio_r8 ( pb ) ;
b = avio_r8 ( pb ) ;
avio_r8 ( pb ) ;
palette [ i ] = ( a << 24 ) | ( r << 16 ) | ( g << 8 ) | ( b ) ;
}
}
}
return 1 ;
}
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void evhttp_write ( int fd , short what , void * arg ) {
struct evhttp_connection * evcon = arg ;
int n ;
if ( what == EV_TIMEOUT ) {
evhttp_connection_fail ( evcon , EVCON_HTTP_TIMEOUT ) ;
return ;
}
n = evbuffer_write ( evcon -> output_buffer , fd ) ;
if ( n == - 1 ) {
event_debug ( ( "%s: evbuffer_write" , __func__ ) ) ;
evhttp_connection_fail ( evcon , EVCON_HTTP_EOF ) ;
return ;
}
if ( n == 0 ) {
event_debug ( ( "%s: write nothing" , __func__ ) ) ;
evhttp_connection_fail ( evcon , EVCON_HTTP_EOF ) ;
return ;
}
if ( EVBUFFER_LENGTH ( evcon -> output_buffer ) != 0 ) {
evhttp_add_event ( & evcon -> ev , evcon -> timeout , HTTP_WRITE_TIMEOUT ) ;
return ;
}
if ( evcon -> cb != NULL ) ( * evcon -> cb ) ( evcon , evcon -> cb_arg ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void ReadToc ( ArchiveHandle * AH ) {
int i ;
char * tmp ;
DumpId * deps ;
int depIdx ;
int depSize ;
TocEntry * te ;
AH -> tocCount = ReadInt ( AH ) ;
AH -> maxDumpId = 0 ;
for ( i = 0 ;
i < AH -> tocCount ;
i ++ ) {
te = ( TocEntry * ) pg_malloc0 ( sizeof ( TocEntry ) ) ;
te -> dumpId = ReadInt ( AH ) ;
if ( te -> dumpId > AH -> maxDumpId ) AH -> maxDumpId = te -> dumpId ;
if ( te -> dumpId <= 0 ) exit_horribly ( modulename , "entry ID %d out of range -- perhaps a corrupt TOC\n" , te -> dumpId ) ;
te -> hadDumper = ReadInt ( AH ) ;
if ( AH -> version >= K_VERS_1_8 ) {
tmp = ReadStr ( AH ) ;
sscanf ( tmp , "%u" , & te -> catalogId . tableoid ) ;
free ( tmp ) ;
}
else te -> catalogId . tableoid = InvalidOid ;
tmp = ReadStr ( AH ) ;
sscanf ( tmp , "%u" , & te -> catalogId . oid ) ;
free ( tmp ) ;
te -> tag = ReadStr ( AH ) ;
te -> desc = ReadStr ( AH ) ;
if ( AH -> version >= K_VERS_1_11 ) {
te -> section = ReadInt ( AH ) ;
}
else {
if ( strcmp ( te -> desc , "COMMENT" ) == 0 || strcmp ( te -> desc , "ACL" ) == 0 || strcmp ( te -> desc , "ACL LANGUAGE" ) == 0 ) te -> section = SECTION_NONE ;
else if ( strcmp ( te -> desc , "TABLE DATA" ) == 0 || strcmp ( te -> desc , "BLOBS" ) == 0 || strcmp ( te -> desc , "BLOB COMMENTS" ) == 0 ) te -> section = SECTION_DATA ;
else if ( strcmp ( te -> desc , "CONSTRAINT" ) == 0 || strcmp ( te -> desc , "CHECK CONSTRAINT" ) == 0 || strcmp ( te -> desc , "FK CONSTRAINT" ) == 0 || strcmp ( te -> desc , "INDEX" ) == 0 || strcmp ( te -> desc , "RULE" ) == 0 || strcmp ( te -> desc , "TRIGGER" ) == 0 ) te -> section = SECTION_POST_DATA ;
else te -> section = SECTION_PRE_DATA ;
}
te -> defn = ReadStr ( AH ) ;
te -> dropStmt = ReadStr ( AH ) ;
if ( AH -> version >= K_VERS_1_3 ) te -> copyStmt = ReadStr ( AH ) ;
if ( AH -> version >= K_VERS_1_6 ) te -> namespace = ReadStr ( AH ) ;
if ( AH -> version >= K_VERS_1_10 ) te -> tablespace = ReadStr ( AH ) ;
te -> owner = ReadStr ( AH ) ;
if ( AH -> version >= K_VERS_1_9 ) {
if ( strcmp ( ReadStr ( AH ) , "true" ) == 0 ) te -> withOids = true ;
else te -> withOids = false ;
}
else te -> withOids = true ;
if ( AH -> version >= K_VERS_1_5 ) {
depSize = 100 ;
deps = ( DumpId * ) pg_malloc ( sizeof ( DumpId ) * depSize ) ;
depIdx = 0 ;
for ( ;
;
) {
tmp = ReadStr ( AH ) ;
if ( ! tmp ) break ;
if ( depIdx >= depSize ) {
depSize *= 2 ;
deps = ( DumpId * ) pg_realloc ( deps , sizeof ( DumpId ) * depSize ) ;
}
sscanf ( tmp , "%d" , & deps [ depIdx ] ) ;
free ( tmp ) ;
depIdx ++ ;
}
if ( depIdx > 0 ) {
deps = ( DumpId * ) pg_realloc ( deps , sizeof ( DumpId ) * depIdx ) ;
te -> dependencies = deps ;
te -> nDeps = depIdx ;
}
else {
free ( deps ) ;
te -> dependencies = NULL ;
te -> nDeps = 0 ;
}
}
else {
te -> dependencies = NULL ;
te -> nDeps = 0 ;
}
if ( AH -> ReadExtraTocPtr ) ( * AH -> ReadExtraTocPtr ) ( AH , te ) ;
ahlog ( AH , 3 , "read TOC entry %d (ID %d) for %s %s\n" , i , te -> dumpId , te -> desc , te -> tag ) ;
te -> prev = AH -> toc -> prev ;
AH -> toc -> prev -> next = te ;
AH -> toc -> prev = te ;
te -> next = AH -> toc ;
if ( strcmp ( te -> desc , "ENCODING" ) == 0 ) processEncodingEntry ( AH , te ) ;
else if ( strcmp ( te -> desc , "STDSTRINGS" ) == 0 ) processStdStringsEntry ( AH , te ) ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static guint16 de_lsa_id ( tvbuff_t * tvb , proto_tree * tree , packet_info * pinfo _U_ , guint32 offset , guint len , gchar * add_string _U_ , int string_len _U_ ) {
guint32 curr_offset ;
curr_offset = offset ;
if ( len == 0 ) {
proto_tree_add_uint_format_value ( tree , hf_gsm_a_dtap_lsa_id , tvb , curr_offset , len , 0 , "not included" ) ;
}
else {
proto_tree_add_item ( tree , hf_gsm_a_dtap_lsa_id , tvb , curr_offset , 3 , ENC_BIG_ENDIAN ) ;
}
curr_offset += len ;
EXTRANEOUS_DATA_CHECK ( len , curr_offset - offset , pinfo , & ei_gsm_a_dtap_extraneous_data ) ;
return ( curr_offset - offset ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
rfbBool rfbSendSetColourMapEntries ( rfbClientPtr cl , int firstColour , int nColours ) {
char buf [ sz_rfbSetColourMapEntriesMsg + 256 * 3 * 2 ] ;
char * wbuf = buf ;
rfbSetColourMapEntriesMsg * scme ;
uint16_t * rgb ;
rfbColourMap * cm = & cl -> screen -> colourMap ;
int i , len ;
if ( nColours > 256 ) {
wbuf = ( char * ) malloc ( sz_rfbSetColourMapEntriesMsg + nColours * 3 * 2 ) ;
}
scme = ( rfbSetColourMapEntriesMsg * ) wbuf ;
rgb = ( uint16_t * ) ( & wbuf [ sz_rfbSetColourMapEntriesMsg ] ) ;
scme -> type = rfbSetColourMapEntries ;
scme -> firstColour = Swap16IfLE ( firstColour ) ;
scme -> nColours = Swap16IfLE ( nColours ) ;
len = sz_rfbSetColourMapEntriesMsg ;
for ( i = 0 ;
i < nColours ;
i ++ ) {
if ( i < ( int ) cm -> count ) {
if ( cm -> is16 ) {
rgb [ i * 3 ] = Swap16IfLE ( cm -> data . shorts [ i * 3 ] ) ;
rgb [ i * 3 + 1 ] = Swap16IfLE ( cm -> data . shorts [ i * 3 + 1 ] ) ;
rgb [ i * 3 + 2 ] = Swap16IfLE ( cm -> data . shorts [ i * 3 + 2 ] ) ;
}
else {
rgb [ i * 3 ] = Swap16IfLE ( ( unsigned short ) cm -> data . bytes [ i * 3 ] ) ;
rgb [ i * 3 + 1 ] = Swap16IfLE ( ( unsigned short ) cm -> data . bytes [ i * 3 + 1 ] ) ;
rgb [ i * 3 + 2 ] = Swap16IfLE ( ( unsigned short ) cm -> data . bytes [ i * 3 + 2 ] ) ;
}
}
}
len += nColours * 3 * 2 ;
LOCK ( cl -> sendMutex ) ;
if ( rfbWriteExact ( cl , wbuf , len ) < 0 ) {
rfbLogPerror ( "rfbSendSetColourMapEntries: write" ) ;
rfbCloseClient ( cl ) ;
if ( wbuf != buf ) free ( wbuf ) ;
UNLOCK ( cl -> sendMutex ) ;
return FALSE ;
}
UNLOCK ( cl -> sendMutex ) ;
rfbStatRecordMessageSent ( cl , rfbSetColourMapEntries , len , len ) ;
if ( wbuf != buf ) free ( wbuf ) ;
return TRUE ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void Type_ParametricCurve_Free ( struct _cms_typehandler_struct * self , void * Ptr ) {
cmsToneCurve * gamma = ( cmsToneCurve * ) Ptr ;
cmsFreeToneCurve ( gamma ) ;
return ;
cmsUNUSED_PARAMETER ( self ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void vp9_idct8x8_1_add_c ( const int16_t * input , uint8_t * dest , int stride ) {
int i , j ;
int a1 ;
int16_t out = dct_const_round_shift ( input [ 0 ] * cospi_16_64 ) ;
out = dct_const_round_shift ( out * cospi_16_64 ) ;
a1 = ROUND_POWER_OF_TWO ( out , 5 ) ;
for ( j = 0 ;
j < 8 ;
++ j ) {
for ( i = 0 ;
i < 8 ;
++ i ) dest [ i ] = clip_pixel ( dest [ i ] + a1 ) ;
dest += stride ;
}
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static size_t mbsnbytes ( const void * _p , size_t n ) {
size_t s ;
const char * p , * pp ;
if ( _p == NULL ) return ( 0 ) ;
p = ( const char * ) _p ;
s = 0 ;
pp = p ;
while ( s < n && * pp ) {
pp ++ ;
s ++ ;
}
return ( s ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
time_t mime_parse_date ( const char * buf , const char * end ) {
static const int DAYS_OFFSET = 25508 ;
static const int days [ 12 ] = {
305 , 336 , - 1 , 30 , 60 , 91 , 121 , 152 , 183 , 213 , 244 , 274 }
;
struct tm tp ;
time_t t ;
int year ;
int month ;
int mday ;
if ( ! buf ) {
return ( time_t ) 0 ;
}
while ( ( buf != end ) && is_ws ( * buf ) ) {
buf += 1 ;
}
if ( ( buf != end ) && is_digit ( * buf ) ) {
if ( ! mime_parse_mday ( buf , end , & tp . tm_mday ) ) {
return ( time_t ) 0 ;
}
if ( ! mime_parse_month ( buf , end , & tp . tm_mon ) ) {
return ( time_t ) 0 ;
}
if ( ! mime_parse_year ( buf , end , & tp . tm_year ) ) {
return ( time_t ) 0 ;
}
if ( ! mime_parse_time ( buf , end , & tp . tm_hour , & tp . tm_min , & tp . tm_sec ) ) {
return ( time_t ) 0 ;
}
}
else if ( end && ( end - buf >= 29 ) && ( buf [ 3 ] == ',' ) ) {
if ( ! mime_parse_rfc822_date_fastcase ( buf , end - buf , & tp ) ) {
return ( time_t ) 0 ;
}
}
else {
if ( ! mime_parse_day ( buf , end , & tp . tm_wday ) ) {
return ( time_t ) 0 ;
}
while ( ( buf != end ) && is_ws ( * buf ) ) {
buf += 1 ;
}
if ( ( buf != end ) && ( ( * buf == ',' ) || is_digit ( * buf ) ) ) {
if ( ! mime_parse_mday ( buf , end , & tp . tm_mday ) ) {
return ( time_t ) 0 ;
}
if ( ! mime_parse_month ( buf , end , & tp . tm_mon ) ) {
return ( time_t ) 0 ;
}
if ( ! mime_parse_year ( buf , end , & tp . tm_year ) ) {
return ( time_t ) 0 ;
}
if ( ! mime_parse_time ( buf , end , & tp . tm_hour , & tp . tm_min , & tp . tm_sec ) ) {
return ( time_t ) 0 ;
}
}
else {
if ( ! mime_parse_month ( buf , end , & tp . tm_mon ) ) {
return ( time_t ) 0 ;
}
if ( ! mime_parse_mday ( buf , end , & tp . tm_mday ) ) {
return ( time_t ) 0 ;
}
if ( ! mime_parse_time ( buf , end , & tp . tm_hour , & tp . tm_min , & tp . tm_sec ) ) {
return ( time_t ) 0 ;
}
if ( ! mime_parse_year ( buf , end , & tp . tm_year ) ) {
return ( time_t ) 0 ;
}
}
}
year = tp . tm_year ;
month = tp . tm_mon ;
mday = tp . tm_mday ;
if ( year > 137 ) {
return ( time_t ) INT_MAX ;
}
if ( year < 70 ) {
return ( time_t ) 0 ;
}
mday += days [ month ] ;
if ( month < 2 ) {
year -= 1 ;
}
mday += ( year * 365 ) + ( year / 4 ) - ( year / 100 ) + ( year / 100 + 3 ) / 4 ;
mday -= DAYS_OFFSET ;
t = ( ( mday * 24 + tp . tm_hour ) * 60 + tp . tm_min ) * 60 + tp . tm_sec ;
return t ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void fz_clamp_color ( fz_context * ctx , const fz_colorspace * cs , const float * in , float * out ) {
cs -> clamp ( cs , in , out ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void dump_tags ( void ) {
static const char * msg = "fast-import" ;
struct tag * t ;
struct strbuf ref_name = STRBUF_INIT ;
struct strbuf err = STRBUF_INIT ;
struct ref_transaction * transaction ;
transaction = ref_transaction_begin ( & err ) ;
if ( ! transaction ) {
failure |= error ( "%s" , err . buf ) ;
goto cleanup ;
}
for ( t = first_tag ;
t ;
t = t -> next_tag ) {
strbuf_reset ( & ref_name ) ;
strbuf_addf ( & ref_name , "refs/tags/%s" , t -> name ) ;
if ( ref_transaction_update ( transaction , ref_name . buf , t -> sha1 , NULL , 0 , msg , & err ) ) {
failure |= error ( "%s" , err . buf ) ;
goto cleanup ;
}
}
if ( ref_transaction_commit ( transaction , & err ) ) failure |= error ( "%s" , err . buf ) ;
cleanup : ref_transaction_free ( transaction ) ;
strbuf_release ( & ref_name ) ;
strbuf_release ( & err ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void mainwindows_resize ( int width , int height ) {
int xdiff , ydiff ;
xdiff = width - screen_width ;
ydiff = height - screen_height ;
screen_width = width ;
screen_height = height ;
if ( ydiff > 0 ) {
MAIN_WINDOW_REC * rec ;
GSList * line , * tmp ;
line = mainwindows_get_line ( mainwindows_find_upper ( NULL ) ) ;
for ( tmp = line ;
tmp != NULL ;
tmp = tmp -> next ) {
rec = tmp -> data ;
rec -> last_line += ydiff ;
mainwindow_resize ( rec , 0 , ydiff ) ;
}
g_slist_free ( line ) ;
}
if ( xdiff > 0 ) {
MAIN_WINDOW_REC * win ;
for ( win = mainwindows_find_lower ( NULL ) ;
win != NULL ;
win = mainwindows_find_lower ( win ) ) {
mainwindows_rresize_line ( xdiff , win ) ;
}
}
if ( xdiff < 0 ) {
MAIN_WINDOW_REC * win ;
for ( win = mainwindows_find_lower ( NULL ) ;
win != NULL ;
win = mainwindows_find_lower ( win ) ) {
int max_windows , i , last_column ;
GSList * line , * tmp ;
line = mainwindows_get_line ( win ) ;
max_windows = ( screen_width + 1 ) / ( NEW_WINDOW_WIDTH + 1 ) ;
if ( max_windows < 1 ) max_windows = 1 ;
last_column = screen_width - 1 ;
for ( tmp = line , i = 0 ;
tmp != NULL ;
tmp = tmp -> next , i ++ ) {
MAIN_WINDOW_REC * rec = tmp -> data ;
if ( i >= max_windows ) mainwindow_destroy_half ( rec ) ;
else last_column = rec -> last_column ;
}
win = line -> data ;
g_slist_free ( line ) ;
mainwindows_rresize_line ( screen_width - last_column + 1 , win ) ;
}
}
if ( ydiff < 0 ) {
mainwindows_resize_smaller ( ydiff ) ;
}
signal_emit ( "terminal resized" , 0 ) ;
irssi_redraw ( ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void fill_vaapi_pic ( VAPictureH264 * va_pic , Picture * pic , int pic_structure ) {
if ( pic_structure == 0 ) pic_structure = pic -> reference ;
pic_structure &= PICT_FRAME ;
va_pic -> picture_id = ff_vaapi_get_surface_id ( pic ) ;
va_pic -> frame_idx = pic -> long_ref ? pic -> pic_id : pic -> frame_num ;
va_pic -> flags = 0 ;
if ( pic_structure != PICT_FRAME ) va_pic -> flags |= ( pic_structure & PICT_TOP_FIELD ) ? VA_PICTURE_H264_TOP_FIELD : VA_PICTURE_H264_BOTTOM_FIELD ;
if ( pic -> reference ) va_pic -> flags |= pic -> long_ref ? VA_PICTURE_H264_LONG_TERM_REFERENCE : VA_PICTURE_H264_SHORT_TERM_REFERENCE ;
va_pic -> TopFieldOrderCnt = 0 ;
if ( pic -> field_poc [ 0 ] != INT_MAX ) va_pic -> TopFieldOrderCnt = pic -> field_poc [ 0 ] ;
va_pic -> BottomFieldOrderCnt = 0 ;
if ( pic -> field_poc [ 1 ] != INT_MAX ) va_pic -> BottomFieldOrderCnt = pic -> field_poc [ 1 ] ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int phar_tar_flush ( phar_archive_data * phar , char * user_stub , long len , int defaultstub , char * * error TSRMLS_DC ) {
phar_entry_info entry = {
0 }
;
static const char newstub [ ] = "<?php // tar-based phar archive stub file\n__HALT_COMPILER();
" ;
php_stream * oldfile , * newfile , * stubfile ;
int closeoldfile , free_user_stub , signature_length ;
struct _phar_pass_tar_info pass ;
char * buf , * signature , * tmp , sigbuf [ 8 ] ;
char halt_stub [ ] = "__HALT_COMPILER();
" ;
entry . flags = PHAR_ENT_PERM_DEF_FILE ;
entry . timestamp = time ( NULL ) ;
entry . is_modified = 1 ;
entry . is_crc_checked = 1 ;
entry . is_tar = 1 ;
entry . tar_type = '0' ;
entry . phar = phar ;
entry . fp_type = PHAR_MOD ;
if ( phar -> is_persistent ) {
if ( error ) {
spprintf ( error , 0 , "internal error: attempt to flush cached tar-based phar \"%s\"" , phar -> fname ) ;
}
return EOF ;
}
if ( phar -> is_data ) {
goto nostub ;
}
if ( ! phar -> is_temporary_alias && phar -> alias_len ) {
entry . filename = estrndup ( ".phar/alias.txt" , sizeof ( ".phar/alias.txt" ) - 1 ) ;
entry . filename_len = sizeof ( ".phar/alias.txt" ) - 1 ;
entry . fp = php_stream_fopen_tmpfile ( ) ;
if ( entry . fp == NULL ) {
spprintf ( error , 0 , "phar error: unable to create temporary file" ) ;
return - 1 ;
}
if ( phar -> alias_len != ( int ) php_stream_write ( entry . fp , phar -> alias , phar -> alias_len ) ) {
if ( error ) {
spprintf ( error , 0 , "unable to set alias in tar-based phar \"%s\"" , phar -> fname ) ;
}
return EOF ;
}
entry . uncompressed_filesize = phar -> alias_len ;
if ( SUCCESS != zend_hash_update ( & phar -> manifest , entry . filename , entry . filename_len , ( void * ) & entry , sizeof ( phar_entry_info ) , NULL ) ) {
if ( error ) {
spprintf ( error , 0 , "unable to set alias in tar-based phar \"%s\"" , phar -> fname ) ;
}
return EOF ;
}
}
else {
zend_hash_del ( & phar -> manifest , ".phar/alias.txt" , sizeof ( ".phar/alias.txt" ) - 1 ) ;
}
if ( user_stub && ! defaultstub ) {
char * pos ;
if ( len < 0 ) {
if ( ! ( php_stream_from_zval_no_verify ( stubfile , ( zval * * ) user_stub ) ) ) {
if ( error ) {
spprintf ( error , 0 , "unable to access resource to copy stub to new tar-based phar \"%s\"" , phar -> fname ) ;
}
return EOF ;
}
if ( len == - 1 ) {
len = PHP_STREAM_COPY_ALL ;
}
else {
len = - len ;
}
user_stub = 0 ;
if ( ! ( len = php_stream_copy_to_mem ( stubfile , & user_stub , len , 0 ) ) || ! user_stub ) {
if ( error ) {
spprintf ( error , 0 , "unable to read resource to copy stub to new tar-based phar \"%s\"" , phar -> fname ) ;
}
return EOF ;
}
free_user_stub = 1 ;
}
else {
free_user_stub = 0 ;
}
tmp = estrndup ( user_stub , len ) ;
if ( ( pos = php_stristr ( tmp , halt_stub , len , sizeof ( halt_stub ) - 1 ) ) == NULL ) {
efree ( tmp ) ;
if ( error ) {
spprintf ( error , 0 , "illegal stub for tar-based phar \"%s\"" , phar -> fname ) ;
}
if ( free_user_stub ) {
efree ( user_stub ) ;
}
return EOF ;
}
pos = user_stub + ( pos - tmp ) ;
efree ( tmp ) ;
len = pos - user_stub + 18 ;
entry . fp = php_stream_fopen_tmpfile ( ) ;
if ( entry . fp == NULL ) {
spprintf ( error , 0 , "phar error: unable to create temporary file" ) ;
return EOF ;
}
entry . uncompressed_filesize = len + 5 ;
if ( ( size_t ) len != php_stream_write ( entry . fp , user_stub , len ) || 5 != php_stream_write ( entry . fp , " ?>\r\n" , 5 ) ) {
if ( error ) {
spprintf ( error , 0 , "unable to create stub from string in new tar-based phar \"%s\"" , phar -> fname ) ;
}
if ( free_user_stub ) {
efree ( user_stub ) ;
}
php_stream_close ( entry . fp ) ;
return EOF ;
}
entry . filename = estrndup ( ".phar/stub.php" , sizeof ( ".phar/stub.php" ) - 1 ) ;
entry . filename_len = sizeof ( ".phar/stub.php" ) - 1 ;
zend_hash_update ( & phar -> manifest , entry . filename , entry . filename_len , ( void * ) & entry , sizeof ( phar_entry_info ) , NULL ) ;
if ( free_user_stub ) {
efree ( user_stub ) ;
}
}
else {
entry . fp = php_stream_fopen_tmpfile ( ) ;
if ( entry . fp == NULL ) {
spprintf ( error , 0 , "phar error: unable to create temporary file" ) ;
return EOF ;
}
if ( sizeof ( newstub ) - 1 != php_stream_write ( entry . fp , newstub , sizeof ( newstub ) - 1 ) ) {
php_stream_close ( entry . fp ) ;
if ( error ) {
spprintf ( error , 0 , "unable to %s stub in%star-based phar \"%s\", failed" , user_stub ? "overwrite" : "create" , user_stub ? " " : " new " , phar -> fname ) ;
}
return EOF ;
}
entry . uncompressed_filesize = entry . compressed_filesize = sizeof ( newstub ) - 1 ;
entry . filename = estrndup ( ".phar/stub.php" , sizeof ( ".phar/stub.php" ) - 1 ) ;
entry . filename_len = sizeof ( ".phar/stub.php" ) - 1 ;
if ( ! defaultstub ) {
if ( ! zend_hash_exists ( & phar -> manifest , ".phar/stub.php" , sizeof ( ".phar/stub.php" ) - 1 ) ) {
if ( SUCCESS != zend_hash_add ( & phar -> manifest , entry . filename , entry . filename_len , ( void * ) & entry , sizeof ( phar_entry_info ) , NULL ) ) {
php_stream_close ( entry . fp ) ;
efree ( entry . filename ) ;
if ( error ) {
spprintf ( error , 0 , "unable to create stub in tar-based phar \"%s\"" , phar -> fname ) ;
}
return EOF ;
}
}
else {
php_stream_close ( entry . fp ) ;
efree ( entry . filename ) ;
}
}
else {
if ( SUCCESS != zend_hash_update ( & phar -> manifest , entry . filename , entry . filename_len , ( void * ) & entry , sizeof ( phar_entry_info ) , NULL ) ) {
php_stream_close ( entry . fp ) ;
efree ( entry . filename ) ;
if ( error ) {
spprintf ( error , 0 , "unable to overwrite stub in tar-based phar \"%s\"" , phar -> fname ) ;
}
return EOF ;
}
}
}
nostub : if ( phar -> fp && ! phar -> is_brandnew ) {
oldfile = phar -> fp ;
closeoldfile = 0 ;
php_stream_rewind ( oldfile ) ;
}
else {
oldfile = php_stream_open_wrapper ( phar -> fname , "rb" , 0 , NULL ) ;
closeoldfile = oldfile != NULL ;
}
newfile = php_stream_fopen_tmpfile ( ) ;
if ( ! newfile ) {
if ( error ) {
spprintf ( error , 0 , "unable to create temporary file" ) ;
}
if ( closeoldfile ) {
php_stream_close ( oldfile ) ;
}
return EOF ;
}
pass . old = oldfile ;
pass . new = newfile ;
pass . error = error ;
pass . free_fp = 1 ;
pass . free_ufp = 1 ;
if ( phar -> metadata ) {
phar_entry_info * mentry ;
if ( SUCCESS == zend_hash_find ( & ( phar -> manifest ) , ".phar/.metadata.bin" , sizeof ( ".phar/.metadata.bin" ) - 1 , ( void * * ) & mentry ) ) {
if ( ZEND_HASH_APPLY_KEEP != phar_tar_setmetadata ( phar -> metadata , mentry , error TSRMLS_CC ) ) {
if ( closeoldfile ) {
php_stream_close ( oldfile ) ;
}
return EOF ;
}
}
else {
phar_entry_info newentry = {
0 }
;
newentry . filename = estrndup ( ".phar/.metadata.bin" , sizeof ( ".phar/.metadata.bin" ) - 1 ) ;
newentry . filename_len = sizeof ( ".phar/.metadata.bin" ) - 1 ;
newentry . phar = phar ;
newentry . tar_type = TAR_FILE ;
newentry . is_tar = 1 ;
if ( SUCCESS != zend_hash_add ( & ( phar -> manifest ) , ".phar/.metadata.bin" , sizeof ( ".phar/.metadata.bin" ) - 1 , ( void * ) & newentry , sizeof ( phar_entry_info ) , ( void * * ) & mentry ) ) {
spprintf ( error , 0 , "phar tar error: unable to add magic metadata file to manifest for phar archive \"%s\"" , phar -> fname ) ;
if ( closeoldfile ) {
php_stream_close ( oldfile ) ;
}
return EOF ;
}
if ( ZEND_HASH_APPLY_KEEP != phar_tar_setmetadata ( phar -> metadata , mentry , error TSRMLS_CC ) ) {
zend_hash_del ( & ( phar -> manifest ) , ".phar/.metadata.bin" , sizeof ( ".phar/.metadata.bin" ) - 1 ) ;
if ( closeoldfile ) {
php_stream_close ( oldfile ) ;
}
return EOF ;
}
}
}
zend_hash_apply_with_argument ( & phar -> manifest , ( apply_func_arg_t ) phar_tar_setupmetadata , ( void * ) & pass TSRMLS_CC ) ;
if ( error && * error ) {
if ( closeoldfile ) {
php_stream_close ( oldfile ) ;
}
php_stream_close ( newfile ) ;
return EOF ;
}
zend_hash_apply_with_argument ( & phar -> manifest , ( apply_func_arg_t ) phar_tar_writeheaders , ( void * ) & pass TSRMLS_CC ) ;
if ( ! phar -> is_data || phar -> sig_flags ) {
if ( FAILURE == phar_create_signature ( phar , newfile , & signature , & signature_length , error TSRMLS_CC ) ) {
if ( error ) {
char * save = * error ;
spprintf ( error , 0 , "phar error: unable to write signature to tar-based phar: %s" , save ) ;
efree ( save ) ;
}
if ( closeoldfile ) {
php_stream_close ( oldfile ) ;
}
php_stream_close ( newfile ) ;
return EOF ;
}
entry . filename = ".phar/signature.bin" ;
entry . filename_len = sizeof ( ".phar/signature.bin" ) - 1 ;
entry . fp = php_stream_fopen_tmpfile ( ) ;
if ( entry . fp == NULL ) {
spprintf ( error , 0 , "phar error: unable to create temporary file" ) ;
return EOF ;
}
# ifdef WORDS_BIGENDIAN # define PHAR_SET_32 ( var , buffer ) \ * ( php_uint32 * ) ( var ) = ( ( ( ( ( unsigned char * ) & ( buffer ) ) [ 3 ] ) << 24 ) \ | ( ( ( ( unsigned char * ) & ( buffer ) ) [ 2 ] ) << 16 ) \ | ( ( ( ( unsigned char * ) & ( buffer ) ) [ 1 ] ) << 8 ) \ | ( ( ( unsigned char * ) & ( buffer ) ) [ 0 ] ) ) # else # define PHAR_SET_32 ( var , buffer ) * ( php_uint32 * ) ( var ) = ( php_uint32 ) ( buffer ) # endif PHAR_SET_32 ( sigbuf , phar -> sig_flags ) ;
PHAR_SET_32 ( sigbuf + 4 , signature_length ) ;
if ( 8 != ( int ) php_stream_write ( entry . fp , sigbuf , 8 ) || signature_length != ( int ) php_stream_write ( entry . fp , signature , signature_length ) ) {
efree ( signature ) ;
if ( error ) {
spprintf ( error , 0 , "phar error: unable to write signature to tar-based phar %s" , phar -> fname ) ;
}
if ( closeoldfile ) {
php_stream_close ( oldfile ) ;
}
php_stream_close ( newfile ) ;
return EOF ;
}
efree ( signature ) ;
entry . uncompressed_filesize = entry . compressed_filesize = signature_length + 8 ;
entry . filename_len = phar_tar_writeheaders ( ( void * ) & entry , ( void * ) & pass TSRMLS_CC ) ;
if ( error && * error ) {
if ( closeoldfile ) {
php_stream_close ( oldfile ) ;
}
php_stream_close ( newfile ) ;
return EOF ;
}
}
buf = ( char * ) ecalloc ( 1024 , 1 ) ;
php_stream_write ( newfile , buf , 1024 ) ;
efree ( buf ) ;
if ( closeoldfile ) {
php_stream_close ( oldfile ) ;
}
if ( error && * error ) {
php_stream_close ( newfile ) ;
return EOF ;
}
if ( phar -> fp && pass . free_fp ) {
php_stream_close ( phar -> fp ) ;
}
if ( phar -> ufp ) {
if ( pass . free_ufp ) {
php_stream_close ( phar -> ufp ) ;
}
phar -> ufp = NULL ;
}
phar -> is_brandnew = 0 ;
php_stream_rewind ( newfile ) ;
if ( phar -> donotflush ) {
phar -> fp = newfile ;
}
else {
phar -> fp = php_stream_open_wrapper ( phar -> fname , "w+b" , IGNORE_URL | STREAM_MUST_SEEK | REPORT_ERRORS , NULL ) ;
if ( ! phar -> fp ) {
phar -> fp = newfile ;
if ( error ) {
spprintf ( error , 0 , "unable to open new phar \"%s\" for writing" , phar -> fname ) ;
}
return EOF ;
}
if ( phar -> flags & PHAR_FILE_COMPRESSED_GZ ) {
php_stream_filter * filter ;
zval filterparams ;
array_init ( & filterparams ) ;
# ifndef MAX_WBITS # define MAX_WBITS 15 # endif add_assoc_long ( & filterparams , "window" , MAX_WBITS + 16 ) ;
filter = php_stream_filter_create ( "zlib.deflate" , & filterparams , php_stream_is_persistent ( phar -> fp ) TSRMLS_CC ) ;
zval_dtor ( & filterparams ) ;
if ( ! filter ) {
phar_stream_copy_to_stream ( newfile , phar -> fp , PHP_STREAM_COPY_ALL , NULL ) ;
php_stream_close ( newfile ) ;
if ( error ) {
spprintf ( error , 4096 , "unable to compress all contents of phar \"%s\" using zlib, PHP versions older than 5.2.6 have a buggy zlib" , phar -> fname ) ;
}
return EOF ;
}
php_stream_filter_append ( & phar -> fp -> writefilters , filter ) ;
phar_stream_copy_to_stream ( newfile , phar -> fp , PHP_STREAM_COPY_ALL , NULL ) ;
php_stream_filter_flush ( filter , 1 ) ;
php_stream_filter_remove ( filter , 1 TSRMLS_CC ) ;
php_stream_close ( phar -> fp ) ;
phar -> fp = newfile ;
}
else if ( phar -> flags & PHAR_FILE_COMPRESSED_BZ2 ) {
php_stream_filter * filter ;
filter = php_stream_filter_create ( "bzip2.compress" , NULL , php_stream_is_persistent ( phar -> fp ) TSRMLS_CC ) ;
php_stream_filter_append ( & phar -> fp -> writefilters , filter ) ;
phar_stream_copy_to_stream ( newfile , phar -> fp , PHP_STREAM_COPY_ALL , NULL ) ;
php_stream_filter_flush ( filter , 1 ) ;
php_stream_filter_remove ( filter , 1 TSRMLS_CC ) ;
php_stream_close ( phar -> fp ) ;
phar -> fp = newfile ;
}
else {
phar_stream_copy_to_stream ( newfile , phar -> fp , PHP_STREAM_COPY_ALL , NULL ) ;
php_stream_close ( newfile ) ;
}
}
return EOF ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
TEST_F ( TransportSecurityPersisterTest , SerializeData1 ) {
std : : string output ;
bool dirty ;
EXPECT_TRUE ( persister_ -> SerializeData ( & output ) ) ;
EXPECT_TRUE ( persister_ -> LoadEntries ( output , & dirty ) ) ;
EXPECT_FALSE ( dirty ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int qemuMonitorTextGetMemoryStats ( qemuMonitorPtr mon , virDomainMemoryStatPtr stats , unsigned int nr_stats ) {
char * reply = NULL ;
int ret = 0 ;
char * offset ;
if ( qemuMonitorHMPCommand ( mon , "info balloon" , & reply ) < 0 ) {
qemuReportError ( VIR_ERR_OPERATION_FAILED , "%s" , _ ( "could not query memory balloon statistics" ) ) ;
return - 1 ;
}
if ( ( offset = strstr ( reply , BALLOON_PREFIX ) ) != NULL ) {
offset += strlen ( BALLOON_PREFIX ) ;
ret = qemuMonitorParseBalloonInfo ( offset , stats , nr_stats ) ;
}
VIR_FREE ( reply ) ;
return ret ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int tree_content_remove ( struct tree_entry * root , const char * p , struct tree_entry * backup_leaf , int allow_root ) {
struct tree_content * t ;
const char * slash1 ;
unsigned int i , n ;
struct tree_entry * e ;
slash1 = strchrnul ( p , '/' ) ;
n = slash1 - p ;
if ( ! root -> tree ) load_tree ( root ) ;
if ( ! * p && allow_root ) {
e = root ;
goto del_entry ;
}
t = root -> tree ;
for ( i = 0 ;
i < t -> entry_count ;
i ++ ) {
e = t -> entries [ i ] ;
if ( e -> name -> str_len == n && ! strncmp_icase ( p , e -> name -> str_dat , n ) ) {
if ( * slash1 && ! S_ISDIR ( e -> versions [ 1 ] . mode ) ) return 1 ;
if ( ! * slash1 || ! S_ISDIR ( e -> versions [ 1 ] . mode ) ) goto del_entry ;
if ( ! e -> tree ) load_tree ( e ) ;
if ( tree_content_remove ( e , slash1 + 1 , backup_leaf , 0 ) ) {
for ( n = 0 ;
n < e -> tree -> entry_count ;
n ++ ) {
if ( e -> tree -> entries [ n ] -> versions [ 1 ] . mode ) {
hashclr ( root -> versions [ 1 ] . sha1 ) ;
return 1 ;
}
}
backup_leaf = NULL ;
goto del_entry ;
}
return 0 ;
}
}
return 0 ;
del_entry : if ( backup_leaf ) memcpy ( backup_leaf , e , sizeof ( * backup_leaf ) ) ;
else if ( e -> tree ) release_tree_content_recursive ( e -> tree ) ;
e -> tree = NULL ;
e -> versions [ 1 ] . mode = 0 ;
hashclr ( e -> versions [ 1 ] . sha1 ) ;
hashclr ( root -> versions [ 1 ] . sha1 ) ;
return 1 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void vmsvga_text_update ( void * opaque , console_ch_t * chardata ) {
struct vmsvga_state_s * s = opaque ;
if ( s -> vga . hw_ops -> text_update ) {
s -> vga . hw_ops -> text_update ( & s -> vga , chardata ) ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static gboolean logcat_dump_text ( wtap_dumper * wdh , const struct wtap_pkthdr * phdr , const guint8 * pd , int * err ) {
gchar * buf ;
gint length ;
gchar priority ;
const struct logger_entry * log_entry = ( struct logger_entry * ) pd ;
const struct logger_entry_v2 * log_entry_v2 = ( struct logger_entry_v2 * ) pd ;
gint payload_length ;
const gchar * tag ;
gint32 pid ;
gint32 tid ;
gint32 seconds ;
gint32 milliseconds ;
const gchar * msg_begin ;
gint msg_pre_skip ;
gchar * log ;
gchar * log_part ;
gchar * log_next ;
const union wtap_pseudo_header * pseudo_header = & phdr -> pseudo_header ;
const struct dumper_t * dumper = ( const struct dumper_t * ) wdh -> priv ;
if ( phdr -> rec_type != REC_TYPE_PACKET ) {
* err = WTAP_ERR_REC_TYPE_UNSUPPORTED ;
return FALSE ;
}
payload_length = GINT32_FROM_LE ( log_entry -> len ) ;
pid = GINT32_FROM_LE ( log_entry -> pid ) ;
tid = GINT32_FROM_LE ( log_entry -> tid ) ;
seconds = GINT32_FROM_LE ( log_entry -> sec ) ;
milliseconds = GINT32_FROM_LE ( log_entry -> nsec ) / 1000000 ;
if ( pseudo_header -> logcat . version == 1 ) {
priority = get_priority ( log_entry -> msg [ 0 ] ) ;
tag = log_entry -> msg + 1 ;
msg_pre_skip = 1 + strlen ( tag ) + 1 ;
msg_begin = log_entry -> msg + msg_pre_skip ;
}
else if ( pseudo_header -> logcat . version == 2 ) {
priority = get_priority ( log_entry_v2 -> msg [ 0 ] ) ;
tag = log_entry_v2 -> msg + 1 ;
msg_pre_skip = 1 + strlen ( tag ) + 1 ;
msg_begin = log_entry_v2 -> msg + msg_pre_skip ;
}
else {
* err = WTAP_ERR_UNSUPPORTED ;
return FALSE ;
}
log = g_strndup ( msg_begin , payload_length - msg_pre_skip ) ;
log_next = log ;
do {
log_part = log_next ;
if ( dumper -> type == DUMP_LONG ) {
log_next = NULL ;
}
else {
log_next = strchr ( log_part , '\n' ) ;
if ( log_next != NULL ) {
* log_next = '\0' ;
++ log_next ;
if ( * log_next == '\0' ) {
log_next = NULL ;
}
}
}
buf = logcat_log ( dumper , seconds , milliseconds , pid , tid , priority , tag , log_part ) ;
if ( ! buf ) {
g_free ( log ) ;
return FALSE ;
}
length = ( guint32 ) strlen ( buf ) ;
if ( ! wtap_dump_file_write ( wdh , buf , length , err ) ) {
g_free ( log ) ;
return FALSE ;
}
wdh -> bytes_dumped += length ;
}
while ( log_next != NULL ) ;
g_free ( log ) ;
return TRUE ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int event_loopexit ( const struct timeval * tv ) {
return ( event_once ( - 1 , EV_TIMEOUT , event_loopexit_cb , current_base , tv ) ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
mbfl_buffer_converter * mbfl_buffer_converter_new ( enum mbfl_no_encoding from , enum mbfl_no_encoding to , int buf_initsz ) {
const mbfl_encoding * _from = mbfl_no2encoding ( from ) ;
const mbfl_encoding * _to = mbfl_no2encoding ( to ) ;
return mbfl_buffer_converter_new2 ( _from ? _from : & mbfl_encoding_pass , _to ? _to : & mbfl_encoding_pass , buf_initsz ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static uint32_t get_nfc ( uint32_t uc , uint32_t uc2 ) {
int t , b ;
t = 0 ;
b = sizeof ( u_composition_table ) / sizeof ( u_composition_table [ 0 ] ) - 1 ;
while ( b >= t ) {
int m = ( t + b ) / 2 ;
if ( u_composition_table [ m ] . cp1 < uc ) t = m + 1 ;
else if ( u_composition_table [ m ] . cp1 > uc ) b = m - 1 ;
else if ( u_composition_table [ m ] . cp2 < uc2 ) t = m + 1 ;
else if ( u_composition_table [ m ] . cp2 > uc2 ) b = m - 1 ;
else return ( u_composition_table [ m ] . nfc ) ;
}
return ( 0 ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void alloc_limit_failure ( char * fn_name , size_t size ) {
fprintf ( stderr , "%s: Maximum allocation size exceeded " "(maxsize = %lu;
size = %lu).\n" , fn_name , ( unsigned long ) alloc_limit , ( unsigned long ) size ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_h245_ModeElement ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h245_ModeElement , ModeElement_sequence ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void InitXCFImage ( XCFLayerInfo * outLayer , ExceptionInfo * exception ) {
outLayer -> image -> page . x = outLayer -> offset_x ;
outLayer -> image -> page . y = outLayer -> offset_y ;
outLayer -> image -> page . width = outLayer -> width ;
outLayer -> image -> page . height = outLayer -> height ;
( void ) SetImageProperty ( outLayer -> image , "label" , ( char * ) outLayer -> name , exception ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void count_more_files_callback ( GObject * source_object , GAsyncResult * res , gpointer user_data ) {
DirectoryCountState * state ;
NautilusDirectory * directory ;
GError * error ;
GList * files ;
state = user_data ;
directory = state -> directory ;
if ( g_cancellable_is_cancelled ( state -> cancellable ) ) {
async_job_end ( directory , "directory count" ) ;
nautilus_directory_async_state_changed ( directory ) ;
directory_count_state_free ( state ) ;
return ;
}
g_assert ( directory -> details -> count_in_progress != NULL ) ;
g_assert ( directory -> details -> count_in_progress == state ) ;
error = NULL ;
files = g_file_enumerator_next_files_finish ( state -> enumerator , res , & error ) ;
state -> file_count += count_non_skipped_files ( files ) ;
if ( files == NULL ) {
count_children_done ( directory , state -> count_file , TRUE , state -> file_count ) ;
directory_count_state_free ( state ) ;
}
else {
g_file_enumerator_next_files_async ( state -> enumerator , DIRECTORY_LOAD_ITEMS_PER_CALLBACK , G_PRIORITY_DEFAULT , state -> cancellable , count_more_files_callback , state ) ;
}
g_list_free_full ( files , g_object_unref ) ;
if ( error ) {
g_error_free ( error ) ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static cmsStage * ReadSetOfCurves ( struct _cms_typehandler_struct * self , cmsIOHANDLER * io , cmsUInt32Number Offset , cmsUInt32Number nCurves ) {
cmsToneCurve * Curves [ cmsMAXCHANNELS ] ;
cmsUInt32Number i ;
cmsStage * Lin = NULL ;
if ( nCurves > cmsMAXCHANNELS ) return FALSE ;
if ( ! io -> Seek ( io , Offset ) ) return FALSE ;
for ( i = 0 ;
i < nCurves ;
i ++ ) Curves [ i ] = NULL ;
for ( i = 0 ;
i < nCurves ;
i ++ ) {
Curves [ i ] = ReadEmbeddedCurve ( self , io ) ;
if ( Curves [ i ] == NULL ) goto Error ;
if ( ! _cmsReadAlignment ( io ) ) goto Error ;
}
Lin = cmsStageAllocToneCurves ( self -> ContextID , nCurves , Curves ) ;
Error : for ( i = 0 ;
i < nCurves ;
i ++ ) cmsFreeToneCurve ( Curves [ i ] ) ;
return Lin ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int vp9_receive_compressed_data ( VP9Decoder * pbi , size_t size , const uint8_t * * psource ) {
VP9_COMMON * const cm = & pbi -> common ;
const uint8_t * source = * psource ;
int retcode = 0 ;
cm -> error . error_code = VPX_CODEC_OK ;
if ( size == 0 ) {
if ( cm -> frame_refs [ 0 ] . idx != INT_MAX ) cm -> frame_refs [ 0 ] . buf -> corrupted = 1 ;
}
if ( cm -> new_fb_idx >= 0 && cm -> frame_bufs [ cm -> new_fb_idx ] . ref_count == 0 ) cm -> release_fb_cb ( cm -> cb_priv , & cm -> frame_bufs [ cm -> new_fb_idx ] . raw_frame_buffer ) ;
cm -> new_fb_idx = get_free_fb ( cm ) ;
if ( setjmp ( cm -> error . jmp ) ) {
pbi -> need_resync = 1 ;
cm -> error . setjmp = 0 ;
vp9_clear_system_state ( ) ;
if ( cm -> frame_refs [ 0 ] . idx != INT_MAX && cm -> frame_refs [ 0 ] . buf != NULL ) cm -> frame_refs [ 0 ] . buf -> corrupted = 1 ;
if ( cm -> new_fb_idx > 0 && cm -> frame_bufs [ cm -> new_fb_idx ] . ref_count > 0 ) cm -> frame_bufs [ cm -> new_fb_idx ] . ref_count -- ;
return - 1 ;
}
cm -> error . setjmp = 1 ;
vp9_decode_frame ( pbi , source , source + size , psource ) ;
swap_frame_buffers ( pbi ) ;
vp9_clear_system_state ( ) ;
cm -> last_width = cm -> width ;
cm -> last_height = cm -> height ;
if ( ! cm -> show_existing_frame ) cm -> last_show_frame = cm -> show_frame ;
if ( cm -> show_frame ) {
if ( ! cm -> show_existing_frame ) vp9_swap_mi_and_prev_mi ( cm ) ;
cm -> current_video_frame ++ ;
}
pbi -> ready_for_new_data = 0 ;
cm -> error . setjmp = 0 ;
return retcode ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static SplinePointList * SplinesFromLayers ( SplineChar * sc , int * flags , int tostroke ) {
int layer ;
SplinePointList * head = NULL , * last , * new , * nlast , * temp , * each , * transed ;
StrokeInfo si ;
int handle_eraser ;
real inversetrans [ 6 ] , transform [ 6 ] ;
int changed ;
if ( tostroke ) {
for ( layer = ly_fore ;
layer < sc -> layer_cnt ;
++ layer ) {
if ( sc -> layers [ layer ] . splines == NULL ) continue ;
else if ( head == NULL ) head = sc -> layers [ layer ] . splines ;
else last -> next = sc -> layers [ layer ] . splines ;
for ( last = sc -> layers [ layer ] . splines ;
last -> next != NULL ;
last = last -> next ) ;
sc -> layers [ layer ] . splines = NULL ;
}
return ( head ) ;
}
if ( * flags == - 1 ) * flags = PsStrokeFlagsDlg ( ) ;
if ( * flags & sf_correctdir ) {
for ( layer = ly_fore ;
layer < sc -> layer_cnt ;
++ layer ) if ( sc -> layers [ layer ] . dofill ) SplineSetsCorrect ( sc -> layers [ layer ] . splines , & changed ) ;
}
handle_eraser = * flags & sf_handle_eraser ;
for ( layer = ly_fore ;
layer < sc -> layer_cnt ;
++ layer ) {
if ( sc -> layers [ layer ] . dostroke ) {
memset ( & si , '\0' , sizeof ( si ) ) ;
si . join = sc -> layers [ layer ] . stroke_pen . linejoin ;
si . cap = sc -> layers [ layer ] . stroke_pen . linecap ;
si . radius = sc -> layers [ layer ] . stroke_pen . width / 2.0f ;
if ( sc -> layers [ layer ] . stroke_pen . width == WIDTH_INHERITED ) si . radius = .5 ;
if ( si . cap == lc_inherited ) si . cap = lc_butt ;
if ( si . join == lj_inherited ) si . join = lj_miter ;
new = NULL ;
memcpy ( transform , sc -> layers [ layer ] . stroke_pen . trans , 4 * sizeof ( real ) ) ;
transform [ 4 ] = transform [ 5 ] = 0 ;
MatInverse ( inversetrans , transform ) ;
transed = SplinePointListTransform ( SplinePointListCopy ( sc -> layers [ layer ] . splines ) , inversetrans , tpt_AllPoints ) ;
for ( each = transed ;
each != NULL ;
each = each -> next ) {
temp = SplineSetStroke ( each , & si , sc -> layers [ layer ] . order2 ) ;
if ( new == NULL ) new = temp ;
else nlast -> next = temp ;
if ( temp != NULL ) for ( nlast = temp ;
nlast -> next != NULL ;
nlast = nlast -> next ) ;
}
new = SplinePointListTransform ( new , transform , tpt_AllPoints ) ;
SplinePointListsFree ( transed ) ;
if ( handle_eraser && sc -> layers [ layer ] . stroke_pen . brush . col == 0xffffff ) {
head = EraseStroke ( sc , head , new ) ;
last = head ;
if ( last != NULL ) for ( ;
last -> next != NULL ;
last = last -> next ) ;
}
else {
if ( head == NULL ) head = new ;
else last -> next = new ;
if ( new != NULL ) for ( last = new ;
last -> next != NULL ;
last = last -> next ) ;
}
}
if ( sc -> layers [ layer ] . dofill ) {
if ( handle_eraser && sc -> layers [ layer ] . fill_brush . col == 0xffffff ) {
head = EraseStroke ( sc , head , sc -> layers [ layer ] . splines ) ;
last = head ;
if ( last != NULL ) for ( ;
last -> next != NULL ;
last = last -> next ) ;
}
else {
new = SplinePointListCopy ( sc -> layers [ layer ] . splines ) ;
if ( head == NULL ) head = new ;
else last -> next = new ;
if ( new != NULL ) for ( last = new ;
last -> next != NULL ;
last = last -> next ) ;
}
}
}
return ( head ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void prplcb_conv_msg ( PurpleConversation * conv , const char * who , const char * message , PurpleMessageFlags flags , time_t mtime ) {
if ( ! ( flags & PURPLE_MESSAGE_SEND ) ) {
handle_conv_msg ( conv , who , message , 0 , mtime ) ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_pvfs2_mkdir_response ( tvbuff_t * tvb , proto_tree * tree , int offset , packet_info * pinfo ) {
offset = dissect_pvfs_fh ( tvb , offset , pinfo , tree , "handle" , NULL ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
IN_PROC_BROWSER_TEST_F ( ExternalProtocolDialogBrowserTest , TestCloseWithChecked ) {
ShowDialog ( ) ;
SetChecked ( true ) ;
EXPECT_TRUE ( dialog_ -> Close ( ) ) ;
EXPECT_FALSE ( called_ ) ;
EXPECT_FALSE ( accept_ ) ;
EXPECT_FALSE ( remember_ ) ;
histogram_tester_ . ExpectBucketCount ( ExternalProtocolHandler : : kHandleStateMetric , ExternalProtocolHandler : : DONT_LAUNCH , 1 ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void vp9_iht4x4_16_add_c ( const int16_t * input , uint8_t * dest , int stride , int tx_type ) {
const transform_2d IHT_4 [ ] = {
{
idct4 , idct4 }
, {
iadst4 , idct4 }
, {
idct4 , iadst4 }
, {
iadst4 , iadst4 }
}
;
int i , j ;
int16_t out [ 4 * 4 ] ;
int16_t * outptr = out ;
int16_t temp_in [ 4 ] , temp_out [ 4 ] ;
for ( i = 0 ;
i < 4 ;
++ i ) {
IHT_4 [ tx_type ] . rows ( input , outptr ) ;
input += 4 ;
outptr += 4 ;
}
for ( i = 0 ;
i < 4 ;
++ i ) {
for ( j = 0 ;
j < 4 ;
++ j ) temp_in [ j ] = out [ j * 4 + i ] ;
IHT_4 [ tx_type ] . cols ( temp_in , temp_out ) ;
for ( j = 0 ;
j < 4 ;
++ j ) dest [ j * stride + i ] = clip_pixel ( ROUND_POWER_OF_TWO ( temp_out [ j ] , 4 ) + dest [ j * stride + i ] ) ;
}
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
int _zip_cdir_write ( struct zip_cdir * cd , FILE * fp , struct zip_error * error ) {
int i ;
cd -> offset = ftello ( fp ) ;
for ( i = 0 ;
i < cd -> nentry ;
i ++ ) {
if ( _zip_dirent_write ( cd -> entry + i , fp , 0 , error ) != 0 ) return - 1 ;
}
cd -> size = ftello ( fp ) - cd -> offset ;
fwrite ( EOCD_MAGIC , 1 , 4 , fp ) ;
_zip_write4 ( 0 , fp ) ;
_zip_write2 ( ( unsigned short ) cd -> nentry , fp ) ;
_zip_write2 ( ( unsigned short ) cd -> nentry , fp ) ;
_zip_write4 ( cd -> size , fp ) ;
_zip_write4 ( cd -> offset , fp ) ;
_zip_write2 ( cd -> comment_len , fp ) ;
fwrite ( cd -> comment , 1 , cd -> comment_len , fp ) ;
if ( ferror ( fp ) ) {
_zip_error_set ( error , ZIP_ER_WRITE , errno ) ;
return - 1 ;
}
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void globfree ( pglob ) register glob_t * pglob ;
{
if ( pglob -> gl_pathv != NULL ) {
size_t i ;
for ( i = 0 ;
i < pglob -> gl_pathc ;
++ i ) free ( pglob -> gl_pathv [ pglob -> gl_offs + i ] ) ;
free ( pglob -> gl_pathv ) ;
pglob -> gl_pathv = NULL ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void tcmpt_destroy ( jpc_enc_tcmpt_t * tcmpt ) {
jpc_enc_rlvl_t * rlvl ;
uint_fast16_t rlvlno ;
if ( tcmpt -> rlvls ) {
for ( rlvlno = 0 , rlvl = tcmpt -> rlvls ;
rlvlno < tcmpt -> numrlvls ;
++ rlvlno , ++ rlvl ) {
rlvl_destroy ( rlvl ) ;
}
jas_free ( tcmpt -> rlvls ) ;
}
if ( tcmpt -> data ) {
jas_seq2d_destroy ( tcmpt -> data ) ;
}
if ( tcmpt -> tsfb ) {
jpc_tsfb_destroy ( tcmpt -> tsfb ) ;
}
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int get_pid_priority ( pid_t pid ) {
struct sched_param par ;
sched_getparam ( pid , & par ) ;
return par . sched_priority ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void fdct32 ( const int * input , int * output , int round ) {
int step [ 32 ] ;
step [ 0 ] = input [ 0 ] + input [ ( 32 - 1 ) ] ;
step [ 1 ] = input [ 1 ] + input [ ( 32 - 2 ) ] ;
step [ 2 ] = input [ 2 ] + input [ ( 32 - 3 ) ] ;
step [ 3 ] = input [ 3 ] + input [ ( 32 - 4 ) ] ;
step [ 4 ] = input [ 4 ] + input [ ( 32 - 5 ) ] ;
step [ 5 ] = input [ 5 ] + input [ ( 32 - 6 ) ] ;
step [ 6 ] = input [ 6 ] + input [ ( 32 - 7 ) ] ;
step [ 7 ] = input [ 7 ] + input [ ( 32 - 8 ) ] ;
step [ 8 ] = input [ 8 ] + input [ ( 32 - 9 ) ] ;
step [ 9 ] = input [ 9 ] + input [ ( 32 - 10 ) ] ;
step [ 10 ] = input [ 10 ] + input [ ( 32 - 11 ) ] ;
step [ 11 ] = input [ 11 ] + input [ ( 32 - 12 ) ] ;
step [ 12 ] = input [ 12 ] + input [ ( 32 - 13 ) ] ;
step [ 13 ] = input [ 13 ] + input [ ( 32 - 14 ) ] ;
step [ 14 ] = input [ 14 ] + input [ ( 32 - 15 ) ] ;
step [ 15 ] = input [ 15 ] + input [ ( 32 - 16 ) ] ;
step [ 16 ] = - input [ 16 ] + input [ ( 32 - 17 ) ] ;
step [ 17 ] = - input [ 17 ] + input [ ( 32 - 18 ) ] ;
step [ 18 ] = - input [ 18 ] + input [ ( 32 - 19 ) ] ;
step [ 19 ] = - input [ 19 ] + input [ ( 32 - 20 ) ] ;
step [ 20 ] = - input [ 20 ] + input [ ( 32 - 21 ) ] ;
step [ 21 ] = - input [ 21 ] + input [ ( 32 - 22 ) ] ;
step [ 22 ] = - input [ 22 ] + input [ ( 32 - 23 ) ] ;
step [ 23 ] = - input [ 23 ] + input [ ( 32 - 24 ) ] ;
step [ 24 ] = - input [ 24 ] + input [ ( 32 - 25 ) ] ;
step [ 25 ] = - input [ 25 ] + input [ ( 32 - 26 ) ] ;
step [ 26 ] = - input [ 26 ] + input [ ( 32 - 27 ) ] ;
step [ 27 ] = - input [ 27 ] + input [ ( 32 - 28 ) ] ;
step [ 28 ] = - input [ 28 ] + input [ ( 32 - 29 ) ] ;
step [ 29 ] = - input [ 29 ] + input [ ( 32 - 30 ) ] ;
step [ 30 ] = - input [ 30 ] + input [ ( 32 - 31 ) ] ;
step [ 31 ] = - input [ 31 ] + input [ ( 32 - 32 ) ] ;
output [ 0 ] = step [ 0 ] + step [ 16 - 1 ] ;
output [ 1 ] = step [ 1 ] + step [ 16 - 2 ] ;
output [ 2 ] = step [ 2 ] + step [ 16 - 3 ] ;
output [ 3 ] = step [ 3 ] + step [ 16 - 4 ] ;
output [ 4 ] = step [ 4 ] + step [ 16 - 5 ] ;
output [ 5 ] = step [ 5 ] + step [ 16 - 6 ] ;
output [ 6 ] = step [ 6 ] + step [ 16 - 7 ] ;
output [ 7 ] = step [ 7 ] + step [ 16 - 8 ] ;
output [ 8 ] = - step [ 8 ] + step [ 16 - 9 ] ;
output [ 9 ] = - step [ 9 ] + step [ 16 - 10 ] ;
output [ 10 ] = - step [ 10 ] + step [ 16 - 11 ] ;
output [ 11 ] = - step [ 11 ] + step [ 16 - 12 ] ;
output [ 12 ] = - step [ 12 ] + step [ 16 - 13 ] ;
output [ 13 ] = - step [ 13 ] + step [ 16 - 14 ] ;
output [ 14 ] = - step [ 14 ] + step [ 16 - 15 ] ;
output [ 15 ] = - step [ 15 ] + step [ 16 - 16 ] ;
output [ 16 ] = step [ 16 ] ;
output [ 17 ] = step [ 17 ] ;
output [ 18 ] = step [ 18 ] ;
output [ 19 ] = step [ 19 ] ;
output [ 20 ] = dct_32_round ( ( - step [ 20 ] + step [ 27 ] ) * cospi_16_64 ) ;
output [ 21 ] = dct_32_round ( ( - step [ 21 ] + step [ 26 ] ) * cospi_16_64 ) ;
output [ 22 ] = dct_32_round ( ( - step [ 22 ] + step [ 25 ] ) * cospi_16_64 ) ;
output [ 23 ] = dct_32_round ( ( - step [ 23 ] + step [ 24 ] ) * cospi_16_64 ) ;
output [ 24 ] = dct_32_round ( ( step [ 24 ] + step [ 23 ] ) * cospi_16_64 ) ;
output [ 25 ] = dct_32_round ( ( step [ 25 ] + step [ 22 ] ) * cospi_16_64 ) ;
output [ 26 ] = dct_32_round ( ( step [ 26 ] + step [ 21 ] ) * cospi_16_64 ) ;
output [ 27 ] = dct_32_round ( ( step [ 27 ] + step [ 20 ] ) * cospi_16_64 ) ;
output [ 28 ] = step [ 28 ] ;
output [ 29 ] = step [ 29 ] ;
output [ 30 ] = step [ 30 ] ;
output [ 31 ] = step [ 31 ] ;
if ( round ) {
output [ 0 ] = half_round_shift ( output [ 0 ] ) ;
output [ 1 ] = half_round_shift ( output [ 1 ] ) ;
output [ 2 ] = half_round_shift ( output [ 2 ] ) ;
output [ 3 ] = half_round_shift ( output [ 3 ] ) ;
output [ 4 ] = half_round_shift ( output [ 4 ] ) ;
output [ 5 ] = half_round_shift ( output [ 5 ] ) ;
output [ 6 ] = half_round_shift ( output [ 6 ] ) ;
output [ 7 ] = half_round_shift ( output [ 7 ] ) ;
output [ 8 ] = half_round_shift ( output [ 8 ] ) ;
output [ 9 ] = half_round_shift ( output [ 9 ] ) ;
output [ 10 ] = half_round_shift ( output [ 10 ] ) ;
output [ 11 ] = half_round_shift ( output [ 11 ] ) ;
output [ 12 ] = half_round_shift ( output [ 12 ] ) ;
output [ 13 ] = half_round_shift ( output [ 13 ] ) ;
output [ 14 ] = half_round_shift ( output [ 14 ] ) ;
output [ 15 ] = half_round_shift ( output [ 15 ] ) ;
output [ 16 ] = half_round_shift ( output [ 16 ] ) ;
output [ 17 ] = half_round_shift ( output [ 17 ] ) ;
output [ 18 ] = half_round_shift ( output [ 18 ] ) ;
output [ 19 ] = half_round_shift ( output [ 19 ] ) ;
output [ 20 ] = half_round_shift ( output [ 20 ] ) ;
output [ 21 ] = half_round_shift ( output [ 21 ] ) ;
output [ 22 ] = half_round_shift ( output [ 22 ] ) ;
output [ 23 ] = half_round_shift ( output [ 23 ] ) ;
output [ 24 ] = half_round_shift ( output [ 24 ] ) ;
output [ 25 ] = half_round_shift ( output [ 25 ] ) ;
output [ 26 ] = half_round_shift ( output [ 26 ] ) ;
output [ 27 ] = half_round_shift ( output [ 27 ] ) ;
output [ 28 ] = half_round_shift ( output [ 28 ] ) ;
output [ 29 ] = half_round_shift ( output [ 29 ] ) ;
output [ 30 ] = half_round_shift ( output [ 30 ] ) ;
output [ 31 ] = half_round_shift ( output [ 31 ] ) ;
}
step [ 0 ] = output [ 0 ] + output [ ( 8 - 1 ) ] ;
step [ 1 ] = output [ 1 ] + output [ ( 8 - 2 ) ] ;
step [ 2 ] = output [ 2 ] + output [ ( 8 - 3 ) ] ;
step [ 3 ] = output [ 3 ] + output [ ( 8 - 4 ) ] ;
step [ 4 ] = - output [ 4 ] + output [ ( 8 - 5 ) ] ;
step [ 5 ] = - output [ 5 ] + output [ ( 8 - 6 ) ] ;
step [ 6 ] = - output [ 6 ] + output [ ( 8 - 7 ) ] ;
step [ 7 ] = - output [ 7 ] + output [ ( 8 - 8 ) ] ;
step [ 8 ] = output [ 8 ] ;
step [ 9 ] = output [ 9 ] ;
step [ 10 ] = dct_32_round ( ( - output [ 10 ] + output [ 13 ] ) * cospi_16_64 ) ;
step [ 11 ] = dct_32_round ( ( - output [ 11 ] + output [ 12 ] ) * cospi_16_64 ) ;
step [ 12 ] = dct_32_round ( ( output [ 12 ] + output [ 11 ] ) * cospi_16_64 ) ;
step [ 13 ] = dct_32_round ( ( output [ 13 ] + output [ 10 ] ) * cospi_16_64 ) ;
step [ 14 ] = output [ 14 ] ;
step [ 15 ] = output [ 15 ] ;
step [ 16 ] = output [ 16 ] + output [ 23 ] ;
step [ 17 ] = output [ 17 ] + output [ 22 ] ;
step [ 18 ] = output [ 18 ] + output [ 21 ] ;
step [ 19 ] = output [ 19 ] + output [ 20 ] ;
step [ 20 ] = - output [ 20 ] + output [ 19 ] ;
step [ 21 ] = - output [ 21 ] + output [ 18 ] ;
step [ 22 ] = - output [ 22 ] + output [ 17 ] ;
step [ 23 ] = - output [ 23 ] + output [ 16 ] ;
step [ 24 ] = - output [ 24 ] + output [ 31 ] ;
step [ 25 ] = - output [ 25 ] + output [ 30 ] ;
step [ 26 ] = - output [ 26 ] + output [ 29 ] ;
step [ 27 ] = - output [ 27 ] + output [ 28 ] ;
step [ 28 ] = output [ 28 ] + output [ 27 ] ;
step [ 29 ] = output [ 29 ] + output [ 26 ] ;
step [ 30 ] = output [ 30 ] + output [ 25 ] ;
step [ 31 ] = output [ 31 ] + output [ 24 ] ;
output [ 0 ] = step [ 0 ] + step [ 3 ] ;
output [ 1 ] = step [ 1 ] + step [ 2 ] ;
output [ 2 ] = - step [ 2 ] + step [ 1 ] ;
output [ 3 ] = - step [ 3 ] + step [ 0 ] ;
output [ 4 ] = step [ 4 ] ;
output [ 5 ] = dct_32_round ( ( - step [ 5 ] + step [ 6 ] ) * cospi_16_64 ) ;
output [ 6 ] = dct_32_round ( ( step [ 6 ] + step [ 5 ] ) * cospi_16_64 ) ;
output [ 7 ] = step [ 7 ] ;
output [ 8 ] = step [ 8 ] + step [ 11 ] ;
output [ 9 ] = step [ 9 ] + step [ 10 ] ;
output [ 10 ] = - step [ 10 ] + step [ 9 ] ;
output [ 11 ] = - step [ 11 ] + step [ 8 ] ;
output [ 12 ] = - step [ 12 ] + step [ 15 ] ;
output [ 13 ] = - step [ 13 ] + step [ 14 ] ;
output [ 14 ] = step [ 14 ] + step [ 13 ] ;
output [ 15 ] = step [ 15 ] + step [ 12 ] ;
output [ 16 ] = step [ 16 ] ;
output [ 17 ] = step [ 17 ] ;
output [ 18 ] = dct_32_round ( step [ 18 ] * - cospi_8_64 + step [ 29 ] * cospi_24_64 ) ;
output [ 19 ] = dct_32_round ( step [ 19 ] * - cospi_8_64 + step [ 28 ] * cospi_24_64 ) ;
output [ 20 ] = dct_32_round ( step [ 20 ] * - cospi_24_64 + step [ 27 ] * - cospi_8_64 ) ;
output [ 21 ] = dct_32_round ( step [ 21 ] * - cospi_24_64 + step [ 26 ] * - cospi_8_64 ) ;
output [ 22 ] = step [ 22 ] ;
output [ 23 ] = step [ 23 ] ;
output [ 24 ] = step [ 24 ] ;
output [ 25 ] = step [ 25 ] ;
output [ 26 ] = dct_32_round ( step [ 26 ] * cospi_24_64 + step [ 21 ] * - cospi_8_64 ) ;
output [ 27 ] = dct_32_round ( step [ 27 ] * cospi_24_64 + step [ 20 ] * - cospi_8_64 ) ;
output [ 28 ] = dct_32_round ( step [ 28 ] * cospi_8_64 + step [ 19 ] * cospi_24_64 ) ;
output [ 29 ] = dct_32_round ( step [ 29 ] * cospi_8_64 + step [ 18 ] * cospi_24_64 ) ;
output [ 30 ] = step [ 30 ] ;
output [ 31 ] = step [ 31 ] ;
step [ 0 ] = dct_32_round ( ( output [ 0 ] + output [ 1 ] ) * cospi_16_64 ) ;
step [ 1 ] = dct_32_round ( ( - output [ 1 ] + output [ 0 ] ) * cospi_16_64 ) ;
step [ 2 ] = dct_32_round ( output [ 2 ] * cospi_24_64 + output [ 3 ] * cospi_8_64 ) ;
step [ 3 ] = dct_32_round ( output [ 3 ] * cospi_24_64 - output [ 2 ] * cospi_8_64 ) ;
step [ 4 ] = output [ 4 ] + output [ 5 ] ;
step [ 5 ] = - output [ 5 ] + output [ 4 ] ;
step [ 6 ] = - output [ 6 ] + output [ 7 ] ;
step [ 7 ] = output [ 7 ] + output [ 6 ] ;
step [ 8 ] = output [ 8 ] ;
step [ 9 ] = dct_32_round ( output [ 9 ] * - cospi_8_64 + output [ 14 ] * cospi_24_64 ) ;
step [ 10 ] = dct_32_round ( output [ 10 ] * - cospi_24_64 + output [ 13 ] * - cospi_8_64 ) ;
step [ 11 ] = output [ 11 ] ;
step [ 12 ] = output [ 12 ] ;
step [ 13 ] = dct_32_round ( output [ 13 ] * cospi_24_64 + output [ 10 ] * - cospi_8_64 ) ;
step [ 14 ] = dct_32_round ( output [ 14 ] * cospi_8_64 + output [ 9 ] * cospi_24_64 ) ;
step [ 15 ] = output [ 15 ] ;
step [ 16 ] = output [ 16 ] + output [ 19 ] ;
step [ 17 ] = output [ 17 ] + output [ 18 ] ;
step [ 18 ] = - output [ 18 ] + output [ 17 ] ;
step [ 19 ] = - output [ 19 ] + output [ 16 ] ;
step [ 20 ] = - output [ 20 ] + output [ 23 ] ;
step [ 21 ] = - output [ 21 ] + output [ 22 ] ;
step [ 22 ] = output [ 22 ] + output [ 21 ] ;
step [ 23 ] = output [ 23 ] + output [ 20 ] ;
step [ 24 ] = output [ 24 ] + output [ 27 ] ;
step [ 25 ] = output [ 25 ] + output [ 26 ] ;
step [ 26 ] = - output [ 26 ] + output [ 25 ] ;
step [ 27 ] = - output [ 27 ] + output [ 24 ] ;
step [ 28 ] = - output [ 28 ] + output [ 31 ] ;
step [ 29 ] = - output [ 29 ] + output [ 30 ] ;
step [ 30 ] = output [ 30 ] + output [ 29 ] ;
step [ 31 ] = output [ 31 ] + output [ 28 ] ;
output [ 0 ] = step [ 0 ] ;
output [ 1 ] = step [ 1 ] ;
output [ 2 ] = step [ 2 ] ;
output [ 3 ] = step [ 3 ] ;
output [ 4 ] = dct_32_round ( step [ 4 ] * cospi_28_64 + step [ 7 ] * cospi_4_64 ) ;
output [ 5 ] = dct_32_round ( step [ 5 ] * cospi_12_64 + step [ 6 ] * cospi_20_64 ) ;
output [ 6 ] = dct_32_round ( step [ 6 ] * cospi_12_64 + step [ 5 ] * - cospi_20_64 ) ;
output [ 7 ] = dct_32_round ( step [ 7 ] * cospi_28_64 + step [ 4 ] * - cospi_4_64 ) ;
output [ 8 ] = step [ 8 ] + step [ 9 ] ;
output [ 9 ] = - step [ 9 ] + step [ 8 ] ;
output [ 10 ] = - step [ 10 ] + step [ 11 ] ;
output [ 11 ] = step [ 11 ] + step [ 10 ] ;
output [ 12 ] = step [ 12 ] + step [ 13 ] ;
output [ 13 ] = - step [ 13 ] + step [ 12 ] ;
output [ 14 ] = - step [ 14 ] + step [ 15 ] ;
output [ 15 ] = step [ 15 ] + step [ 14 ] ;
output [ 16 ] = step [ 16 ] ;
output [ 17 ] = dct_32_round ( step [ 17 ] * - cospi_4_64 + step [ 30 ] * cospi_28_64 ) ;
output [ 18 ] = dct_32_round ( step [ 18 ] * - cospi_28_64 + step [ 29 ] * - cospi_4_64 ) ;
output [ 19 ] = step [ 19 ] ;
output [ 20 ] = step [ 20 ] ;
output [ 21 ] = dct_32_round ( step [ 21 ] * - cospi_20_64 + step [ 26 ] * cospi_12_64 ) ;
output [ 22 ] = dct_32_round ( step [ 22 ] * - cospi_12_64 + step [ 25 ] * - cospi_20_64 ) ;
output [ 23 ] = step [ 23 ] ;
output [ 24 ] = step [ 24 ] ;
output [ 25 ] = dct_32_round ( step [ 25 ] * cospi_12_64 + step [ 22 ] * - cospi_20_64 ) ;
output [ 26 ] = dct_32_round ( step [ 26 ] * cospi_20_64 + step [ 21 ] * cospi_12_64 ) ;
output [ 27 ] = step [ 27 ] ;
output [ 28 ] = step [ 28 ] ;
output [ 29 ] = dct_32_round ( step [ 29 ] * cospi_28_64 + step [ 18 ] * - cospi_4_64 ) ;
output [ 30 ] = dct_32_round ( step [ 30 ] * cospi_4_64 + step [ 17 ] * cospi_28_64 ) ;
output [ 31 ] = step [ 31 ] ;
step [ 0 ] = output [ 0 ] ;
step [ 1 ] = output [ 1 ] ;
step [ 2 ] = output [ 2 ] ;
step [ 3 ] = output [ 3 ] ;
step [ 4 ] = output [ 4 ] ;
step [ 5 ] = output [ 5 ] ;
step [ 6 ] = output [ 6 ] ;
step [ 7 ] = output [ 7 ] ;
step [ 8 ] = dct_32_round ( output [ 8 ] * cospi_30_64 + output [ 15 ] * cospi_2_64 ) ;
step [ 9 ] = dct_32_round ( output [ 9 ] * cospi_14_64 + output [ 14 ] * cospi_18_64 ) ;
step [ 10 ] = dct_32_round ( output [ 10 ] * cospi_22_64 + output [ 13 ] * cospi_10_64 ) ;
step [ 11 ] = dct_32_round ( output [ 11 ] * cospi_6_64 + output [ 12 ] * cospi_26_64 ) ;
step [ 12 ] = dct_32_round ( output [ 12 ] * cospi_6_64 + output [ 11 ] * - cospi_26_64 ) ;
step [ 13 ] = dct_32_round ( output [ 13 ] * cospi_22_64 + output [ 10 ] * - cospi_10_64 ) ;
step [ 14 ] = dct_32_round ( output [ 14 ] * cospi_14_64 + output [ 9 ] * - cospi_18_64 ) ;
step [ 15 ] = dct_32_round ( output [ 15 ] * cospi_30_64 + output [ 8 ] * - cospi_2_64 ) ;
step [ 16 ] = output [ 16 ] + output [ 17 ] ;
step [ 17 ] = - output [ 17 ] + output [ 16 ] ;
step [ 18 ] = - output [ 18 ] + output [ 19 ] ;
step [ 19 ] = output [ 19 ] + output [ 18 ] ;
step [ 20 ] = output [ 20 ] + output [ 21 ] ;
step [ 21 ] = - output [ 21 ] + output [ 20 ] ;
step [ 22 ] = - output [ 22 ] + output [ 23 ] ;
step [ 23 ] = output [ 23 ] + output [ 22 ] ;
step [ 24 ] = output [ 24 ] + output [ 25 ] ;
step [ 25 ] = - output [ 25 ] + output [ 24 ] ;
step [ 26 ] = - output [ 26 ] + output [ 27 ] ;
step [ 27 ] = output [ 27 ] + output [ 26 ] ;
step [ 28 ] = output [ 28 ] + output [ 29 ] ;
step [ 29 ] = - output [ 29 ] + output [ 28 ] ;
step [ 30 ] = - output [ 30 ] + output [ 31 ] ;
step [ 31 ] = output [ 31 ] + output [ 30 ] ;
output [ 0 ] = step [ 0 ] ;
output [ 16 ] = step [ 1 ] ;
output [ 8 ] = step [ 2 ] ;
output [ 24 ] = step [ 3 ] ;
output [ 4 ] = step [ 4 ] ;
output [ 20 ] = step [ 5 ] ;
output [ 12 ] = step [ 6 ] ;
output [ 28 ] = step [ 7 ] ;
output [ 2 ] = step [ 8 ] ;
output [ 18 ] = step [ 9 ] ;
output [ 10 ] = step [ 10 ] ;
output [ 26 ] = step [ 11 ] ;
output [ 6 ] = step [ 12 ] ;
output [ 22 ] = step [ 13 ] ;
output [ 14 ] = step [ 14 ] ;
output [ 30 ] = step [ 15 ] ;
output [ 1 ] = dct_32_round ( step [ 16 ] * cospi_31_64 + step [ 31 ] * cospi_1_64 ) ;
output [ 17 ] = dct_32_round ( step [ 17 ] * cospi_15_64 + step [ 30 ] * cospi_17_64 ) ;
output [ 9 ] = dct_32_round ( step [ 18 ] * cospi_23_64 + step [ 29 ] * cospi_9_64 ) ;
output [ 25 ] = dct_32_round ( step [ 19 ] * cospi_7_64 + step [ 28 ] * cospi_25_64 ) ;
output [ 5 ] = dct_32_round ( step [ 20 ] * cospi_27_64 + step [ 27 ] * cospi_5_64 ) ;
output [ 21 ] = dct_32_round ( step [ 21 ] * cospi_11_64 + step [ 26 ] * cospi_21_64 ) ;
output [ 13 ] = dct_32_round ( step [ 22 ] * cospi_19_64 + step [ 25 ] * cospi_13_64 ) ;
output [ 29 ] = dct_32_round ( step [ 23 ] * cospi_3_64 + step [ 24 ] * cospi_29_64 ) ;
output [ 3 ] = dct_32_round ( step [ 24 ] * cospi_3_64 + step [ 23 ] * - cospi_29_64 ) ;
output [ 19 ] = dct_32_round ( step [ 25 ] * cospi_19_64 + step [ 22 ] * - cospi_13_64 ) ;
output [ 11 ] = dct_32_round ( step [ 26 ] * cospi_11_64 + step [ 21 ] * - cospi_21_64 ) ;
output [ 27 ] = dct_32_round ( step [ 27 ] * cospi_27_64 + step [ 20 ] * - cospi_5_64 ) ;
output [ 7 ] = dct_32_round ( step [ 28 ] * cospi_7_64 + step [ 19 ] * - cospi_25_64 ) ;
output [ 23 ] = dct_32_round ( step [ 29 ] * cospi_23_64 + step [ 18 ] * - cospi_9_64 ) ;
output [ 15 ] = dct_32_round ( step [ 30 ] * cospi_15_64 + step [ 17 ] * - cospi_17_64 ) ;
output [ 31 ] = dct_32_round ( step [ 31 ] * cospi_31_64 + step [ 16 ] * - cospi_1_64 ) ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static VALUE ossl_asn1_ ## klass ( int argc , VALUE * argv , VALUE self ) \ {
return rb_funcall3 ( cASN1 ## klass , rb_intern ( "new" ) , argc , argv ) ;
}
OSSL_ASN1_IMPL_FACTORY_METHOD ( Boolean ) OSSL_ASN1_IMPL_FACTORY_METHOD ( Integer ) OSSL_ASN1_IMPL_FACTORY_METHOD ( Enumerated ) OSSL_ASN1_IMPL_FACTORY_METHOD ( BitString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( OctetString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( UTF8String ) OSSL_ASN1_IMPL_FACTORY_METHOD ( NumericString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( PrintableString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( T61String ) OSSL_ASN1_IMPL_FACTORY_METHOD ( VideotexString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( IA5String ) OSSL_ASN1_IMPL_FACTORY_METHOD ( GraphicString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( ISO64String ) OSSL_ASN1_IMPL_FACTORY_METHOD ( GeneralString ) OSSL_ASN1_IMPL_FACTORY_METHOD ( UniversalString )
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static inline char * upcase_string ( char * dst , size_t dst_size , const char * src ) {
int i ;
for ( i = 0 ;
src [ i ] && i < dst_size - 1 ;
i ++ ) dst [ i ] = av_toupper ( src [ i ] ) ;
dst [ i ] = 0 ;
return dst ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void TSFetchUrl ( const char * headers , int request_len , sockaddr const * ip , TSCont contp , TSFetchWakeUpOptions callback_options , TSFetchEvent events ) {
if ( callback_options != NO_CALLBACK ) {
sdk_assert ( sdk_sanity_check_continuation ( contp ) == TS_SUCCESS ) ;
}
FetchSM * fetch_sm = FetchSMAllocator . alloc ( ) ;
fetch_sm -> init ( ( Continuation * ) contp , callback_options , events , headers , request_len , ip ) ;
fetch_sm -> httpConnect ( ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void dequant_lsp16r ( GetBitContext * gb , double * i_lsps , const double * old , double * a1 , double * a2 , int q_mode ) {
static const uint16_t vec_sizes [ 3 ] = {
128 , 128 , 128 }
;
static const double mul_lsf [ 3 ] = {
1.2232979501e-3 , 1.4062241527e-3 , 1.6114744851e-3 }
;
static const double base_lsf [ 3 ] = {
M_PI * - 5.5830e-2 , M_PI * - 5.2908e-2 , M_PI * - 5.4776e-2 }
;
const float ( * ipol_tab ) [ 2 ] [ 16 ] = q_mode ? wmavoice_lsp16_intercoeff_b : wmavoice_lsp16_intercoeff_a ;
uint16_t interpol , v [ 3 ] ;
int n ;
dequant_lsp16i ( gb , i_lsps ) ;
interpol = get_bits ( gb , 5 ) ;
v [ 0 ] = get_bits ( gb , 7 ) ;
v [ 1 ] = get_bits ( gb , 7 ) ;
v [ 2 ] = get_bits ( gb , 7 ) ;
for ( n = 0 ;
n < 16 ;
n ++ ) {
double delta = old [ n ] - i_lsps [ n ] ;
a1 [ n ] = ipol_tab [ interpol ] [ 0 ] [ n ] * delta + i_lsps [ n ] ;
a1 [ 16 + n ] = ipol_tab [ interpol ] [ 1 ] [ n ] * delta + i_lsps [ n ] ;
}
dequant_lsps ( a2 , 10 , v , vec_sizes , 1 , wmavoice_dq_lsp16r1 , mul_lsf , base_lsf ) ;
dequant_lsps ( & a2 [ 10 ] , 10 , & v [ 1 ] , & vec_sizes [ 1 ] , 1 , wmavoice_dq_lsp16r2 , & mul_lsf [ 1 ] , & base_lsf [ 1 ] ) ;
dequant_lsps ( & a2 [ 20 ] , 12 , & v [ 2 ] , & vec_sizes [ 2 ] , 1 , wmavoice_dq_lsp16r3 , & mul_lsf [ 2 ] , & base_lsf [ 2 ] ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void api_init ( ) {
static int init = 1 ;
if ( init ) {
init = 0 ;
TS_URL_SCHEME_FILE = URL_SCHEME_FILE ;
TS_URL_SCHEME_FTP = URL_SCHEME_FTP ;
TS_URL_SCHEME_GOPHER = URL_SCHEME_GOPHER ;
TS_URL_SCHEME_HTTP = URL_SCHEME_HTTP ;
TS_URL_SCHEME_HTTPS = URL_SCHEME_HTTPS ;
TS_URL_SCHEME_MAILTO = URL_SCHEME_MAILTO ;
TS_URL_SCHEME_NEWS = URL_SCHEME_NEWS ;
TS_URL_SCHEME_NNTP = URL_SCHEME_NNTP ;
TS_URL_SCHEME_PROSPERO = URL_SCHEME_PROSPERO ;
TS_URL_SCHEME_TELNET = URL_SCHEME_TELNET ;
TS_URL_SCHEME_WAIS = URL_SCHEME_WAIS ;
TS_URL_SCHEME_WS = URL_SCHEME_WS ;
TS_URL_SCHEME_WSS = URL_SCHEME_WSS ;
TS_URL_LEN_FILE = URL_LEN_FILE ;
TS_URL_LEN_FTP = URL_LEN_FTP ;
TS_URL_LEN_GOPHER = URL_LEN_GOPHER ;
TS_URL_LEN_HTTP = URL_LEN_HTTP ;
TS_URL_LEN_HTTPS = URL_LEN_HTTPS ;
TS_URL_LEN_MAILTO = URL_LEN_MAILTO ;
TS_URL_LEN_NEWS = URL_LEN_NEWS ;
TS_URL_LEN_NNTP = URL_LEN_NNTP ;
TS_URL_LEN_PROSPERO = URL_LEN_PROSPERO ;
TS_URL_LEN_TELNET = URL_LEN_TELNET ;
TS_URL_LEN_WAIS = URL_LEN_WAIS ;
TS_URL_LEN_WS = URL_LEN_WS ;
TS_URL_LEN_WSS = URL_LEN_WSS ;
TS_MIME_FIELD_ACCEPT = MIME_FIELD_ACCEPT ;
TS_MIME_FIELD_ACCEPT_CHARSET = MIME_FIELD_ACCEPT_CHARSET ;
TS_MIME_FIELD_ACCEPT_ENCODING = MIME_FIELD_ACCEPT_ENCODING ;
TS_MIME_FIELD_ACCEPT_LANGUAGE = MIME_FIELD_ACCEPT_LANGUAGE ;
TS_MIME_FIELD_ACCEPT_RANGES = MIME_FIELD_ACCEPT_RANGES ;
TS_MIME_FIELD_AGE = MIME_FIELD_AGE ;
TS_MIME_FIELD_ALLOW = MIME_FIELD_ALLOW ;
TS_MIME_FIELD_APPROVED = MIME_FIELD_APPROVED ;
TS_MIME_FIELD_AUTHORIZATION = MIME_FIELD_AUTHORIZATION ;
TS_MIME_FIELD_BYTES = MIME_FIELD_BYTES ;
TS_MIME_FIELD_CACHE_CONTROL = MIME_FIELD_CACHE_CONTROL ;
TS_MIME_FIELD_CLIENT_IP = MIME_FIELD_CLIENT_IP ;
TS_MIME_FIELD_CONNECTION = MIME_FIELD_CONNECTION ;
TS_MIME_FIELD_CONTENT_BASE = MIME_FIELD_CONTENT_BASE ;
TS_MIME_FIELD_CONTENT_ENCODING = MIME_FIELD_CONTENT_ENCODING ;
TS_MIME_FIELD_CONTENT_LANGUAGE = MIME_FIELD_CONTENT_LANGUAGE ;
TS_MIME_FIELD_CONTENT_LENGTH = MIME_FIELD_CONTENT_LENGTH ;
TS_MIME_FIELD_CONTENT_LOCATION = MIME_FIELD_CONTENT_LOCATION ;
TS_MIME_FIELD_CONTENT_MD5 = MIME_FIELD_CONTENT_MD5 ;
TS_MIME_FIELD_CONTENT_RANGE = MIME_FIELD_CONTENT_RANGE ;
TS_MIME_FIELD_CONTENT_TYPE = MIME_FIELD_CONTENT_TYPE ;
TS_MIME_FIELD_CONTROL = MIME_FIELD_CONTROL ;
TS_MIME_FIELD_COOKIE = MIME_FIELD_COOKIE ;
TS_MIME_FIELD_DATE = MIME_FIELD_DATE ;
TS_MIME_FIELD_DISTRIBUTION = MIME_FIELD_DISTRIBUTION ;
TS_MIME_FIELD_ETAG = MIME_FIELD_ETAG ;
TS_MIME_FIELD_EXPECT = MIME_FIELD_EXPECT ;
TS_MIME_FIELD_EXPIRES = MIME_FIELD_EXPIRES ;
TS_MIME_FIELD_FOLLOWUP_TO = MIME_FIELD_FOLLOWUP_TO ;
TS_MIME_FIELD_FROM = MIME_FIELD_FROM ;
TS_MIME_FIELD_HOST = MIME_FIELD_HOST ;
TS_MIME_FIELD_IF_MATCH = MIME_FIELD_IF_MATCH ;
TS_MIME_FIELD_IF_MODIFIED_SINCE = MIME_FIELD_IF_MODIFIED_SINCE ;
TS_MIME_FIELD_IF_NONE_MATCH = MIME_FIELD_IF_NONE_MATCH ;
TS_MIME_FIELD_IF_RANGE = MIME_FIELD_IF_RANGE ;
TS_MIME_FIELD_IF_UNMODIFIED_SINCE = MIME_FIELD_IF_UNMODIFIED_SINCE ;
TS_MIME_FIELD_KEEP_ALIVE = MIME_FIELD_KEEP_ALIVE ;
TS_MIME_FIELD_KEYWORDS = MIME_FIELD_KEYWORDS ;
TS_MIME_FIELD_LAST_MODIFIED = MIME_FIELD_LAST_MODIFIED ;
TS_MIME_FIELD_LINES = MIME_FIELD_LINES ;
TS_MIME_FIELD_LOCATION = MIME_FIELD_LOCATION ;
TS_MIME_FIELD_MAX_FORWARDS = MIME_FIELD_MAX_FORWARDS ;
TS_MIME_FIELD_MESSAGE_ID = MIME_FIELD_MESSAGE_ID ;
TS_MIME_FIELD_NEWSGROUPS = MIME_FIELD_NEWSGROUPS ;
TS_MIME_FIELD_ORGANIZATION = MIME_FIELD_ORGANIZATION ;
TS_MIME_FIELD_PATH = MIME_FIELD_PATH ;
TS_MIME_FIELD_PRAGMA = MIME_FIELD_PRAGMA ;
TS_MIME_FIELD_PROXY_AUTHENTICATE = MIME_FIELD_PROXY_AUTHENTICATE ;
TS_MIME_FIELD_PROXY_AUTHORIZATION = MIME_FIELD_PROXY_AUTHORIZATION ;
TS_MIME_FIELD_PROXY_CONNECTION = MIME_FIELD_PROXY_CONNECTION ;
TS_MIME_FIELD_PUBLIC = MIME_FIELD_PUBLIC ;
TS_MIME_FIELD_RANGE = MIME_FIELD_RANGE ;
TS_MIME_FIELD_REFERENCES = MIME_FIELD_REFERENCES ;
TS_MIME_FIELD_REFERER = MIME_FIELD_REFERER ;
TS_MIME_FIELD_REPLY_TO = MIME_FIELD_REPLY_TO ;
TS_MIME_FIELD_RETRY_AFTER = MIME_FIELD_RETRY_AFTER ;
TS_MIME_FIELD_SENDER = MIME_FIELD_SENDER ;
TS_MIME_FIELD_SERVER = MIME_FIELD_SERVER ;
TS_MIME_FIELD_SET_COOKIE = MIME_FIELD_SET_COOKIE ;
TS_MIME_FIELD_STRICT_TRANSPORT_SECURITY = MIME_FIELD_STRICT_TRANSPORT_SECURITY ;
TS_MIME_FIELD_SUBJECT = MIME_FIELD_SUBJECT ;
TS_MIME_FIELD_SUMMARY = MIME_FIELD_SUMMARY ;
TS_MIME_FIELD_TE = MIME_FIELD_TE ;
TS_MIME_FIELD_TRANSFER_ENCODING = MIME_FIELD_TRANSFER_ENCODING ;
TS_MIME_FIELD_UPGRADE = MIME_FIELD_UPGRADE ;
TS_MIME_FIELD_USER_AGENT = MIME_FIELD_USER_AGENT ;
TS_MIME_FIELD_VARY = MIME_FIELD_VARY ;
TS_MIME_FIELD_VIA = MIME_FIELD_VIA ;
TS_MIME_FIELD_WARNING = MIME_FIELD_WARNING ;
TS_MIME_FIELD_WWW_AUTHENTICATE = MIME_FIELD_WWW_AUTHENTICATE ;
TS_MIME_FIELD_XREF = MIME_FIELD_XREF ;
TS_MIME_FIELD_X_FORWARDED_FOR = MIME_FIELD_X_FORWARDED_FOR ;
TS_MIME_LEN_ACCEPT = MIME_LEN_ACCEPT ;
TS_MIME_LEN_ACCEPT_CHARSET = MIME_LEN_ACCEPT_CHARSET ;
TS_MIME_LEN_ACCEPT_ENCODING = MIME_LEN_ACCEPT_ENCODING ;
TS_MIME_LEN_ACCEPT_LANGUAGE = MIME_LEN_ACCEPT_LANGUAGE ;
TS_MIME_LEN_ACCEPT_RANGES = MIME_LEN_ACCEPT_RANGES ;
TS_MIME_LEN_AGE = MIME_LEN_AGE ;
TS_MIME_LEN_ALLOW = MIME_LEN_ALLOW ;
TS_MIME_LEN_APPROVED = MIME_LEN_APPROVED ;
TS_MIME_LEN_AUTHORIZATION = MIME_LEN_AUTHORIZATION ;
TS_MIME_LEN_BYTES = MIME_LEN_BYTES ;
TS_MIME_LEN_CACHE_CONTROL = MIME_LEN_CACHE_CONTROL ;
TS_MIME_LEN_CLIENT_IP = MIME_LEN_CLIENT_IP ;
TS_MIME_LEN_CONNECTION = MIME_LEN_CONNECTION ;
TS_MIME_LEN_CONTENT_BASE = MIME_LEN_CONTENT_BASE ;
TS_MIME_LEN_CONTENT_ENCODING = MIME_LEN_CONTENT_ENCODING ;
TS_MIME_LEN_CONTENT_LANGUAGE = MIME_LEN_CONTENT_LANGUAGE ;
TS_MIME_LEN_CONTENT_LENGTH = MIME_LEN_CONTENT_LENGTH ;
TS_MIME_LEN_CONTENT_LOCATION = MIME_LEN_CONTENT_LOCATION ;
TS_MIME_LEN_CONTENT_MD5 = MIME_LEN_CONTENT_MD5 ;
TS_MIME_LEN_CONTENT_RANGE = MIME_LEN_CONTENT_RANGE ;
TS_MIME_LEN_CONTENT_TYPE = MIME_LEN_CONTENT_TYPE ;
TS_MIME_LEN_CONTROL = MIME_LEN_CONTROL ;
TS_MIME_LEN_COOKIE = MIME_LEN_COOKIE ;
TS_MIME_LEN_DATE = MIME_LEN_DATE ;
TS_MIME_LEN_DISTRIBUTION = MIME_LEN_DISTRIBUTION ;
TS_MIME_LEN_ETAG = MIME_LEN_ETAG ;
TS_MIME_LEN_EXPECT = MIME_LEN_EXPECT ;
TS_MIME_LEN_EXPIRES = MIME_LEN_EXPIRES ;
TS_MIME_LEN_FOLLOWUP_TO = MIME_LEN_FOLLOWUP_TO ;
TS_MIME_LEN_FROM = MIME_LEN_FROM ;
TS_MIME_LEN_HOST = MIME_LEN_HOST ;
TS_MIME_LEN_IF_MATCH = MIME_LEN_IF_MATCH ;
TS_MIME_LEN_IF_MODIFIED_SINCE = MIME_LEN_IF_MODIFIED_SINCE ;
TS_MIME_LEN_IF_NONE_MATCH = MIME_LEN_IF_NONE_MATCH ;
TS_MIME_LEN_IF_RANGE = MIME_LEN_IF_RANGE ;
TS_MIME_LEN_IF_UNMODIFIED_SINCE = MIME_LEN_IF_UNMODIFIED_SINCE ;
TS_MIME_LEN_KEEP_ALIVE = MIME_LEN_KEEP_ALIVE ;
TS_MIME_LEN_KEYWORDS = MIME_LEN_KEYWORDS ;
TS_MIME_LEN_LAST_MODIFIED = MIME_LEN_LAST_MODIFIED ;
TS_MIME_LEN_LINES = MIME_LEN_LINES ;
TS_MIME_LEN_LOCATION = MIME_LEN_LOCATION ;
TS_MIME_LEN_MAX_FORWARDS = MIME_LEN_MAX_FORWARDS ;
TS_MIME_LEN_MESSAGE_ID = MIME_LEN_MESSAGE_ID ;
TS_MIME_LEN_NEWSGROUPS = MIME_LEN_NEWSGROUPS ;
TS_MIME_LEN_ORGANIZATION = MIME_LEN_ORGANIZATION ;
TS_MIME_LEN_PATH = MIME_LEN_PATH ;
TS_MIME_LEN_PRAGMA = MIME_LEN_PRAGMA ;
TS_MIME_LEN_PROXY_AUTHENTICATE = MIME_LEN_PROXY_AUTHENTICATE ;
TS_MIME_LEN_PROXY_AUTHORIZATION = MIME_LEN_PROXY_AUTHORIZATION ;
TS_MIME_LEN_PROXY_CONNECTION = MIME_LEN_PROXY_CONNECTION ;
TS_MIME_LEN_PUBLIC = MIME_LEN_PUBLIC ;
TS_MIME_LEN_RANGE = MIME_LEN_RANGE ;
TS_MIME_LEN_REFERENCES = MIME_LEN_REFERENCES ;
TS_MIME_LEN_REFERER = MIME_LEN_REFERER ;
TS_MIME_LEN_REPLY_TO = MIME_LEN_REPLY_TO ;
TS_MIME_LEN_RETRY_AFTER = MIME_LEN_RETRY_AFTER ;
TS_MIME_LEN_SENDER = MIME_LEN_SENDER ;
TS_MIME_LEN_SERVER = MIME_LEN_SERVER ;
TS_MIME_LEN_SET_COOKIE = MIME_LEN_SET_COOKIE ;
TS_MIME_LEN_STRICT_TRANSPORT_SECURITY = MIME_LEN_STRICT_TRANSPORT_SECURITY ;
TS_MIME_LEN_SUBJECT = MIME_LEN_SUBJECT ;
TS_MIME_LEN_SUMMARY = MIME_LEN_SUMMARY ;
TS_MIME_LEN_TE = MIME_LEN_TE ;
TS_MIME_LEN_TRANSFER_ENCODING = MIME_LEN_TRANSFER_ENCODING ;
TS_MIME_LEN_UPGRADE = MIME_LEN_UPGRADE ;
TS_MIME_LEN_USER_AGENT = MIME_LEN_USER_AGENT ;
TS_MIME_LEN_VARY = MIME_LEN_VARY ;
TS_MIME_LEN_VIA = MIME_LEN_VIA ;
TS_MIME_LEN_WARNING = MIME_LEN_WARNING ;
TS_MIME_LEN_WWW_AUTHENTICATE = MIME_LEN_WWW_AUTHENTICATE ;
TS_MIME_LEN_XREF = MIME_LEN_XREF ;
TS_MIME_LEN_X_FORWARDED_FOR = MIME_LEN_X_FORWARDED_FOR ;
TS_HTTP_METHOD_CONNECT = HTTP_METHOD_CONNECT ;
TS_HTTP_METHOD_DELETE = HTTP_METHOD_DELETE ;
TS_HTTP_METHOD_GET = HTTP_METHOD_GET ;
TS_HTTP_METHOD_HEAD = HTTP_METHOD_HEAD ;
TS_HTTP_METHOD_OPTIONS = HTTP_METHOD_OPTIONS ;
TS_HTTP_METHOD_POST = HTTP_METHOD_POST ;
TS_HTTP_METHOD_PURGE = HTTP_METHOD_PURGE ;
TS_HTTP_METHOD_PUT = HTTP_METHOD_PUT ;
TS_HTTP_METHOD_TRACE = HTTP_METHOD_TRACE ;
TS_HTTP_METHOD_PUSH = HTTP_METHOD_PUSH ;
TS_HTTP_LEN_CONNECT = HTTP_LEN_CONNECT ;
TS_HTTP_LEN_DELETE = HTTP_LEN_DELETE ;
TS_HTTP_LEN_GET = HTTP_LEN_GET ;
TS_HTTP_LEN_HEAD = HTTP_LEN_HEAD ;
TS_HTTP_LEN_OPTIONS = HTTP_LEN_OPTIONS ;
TS_HTTP_LEN_POST = HTTP_LEN_POST ;
TS_HTTP_LEN_PURGE = HTTP_LEN_PURGE ;
TS_HTTP_LEN_PUT = HTTP_LEN_PUT ;
TS_HTTP_LEN_TRACE = HTTP_LEN_TRACE ;
TS_HTTP_LEN_PUSH = HTTP_LEN_PUSH ;
TS_HTTP_VALUE_BYTES = HTTP_VALUE_BYTES ;
TS_HTTP_VALUE_CHUNKED = HTTP_VALUE_CHUNKED ;
TS_HTTP_VALUE_CLOSE = HTTP_VALUE_CLOSE ;
TS_HTTP_VALUE_COMPRESS = HTTP_VALUE_COMPRESS ;
TS_HTTP_VALUE_DEFLATE = HTTP_VALUE_DEFLATE ;
TS_HTTP_VALUE_GZIP = HTTP_VALUE_GZIP ;
TS_HTTP_VALUE_IDENTITY = HTTP_VALUE_IDENTITY ;
TS_HTTP_VALUE_KEEP_ALIVE = HTTP_VALUE_KEEP_ALIVE ;
TS_HTTP_VALUE_MAX_AGE = HTTP_VALUE_MAX_AGE ;
TS_HTTP_VALUE_MAX_STALE = HTTP_VALUE_MAX_STALE ;
TS_HTTP_VALUE_MIN_FRESH = HTTP_VALUE_MIN_FRESH ;
TS_HTTP_VALUE_MUST_REVALIDATE = HTTP_VALUE_MUST_REVALIDATE ;
TS_HTTP_VALUE_NONE = HTTP_VALUE_NONE ;
TS_HTTP_VALUE_NO_CACHE = HTTP_VALUE_NO_CACHE ;
TS_HTTP_VALUE_NO_STORE = HTTP_VALUE_NO_STORE ;
TS_HTTP_VALUE_NO_TRANSFORM = HTTP_VALUE_NO_TRANSFORM ;
TS_HTTP_VALUE_ONLY_IF_CACHED = HTTP_VALUE_ONLY_IF_CACHED ;
TS_HTTP_VALUE_PRIVATE = HTTP_VALUE_PRIVATE ;
TS_HTTP_VALUE_PROXY_REVALIDATE = HTTP_VALUE_PROXY_REVALIDATE ;
TS_HTTP_VALUE_PUBLIC = HTTP_VALUE_PUBLIC ;
TS_HTTP_VALUE_S_MAXAGE = HTTP_VALUE_S_MAXAGE ;
TS_HTTP_LEN_BYTES = HTTP_LEN_BYTES ;
TS_HTTP_LEN_CHUNKED = HTTP_LEN_CHUNKED ;
TS_HTTP_LEN_CLOSE = HTTP_LEN_CLOSE ;
TS_HTTP_LEN_COMPRESS = HTTP_LEN_COMPRESS ;
TS_HTTP_LEN_DEFLATE = HTTP_LEN_DEFLATE ;
TS_HTTP_LEN_GZIP = HTTP_LEN_GZIP ;
TS_HTTP_LEN_IDENTITY = HTTP_LEN_IDENTITY ;
TS_HTTP_LEN_KEEP_ALIVE = HTTP_LEN_KEEP_ALIVE ;
TS_HTTP_LEN_MAX_AGE = HTTP_LEN_MAX_AGE ;
TS_HTTP_LEN_MAX_STALE = HTTP_LEN_MAX_STALE ;
TS_HTTP_LEN_MIN_FRESH = HTTP_LEN_MIN_FRESH ;
TS_HTTP_LEN_MUST_REVALIDATE = HTTP_LEN_MUST_REVALIDATE ;
TS_HTTP_LEN_NONE = HTTP_LEN_NONE ;
TS_HTTP_LEN_NO_CACHE = HTTP_LEN_NO_CACHE ;
TS_HTTP_LEN_NO_STORE = HTTP_LEN_NO_STORE ;
TS_HTTP_LEN_NO_TRANSFORM = HTTP_LEN_NO_TRANSFORM ;
TS_HTTP_LEN_ONLY_IF_CACHED = HTTP_LEN_ONLY_IF_CACHED ;
TS_HTTP_LEN_PRIVATE = HTTP_LEN_PRIVATE ;
TS_HTTP_LEN_PROXY_REVALIDATE = HTTP_LEN_PROXY_REVALIDATE ;
TS_HTTP_LEN_PUBLIC = HTTP_LEN_PUBLIC ;
TS_HTTP_LEN_S_MAXAGE = HTTP_LEN_S_MAXAGE ;
http_global_hooks = new HttpAPIHooks ;
ssl_hooks = new SslAPIHooks ;
lifecycle_hooks = new LifecycleAPIHooks ;
global_config_cbs = new ConfigUpdateCbTable ;
if ( TS_MAX_API_STATS > 0 ) {
api_rsb = RecAllocateRawStatBlock ( TS_MAX_API_STATS ) ;
if ( nullptr == api_rsb ) {
Warning ( "Can't allocate API stats block" ) ;
}
else {
Debug ( "sdk" , "initialized SDK stats APIs with %d slots" , TS_MAX_API_STATS ) ;
}
}
else {
api_rsb = nullptr ;
}
memset ( state_arg_table , 0 , sizeof ( state_arg_table ) ) ;
ink_strlcpy ( traffic_server_version , appVersionInfo . VersionStr , sizeof ( traffic_server_version ) ) ;
if ( sscanf ( traffic_server_version , "%d.%d.%d" , & ts_major_version , & ts_minor_version , & ts_patch_version ) != 3 ) {
Warning ( "Unable to parse traffic server version string '%s'\n" , traffic_server_version ) ;
}
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void libschroedinger_flush ( AVCodecContext * avctx ) {
SchroDecoderParams * p_schro_params = avctx -> priv_data ;
ff_schro_queue_free ( & p_schro_params -> dec_frame_queue , libschroedinger_decode_frame_free ) ;
ff_schro_queue_init ( & p_schro_params -> dec_frame_queue ) ;
schro_decoder_reset ( p_schro_params -> decoder ) ;
p_schro_params -> eos_pulled = 0 ;
p_schro_params -> eos_signalled = 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static unsigned get_current_codepage ( void ) {
return ( - 1 ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void virtio_pci_save_config ( void * opaque , QEMUFile * f ) {
VirtIOPCIProxy * proxy = opaque ;
pci_device_save ( & proxy -> pci_dev , f ) ;
msix_save ( & proxy -> pci_dev , f ) ;
if ( msix_present ( & proxy -> pci_dev ) ) qemu_put_be16 ( f , proxy -> vdev -> config_vector ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void test_bug44495 ( ) {
int rc ;
MYSQL con ;
MYSQL_STMT * stmt ;
DBUG_ENTER ( "test_bug44495" ) ;
myheader ( "test_44495" ) ;
rc = mysql_query ( mysql , "DROP PROCEDURE IF EXISTS p1" ) ;
myquery ( rc ) ;
rc = mysql_query ( mysql , "CREATE PROCEDURE p1(IN arg VARCHAR(25))" " BEGIN SET @stmt = CONCAT('SELECT \"', arg, '\"');
" " PREPARE ps1 FROM @stmt;
" " EXECUTE ps1;
" " DROP PREPARE ps1;
" "END;
" ) ;
myquery ( rc ) ;
DIE_UNLESS ( mysql_client_init ( & con ) ) ;
DIE_UNLESS ( mysql_real_connect ( & con , opt_host , opt_user , opt_password , current_db , opt_port , opt_unix_socket , CLIENT_MULTI_RESULTS ) ) ;
stmt = mysql_simple_prepare ( & con , "CALL p1('abc')" ) ;
check_stmt ( stmt ) ;
rc = mysql_stmt_execute ( stmt ) ;
check_execute ( stmt , rc ) ;
rc = my_process_stmt_result ( stmt ) ;
DIE_UNLESS ( rc == 1 ) ;
mysql_stmt_close ( stmt ) ;
mysql_close ( & con ) ;
rc = mysql_query ( mysql , "DROP PROCEDURE p1" ) ;
myquery ( rc ) ;
DBUG_VOID_RETURN ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void doInsertionSort ( char * array , int32_t length , int32_t itemSize , UComparator * cmp , const void * context , void * pv ) {
int32_t j ;
for ( j = 1 ;
j < length ;
++ j ) {
char * item = array + j * itemSize ;
int32_t insertionPoint = uprv_stableBinarySearch ( array , j , item , itemSize , cmp , context ) ;
if ( insertionPoint < 0 ) {
insertionPoint = ~ insertionPoint ;
}
else {
++ insertionPoint ;
}
if ( insertionPoint < j ) {
char * dest = array + insertionPoint * itemSize ;
uprv_memcpy ( pv , item , itemSize ) ;
uprv_memmove ( dest + itemSize , dest , ( j - insertionPoint ) * ( size_t ) itemSize ) ;
uprv_memcpy ( dest , pv , itemSize ) ;
}
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void gpgsm_set_status_handler ( void * engine , engine_status_handler_t fnc , void * fnc_value ) {
engine_gpgsm_t gpgsm = engine ;
gpgsm -> status . fnc = fnc ;
gpgsm -> status . fnc_value = fnc_value ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
gcry_sexp_t gcry_sexp_car ( const gcry_sexp_t list ) {
return gcry_sexp_nth ( list , 0 ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int get_riff ( AVFormatContext * s , AVIOContext * pb ) {
AVIContext * avi = s -> priv_data ;
char header [ 8 ] = {
0 }
;
int i ;
avio_read ( pb , header , 4 ) ;
avi -> riff_end = avio_rl32 ( pb ) ;
avi -> riff_end += avio_tell ( pb ) ;
avio_read ( pb , header + 4 , 4 ) ;
for ( i = 0 ;
avi_headers [ i ] [ 0 ] ;
i ++ ) if ( ! memcmp ( header , avi_headers [ i ] , 8 ) ) break ;
if ( ! avi_headers [ i ] [ 0 ] ) return AVERROR_INVALIDDATA ;
if ( header [ 7 ] == 0x19 ) av_log ( s , AV_LOG_INFO , "This file has been generated by a totally broken muxer.\n" ) ;
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
TEST_F ( AutocompleteResultTest , CopyOldMatchesWithOneProviderWithoutDefault ) {
TestData last [ ] = {
{
0 , 2 , 1250 , true }
, {
1 , 2 , 1150 , true }
, {
2 , 1 , 900 , false }
, {
3 , 1 , 800 , false }
, {
4 , 1 , 700 , false }
, }
;
TestData current [ ] = {
{
5 , 1 , 1000 , true }
, {
6 , 2 , 800 , false }
, {
7 , 1 , 500 , true }
, }
;
TestData result [ ] = {
{
5 , 1 , 1000 , true }
, {
1 , 2 , 999 , true }
, {
6 , 2 , 800 , false }
, {
4 , 1 , 700 , false }
, {
7 , 1 , 500 , true }
, }
;
ASSERT_NO_FATAL_FAILURE ( RunCopyOldMatchesTest ( last , arraysize ( last ) , current , arraysize ( current ) , result , arraysize ( result ) ) ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static enum fetch_step vbf_stp_retry ( struct worker * wrk , struct busyobj * bo ) {
struct vfp_ctx * vfc ;
CHECK_OBJ_NOTNULL ( wrk , WORKER_MAGIC ) ;
CHECK_OBJ_NOTNULL ( bo , BUSYOBJ_MAGIC ) ;
vfc = bo -> vfc ;
CHECK_OBJ_NOTNULL ( vfc , VFP_CTX_MAGIC ) ;
assert ( bo -> fetch_objcore -> boc -> state <= BOS_REQ_DONE ) ;
VSLb_ts_busyobj ( bo , "Retry" , W_TIM_real ( wrk ) ) ;
assert ( bo -> director_state == DIR_S_NULL ) ;
bo -> storage = NULL ;
bo -> storage_hint = NULL ;
bo -> do_esi = 0 ;
bo -> do_stream = 1 ;
VFP_Setup ( vfc ) ;
VSL_ChgId ( bo -> vsl , "bereq" , "retry" , VXID_Get ( wrk , VSL_BACKENDMARKER ) ) ;
VSLb_ts_busyobj ( bo , "Start" , bo -> t_prev ) ;
http_VSL_log ( bo -> bereq ) ;
return ( F_STP_STARTFETCH ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int i2d_ ## name ( type * a , unsigned char * * out ) ;
DECLARE_ASN1_ITEM ( itname ) # define DECLARE_ASN1_ENCODE_FUNCTIONS_const ( type , name ) type * d2i_ ## name ( type * * a , const unsigned char * * in , long len ) ;
int i2d_ ## name ( const type * a , unsigned char * * out ) ;
DECLARE_ASN1_ITEM ( name ) # define DECLARE_ASN1_NDEF_FUNCTION ( name ) int i2d_ ## name ## _NDEF ( name * a , unsigned char * * out ) ;
# define DECLARE_ASN1_FUNCTIONS_const ( name ) DECLARE_ASN1_ALLOC_FUNCTIONS ( name ) DECLARE_ASN1_ENCODE_FUNCTIONS_const ( name , name ) # define DECLARE_ASN1_ALLOC_FUNCTIONS_name ( type , name ) type * name ## _new ( void ) ;
void name ## _free ( type * a ) ;
# define DECLARE_ASN1_PRINT_FUNCTION ( stname ) DECLARE_ASN1_PRINT_FUNCTION_fname ( stname , stname ) # define DECLARE_ASN1_PRINT_FUNCTION_fname ( stname , fname ) int fname ## _print_ctx ( BIO * out , stname * x , int indent , const ASN1_PCTX * pctx ) ;
# define D2I_OF ( type ) type * ( * ) ( type * * , const unsigned char * * , long ) # define I2D_OF ( type ) int ( * ) ( type * , unsigned char * * ) # define I2D_OF_const ( type ) int ( * ) ( const type * , unsigned char * * ) # define CHECKED_D2I_OF ( type , d2i ) ( ( d2i_of_void * ) ( 1 ? d2i : ( ( D2I_OF ( type ) ) 0 ) ) ) # define CHECKED_I2D_OF ( type , i2d ) ( ( i2d_of_void * ) ( 1 ? i2d : ( ( I2D_OF ( type ) ) 0 ) ) ) # define CHECKED_NEW_OF ( type , xnew ) ( ( void * ( * ) ( void ) ) ( 1 ? xnew : ( ( type * ( * ) ( void ) ) 0 ) ) ) # define CHECKED_PTR_OF ( type , p ) ( ( void * ) ( 1 ? p : ( type * ) 0 ) ) # define CHECKED_PPTR_OF ( type , p ) ( ( void * * ) ( 1 ? p : ( type * * ) 0 ) ) # define TYPEDEF_D2I_OF ( type ) typedef type * d2i_of_ ## type ( type * * , const unsigned char * * , long ) # define TYPEDEF_I2D_OF ( type ) typedef int i2d_of_ ## type ( type * , unsigned char * * ) # define TYPEDEF_D2I2D_OF ( type ) TYPEDEF_D2I_OF ( type ) ;
TYPEDEF_I2D_OF ( type ) TYPEDEF_D2I2D_OF ( void ) ;
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION typedef const ASN1_ITEM ASN1_ITEM_EXP ;
# define ASN1_ITEM_ptr ( iptr ) ( iptr ) # define ASN1_ITEM_ref ( iptr ) ( & ( iptr ## _it ) ) # define ASN1_ITEM_rptr ( ref ) ( & ( ref ## _it ) ) # define DECLARE_ASN1_ITEM ( name ) OPENSSL_EXTERN const ASN1_ITEM name ## _it ;
# else typedef const ASN1_ITEM * ASN1_ITEM_EXP ( void ) ;
# define ASN1_ITEM_ptr ( iptr ) ( iptr ( ) ) # define ASN1_ITEM_ref ( iptr ) ( iptr ## _it ) # define ASN1_ITEM_rptr ( ref ) ( ref ## _it ( ) ) # define DECLARE_ASN1_ITEM ( name ) const ASN1_ITEM * name ## _it ( void ) ;
# endif # define ASN1_STRFLGS_ESC_2253 1 # define ASN1_STRFLGS_ESC_CTRL 2 # define ASN1_STRFLGS_ESC_MSB 4 # define ASN1_STRFLGS_ESC_QUOTE 8 # define CHARTYPE_PRINTABLESTRING 0x10 # define CHARTYPE_FIRST_ESC_2253 0x20 # define CHARTYPE_LAST_ESC_2253 0x40 # define ASN1_STRFLGS_UTF8_CONVERT 0x10 # define ASN1_STRFLGS_IGNORE_TYPE 0x20 # define ASN1_STRFLGS_SHOW_TYPE 0x40 # define ASN1_STRFLGS_DUMP_ALL 0x80 # define ASN1_STRFLGS_DUMP_UNKNOWN 0x100 # define ASN1_STRFLGS_DUMP_DER 0x200 # define ASN1_STRFLGS_ESC_2254 0x400 # define ASN1_STRFLGS_RFC2253 ( ASN1_STRFLGS_ESC_2253 | ASN1_STRFLGS_ESC_CTRL | ASN1_STRFLGS_ESC_MSB | ASN1_STRFLGS_UTF8_CONVERT | ASN1_STRFLGS_DUMP_UNKNOWN | ASN1_STRFLGS_DUMP_DER ) DEFINE_STACK_OF ( ASN1_INTEGER ) DEFINE_STACK_OF ( ASN1_GENERALSTRING ) DEFINE_STACK_OF ( ASN1_UTF8STRING ) typedef struct asn1_type_st {
int type ;
union {
char * ptr ;
ASN1_BOOLEAN boolean ;
ASN1_STRING * asn1_string ;
ASN1_OBJECT * object ;
ASN1_INTEGER * integer ;
ASN1_ENUMERATED * enumerated ;
ASN1_BIT_STRING * bit_string ;
ASN1_OCTET_STRING * octet_string ;
ASN1_PRINTABLESTRING * printablestring ;
ASN1_T61STRING * t61string ;
ASN1_IA5STRING * ia5string ;
ASN1_GENERALSTRING * generalstring ;
ASN1_BMPSTRING * bmpstring ;
ASN1_UNIVERSALSTRING * universalstring ;
ASN1_UTCTIME * utctime ;
ASN1_GENERALIZEDTIME * generalizedtime ;
ASN1_VISIBLESTRING * visiblestring ;
ASN1_UTF8STRING * utf8string ;
ASN1_STRING * set ;
ASN1_STRING * sequence ;
ASN1_VALUE * asn1_value ;
}
value ;
}
ASN1_TYPE ;
DEFINE_STACK_OF ( ASN1_TYPE ) typedef STACK_OF ( ASN1_TYPE ) ASN1_SEQUENCE_ANY ;
DECLARE_ASN1_ENCODE_FUNCTIONS_const ( ASN1_SEQUENCE_ANY , ASN1_SEQUENCE_ANY ) DECLARE_ASN1_ENCODE_FUNCTIONS_const ( ASN1_SEQUENCE_ANY , ASN1_SET_ANY ) typedef struct BIT_STRING_BITNAME_st {
int bitnum ;
const char * lname ;
const char * sname ;
}
BIT_STRING_BITNAME ;
# define B_ASN1_TIME B_ASN1_UTCTIME | B_ASN1_GENERALIZEDTIME # define B_ASN1_PRINTABLE B_ASN1_NUMERICSTRING | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING | B_ASN1_BIT_STRING | B_ASN1_UNIVERSALSTRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING | B_ASN1_SEQUENCE | B_ASN1_UNKNOWN # define B_ASN1_DIRECTORYSTRING B_ASN1_PRINTABLESTRING | B_ASN1_TELETEXSTRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING | B_ASN1_UTF8STRING # define B_ASN1_DISPLAYTEXT B_ASN1_IA5STRING | B_ASN1_VISIBLESTRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING DECLARE_ASN1_FUNCTIONS_fname ( ASN1_TYPE , ASN1_ANY , ASN1_TYPE ) int ASN1_TYPE_get ( const ASN1_TYPE * a ) ;
void ASN1_TYPE_set ( ASN1_TYPE * a , int type , void * value ) ;
int ASN1_TYPE_set1 ( ASN1_TYPE * a , int type , const void * value ) ;
int ASN1_TYPE_cmp ( const ASN1_TYPE * a , const ASN1_TYPE * b ) ;
ASN1_TYPE * ASN1_TYPE_pack_sequence ( const ASN1_ITEM * it , void * s , ASN1_TYPE * * t ) ;
void * ASN1_TYPE_unpack_sequence ( const ASN1_ITEM * it , const ASN1_TYPE * t ) ;
ASN1_OBJECT * ASN1_OBJECT_new ( void ) ;
void ASN1_OBJECT_free ( ASN1_OBJECT * a ) ;
int i2d_ASN1_OBJECT ( const ASN1_OBJECT * a , unsigned char * * pp ) ;
ASN1_OBJECT * d2i_ASN1_OBJECT ( ASN1_OBJECT * * a , const unsigned char * * pp , long length ) ;
DECLARE_ASN1_ITEM ( ASN1_OBJECT ) DEFINE_STACK_OF ( ASN1_OBJECT ) ASN1_STRING * ASN1_STRING_new ( void ) ;
void ASN1_STRING_free ( ASN1_STRING * a ) ;
void ASN1_STRING_clear_free ( ASN1_STRING * a ) ;
int ASN1_STRING_copy ( ASN1_STRING * dst , const ASN1_STRING * str ) ;
ASN1_STRING * ASN1_STRING_dup ( const ASN1_STRING * a ) ;
ASN1_STRING * ASN1_STRING_type_new ( int type ) ;
int ASN1_STRING_cmp ( const ASN1_STRING * a , const ASN1_STRING * b ) ;
int ASN1_STRING_set ( ASN1_STRING * str , const void * data , int len ) ;
void ASN1_STRING_set0 ( ASN1_STRING * str , void * data , int len ) ;
int ASN1_STRING_length ( const ASN1_STRING * x ) ;
void ASN1_STRING_length_set ( ASN1_STRING * x , int n ) ;
int ASN1_STRING_type ( const ASN1_STRING * x ) ;
DEPRECATEDIN_1_1_0 ( unsigned char * ASN1_STRING_data ( ASN1_STRING * x ) ) const unsigned char * ASN1_STRING_get0_data ( const ASN1_STRING * x ) ;
DECLARE_ASN1_FUNCTIONS ( ASN1_BIT_STRING ) int ASN1_BIT_STRING_set ( ASN1_BIT_STRING * a , unsigned char * d , int length ) ;
int ASN1_BIT_STRING_set_bit ( ASN1_BIT_STRING * a , int n , int value ) ;
int ASN1_BIT_STRING_get_bit ( const ASN1_BIT_STRING * a , int n ) ;
int ASN1_BIT_STRING_check ( const ASN1_BIT_STRING * a , const unsigned char * flags , int flags_len ) ;
int ASN1_BIT_STRING_name_print ( BIO * out , ASN1_BIT_STRING * bs , BIT_STRING_BITNAME * tbl , int indent ) ;
int ASN1_BIT_STRING_num_asc ( const char * name , BIT_STRING_BITNAME * tbl ) ;
int ASN1_BIT_STRING_set_asc ( ASN1_BIT_STRING * bs , const char * name , int value , BIT_STRING_BITNAME * tbl ) ;
DECLARE_ASN1_FUNCTIONS ( ASN1_INTEGER ) ASN1_INTEGER * d2i_ASN1_UINTEGER ( ASN1_INTEGER * * a , const unsigned char * * pp , long length ) ;
ASN1_INTEGER * ASN1_INTEGER_dup ( const ASN1_INTEGER * x ) ;
int ASN1_INTEGER_cmp ( const ASN1_INTEGER * x , const ASN1_INTEGER * y ) ;
DECLARE_ASN1_FUNCTIONS ( ASN1_ENUMERATED ) int ASN1_UTCTIME_check ( const ASN1_UTCTIME * a ) ;
ASN1_UTCTIME * ASN1_UTCTIME_set ( ASN1_UTCTIME * s , time_t t ) ;
ASN1_UTCTIME * ASN1_UTCTIME_adj ( ASN1_UTCTIME * s , time_t t , int offset_day , long offset_sec ) ;
int ASN1_UTCTIME_set_string ( ASN1_UTCTIME * s , const char * str ) ;
int ASN1_UTCTIME_cmp_time_t ( const ASN1_UTCTIME * s , time_t t ) ;
int ASN1_GENERALIZEDTIME_check ( const ASN1_GENERALIZEDTIME * a ) ;
ASN1_GENERALIZEDTIME * ASN1_GENERALIZEDTIME_set ( ASN1_GENERALIZEDTIME * s , time_t t ) ;
ASN1_GENERALIZEDTIME * ASN1_GENERALIZEDTIME_adj ( ASN1_GENERALIZEDTIME * s , time_t t , int offset_day , long offset_sec ) ;
int ASN1_GENERALIZEDTIME_set_string ( ASN1_GENERALIZEDTIME * s , const char * str ) ;
int ASN1_TIME_diff ( int * pday , int * psec , const ASN1_TIME * from , const ASN1_TIME * to ) ;
DECLARE_ASN1_FUNCTIONS ( ASN1_OCTET_STRING ) ASN1_OCTET_STRING * ASN1_OCTET_STRING_dup ( const ASN1_OCTET_STRING * a ) ;
int ASN1_OCTET_STRING_cmp ( const ASN1_OCTET_STRING * a , const ASN1_OCTET_STRING * b ) ;
int ASN1_OCTET_STRING_set ( ASN1_OCTET_STRING * str , const unsigned char * data , int len ) ;
DECLARE_ASN1_FUNCTIONS ( ASN1_VISIBLESTRING ) DECLARE_ASN1_FUNCTIONS ( ASN1_UNIVERSALSTRING ) DECLARE_ASN1_FUNCTIONS ( ASN1_UTF8STRING ) DECLARE_ASN1_FUNCTIONS ( ASN1_NULL ) DECLARE_ASN1_FUNCTIONS ( ASN1_BMPSTRING ) int UTF8_getc ( const unsigned char * str , int len , unsigned long * val ) ;
int UTF8_putc ( unsigned char * str , int len , unsigned long value ) ;
DECLARE_ASN1_FUNCTIONS_name ( ASN1_STRING , ASN1_PRINTABLE ) DECLARE_ASN1_FUNCTIONS_name ( ASN1_STRING , DIRECTORYSTRING ) DECLARE_ASN1_FUNCTIONS_name ( ASN1_STRING , DISPLAYTEXT ) DECLARE_ASN1_FUNCTIONS ( ASN1_PRINTABLESTRING ) DECLARE_ASN1_FUNCTIONS ( ASN1_T61STRING ) DECLARE_ASN1_FUNCTIONS ( ASN1_IA5STRING ) DECLARE_ASN1_FUNCTIONS ( ASN1_GENERALSTRING )
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static const char * cmd_unicode_map ( cmd_parms * cmd , void * _dcfg , const char * p1 ) {
const char * filename = resolve_relative_path ( cmd -> pool , cmd -> directive -> filename , p1 ) ;
char * error_msg ;
directory_config * dcfg = ( directory_config * ) _dcfg ;
if ( dcfg == NULL ) return NULL ;
if ( unicode_map_init ( dcfg , filename , & error_msg ) <= 0 ) {
return error_msg ;
}
return NULL ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
xsltDocumentPtr xsltNewDocument ( xsltTransformContextPtr ctxt , xmlDocPtr doc ) {
xsltDocumentPtr cur ;
cur = ( xsltDocumentPtr ) xmlMalloc ( sizeof ( xsltDocument ) ) ;
if ( cur == NULL ) {
xsltTransformError ( ctxt , NULL , ( xmlNodePtr ) doc , "xsltNewDocument : malloc failed\n" ) ;
return ( NULL ) ;
}
memset ( cur , 0 , sizeof ( xsltDocument ) ) ;
cur -> doc = doc ;
if ( ctxt != NULL ) {
if ( ! XSLT_IS_RES_TREE_FRAG ( doc ) ) {
cur -> next = ctxt -> docList ;
ctxt -> docList = cur ;
}
}
return ( cur ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void add_mrange ( fz_context * ctx , pdf_cmap * cmap , unsigned int low , int * out , int len ) {
int out_pos ;
if ( cmap -> dlen + len + 1 > cmap -> dcap ) {
int new_cap = cmap -> dcap ? cmap -> dcap * 2 : 256 ;
cmap -> dict = fz_resize_array ( ctx , cmap -> dict , new_cap , sizeof * cmap -> dict ) ;
cmap -> dcap = new_cap ;
}
out_pos = cmap -> dlen ;
cmap -> dict [ out_pos ] = len ;
memcpy ( & cmap -> dict [ out_pos + 1 ] , out , sizeof ( int ) * len ) ;
cmap -> dlen += len + 1 ;
add_range ( ctx , cmap , low , low , out_pos , 1 , 1 ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
my_bool end_of_query ( int c ) {
return match_delimiter ( c , delimiter , delimiter_length ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int SpoolssAddPrinterDriver_r ( tvbuff_t * tvb , int offset , packet_info * pinfo , proto_tree * tree , dcerpc_info * di , guint8 * drep _U_ ) {
offset = dissect_doserror ( tvb , offset , pinfo , tree , di , drep , hf_rc , NULL ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static PyObject * string__format__ ( PyObject * self , PyObject * args ) {
PyObject * format_spec ;
PyObject * result = NULL ;
PyObject * tmp = NULL ;
if ( ! PyArg_ParseTuple ( args , "O:__format__" , & format_spec ) ) goto done ;
if ( ! ( PyString_Check ( format_spec ) || PyUnicode_Check ( format_spec ) ) ) {
PyErr_Format ( PyExc_TypeError , "__format__ arg must be str " "or unicode, not %s" , Py_TYPE ( format_spec ) -> tp_name ) ;
goto done ;
}
tmp = PyObject_Str ( format_spec ) ;
if ( tmp == NULL ) goto done ;
format_spec = tmp ;
result = _PyBytes_FormatAdvanced ( self , PyString_AS_STRING ( format_spec ) , PyString_GET_SIZE ( format_spec ) ) ;
done : Py_XDECREF ( tmp ) ;
return result ;
}
| 0False
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.