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 dissect_h245_G7231AnnexCCapability ( 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_G7231AnnexCCapability , G7231AnnexCCapability_sequence ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void pdf_run_ri ( fz_context * ctx , pdf_processor * proc , const char * intent ) {
pdf_run_processor * pr = ( pdf_run_processor * ) proc ;
pdf_gstate * gstate = pdf_flush_text ( ctx , pr ) ;
gstate -> fill . color_params . ri = fz_lookup_rendering_intent ( intent ) ;
gstate -> stroke . color_params . ri = gstate -> fill . color_params . ri ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static inline int ipv6_addr_src_scope ( const struct in6_addr * addr ) {
return __ipv6_addr_src_scope ( __ipv6_addr_type ( addr ) ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static XHCIStreamContext * xhci_alloc_stream_contexts ( unsigned count , dma_addr_t base ) {
XHCIStreamContext * stctx ;
unsigned int i ;
stctx = g_new0 ( XHCIStreamContext , count ) ;
for ( i = 0 ;
i < count ;
i ++ ) {
stctx [ i ] . pctx = base + i * 16 ;
stctx [ i ] . sct = - 1 ;
}
return stctx ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static inline int match_prefix ( char * prefix , int plen , char * option , int olen ) {
if ( plen > olen ) return 0 ;
return ! memcmp ( prefix , option , plen ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void handle_connections_sockets ( ) {
my_socket UNINIT_VAR ( sock ) , UNINIT_VAR ( new_sock ) ;
uint error_count = 0 ;
THD * thd ;
struct sockaddr_storage cAddr ;
int ip_flags __attribute__ ( ( unused ) ) = 0 ;
int socket_flags __attribute__ ( ( unused ) ) = 0 ;
int extra_ip_flags __attribute__ ( ( unused ) ) = 0 ;
int flags = 0 , retval ;
st_vio * vio_tmp ;
# ifdef HAVE_POLL int socket_count = 0 ;
struct pollfd fds [ 3 ] ;
# define setup_fds ( X ) fds [ socket_count ] . fd = X ;
fds [ socket_count ] . events = POLLIN ;
socket_count ++ # else fd_set readFDs , clientFDs ;
uint max_used_connection = ( uint ) max ( max ( base_ip_sock , unix_sock ) , extra_ip_sock ) + 1 ;
# define setup_fds ( X ) FD_SET ( X , & clientFDs ) FD_ZERO ( & clientFDs ) ;
# endif DBUG_ENTER ( "handle_connections_sockets" ) ;
if ( base_ip_sock != INVALID_SOCKET ) {
setup_fds ( base_ip_sock ) ;
ip_flags = fcntl ( base_ip_sock , F_GETFL , 0 ) ;
}
if ( extra_ip_sock != INVALID_SOCKET ) {
setup_fds ( extra_ip_sock ) ;
extra_ip_flags = fcntl ( extra_ip_sock , F_GETFL , 0 ) ;
}
# ifdef HAVE_SYS_UN_H setup_fds ( unix_sock ) ;
socket_flags = fcntl ( unix_sock , F_GETFL , 0 ) ;
# endif DBUG_PRINT ( "general" , ( "Waiting for connections." ) ) ;
MAYBE_BROKEN_SYSCALL ;
while ( ! abort_loop ) {
# ifdef HAVE_POLL retval = poll ( fds , socket_count , - 1 ) ;
# else readFDs = clientFDs ;
retval = select ( ( int ) max_used_connection , & readFDs , 0 , 0 , 0 ) ;
# endif if ( retval < 0 ) {
if ( socket_errno != SOCKET_EINTR ) {
if ( ! select_errors ++ && ! abort_loop ) sql_print_error ( "mysqld: Got error %d from select" , socket_errno ) ;
}
MAYBE_BROKEN_SYSCALL continue ;
}
if ( abort_loop ) {
MAYBE_BROKEN_SYSCALL ;
break ;
}
# ifdef HAVE_POLL for ( int i = 0 ;
i < socket_count ;
++ i ) {
if ( fds [ i ] . revents & POLLIN ) {
sock = fds [ i ] . fd ;
flags = fcntl ( sock , F_GETFL , 0 ) ;
break ;
}
}
# else if ( FD_ISSET ( base_ip_sock , & readFDs ) ) {
sock = base_ip_sock ;
flags = ip_flags ;
}
else if ( FD_ISSET ( extra_ip_sock , & readFDs ) ) {
sock = extra_ip_sock ;
flags = extra_ip_flags ;
}
else {
sock = unix_sock ;
flags = socket_flags ;
}
# endif # if ! defined ( NO_FCNTL_NONBLOCK ) if ( ! ( test_flags & TEST_BLOCKING ) ) {
# if defined ( O_NONBLOCK ) fcntl ( sock , F_SETFL , flags | O_NONBLOCK ) ;
# elif defined ( O_NDELAY ) fcntl ( sock , F_SETFL , flags | O_NDELAY ) ;
# endif }
# endif for ( uint retry = 0 ;
retry < MAX_ACCEPT_RETRY ;
retry ++ ) {
size_socket length = sizeof ( struct sockaddr_storage ) ;
new_sock = accept ( sock , ( struct sockaddr * ) ( & cAddr ) , & length ) ;
if ( new_sock != INVALID_SOCKET || ( socket_errno != SOCKET_EINTR && socket_errno != SOCKET_EAGAIN ) ) break ;
MAYBE_BROKEN_SYSCALL ;
# if ! defined ( NO_FCNTL_NONBLOCK ) if ( ! ( test_flags & TEST_BLOCKING ) ) {
if ( retry == MAX_ACCEPT_RETRY - 1 ) fcntl ( sock , F_SETFL , flags ) ;
}
# endif }
# if ! defined ( NO_FCNTL_NONBLOCK ) if ( ! ( test_flags & TEST_BLOCKING ) ) fcntl ( sock , F_SETFL , flags ) ;
# endif if ( new_sock == INVALID_SOCKET ) {
if ( ( error_count ++ & 255 ) == 0 ) sql_perror ( "Error in accept" ) ;
MAYBE_BROKEN_SYSCALL ;
if ( socket_errno == SOCKET_ENFILE || socket_errno == SOCKET_EMFILE ) sleep ( 1 ) ;
continue ;
}
# ifdef HAVE_LIBWRAP {
if ( sock == base_ip_sock || sock == extra_ip_sock ) {
struct request_info req ;
signal ( SIGCHLD , SIG_DFL ) ;
request_init ( & req , RQ_DAEMON , libwrapName , RQ_FILE , new_sock , NULL ) ;
my_fromhost ( & req ) ;
if ( ! my_hosts_access ( & req ) ) {
syslog ( deny_severity , "refused connect from %s" , my_eval_client ( & req ) ) ;
if ( req . sink ) ( ( void ( * ) ( int ) ) req . sink ) ( req . fd ) ;
( void ) mysql_socket_shutdown ( new_sock , SHUT_RDWR ) ;
( void ) closesocket ( new_sock ) ;
continue ;
}
}
}
# endif {
size_socket dummyLen ;
struct sockaddr_storage dummy ;
dummyLen = sizeof ( dummy ) ;
if ( getsockname ( new_sock , ( struct sockaddr * ) & dummy , ( SOCKET_SIZE_TYPE * ) & dummyLen ) < 0 ) {
sql_perror ( "Error on new connection socket" ) ;
( void ) mysql_socket_shutdown ( new_sock , SHUT_RDWR ) ;
( void ) closesocket ( new_sock ) ;
continue ;
}
}
if ( ! ( thd = new THD ) ) {
( void ) mysql_socket_shutdown ( new_sock , SHUT_RDWR ) ;
( void ) closesocket ( new_sock ) ;
continue ;
}
if ( ! ( vio_tmp = vio_new ( new_sock , sock == unix_sock ? VIO_TYPE_SOCKET : VIO_TYPE_TCPIP , sock == unix_sock ? VIO_LOCALHOST : 0 ) ) || my_net_init ( & thd -> net , vio_tmp ) ) {
if ( vio_tmp && thd -> net . vio != vio_tmp ) vio_delete ( vio_tmp ) ;
else {
( void ) mysql_socket_shutdown ( new_sock , SHUT_RDWR ) ;
( void ) closesocket ( new_sock ) ;
}
delete thd ;
continue ;
}
if ( sock == unix_sock ) thd -> security_ctx -> host = ( char * ) my_localhost ;
if ( sock == extra_ip_sock ) {
thd -> extra_port = 1 ;
thd -> scheduler = extra_thread_scheduler ;
}
create_new_thread ( thd ) ;
}
DBUG_VOID_RETURN ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
hb_unicode_funcs_t * hb_icu_get_unicode_funcs ( void ) {
static const hb_unicode_funcs_t _hb_icu_unicode_funcs = {
HB_OBJECT_HEADER_STATIC , NULL , true , {
# define HB_UNICODE_FUNC_IMPLEMENT ( name ) hb_icu_unicode_ ## name , HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS # undef HB_UNICODE_FUNC_IMPLEMENT }
}
;
# if U_ICU_VERSION_MAJOR_NUM >= 49 if ( ! hb_atomic_ptr_get ( & normalizer ) ) {
UErrorCode icu_err = U_ZERO_ERROR ;
hb_atomic_ptr_cmpexch ( & normalizer , NULL , unorm2_getNFCInstance ( & icu_err ) ) ;
}
# endif return const_cast < hb_unicode_funcs_t * > ( & _hb_icu_unicode_funcs ) ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int test_forward_match ( xd3_stream * stream , int unused ) {
usize_t i ;
uint8_t buf1 [ 256 ] , buf2 [ 256 ] ;
memset ( buf1 , 0 , 256 ) ;
memset ( buf2 , 0 , 256 ) ;
for ( i = 0 ;
i < 256 ;
i ++ ) {
CHECK ( xd3_forward_match ( buf1 , buf2 , i ) == ( int ) i ) ;
}
for ( i = 0 ;
i < 255 ;
i ++ ) {
buf2 [ i ] = 1 ;
CHECK ( xd3_forward_match ( buf1 , buf2 , 256 ) == ( int ) i ) ;
buf2 [ i ] = 0 ;
}
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int main_file_exists ( main_file * xfile ) {
struct stat sbuf ;
return stat ( xfile -> filename , & sbuf ) == 0 && S_ISREG ( sbuf . st_mode ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void circlearcto ( real a1 , real a2 , real cx , real cy , real r , SplineSet * cur , real * transform ) {
SplinePoint * pt ;
DBasePoint temp , base , cp ;
real cplen ;
int sign = 1 ;
real s1 , s2 , c1 , c2 ;
if ( a1 == a2 ) return ;
cplen = ( a2 - a1 ) / 90 * r * .552 ;
a1 *= 3.1415926535897932 / 180 ;
a2 *= 3.1415926535897932 / 180 ;
s1 = sin ( a1 ) ;
s2 = sin ( a2 ) ;
c1 = cos ( a1 ) ;
c2 = cos ( a2 ) ;
temp . x = cx + r * c2 ;
temp . y = cy + r * s2 ;
base . x = cx + r * c1 ;
base . y = cy + r * s1 ;
pt = chunkalloc ( sizeof ( SplinePoint ) ) ;
Transform ( & pt -> me , & temp , transform ) ;
cp . x = temp . x - cplen * s2 ;
cp . y = temp . y + cplen * c2 ;
if ( ( cp . x - base . x ) * ( cp . x - base . x ) + ( cp . y - base . y ) * ( cp . y - base . y ) > ( temp . x - base . x ) * ( temp . x - base . x ) + ( temp . y - base . y ) * ( temp . y - base . y ) ) {
sign = - 1 ;
cp . x = temp . x + cplen * s2 ;
cp . y = temp . y - cplen * c2 ;
}
Transform ( & pt -> prevcp , & cp , transform ) ;
pt -> nonextcp = true ;
cp . x = base . x + sign * cplen * s1 ;
cp . y = base . y - sign * cplen * c1 ;
Transform ( & cur -> last -> nextcp , & cp , transform ) ;
cur -> last -> nonextcp = false ;
CheckMake ( cur -> last , pt ) ;
SplineMake3 ( cur -> last , pt ) ;
cur -> last = pt ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int cinepak_decode_strip ( CinepakContext * s , cvid_strip * strip , const uint8_t * data , int size ) {
const uint8_t * eod = ( data + size ) ;
int chunk_id , chunk_size ;
if ( strip -> x2 > s -> width || strip -> y2 > s -> height || strip -> x1 >= strip -> x2 || strip -> y1 >= strip -> y2 ) return AVERROR_INVALIDDATA ;
while ( ( data + 4 ) <= eod ) {
chunk_id = data [ 0 ] ;
chunk_size = AV_RB24 ( & data [ 1 ] ) - 4 ;
if ( chunk_size < 0 ) return AVERROR_INVALIDDATA ;
data += 4 ;
chunk_size = ( ( data + chunk_size ) > eod ) ? ( eod - data ) : chunk_size ;
switch ( chunk_id ) {
case 0x20 : case 0x21 : case 0x24 : case 0x25 : cinepak_decode_codebook ( strip -> v4_codebook , chunk_id , chunk_size , data ) ;
break ;
case 0x22 : case 0x23 : case 0x26 : case 0x27 : cinepak_decode_codebook ( strip -> v1_codebook , chunk_id , chunk_size , data ) ;
break ;
case 0x30 : case 0x31 : case 0x32 : return cinepak_decode_vectors ( s , strip , chunk_id , chunk_size , data ) ;
}
data += chunk_size ;
}
return AVERROR_INVALIDDATA ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void evdns_close_server_port ( struct evdns_server_port * port ) {
if ( -- port -> refcnt == 0 ) server_port_free ( port ) ;
port -> closing = 1 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void bug20023_change_user ( MYSQL * con ) {
DIE_IF ( mysql_change_user ( con , opt_user , opt_password , opt_db ? opt_db : "test" ) ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void test_warnings ( ) {
int rc ;
MYSQL_RES * result ;
myheader ( "test_warnings" ) ;
mysql_query ( mysql , "DROP TABLE if exists test_non_exists" ) ;
rc = mysql_query ( mysql , "DROP TABLE if exists test_non_exists" ) ;
myquery ( rc ) ;
if ( ! opt_silent ) fprintf ( stdout , "\n total warnings: %d" , mysql_warning_count ( mysql ) ) ;
rc = mysql_query ( mysql , "SHOW WARNINGS" ) ;
myquery ( rc ) ;
result = mysql_store_result ( mysql ) ;
mytest ( result ) ;
rc = my_process_result_set ( result ) ;
DIE_UNLESS ( rc == 1 ) ;
mysql_free_result ( result ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
EC_KEY * d2i_ECPrivateKey_bio ( BIO * bp , EC_KEY * * eckey ) {
return ASN1_d2i_bio_of ( EC_KEY , EC_KEY_new , d2i_ECPrivateKey , bp , eckey ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void vout_del_buffer ( decoder_t * p_dec , picture_t * p_pic ) {
vout_ReleasePicture ( p_dec -> p_owner -> p_vout , p_pic ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
TEST_F ( TemplateURLTest , ReplaceSearchTerms ) {
struct TestData {
const std : : string url ;
const std : : string expected_result ;
}
test_data [ ] = {
{
"http://foo/{
language}
{
searchTerms}
{
inputEncoding}
" , "http://foo/{
language}
XUTF-8" }
, {
"http://foo/{
language}
{
inputEncoding}
{
searchTerms}
" , "http://foo/{
language}
UTF-8X" }
, {
"http://foo/{
searchTerms}
{
language}
{
inputEncoding}
" , "http://foo/X{
language}
UTF-8" }
, {
"http://foo/{
searchTerms}
{
inputEncoding}
{
language}
" , "http://foo/XUTF-8{
language}
" }
, {
"http://foo/{
inputEncoding}
{
searchTerms}
{
language}
" , "http://foo/UTF-8X{
language}
" }
, {
"http://foo/{
inputEncoding}
{
language}
{
searchTerms}
" , "http://foo/UTF-8{
language}
X" }
, {
"http://foo/{
language}
a{
searchTerms}
a{
inputEncoding}
a" , "http://foo/{
language}
aXaUTF-8a" }
, {
"http://foo/{
language}
a{
inputEncoding}
a{
searchTerms}
a" , "http://foo/{
language}
aUTF-8aXa" }
, {
"http://foo/{
searchTerms}
a{
language}
a{
inputEncoding}
a" , "http://foo/Xa{
language}
aUTF-8a" }
, {
"http://foo/{
searchTerms}
a{
inputEncoding}
a{
language}
a" , "http://foo/XaUTF-8a{
language}
a" }
, {
"http://foo/{
inputEncoding}
a{
searchTerms}
a{
language}
a" , "http://foo/UTF-8aXa{
language}
a" }
, {
"http://foo/{
inputEncoding}
a{
language}
a{
searchTerms}
a" , "http://foo/UTF-8a{
language}
aXa" }
, }
;
TemplateURLData data ;
data . input_encodings . push_back ( "UTF-8" ) ;
for ( size_t i = 0 ;
i < arraysize ( test_data ) ;
++ i ) {
data . SetURL ( test_data [ i ] . url ) ;
TemplateURL url ( data ) ;
EXPECT_TRUE ( url . url_ref ( ) . IsValid ( search_terms_data_ ) ) ;
ASSERT_TRUE ( url . url_ref ( ) . SupportsReplacement ( search_terms_data_ ) ) ;
std : : string expected_result = test_data [ i ] . expected_result ;
base : : ReplaceSubstringsAfterOffset ( & expected_result , 0 , "{
language}
" , search_terms_data_ . GetApplicationLocale ( ) ) ;
GURL result ( url . url_ref ( ) . ReplaceSearchTerms ( TemplateURLRef : : SearchTermsArgs ( ASCIIToUTF16 ( "X" ) ) , search_terms_data_ ) ) ;
ASSERT_TRUE ( result . is_valid ( ) ) ;
EXPECT_EQ ( expected_result , result . spec ( ) ) ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void add_converter ( struct archive_string_conv * sc , int ( * converter ) ( struct archive_string * , const void * , size_t , struct archive_string_conv * ) ) {
if ( sc == NULL || sc -> nconverter >= 2 ) __archive_errx ( 1 , "Programing error" ) ;
sc -> converter [ sc -> nconverter ++ ] = converter ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void dissect_zcl_groups_view_group_response ( tvbuff_t * tvb , proto_tree * tree , guint * offset ) {
guint attr_uint ;
guint8 * attr_string ;
proto_tree_add_item ( tree , hf_zbee_zcl_groups_status , tvb , * offset , 1 , ENC_LITTLE_ENDIAN ) ;
* offset += 1 ;
proto_tree_add_item ( tree , hf_zbee_zcl_groups_group_id , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ;
* offset += 2 ;
attr_uint = tvb_get_guint8 ( tvb , * offset ) ;
if ( attr_uint == 0xff ) attr_uint = 0 ;
proto_tree_add_uint ( tree , hf_zbee_zcl_groups_attr_str_len , tvb , * offset , 1 , attr_uint ) ;
* offset += 1 ;
attr_string = tvb_get_string_enc ( wmem_packet_scope ( ) , tvb , * offset , attr_uint , ENC_ASCII ) ;
proto_item_append_text ( tree , ", String: %s" , attr_string ) ;
proto_tree_add_string ( tree , hf_zbee_zcl_groups_attr_str , tvb , * offset , attr_uint , attr_string ) ;
* offset += attr_uint ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int32_t compareUnicode ( UCMTable * lTable , const UCMapping * l , UCMTable * rTable , const UCMapping * r ) {
const UChar32 * lu , * ru ;
int32_t result , i , length ;
if ( l -> uLen == 1 && r -> uLen == 1 ) {
return l -> u - r -> u ;
}
lu = UCM_GET_CODE_POINTS ( lTable , l ) ;
ru = UCM_GET_CODE_POINTS ( rTable , r ) ;
if ( l -> uLen <= r -> uLen ) {
length = l -> uLen ;
}
else {
length = r -> uLen ;
}
for ( i = 0 ;
i < length ;
++ i ) {
result = lu [ i ] - ru [ i ] ;
if ( result != 0 ) {
return result ;
}
}
return l -> uLen - r -> uLen ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int sort_record_index ( MI_SORT_PARAM * sort_param , MI_INFO * info , MI_KEYDEF * keyinfo , my_off_t page , uchar * buff , uint sort_key , File new_file , my_bool update_index ) {
uint nod_flag , used_length , key_length ;
uchar * temp_buff , * keypos , * endpos ;
my_off_t next_page , rec_pos ;
uchar lastkey [ MI_MAX_KEY_BUFF ] ;
char llbuff [ 22 ] ;
SORT_INFO * sort_info = sort_param -> sort_info ;
MI_CHECK * param = sort_info -> param ;
DBUG_ENTER ( "sort_record_index" ) ;
nod_flag = mi_test_if_nod ( buff ) ;
temp_buff = 0 ;
if ( nod_flag ) {
if ( ! ( temp_buff = ( uchar * ) my_alloca ( ( uint ) keyinfo -> block_length ) ) ) {
mi_check_print_error ( param , "Not Enough memory" ) ;
DBUG_RETURN ( - 1 ) ;
}
}
used_length = mi_getint ( buff ) ;
keypos = buff + 2 + nod_flag ;
endpos = buff + used_length ;
for ( ;
;
) {
if ( nod_flag ) {
next_page = _mi_kpos ( nod_flag , keypos ) ;
if ( my_pread ( info -> s -> kfile , ( uchar * ) temp_buff , ( uint ) keyinfo -> block_length , next_page , MYF ( MY_NABP + MY_WME ) ) ) {
mi_check_print_error ( param , "Can't read keys from filepos: %s" , llstr ( next_page , llbuff ) ) ;
goto err ;
}
if ( sort_record_index ( sort_param , info , keyinfo , next_page , temp_buff , sort_key , new_file , update_index ) ) goto err ;
}
if ( keypos >= endpos || ( key_length = ( * keyinfo -> get_key ) ( keyinfo , nod_flag , & keypos , lastkey ) ) == 0 ) break ;
rec_pos = _mi_dpos ( info , 0 , lastkey + key_length ) ;
if ( ( * info -> s -> read_rnd ) ( info , sort_param -> record , rec_pos , 0 ) ) {
mi_check_print_error ( param , "%d when reading datafile" , my_errno ) ;
goto err ;
}
if ( rec_pos != sort_param -> filepos && update_index ) {
_mi_dpointer ( info , keypos - nod_flag - info -> s -> rec_reflength , sort_param -> filepos ) ;
if ( movepoint ( info , sort_param -> record , rec_pos , sort_param -> filepos , sort_key ) ) {
mi_check_print_error ( param , "%d when updating key-pointers" , my_errno ) ;
goto err ;
}
}
if ( sort_write_record ( sort_param ) ) goto err ;
}
bzero ( ( uchar * ) buff + used_length , keyinfo -> block_length - used_length ) ;
if ( my_pwrite ( info -> s -> kfile , ( uchar * ) buff , ( uint ) keyinfo -> block_length , page , param -> myf_rw ) ) {
mi_check_print_error ( param , "%d when updating keyblock" , my_errno ) ;
goto err ;
}
if ( temp_buff ) my_afree ( ( uchar * ) temp_buff ) ;
DBUG_RETURN ( 0 ) ;
err : if ( temp_buff ) my_afree ( ( uchar * ) temp_buff ) ;
DBUG_RETURN ( 1 ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static inline bool is_one_of ( const hb_glyph_info_t & info , unsigned int flags ) {
if ( _hb_glyph_info_ligated ( & info ) ) return false ;
return ! ! ( FLAG_SAFE ( info . myanmar_category ( ) ) & flags ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static inline void SetPixelBlueTraits ( Image * image , const PixelTrait traits ) {
image -> channel_map [ BluePixelChannel ] . traits = traits ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
fz_colorspace * fz_device_gray ( fz_context * ctx ) {
return ctx -> colorspace -> gray ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int tipc_netlink_compat_start ( void ) {
int res ;
res = genl_register_family_with_ops ( & tipc_genl_compat_family , tipc_genl_compat_ops ) ;
if ( res ) {
pr_err ( "Failed to register legacy compat interface\n" ) ;
return res ;
}
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
long dtls1_default_timeout ( void ) {
return ( 60 * 60 * 2 ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void nonrd_pick_partition ( VP9_COMP * cpi , const TileInfo * const tile , TOKENEXTRA * * tp , int mi_row , int mi_col , BLOCK_SIZE bsize , int * rate , int64_t * dist , int do_recon , int64_t best_rd , PC_TREE * pc_tree ) {
const SPEED_FEATURES * const sf = & cpi -> sf ;
const VP9EncoderConfig * const oxcf = & cpi -> oxcf ;
VP9_COMMON * const cm = & cpi -> common ;
MACROBLOCK * const x = & cpi -> mb ;
MACROBLOCKD * const xd = & x -> e_mbd ;
const int ms = num_8x8_blocks_wide_lookup [ bsize ] / 2 ;
TOKENEXTRA * tp_orig = * tp ;
PICK_MODE_CONTEXT * ctx = & pc_tree -> none ;
int i ;
BLOCK_SIZE subsize = bsize ;
int this_rate , sum_rate = 0 , best_rate = INT_MAX ;
int64_t this_dist , sum_dist = 0 , best_dist = INT64_MAX ;
int64_t sum_rd = 0 ;
int do_split = bsize >= BLOCK_8X8 ;
int do_rect = 1 ;
const int force_horz_split = ( mi_row + ms >= cm -> mi_rows ) ;
const int force_vert_split = ( mi_col + ms >= cm -> mi_cols ) ;
const int xss = x -> e_mbd . plane [ 1 ] . subsampling_x ;
const int yss = x -> e_mbd . plane [ 1 ] . subsampling_y ;
int partition_none_allowed = ! force_horz_split && ! force_vert_split ;
int partition_horz_allowed = ! force_vert_split && yss <= xss && bsize >= BLOCK_8X8 ;
int partition_vert_allowed = ! force_horz_split && xss <= yss && bsize >= BLOCK_8X8 ;
( void ) * tp_orig ;
assert ( num_8x8_blocks_wide_lookup [ bsize ] == num_8x8_blocks_high_lookup [ bsize ] ) ;
if ( sf -> auto_min_max_partition_size ) {
partition_none_allowed &= ( bsize <= sf -> max_partition_size && bsize >= sf -> min_partition_size ) ;
partition_horz_allowed &= ( ( bsize <= sf -> max_partition_size && bsize > sf -> min_partition_size ) || force_horz_split ) ;
partition_vert_allowed &= ( ( bsize <= sf -> max_partition_size && bsize > sf -> min_partition_size ) || force_vert_split ) ;
do_split &= bsize > sf -> min_partition_size ;
}
if ( sf -> use_square_partition_only ) {
partition_horz_allowed &= force_horz_split ;
partition_vert_allowed &= force_vert_split ;
}
if ( partition_none_allowed ) {
nonrd_pick_sb_modes ( cpi , tile , mi_row , mi_col , & this_rate , & this_dist , bsize , ctx ) ;
ctx -> mic . mbmi = xd -> mi [ 0 ] . src_mi -> mbmi ;
ctx -> skip_txfm [ 0 ] = x -> skip_txfm [ 0 ] ;
ctx -> skip = x -> skip ;
if ( this_rate != INT_MAX ) {
int pl = partition_plane_context ( xd , mi_row , mi_col , bsize ) ;
this_rate += cpi -> partition_cost [ pl ] [ PARTITION_NONE ] ;
sum_rd = RDCOST ( x -> rdmult , x -> rddiv , this_rate , this_dist ) ;
if ( sum_rd < best_rd ) {
int64_t stop_thresh = 4096 ;
int64_t stop_thresh_rd ;
best_rate = this_rate ;
best_dist = this_dist ;
best_rd = sum_rd ;
if ( bsize >= BLOCK_8X8 ) pc_tree -> partitioning = PARTITION_NONE ;
stop_thresh >>= 8 - ( b_width_log2 ( bsize ) + b_height_log2 ( bsize ) ) ;
stop_thresh_rd = RDCOST ( x -> rdmult , x -> rddiv , 0 , stop_thresh ) ;
if ( ! x -> e_mbd . lossless && best_rd < stop_thresh_rd ) {
do_split = 0 ;
do_rect = 0 ;
}
}
}
}
store_pred_mv ( x , ctx ) ;
sum_rd = 0 ;
if ( do_split ) {
int pl = partition_plane_context ( xd , mi_row , mi_col , bsize ) ;
sum_rate += cpi -> partition_cost [ pl ] [ PARTITION_SPLIT ] ;
subsize = get_subsize ( bsize , PARTITION_SPLIT ) ;
for ( i = 0 ;
i < 4 && sum_rd < best_rd ;
++ i ) {
const int x_idx = ( i & 1 ) * ms ;
const int y_idx = ( i >> 1 ) * ms ;
if ( mi_row + y_idx >= cm -> mi_rows || mi_col + x_idx >= cm -> mi_cols ) continue ;
load_pred_mv ( x , ctx ) ;
nonrd_pick_partition ( cpi , tile , tp , mi_row + y_idx , mi_col + x_idx , subsize , & this_rate , & this_dist , 0 , best_rd - sum_rd , pc_tree -> split [ i ] ) ;
if ( this_rate == INT_MAX ) {
sum_rd = INT64_MAX ;
}
else {
sum_rate += this_rate ;
sum_dist += this_dist ;
sum_rd = RDCOST ( x -> rdmult , x -> rddiv , sum_rate , sum_dist ) ;
}
}
if ( sum_rd < best_rd ) {
best_rate = sum_rate ;
best_dist = sum_dist ;
best_rd = sum_rd ;
pc_tree -> partitioning = PARTITION_SPLIT ;
}
else {
if ( sf -> less_rectangular_check ) do_rect &= ! partition_none_allowed ;
}
}
if ( partition_horz_allowed && do_rect ) {
subsize = get_subsize ( bsize , PARTITION_HORZ ) ;
if ( sf -> adaptive_motion_search ) load_pred_mv ( x , ctx ) ;
nonrd_pick_sb_modes ( cpi , tile , mi_row , mi_col , & this_rate , & this_dist , subsize , & pc_tree -> horizontal [ 0 ] ) ;
pc_tree -> horizontal [ 0 ] . mic . mbmi = xd -> mi [ 0 ] . src_mi -> mbmi ;
pc_tree -> horizontal [ 0 ] . skip_txfm [ 0 ] = x -> skip_txfm [ 0 ] ;
pc_tree -> horizontal [ 0 ] . skip = x -> skip ;
sum_rd = RDCOST ( x -> rdmult , x -> rddiv , sum_rate , sum_dist ) ;
if ( sum_rd < best_rd && mi_row + ms < cm -> mi_rows ) {
load_pred_mv ( x , ctx ) ;
nonrd_pick_sb_modes ( cpi , tile , mi_row + ms , mi_col , & this_rate , & this_dist , subsize , & pc_tree -> horizontal [ 1 ] ) ;
pc_tree -> horizontal [ 1 ] . mic . mbmi = xd -> mi [ 0 ] . src_mi -> mbmi ;
pc_tree -> horizontal [ 1 ] . skip_txfm [ 0 ] = x -> skip_txfm [ 0 ] ;
pc_tree -> horizontal [ 1 ] . skip = x -> skip ;
if ( this_rate == INT_MAX ) {
sum_rd = INT64_MAX ;
}
else {
int pl = partition_plane_context ( xd , mi_row , mi_col , bsize ) ;
this_rate += cpi -> partition_cost [ pl ] [ PARTITION_HORZ ] ;
sum_rate += this_rate ;
sum_dist += this_dist ;
sum_rd = RDCOST ( x -> rdmult , x -> rddiv , sum_rate , sum_dist ) ;
}
}
if ( sum_rd < best_rd ) {
best_rd = sum_rd ;
best_rate = sum_rate ;
best_dist = sum_dist ;
pc_tree -> partitioning = PARTITION_HORZ ;
}
}
if ( partition_vert_allowed && do_rect ) {
subsize = get_subsize ( bsize , PARTITION_VERT ) ;
if ( sf -> adaptive_motion_search ) load_pred_mv ( x , ctx ) ;
nonrd_pick_sb_modes ( cpi , tile , mi_row , mi_col , & this_rate , & this_dist , subsize , & pc_tree -> vertical [ 0 ] ) ;
pc_tree -> vertical [ 0 ] . mic . mbmi = xd -> mi [ 0 ] . src_mi -> mbmi ;
pc_tree -> vertical [ 0 ] . skip_txfm [ 0 ] = x -> skip_txfm [ 0 ] ;
pc_tree -> vertical [ 0 ] . skip = x -> skip ;
sum_rd = RDCOST ( x -> rdmult , x -> rddiv , sum_rate , sum_dist ) ;
if ( sum_rd < best_rd && mi_col + ms < cm -> mi_cols ) {
load_pred_mv ( x , ctx ) ;
nonrd_pick_sb_modes ( cpi , tile , mi_row , mi_col + ms , & this_rate , & this_dist , subsize , & pc_tree -> vertical [ 1 ] ) ;
pc_tree -> vertical [ 1 ] . mic . mbmi = xd -> mi [ 0 ] . src_mi -> mbmi ;
pc_tree -> vertical [ 1 ] . skip_txfm [ 0 ] = x -> skip_txfm [ 0 ] ;
pc_tree -> vertical [ 1 ] . skip = x -> skip ;
if ( this_rate == INT_MAX ) {
sum_rd = INT64_MAX ;
}
else {
int pl = partition_plane_context ( xd , mi_row , mi_col , bsize ) ;
this_rate += cpi -> partition_cost [ pl ] [ PARTITION_VERT ] ;
sum_rate += this_rate ;
sum_dist += this_dist ;
sum_rd = RDCOST ( x -> rdmult , x -> rddiv , sum_rate , sum_dist ) ;
}
}
if ( sum_rd < best_rd ) {
best_rate = sum_rate ;
best_dist = sum_dist ;
best_rd = sum_rd ;
pc_tree -> partitioning = PARTITION_VERT ;
}
}
( void ) best_rd ;
* rate = best_rate ;
* dist = best_dist ;
if ( best_rate == INT_MAX ) return ;
subsize = get_subsize ( bsize , pc_tree -> partitioning ) ;
fill_mode_info_sb ( cm , x , mi_row , mi_col , bsize , subsize , pc_tree ) ;
if ( best_rate < INT_MAX && best_dist < INT64_MAX && do_recon ) {
int output_enabled = ( bsize == BLOCK_64X64 ) ;
if ( ( oxcf -> aq_mode == COMPLEXITY_AQ ) && cm -> seg . update_map ) {
vp9_select_in_frame_q_segment ( cpi , mi_row , mi_col , output_enabled , best_rate ) ;
}
if ( oxcf -> aq_mode == CYCLIC_REFRESH_AQ ) vp9_cyclic_refresh_set_rate_and_dist_sb ( cpi -> cyclic_refresh , best_rate , best_dist ) ;
encode_sb_rt ( cpi , tile , tp , mi_row , mi_col , output_enabled , bsize , pc_tree ) ;
}
if ( bsize == BLOCK_64X64 ) {
assert ( tp_orig < * tp ) ;
assert ( best_rate < INT_MAX ) ;
assert ( best_dist < INT64_MAX ) ;
}
else {
assert ( tp_orig == * tp ) ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
const gchar * nautilus_mime_types_group_get_name ( gint group_index ) {
g_return_val_if_fail ( group_index < G_N_ELEMENTS ( mimetype_groups ) , NULL ) ;
return gettext ( mimetype_groups [ group_index ] . name ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
fz_colorspace * fz_new_colorspace ( fz_context * ctx , const char * name , enum fz_colorspace_type type , int flags , int n , fz_colorspace_convert_fn * to_ccs , fz_colorspace_convert_fn * from_ccs , fz_colorspace_base_fn * base , fz_colorspace_clamp_fn * clamp , fz_colorspace_destruct_fn * destruct , void * data , size_t size ) {
fz_colorspace * cs = fz_malloc_struct ( ctx , fz_colorspace ) ;
FZ_INIT_KEY_STORABLE ( cs , 1 , fz_drop_colorspace_imp ) ;
cs -> size = sizeof ( fz_colorspace ) + size ;
fz_strlcpy ( cs -> name , name ? name : "UNKNOWN" , sizeof cs -> name ) ;
cs -> type = type ;
cs -> flags = flags ;
cs -> n = n ;
cs -> to_ccs = to_ccs ;
cs -> from_ccs = from_ccs ;
cs -> get_base = base ;
if ( clamp != NULL ) cs -> clamp = clamp ;
else cs -> clamp = clamp_default ;
cs -> free_data = destruct ;
cs -> data = data ;
return cs ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int ra288_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 ;
float * out ;
int i , ret ;
RA288Context * ractx = avctx -> priv_data ;
GetBitContext gb ;
if ( buf_size < avctx -> block_align ) {
av_log ( avctx , AV_LOG_ERROR , "Error! Input buffer is too small [%d<%d]\n" , buf_size , avctx -> block_align ) ;
return AVERROR_INVALIDDATA ;
}
frame -> nb_samples = RA288_BLOCK_SIZE * RA288_BLOCKS_PER_FRAME ;
if ( ( ret = ff_get_buffer ( avctx , frame ) ) < 0 ) {
av_log ( avctx , AV_LOG_ERROR , "get_buffer() failed\n" ) ;
return ret ;
}
out = ( float * ) frame -> data [ 0 ] ;
init_get_bits ( & gb , buf , avctx -> block_align * 8 ) ;
for ( i = 0 ;
i < RA288_BLOCKS_PER_FRAME ;
i ++ ) {
float gain = amptable [ get_bits ( & gb , 3 ) ] ;
int cb_coef = get_bits ( & gb , 6 + ( i & 1 ) ) ;
decode ( ractx , gain , cb_coef ) ;
memcpy ( out , & ractx -> sp_hist [ 70 + 36 ] , RA288_BLOCK_SIZE * sizeof ( * out ) ) ;
out += RA288_BLOCK_SIZE ;
if ( ( i & 7 ) == 3 ) {
backward_filter ( ractx , ractx -> sp_hist , ractx -> sp_rec , syn_window , ractx -> sp_lpc , syn_bw_tab , 36 , 40 , 35 , 70 ) ;
backward_filter ( ractx , ractx -> gain_hist , ractx -> gain_rec , gain_window , ractx -> gain_lpc , gain_bw_tab , 10 , 8 , 20 , 28 ) ;
}
}
* got_frame_ptr = 1 ;
return avctx -> block_align ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
uint end_of_word ( char * pos ) {
char * end = strend ( pos ) ;
return ( ( end > pos + 2 && ! memcmp ( end - 2 , "\\b" , 2 ) ) || ( end >= pos + 2 && ! memcmp ( end - 2 , "\\$" , 2 ) ) ) ? 1 : 0 ;
}
| 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 ) ) {
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 ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static PGresult * executeQuery ( PGconn * conn , const char * query ) {
PGresult * res ;
if ( verbose ) fprintf ( stderr , _ ( "%s: executing %s\n" ) , progname , query ) ;
res = PQexec ( conn , query ) ;
if ( ! res || PQresultStatus ( res ) != PGRES_TUPLES_OK ) {
fprintf ( stderr , _ ( "%s: query failed: %s" ) , progname , PQerrorMessage ( conn ) ) ;
fprintf ( stderr , _ ( "%s: query was: %s\n" ) , progname , query ) ;
PQfinish ( conn ) ;
exit_nicely ( 1 ) ;
}
return res ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
const char * irc_ctcp_get_reply ( struct t_irc_server * server , const char * ctcp ) {
struct t_config_option * ptr_option ;
char option_name [ 512 ] ;
snprintf ( option_name , sizeof ( option_name ) , "%s.%s" , server -> name , ctcp ) ;
ptr_option = weechat_config_search_option ( irc_config_file , irc_config_section_ctcp , option_name ) ;
if ( ptr_option ) return weechat_config_string ( ptr_option ) ;
ptr_option = weechat_config_search_option ( irc_config_file , irc_config_section_ctcp , ctcp ) ;
if ( ptr_option ) return weechat_config_string ( ptr_option ) ;
return irc_ctcp_get_default_reply ( ctcp ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void vmmouse_get_data ( uint32_t * data ) {
CPUX86State * env = cpu_single_env ;
data [ 0 ] = env -> regs [ R_EAX ] ;
data [ 1 ] = env -> regs [ R_EBX ] ;
data [ 2 ] = env -> regs [ R_ECX ] ;
data [ 3 ] = env -> regs [ R_EDX ] ;
data [ 4 ] = env -> regs [ R_ESI ] ;
data [ 5 ] = env -> regs [ R_EDI ] ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void decode_vectors ( COOKContext * q , COOKSubpacket * p , int * category , int * quant_index_table , float * mlt_buffer ) {
int subband_coef_index [ SUBBAND_SIZE ] ;
int subband_coef_sign [ SUBBAND_SIZE ] ;
int band , j ;
int index = 0 ;
for ( band = 0 ;
band < p -> total_subbands ;
band ++ ) {
index = category [ band ] ;
if ( category [ band ] < 7 ) {
if ( unpack_SQVH ( q , p , category [ band ] , subband_coef_index , subband_coef_sign ) ) {
index = 7 ;
for ( j = 0 ;
j < p -> total_subbands ;
j ++ ) category [ band + j ] = 7 ;
}
}
if ( index >= 7 ) {
memset ( subband_coef_index , 0 , sizeof ( subband_coef_index ) ) ;
memset ( subband_coef_sign , 0 , sizeof ( subband_coef_sign ) ) ;
}
q -> scalar_dequant ( q , index , quant_index_table [ band ] , subband_coef_index , subband_coef_sign , & mlt_buffer [ band * SUBBAND_SIZE ] ) ;
}
if ( p -> total_subbands * SUBBAND_SIZE >= q -> samples_per_channel ) return ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void x8_ac_compensation ( IntraX8Context * const w , int const direction , int const dc_level ) {
MpegEncContext * const s = w -> s ;
int t ;
# define B ( x , y ) s -> block [ 0 ] [ s -> dsp . idct_permutation [ ( x ) + ( y ) * 8 ] ] # define T ( x ) ( ( x ) * dc_level + 0x8000 ) >> 16 ;
switch ( direction ) {
case 0 : t = T ( 3811 ) ;
B ( 1 , 0 ) -= t ;
B ( 0 , 1 ) -= t ;
t = T ( 487 ) ;
B ( 2 , 0 ) -= t ;
B ( 0 , 2 ) -= t ;
t = T ( 506 ) ;
B ( 3 , 0 ) -= t ;
B ( 0 , 3 ) -= t ;
t = T ( 135 ) ;
B ( 4 , 0 ) -= t ;
B ( 0 , 4 ) -= t ;
B ( 2 , 1 ) += t ;
B ( 1 , 2 ) += t ;
B ( 3 , 1 ) += t ;
B ( 1 , 3 ) += t ;
t = T ( 173 ) ;
B ( 5 , 0 ) -= t ;
B ( 0 , 5 ) -= t ;
t = T ( 61 ) ;
B ( 6 , 0 ) -= t ;
B ( 0 , 6 ) -= t ;
B ( 5 , 1 ) += t ;
B ( 1 , 5 ) += t ;
t = T ( 42 ) ;
B ( 7 , 0 ) -= t ;
B ( 0 , 7 ) -= t ;
B ( 4 , 1 ) += t ;
B ( 1 , 4 ) += t ;
B ( 4 , 4 ) += t ;
t = T ( 1084 ) ;
B ( 1 , 1 ) += t ;
s -> block_last_index [ 0 ] = FFMAX ( s -> block_last_index [ 0 ] , 7 * 8 ) ;
break ;
case 1 : B ( 0 , 1 ) -= T ( 6269 ) ;
B ( 0 , 3 ) -= T ( 708 ) ;
B ( 0 , 5 ) -= T ( 172 ) ;
B ( 0 , 7 ) -= T ( 73 ) ;
s -> block_last_index [ 0 ] = FFMAX ( s -> block_last_index [ 0 ] , 7 * 8 ) ;
break ;
case 2 : B ( 1 , 0 ) -= T ( 6269 ) ;
B ( 3 , 0 ) -= T ( 708 ) ;
B ( 5 , 0 ) -= T ( 172 ) ;
B ( 7 , 0 ) -= T ( 73 ) ;
s -> block_last_index [ 0 ] = FFMAX ( s -> block_last_index [ 0 ] , 7 ) ;
break ;
}
# undef B # undef T }
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_h225_IA5String ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_IA5String ( tvb , offset , actx , tree , hf_index , NO_BOUND , NO_BOUND , FALSE ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int isoent_make_path_table_2 ( struct archive_write * a , struct vdd * vdd , int depth , int * dir_number ) {
struct isoent * np ;
struct isoent * * enttbl ;
struct path_table * pt ;
int i ;
pt = & vdd -> pathtbl [ depth ] ;
if ( pt -> cnt == 0 ) {
pt -> sorted = NULL ;
return ( ARCHIVE_OK ) ;
}
enttbl = malloc ( pt -> cnt * sizeof ( struct isoent * ) ) ;
if ( enttbl == NULL ) {
archive_set_error ( & a -> archive , ENOMEM , "Can't allocate memory" ) ;
return ( ARCHIVE_FATAL ) ;
}
pt -> sorted = enttbl ;
for ( np = pt -> first ;
np != NULL ;
np = np -> ptnext ) * enttbl ++ = np ;
enttbl = pt -> sorted ;
switch ( vdd -> vdd_type ) {
case VDD_PRIMARY : case VDD_ENHANCED : # ifdef __COMPAR_FN_T qsort ( enttbl , pt -> cnt , sizeof ( struct isoent * ) , ( __compar_fn_t ) _compare_path_table ) ;
# else qsort ( enttbl , pt -> cnt , sizeof ( struct isoent * ) , _compare_path_table ) ;
# endif break ;
case VDD_JOLIET : # ifdef __COMPAR_FN_T qsort ( enttbl , pt -> cnt , sizeof ( struct isoent * ) , ( __compar_fn_t ) _compare_path_table_joliet ) ;
# else qsort ( enttbl , pt -> cnt , sizeof ( struct isoent * ) , _compare_path_table_joliet ) ;
# endif break ;
}
for ( i = 0 ;
i < pt -> cnt ;
i ++ ) enttbl [ i ] -> dir_number = ( * dir_number ) ++ ;
return ( ARCHIVE_OK ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static const char * calc_ip ( const char * ip , long * val , char end ) {
long ip_val , tmp ;
if ( ! ( ip = str2int ( ip , 10 , 0 , 255 , & ip_val ) ) || * ip != '.' ) return 0 ;
ip_val <<= 24 ;
if ( ! ( ip = str2int ( ip + 1 , 10 , 0 , 255 , & tmp ) ) || * ip != '.' ) return 0 ;
ip_val += tmp << 16 ;
if ( ! ( ip = str2int ( ip + 1 , 10 , 0 , 255 , & tmp ) ) || * ip != '.' ) return 0 ;
ip_val += tmp << 8 ;
if ( ! ( ip = str2int ( ip + 1 , 10 , 0 , 255 , & tmp ) ) || * ip != end ) return 0 ;
* val = ip_val + tmp ;
return ip ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static __always_inline __be64 __cpu_to_be64p ( const __u64 * p ) {
return ( __be64 ) __swab64p ( p ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static guint16 de_bcc_state_attr ( tvbuff_t * tvb , proto_tree * tree , packet_info * pinfo _U_ , guint32 offset , guint len _U_ , gchar * add_string _U_ , int string_len _U_ ) {
proto_tree_add_item ( tree , hf_gsm_a_dtap_bcc_state_attr , tvb , offset , 1 , ENC_NA ) ;
proto_tree_add_item ( tree , hf_gsm_a_dtap_bcc_state_attr_da , tvb , offset , 1 , ENC_NA ) ;
proto_tree_add_item ( tree , hf_gsm_a_dtap_bcc_state_attr_ua , tvb , offset , 1 , ENC_NA ) ;
proto_tree_add_item ( tree , hf_gsm_a_dtap_bcc_state_attr_comm , tvb , offset , 1 , ENC_NA ) ;
proto_tree_add_item ( tree , hf_gsm_a_dtap_bcc_state_attr_oi , tvb , offset , 1 , ENC_NA ) ;
return 1 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
inline uint char_val ( char X ) {
return ( uint ) ( X >= '0' && X <= '9' ? X - '0' : X >= 'A' && X <= 'Z' ? X - 'A' + 10 : X - 'a' + 10 ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
METHOD ( asn1_parser_t , iterate , bool , private_asn1_parser_t * this , int * objectID , chunk_t * object ) {
chunk_t * blob , * blob1 ;
u_char * start_ptr ;
u_int level ;
asn1Object_t obj ;
* object = chunk_empty ;
obj = this -> objects [ ++ ( this -> line ) ] ;
if ( obj . flags & ASN1_EXIT ) {
return FALSE ;
}
if ( obj . flags & ASN1_END ) {
if ( this -> loopAddr [ obj . level ] && this -> blobs [ obj . level + 1 ] . len > 0 ) {
this -> line = this -> loopAddr [ obj . level ] ;
obj = this -> objects [ this -> line ] ;
}
else {
this -> loopAddr [ obj . level ] = 0 ;
goto end ;
}
}
level = this -> level0 + obj . level ;
blob = this -> blobs + obj . level ;
blob1 = blob + 1 ;
start_ptr = blob -> ptr ;
if ( ( obj . flags & ASN1_DEF ) && ( blob -> len == 0 || * start_ptr != obj . type ) ) {
DBG2 ( DBG_ASN , "L%d - %s:" , level , obj . name ) ;
if ( obj . type & ASN1_CONSTRUCTED ) {
this -> line ++ ;
}
goto end ;
}
if ( ( obj . flags & ASN1_OPT ) && ( blob -> len == 0 || * start_ptr != obj . type ) ) {
do {
this -> line ++ ;
}
while ( ! ( ( this -> objects [ this -> line ] . flags & ASN1_END ) && ( this -> objects [ this -> line ] . level == obj . level ) ) ) ;
goto end ;
}
if ( blob -> len < 2 ) {
DBG1 ( DBG_ASN , "L%d - %s: ASN.1 object smaller than 2 octets" , level , obj . name ) ;
this -> success = FALSE ;
goto end ;
}
blob1 -> len = asn1_length ( blob ) ;
if ( blob1 -> len == ASN1_INVALID_LENGTH ) {
DBG1 ( DBG_ASN , "L%d - %s: length of ASN.1 object invalid or too large" , level , obj . name ) ;
this -> success = FALSE ;
goto end ;
}
blob1 -> ptr = blob -> ptr ;
blob -> ptr += blob1 -> len ;
blob -> len -= blob1 -> len ;
if ( obj . flags & ASN1_RAW ) {
DBG2 ( DBG_ASN , "L%d - %s:" , level , obj . name ) ;
object -> ptr = start_ptr ;
object -> len = ( size_t ) ( blob -> ptr - start_ptr ) ;
goto end ;
}
if ( * start_ptr != obj . type && ! ( this -> implicit && this -> line == 0 ) ) {
DBG2 ( DBG_ASN , "L%d - %s: ASN1 tag 0x%02x expected, but is 0x%02x" , level , obj . name , obj . type , * start_ptr ) ;
DBG3 ( DBG_ASN , "%b" , start_ptr , ( u_int ) ( blob -> ptr - start_ptr ) ) ;
this -> success = FALSE ;
goto end ;
}
DBG2 ( DBG_ASN , "L%d - %s:" , level , obj . name ) ;
if ( obj . flags & ASN1_LOOP ) {
if ( blob1 -> len > 0 ) {
this -> loopAddr [ obj . level ] = this -> line + 1 ;
}
else {
do {
this -> line ++ ;
}
while ( ! ( ( this -> objects [ this -> line ] . flags & ASN1_END ) && ( this -> objects [ this -> line ] . level == obj . level ) ) ) ;
goto end ;
}
}
if ( obj . flags & ASN1_OBJ ) {
object -> ptr = start_ptr ;
object -> len = ( size_t ) ( blob -> ptr - start_ptr ) ;
if ( this -> private ) {
DBG4 ( DBG_ASN , "%B" , object ) ;
}
else {
DBG3 ( DBG_ASN , "%B" , object ) ;
}
}
else if ( obj . flags & ASN1_BODY ) {
* object = * blob1 ;
asn1_debug_simple_object ( * object , obj . type , this -> private ) ;
}
end : * objectID = this -> line ;
return this -> success ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static inline Quantum GetPixelWriteMask ( const Image * restrict image , const Quantum * restrict pixel ) {
if ( image -> channel_map [ WriteMaskPixelChannel ] . traits == UndefinedPixelTrait ) return ( ( Quantum ) QuantumRange ) ;
return ( pixel [ image -> channel_map [ WriteMaskPixelChannel ] . offset ] ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int context_init ( H264Context * h ) {
ERContext * er = & h -> er ;
int mb_array_size = h -> mb_height * h -> mb_stride ;
int y_size = ( 2 * h -> mb_width + 1 ) * ( 2 * h -> mb_height + 1 ) ;
int c_size = h -> mb_stride * ( h -> mb_height + 1 ) ;
int yc_size = y_size + 2 * c_size ;
int x , y , i ;
FF_ALLOCZ_OR_GOTO ( h -> avctx , h -> top_borders [ 0 ] , h -> mb_width * 16 * 3 * sizeof ( uint8_t ) * 2 , fail ) FF_ALLOCZ_OR_GOTO ( h -> avctx , h -> top_borders [ 1 ] , h -> mb_width * 16 * 3 * sizeof ( uint8_t ) * 2 , fail ) h -> ref_cache [ 0 ] [ scan8 [ 5 ] + 1 ] = h -> ref_cache [ 0 ] [ scan8 [ 7 ] + 1 ] = h -> ref_cache [ 0 ] [ scan8 [ 13 ] + 1 ] = h -> ref_cache [ 1 ] [ scan8 [ 5 ] + 1 ] = h -> ref_cache [ 1 ] [ scan8 [ 7 ] + 1 ] = h -> ref_cache [ 1 ] [ scan8 [ 13 ] + 1 ] = PART_NOT_AVAILABLE ;
if ( CONFIG_ERROR_RESILIENCE ) {
er -> avctx = h -> avctx ;
er -> dsp = & h -> dsp ;
er -> decode_mb = h264_er_decode_mb ;
er -> opaque = h ;
er -> quarter_sample = 1 ;
er -> mb_num = h -> mb_num ;
er -> mb_width = h -> mb_width ;
er -> mb_height = h -> mb_height ;
er -> mb_stride = h -> mb_stride ;
er -> b8_stride = h -> mb_width * 2 + 1 ;
FF_ALLOCZ_OR_GOTO ( h -> avctx , er -> mb_index2xy , ( h -> mb_num + 1 ) * sizeof ( int ) , fail ) ;
for ( y = 0 ;
y < h -> mb_height ;
y ++ ) for ( x = 0 ;
x < h -> mb_width ;
x ++ ) er -> mb_index2xy [ x + y * h -> mb_width ] = x + y * h -> mb_stride ;
er -> mb_index2xy [ h -> mb_height * h -> mb_width ] = ( h -> mb_height - 1 ) * h -> mb_stride + h -> mb_width ;
FF_ALLOCZ_OR_GOTO ( h -> avctx , er -> error_status_table , mb_array_size * sizeof ( uint8_t ) , fail ) ;
FF_ALLOC_OR_GOTO ( h -> avctx , er -> mbintra_table , mb_array_size , fail ) ;
memset ( er -> mbintra_table , 1 , mb_array_size ) ;
FF_ALLOCZ_OR_GOTO ( h -> avctx , er -> mbskip_table , mb_array_size + 2 , fail ) ;
FF_ALLOC_OR_GOTO ( h -> avctx , er -> er_temp_buffer , h -> mb_height * h -> mb_stride , fail ) ;
FF_ALLOCZ_OR_GOTO ( h -> avctx , h -> dc_val_base , yc_size * sizeof ( int16_t ) , fail ) ;
er -> dc_val [ 0 ] = h -> dc_val_base + h -> mb_width * 2 + 2 ;
er -> dc_val [ 1 ] = h -> dc_val_base + y_size + h -> mb_stride + 1 ;
er -> dc_val [ 2 ] = er -> dc_val [ 1 ] + c_size ;
for ( i = 0 ;
i < yc_size ;
i ++ ) h -> dc_val_base [ i ] = 1024 ;
}
return 0 ;
fail : return AVERROR ( ENOMEM ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void * prplcb_notify_email ( PurpleConnection * gc , const char * subject , const char * from , const char * to , const char * url ) {
struct im_connection * ic = purple_ic_by_gc ( gc ) ;
imcb_notify_email ( ic , "Received e-mail from %s for %s: %s <%s>" , from , to , subject , url ) ;
return NULL ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_rsl_ie_resource_inf ( tvbuff_t * tvb , packet_info * pinfo _U_ , proto_tree * tree , int offset , gboolean is_mandatory ) {
proto_item * ti ;
proto_tree * ie_tree ;
guint8 ie_id ;
guint length ;
int ie_offset ;
if ( is_mandatory == FALSE ) {
ie_id = tvb_get_guint8 ( tvb , offset ) ;
if ( ie_id != RSL_IE_RESOURCE_INF ) return offset ;
}
ie_tree = proto_tree_add_subtree ( tree , tvb , offset , 0 , ett_ie_resource_inf , & ti , "Resource Information IE" ) ;
proto_tree_add_item ( ie_tree , hf_rsl_ie_id , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
offset ++ ;
length = tvb_get_guint8 ( tvb , offset ) ;
proto_item_set_len ( ti , length + 2 ) ;
proto_tree_add_item ( ie_tree , hf_rsl_ie_length , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
offset ++ ;
ie_offset = offset ;
while ( length > 0 ) {
proto_tree_add_item ( ie_tree , hf_rsl_ch_no_Cbits , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( ie_tree , hf_rsl_ch_no_TN , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
offset ++ ;
proto_tree_add_item ( ie_tree , hf_rsl_interf_band , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
proto_tree_add_item ( ie_tree , hf_rsl_interf_band_reserved , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
offset ++ ;
length = length - 2 ;
}
return ie_offset + length ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void jpc_qmfb_split_row ( jpc_fix_t * a , int numcols , int parity ) {
int bufsize = JPC_CEILDIVPOW2 ( numcols , 1 ) ;
jpc_fix_t splitbuf [ QMFB_SPLITBUFSIZE ] ;
jpc_fix_t * buf = splitbuf ;
register jpc_fix_t * srcptr ;
register jpc_fix_t * dstptr ;
register int n ;
register int m ;
int hstartcol ;
if ( bufsize > QMFB_SPLITBUFSIZE ) {
if ( ! ( buf = jas_alloc2 ( bufsize , sizeof ( jpc_fix_t ) ) ) ) {
abort ( ) ;
}
}
if ( numcols >= 2 ) {
hstartcol = ( numcols + 1 - parity ) >> 1 ;
m = numcols - hstartcol ;
n = m ;
dstptr = buf ;
srcptr = & a [ 1 - parity ] ;
while ( n -- > 0 ) {
* dstptr = * srcptr ;
++ dstptr ;
srcptr += 2 ;
}
dstptr = & a [ 1 - parity ] ;
srcptr = & a [ 2 - parity ] ;
n = numcols - m - ( ! parity ) ;
while ( n -- > 0 ) {
* dstptr = * srcptr ;
++ dstptr ;
srcptr += 2 ;
}
dstptr = & a [ hstartcol ] ;
srcptr = buf ;
n = m ;
while ( n -- > 0 ) {
* dstptr = * srcptr ;
++ dstptr ;
++ srcptr ;
}
}
if ( buf != splitbuf ) {
jas_free ( buf ) ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void jpc_ns_fwdlift_colres ( jpc_fix_t * a , int numrows , int numcols , int stride , int parity ) {
jpc_fix_t * lptr ;
jpc_fix_t * hptr ;
register jpc_fix_t * lptr2 ;
register jpc_fix_t * hptr2 ;
register int n ;
register int i ;
int llen ;
llen = ( numrows + 1 - parity ) >> 1 ;
if ( numrows > 1 ) {
lptr = & a [ 0 ] ;
hptr = & a [ llen * stride ] ;
if ( parity ) {
lptr2 = lptr ;
hptr2 = hptr ;
for ( i = 0 ;
i < numcols ;
++ i ) {
jpc_fix_pluseq ( hptr2 [ 0 ] , jpc_fix_mul ( jpc_dbltofix ( 2.0 * ALPHA ) , lptr2 [ 0 ] ) ) ;
++ hptr2 ;
++ lptr2 ;
}
hptr += stride ;
}
n = numrows - llen - parity - ( parity == ( numrows & 1 ) ) ;
while ( n -- > 0 ) {
lptr2 = lptr ;
hptr2 = hptr ;
for ( i = 0 ;
i < numcols ;
++ i ) {
jpc_fix_pluseq ( hptr2 [ 0 ] , jpc_fix_mul ( jpc_dbltofix ( ALPHA ) , jpc_fix_add ( lptr2 [ 0 ] , lptr2 [ stride ] ) ) ) ;
++ lptr2 ;
++ hptr2 ;
}
hptr += stride ;
lptr += stride ;
}
if ( parity == ( numrows & 1 ) ) {
lptr2 = lptr ;
hptr2 = hptr ;
for ( i = 0 ;
i < numcols ;
++ i ) {
jpc_fix_pluseq ( hptr2 [ 0 ] , jpc_fix_mul ( jpc_dbltofix ( 2.0 * ALPHA ) , lptr2 [ 0 ] ) ) ;
++ lptr2 ;
++ hptr2 ;
}
}
lptr = & a [ 0 ] ;
hptr = & a [ llen * stride ] ;
if ( ! parity ) {
lptr2 = lptr ;
hptr2 = hptr ;
for ( i = 0 ;
i < numcols ;
++ i ) {
jpc_fix_pluseq ( lptr2 [ 0 ] , jpc_fix_mul ( jpc_dbltofix ( 2.0 * BETA ) , hptr2 [ 0 ] ) ) ;
++ lptr2 ;
++ hptr2 ;
}
lptr += stride ;
}
n = llen - ( ! parity ) - ( parity != ( numrows & 1 ) ) ;
while ( n -- > 0 ) {
lptr2 = lptr ;
hptr2 = hptr ;
for ( i = 0 ;
i < numcols ;
++ i ) {
jpc_fix_pluseq ( lptr2 [ 0 ] , jpc_fix_mul ( jpc_dbltofix ( BETA ) , jpc_fix_add ( hptr2 [ 0 ] , hptr2 [ stride ] ) ) ) ;
++ lptr2 ;
++ hptr2 ;
}
lptr += stride ;
hptr += stride ;
}
if ( parity != ( numrows & 1 ) ) {
lptr2 = lptr ;
hptr2 = hptr ;
for ( i = 0 ;
i < numcols ;
++ i ) {
jpc_fix_pluseq ( lptr2 [ 0 ] , jpc_fix_mul ( jpc_dbltofix ( 2.0 * BETA ) , hptr2 [ 0 ] ) ) ;
++ lptr2 ;
++ hptr2 ;
}
}
lptr = & a [ 0 ] ;
hptr = & a [ llen * stride ] ;
if ( parity ) {
lptr2 = lptr ;
hptr2 = hptr ;
for ( i = 0 ;
i < numcols ;
++ i ) {
jpc_fix_pluseq ( hptr2 [ 0 ] , jpc_fix_mul ( jpc_dbltofix ( 2.0 * GAMMA ) , lptr2 [ 0 ] ) ) ;
++ hptr2 ;
++ lptr2 ;
}
hptr += stride ;
}
n = numrows - llen - parity - ( parity == ( numrows & 1 ) ) ;
while ( n -- > 0 ) {
lptr2 = lptr ;
hptr2 = hptr ;
for ( i = 0 ;
i < numcols ;
++ i ) {
jpc_fix_pluseq ( hptr2 [ 0 ] , jpc_fix_mul ( jpc_dbltofix ( GAMMA ) , jpc_fix_add ( lptr2 [ 0 ] , lptr2 [ stride ] ) ) ) ;
++ lptr2 ;
++ hptr2 ;
}
hptr += stride ;
lptr += stride ;
}
if ( parity == ( numrows & 1 ) ) {
lptr2 = lptr ;
hptr2 = hptr ;
for ( i = 0 ;
i < numcols ;
++ i ) {
jpc_fix_pluseq ( hptr2 [ 0 ] , jpc_fix_mul ( jpc_dbltofix ( 2.0 * GAMMA ) , lptr2 [ 0 ] ) ) ;
++ lptr2 ;
++ hptr2 ;
}
}
lptr = & a [ 0 ] ;
hptr = & a [ llen * stride ] ;
if ( ! parity ) {
lptr2 = lptr ;
hptr2 = hptr ;
for ( i = 0 ;
i < numcols ;
++ i ) {
jpc_fix_pluseq ( lptr2 [ 0 ] , jpc_fix_mul ( jpc_dbltofix ( 2.0 * DELTA ) , hptr2 [ 0 ] ) ) ;
++ lptr2 ;
++ hptr2 ;
}
lptr += stride ;
}
n = llen - ( ! parity ) - ( parity != ( numrows & 1 ) ) ;
while ( n -- > 0 ) {
lptr2 = lptr ;
hptr2 = hptr ;
for ( i = 0 ;
i < numcols ;
++ i ) {
jpc_fix_pluseq ( lptr2 [ 0 ] , jpc_fix_mul ( jpc_dbltofix ( DELTA ) , jpc_fix_add ( hptr2 [ 0 ] , hptr2 [ stride ] ) ) ) ;
++ lptr2 ;
++ hptr2 ;
}
lptr += stride ;
hptr += stride ;
}
if ( parity != ( numrows & 1 ) ) {
lptr2 = lptr ;
hptr2 = hptr ;
for ( i = 0 ;
i < numcols ;
++ i ) {
jpc_fix_pluseq ( lptr2 [ 0 ] , jpc_fix_mul ( jpc_dbltofix ( 2.0 * DELTA ) , hptr2 [ 0 ] ) ) ;
++ lptr2 ;
++ hptr2 ;
}
}
# if defined ( WT_DOSCALE ) lptr = & a [ 0 ] ;
n = llen ;
while ( n -- > 0 ) {
lptr2 = lptr ;
for ( i = 0 ;
i < numcols ;
++ i ) {
lptr2 [ 0 ] = jpc_fix_mul ( lptr2 [ 0 ] , jpc_dbltofix ( LGAIN ) ) ;
++ lptr2 ;
}
lptr += stride ;
}
hptr = & a [ llen * stride ] ;
n = numrows - llen ;
while ( n -- > 0 ) {
hptr2 = hptr ;
for ( i = 0 ;
i < numcols ;
++ i ) {
hptr2 [ 0 ] = jpc_fix_mul ( hptr2 [ 0 ] , jpc_dbltofix ( HGAIN ) ) ;
++ hptr2 ;
}
hptr += stride ;
}
# endif }
else {
# if defined ( WT_LENONE ) if ( parity ) {
lptr2 = & a [ 0 ] ;
for ( i = 0 ;
i < numcols ;
++ i ) {
lptr2 [ 0 ] = jpc_fix_asl ( lptr2 [ 0 ] , 1 ) ;
++ lptr2 ;
}
}
# endif }
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int sdp_parse_fmtp_config_h264 ( AVFormatContext * s , AVStream * stream , PayloadContext * h264_data , const char * attr , const char * value ) {
AVCodecParameters * par = stream -> codecpar ;
if ( ! strcmp ( attr , "packetization-mode" ) ) {
av_log ( s , AV_LOG_DEBUG , "RTP Packetization Mode: %d\n" , atoi ( value ) ) ;
h264_data -> packetization_mode = atoi ( value ) ;
if ( h264_data -> packetization_mode > 1 ) av_log ( s , AV_LOG_ERROR , "Interleaved RTP mode is not supported yet.\n" ) ;
}
else if ( ! strcmp ( attr , "profile-level-id" ) ) {
if ( strlen ( value ) == 6 ) parse_profile_level_id ( s , h264_data , value ) ;
}
else if ( ! strcmp ( attr , "sprop-parameter-sets" ) ) {
int ret ;
if ( * value == 0 || value [ strlen ( value ) - 1 ] == ',' ) {
av_log ( s , AV_LOG_WARNING , "Missing PPS in sprop-parameter-sets, ignoring\n" ) ;
return 0 ;
}
par -> extradata_size = 0 ;
av_freep ( & par -> extradata ) ;
ret = ff_h264_parse_sprop_parameter_sets ( s , & par -> extradata , & par -> extradata_size , value ) ;
av_log ( s , AV_LOG_DEBUG , "Extradata set to %p (size: %d)\n" , par -> extradata , par -> extradata_size ) ;
return ret ;
}
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static guint32 parse_wbxml_tag ( proto_tree * tree , tvbuff_t * tvb , guint32 offset , guint32 str_tbl , guint8 * level , guint8 * codepage_stag , guint8 * codepage_attr ) {
guint32 tvb_len = tvb_reported_length ( tvb ) ;
guint32 off = offset , last_off ;
guint32 len ;
guint str_len ;
guint32 ent ;
guint32 idx ;
guint8 peek ;
guint32 tag_len ;
guint8 tag_save_known = 0 ;
guint8 tag_new_known = 0 ;
const char * tag_save_literal ;
const char * tag_new_literal ;
char * tag_save_buf = NULL ;
char * tag_new_buf = NULL ;
guint8 parsing_tag_content = FALSE ;
tag_save_literal = NULL ;
DebugLog ( ( "parse_wbxml_tag (level = %u, offset = %u)\n" , * level , offset ) ) ;
last_off = off ;
while ( off < tvb_len ) {
peek = tvb_get_guint8 ( tvb , off ) ;
DebugLog ( ( "STAG: (top of while) level = %3u, peek = 0x%02X, off = %u, tvb_len = %u\n" , * level , peek , off , tvb_len ) ) ;
if ( ( peek & 0x3F ) < 4 ) switch ( peek ) {
case 0x00 : * codepage_stag = tvb_get_guint8 ( tvb , off + 1 ) ;
proto_tree_add_text ( tree , tvb , off , 2 , " | Tag | T -->%3d " "| SWITCH_PAGE (Tag code page) " "|" , * codepage_stag ) ;
off += 2 ;
break ;
case 0x01 : if ( tag_save_known ) {
proto_tree_add_text ( tree , tvb , off , 1 , " %3d | Tag | T %3d " "| END (Known Tag 0x%02X) " "| %s</%s>" , * level , * codepage_stag , tag_save_known , Indent ( * level ) , tag_save_literal ) ;
}
else {
proto_tree_add_text ( tree , tvb , off , 1 , " %3d | Tag | T %3d " "| END (Literal Tag) " "| %s</%s>" , * level , * codepage_stag , Indent ( * level ) , tag_save_literal ? tag_save_literal : "" ) ;
}
( * level ) -- ;
off ++ ;
DebugLog ( ( "STAG: level = %u, Return: len = %u\n" , * level , off - offset ) ) ;
return ( off - offset ) ;
case 0x02 : ent = tvb_get_guintvar ( tvb , off + 1 , & len ) ;
proto_tree_add_text ( tree , tvb , off , 1 + len , " %3d | Tag | T %3d " "| ENTITY " "| %s'&#%u;
'" , * level , * codepage_stag , Indent ( * level ) , ent ) ;
off += 1 + len ;
break ;
case 0x03 : len = tvb_strsize ( tvb , off + 1 ) ;
proto_tree_add_text ( tree , tvb , off , 1 + len , " %3d | Tag | T %3d " "| STR_I (Inline string) " "| %s\'%s\'" , * level , * codepage_stag , Indent ( * level ) , tvb_format_text ( tvb , off + 1 , len - 1 ) ) ;
off += 1 + len ;
break ;
case 0x40 : case 0x41 : case 0x42 : len = tvb_strsize ( tvb , off + 1 ) ;
proto_tree_add_text ( tree , tvb , off , 1 + len , " %3d | Tag | T %3d " "| EXT_I_%1x (Extension Token) " "| %s(Inline string extension: \'%s\')" , * level , * codepage_stag , peek & 0x0f , Indent ( * level ) , tvb_format_text ( tvb , off + 1 , len - 1 ) ) ;
off += 1 + len ;
break ;
case 0x43 : proto_tree_add_text ( tree , tvb , off , 1 , " %3d | Tag | T %3d " "| PI (XML Processing Instruction) " "| %s<?xml" , * level , * codepage_stag , Indent ( * level ) ) ;
len = parse_wbxml_attribute_list ( tree , tvb , off , str_tbl , * level , codepage_attr ) ;
off += len ;
if ( off >= tvb_len ) {
DebugLog ( ( "STAG: level = %u, ThrowException: len = %u (short frame)\n" , * level , off - offset ) ) ;
THROW ( ReportedBoundsError ) ;
}
proto_tree_add_text ( tree , tvb , off - 1 , 1 , " %3d | Tag | T %3d " "| END (PI) " "| %s?>" , * level , * codepage_stag , Indent ( * level ) ) ;
break ;
case 0x80 : case 0x81 : case 0x82 : idx = tvb_get_guintvar ( tvb , off + 1 , & len ) ;
proto_tree_add_text ( tree , tvb , off , 1 + len , " %3d | Tag | T %3d " "| EXT_T_%1x (Extension Token) " "| %s(Extension Token, integer value: %u)" , * level , * codepage_stag , peek & 0x0f , Indent ( * level ) , idx ) ;
off += 1 + len ;
break ;
case 0x83 : idx = tvb_get_guintvar ( tvb , off + 1 , & len ) ;
str_len = tvb_strsize ( tvb , str_tbl + idx ) ;
proto_tree_add_text ( tree , tvb , off , 1 + len , " %3d | Tag | T %3d " "| STR_T (Tableref string) " "| %s\'%s\'" , * level , * codepage_stag , Indent ( * level ) , tvb_format_text ( tvb , str_tbl + idx , str_len - 1 ) ) ;
off += 1 + len ;
break ;
case 0xC0 : case 0xC1 : case 0xC2 : proto_tree_add_text ( tree , tvb , off , 1 , " %3d | Tag | T %3d " "| EXT_%1x (Extension Token) " "| %s(Single-byte extension)" , * level , * codepage_stag , peek & 0x0f , Indent ( * level ) ) ;
off ++ ;
break ;
case 0xC3 : if ( tvb_get_guint8 ( tvb , 0 ) ) {
idx = tvb_get_guintvar ( tvb , off + 1 , & len ) ;
proto_tree_add_text ( tree , tvb , off , 1 + len + idx , " %3d | Tag | T %3d " "| OPAQUE (Opaque data) " "| %s(%d bytes of opaque data)" , * level , * codepage_stag , Indent ( * level ) , idx ) ;
off += 1 + len + idx ;
}
else {
proto_tree_add_text ( tree , tvb , off , 1 , " %3d | Tag | T %3d " "| RESERVED_2 (Invalid Token!) " "| WBXML 1.0 parsing stops here." , * level , * codepage_stag ) ;
off = tvb_len ;
DebugLog ( ( "STAG: level = %u, Return: len = %u\n" , * level , off - offset ) ) ;
return ( off - offset ) ;
}
break ;
}
else {
tag_len = 0 ;
if ( ( peek & 0x3F ) == 4 ) {
DebugLog ( ( "STAG: LITERAL tag (peek = 0x%02X, off = %u)" " - TableRef follows!\n" , peek , off ) ) ;
idx = tvb_get_guintvar ( tvb , off + 1 , & tag_len ) ;
str_len = tvb_strsize ( tvb , str_tbl + idx ) ;
tag_new_literal = ( const gchar * ) tvb_get_ptr ( tvb , str_tbl + idx , str_len ) ;
tag_new_known = 0 ;
}
else {
tag_new_known = peek & 0x3F ;
tag_new_buf = wmem_strdup_printf ( wmem_packet_scope ( ) , "Tag_0x%02X" , tag_new_known ) ;
tag_new_literal = tag_new_buf ;
}
if ( peek & 0x40 ) {
if ( parsing_tag_content ) {
DebugLog ( ( "STAG: Tag in Tag - RECURSE! (off = %u)\n" , off ) ) ;
( * level ) ++ ;
len = parse_wbxml_tag ( tree , tvb , off , str_tbl , level , codepage_stag , codepage_attr ) ;
off += len ;
}
else {
if ( ( peek & 0x3F ) == 4 ) {
tag_save_literal = tag_new_literal ;
tag_save_known = 0 ;
}
else {
tag_save_known = tag_new_known ;
tag_save_buf = wmem_strdup_printf ( wmem_packet_scope ( ) , "Tag_0x%02X" , tag_new_known ) ;
tag_save_literal = tag_save_buf ;
}
if ( peek & 0x80 ) {
if ( tag_new_known ) {
proto_tree_add_text ( tree , tvb , off , 1 , " %3d | Tag | T %3d " "| Known Tag 0x%02X (AC) " "| %s<%s" , * level , * codepage_stag , tag_new_known , Indent ( * level ) , tag_new_literal ) ;
off ++ ;
}
else {
proto_tree_add_text ( tree , tvb , off , 1 , " %3d | Tag | T %3d " "| LITERAL_AC (Literal tag) (AC) " "| %s<%s" , * level , * codepage_stag , Indent ( * level ) , tag_new_literal ) ;
off += 1 + tag_len ;
}
len = parse_wbxml_attribute_list ( tree , tvb , off , str_tbl , * level , codepage_attr ) ;
off += len ;
if ( off >= tvb_len ) {
DebugLog ( ( "STAG: level = %u, ThrowException: " "len = %u (short frame)\n" , * level , off - offset ) ) ;
THROW ( ReportedBoundsError ) ;
}
proto_tree_add_text ( tree , tvb , off - 1 , 1 , " %3d | Tag | T %3d " "| END (attribute list) " "| %s>" , * level , * codepage_stag , Indent ( * level ) ) ;
}
else {
if ( tag_new_known ) {
proto_tree_add_text ( tree , tvb , off , 1 , " %3d | Tag | T %3d " "| Known Tag 0x%02X (.C) " "| %s<%s>" , * level , * codepage_stag , tag_new_known , Indent ( * level ) , tag_new_literal ) ;
off ++ ;
}
else {
proto_tree_add_text ( tree , tvb , off , 1 , " %3d | Tag | T %3d " "| LITERAL_C (Literal Tag) (.C) " "| %s<%s>" , * level , * codepage_stag , Indent ( * level ) , tag_new_literal ) ;
off += 1 + tag_len ;
}
}
parsing_tag_content = TRUE ;
DebugLog ( ( "Tag in Tag - No recursion this time! " "(off = %u)\n" , off ) ) ;
}
}
else {
DebugLog ( ( "<Tag/> in Tag - No recursion! (off = %u)\n" , off ) ) ;
( * level ) ++ ;
if ( peek & 0x80 ) {
if ( tag_new_known ) {
proto_tree_add_text ( tree , tvb , off , 1 , " %3d | Tag | T %3d " "| Known Tag 0x%02X (A.) " "| %s<%s" , * level , * codepage_stag , tag_new_known , Indent ( * level ) , tag_new_literal ) ;
off ++ ;
len = parse_wbxml_attribute_list ( tree , tvb , off , str_tbl , * level , codepage_attr ) ;
off += len ;
if ( off >= tvb_len ) {
DebugLog ( ( "STAG: level = %u, ThrowException: " "len = %u (short frame)\n" , * level , off - offset ) ) ;
THROW ( ReportedBoundsError ) ;
}
proto_tree_add_text ( tree , tvb , off - 1 , 1 , " %3d | Tag | T %3d " "| END (Known Tag) " "| %s/>" , * level , * codepage_stag , Indent ( * level ) ) ;
}
else {
proto_tree_add_text ( tree , tvb , off , 1 , " %3d | Tag | T %3d " "| LITERAL_A (Literal Tag) (A.) " "| %s<%s" , * level , * codepage_stag , Indent ( * level ) , tag_new_literal ) ;
off += 1 + tag_len ;
len = parse_wbxml_attribute_list ( tree , tvb , off , str_tbl , * level , codepage_attr ) ;
off += len ;
if ( off >= tvb_len ) {
DebugLog ( ( "STAG: level = %u, ThrowException: " "len = %u (short frame)\n" , * level , off - offset ) ) ;
THROW ( ReportedBoundsError ) ;
}
proto_tree_add_text ( tree , tvb , off - 1 , 1 , " %3d | Tag | T %3d " "| END (Literal Tag) " "| %s/>" , * level , * codepage_stag , Indent ( * level ) ) ;
}
}
else {
if ( tag_new_known ) {
proto_tree_add_text ( tree , tvb , off , 1 , " %3d | Tag | T %3d " "| Known Tag 0x%02x (..) " "| %s<%s />" , * level , * codepage_stag , tag_new_known , Indent ( * level ) , tag_new_literal ) ;
off ++ ;
}
else {
proto_tree_add_text ( tree , tvb , off , 1 , " %3d | Tag | T %3d " "| LITERAL (Literal Tag) (..) " "| %s<%s />" , * level , * codepage_stag , Indent ( * level ) , tag_new_literal ) ;
off += 1 + tag_len ;
}
}
( * level ) -- ;
}
}
if ( off < last_off ) {
THROW ( ReportedBoundsError ) ;
}
last_off = off ;
}
DebugLog ( ( "STAG: level = %u, Return: len = %u (end of function body)\n" , * level , off - offset ) ) ;
return ( off - offset ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
IN_PROC_BROWSER_TEST_F ( BluetoothChooserBrowserTest , InvokeDialog_ConnectedModal ) {
set_status ( FakeBluetoothChooserController : : BluetoothStatus : : IDLE ) ;
AddConnectedDevice ( ) ;
RunDialog ( ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static gpgme_error_t uiserver_set_locale ( void * engine , int category , const char * value ) {
engine_uiserver_t uiserver = engine ;
gpgme_error_t err ;
char * optstr ;
char * catstr ;
if ( category == LC_CTYPE ) {
catstr = "lc-ctype" ;
if ( ! value && uiserver -> lc_ctype_set ) return gpg_error ( GPG_ERR_INV_VALUE ) ;
if ( value ) uiserver -> lc_ctype_set = 1 ;
}
# ifdef LC_MESSAGES else if ( category == LC_MESSAGES ) {
catstr = "lc-messages" ;
if ( ! value && uiserver -> lc_messages_set ) return gpg_error ( GPG_ERR_INV_VALUE ) ;
if ( value ) uiserver -> lc_messages_set = 1 ;
}
# endif else return gpg_error ( GPG_ERR_INV_VALUE ) ;
if ( ! value ) return 0 ;
if ( asprintf ( & optstr , "OPTION %s=%s" , catstr , value ) < 0 ) err = gpg_error_from_syserror ( ) ;
else {
err = assuan_transact ( uiserver -> assuan_ctx , optstr , NULL , NULL , NULL , NULL , NULL , NULL ) ;
free ( optstr ) ;
}
return err ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_h245_OCTET_STRING_SIZE_6 ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_octet_string ( tvb , offset , actx , tree , hf_index , 6 , 6 , FALSE , NULL ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int amr_decode_fix_avctx ( AVCodecContext * avctx ) {
const int is_amr_wb = 1 + ( avctx -> codec_id == AV_CODEC_ID_AMR_WB ) ;
avctx -> sample_rate = 8000 * is_amr_wb ;
if ( avctx -> channels > 1 ) {
av_log_missing_feature ( avctx , "multi-channel AMR" , 0 ) ;
return AVERROR_PATCHWELCOME ;
}
avctx -> channels = 1 ;
avctx -> channel_layout = AV_CH_LAYOUT_MONO ;
avctx -> sample_fmt = AV_SAMPLE_FMT_S16 ;
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void set_partial_b64x64_partition ( MODE_INFO * mi , int mis , int bh_in , int bw_in , int row8x8_remaining , int col8x8_remaining , BLOCK_SIZE bsize , MODE_INFO * mi_8x8 ) {
int bh = bh_in ;
int r , c ;
for ( r = 0 ;
r < MI_BLOCK_SIZE ;
r += bh ) {
int bw = bw_in ;
for ( c = 0 ;
c < MI_BLOCK_SIZE ;
c += bw ) {
const int index = r * mis + c ;
mi_8x8 [ index ] . src_mi = mi + index ;
mi_8x8 [ index ] . src_mi -> mbmi . sb_type = find_partition_size ( bsize , row8x8_remaining - r , col8x8_remaining - c , & bh , & bw ) ;
}
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_rsl_ie_act_type ( tvbuff_t * tvb , packet_info * pinfo _U_ , proto_tree * tree , int offset , gboolean is_mandatory ) {
proto_tree * ie_tree ;
guint8 ie_id ;
guint octet ;
if ( is_mandatory == FALSE ) {
ie_id = tvb_get_guint8 ( tvb , offset ) ;
if ( ie_id != RSL_IE_ACT_TYPE ) return offset ;
}
ie_tree = proto_tree_add_subtree ( tree , tvb , offset , 2 , ett_ie_act_type , NULL , "Activation Type IE " ) ;
proto_tree_add_item ( ie_tree , hf_rsl_ie_id , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
offset ++ ;
proto_tree_add_item ( ie_tree , hf_rsl_rbit , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
octet = ( tvb_get_guint8 ( tvb , offset ) & 0x06 ) >> 1 ;
proto_tree_add_item ( ie_tree , hf_rsl_a3a2 , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
switch ( octet ) {
case 0 : proto_tree_add_item ( ie_tree , hf_rsl_a1_0 , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
break ;
case 1 : proto_tree_add_item ( ie_tree , hf_rsl_a1_1 , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
break ;
case 2 : proto_tree_add_item ( ie_tree , hf_rsl_a1_2 , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
break ;
default : break ;
}
offset ++ ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static struct isoent * isoent_find_child ( struct isoent * isoent , const char * child_name ) {
struct isoent * np ;
np = ( struct isoent * ) __archive_rb_tree_find_node ( & ( isoent -> rbtree ) , child_name ) ;
return ( np ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int curl_msnprintf ( char * buffer , size_t maxlength , const char * format , ... ) {
int retcode ;
va_list ap_save ;
va_start ( ap_save , format ) ;
retcode = curl_mvsnprintf ( buffer , maxlength , format , ap_save ) ;
va_end ( ap_save ) ;
return retcode ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int32_t u_printf_simple_percent_handler ( const u_printf_stream_handler * handler , void * context , ULocaleBundle * formatBundle , const u_printf_spec_info * info , const ufmt_args * args ) {
( void ) formatBundle ;
( void ) info ;
( void ) args ;
static const UChar PERCENT [ ] = {
UP_PERCENT }
;
return handler -> write ( context , PERCENT , 1 ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
unsigned long # define BN_LONG long # define BN_BITS 128 # define BN_BYTES 8 # define BN_BITS2 64 # define BN_BITS4 32 # define BN_MASK ( 0xffffffffffffffffffffffffffffffffLL ) # define BN_MASK2 ( 0xffffffffffffffffL ) # define BN_MASK2l ( 0xffffffffL ) # define BN_MASK2h ( 0xffffffff00000000L ) # define BN_MASK2h1 ( 0xffffffff80000000L ) # define BN_TBIT ( 0x8000000000000000L ) # define BN_DEC_CONV ( 10000000000000000000UL ) # define BN_DEC_FMT1 "%lu" # define BN_DEC_FMT2 "%019lu" # define BN_DEC_NUM 19 # define BN_HEX_FMT1 "%lX" # define BN_HEX_FMT2 "%016lX" # endif # ifdef SIXTY_FOUR_BIT # undef BN_LLONG # undef BN_ULLONG # define BN_ULONG unsigned long long # define BN_LONG long long # define BN_BITS 128 # define BN_BYTES 8 # define BN_BITS2 64 # define BN_BITS4 32 # define BN_MASK2 ( 0xffffffffffffffffLL ) # define BN_MASK2l ( 0xffffffffL ) # define BN_MASK2h ( 0xffffffff00000000LL ) # define BN_MASK2h1 ( 0xffffffff80000000LL ) # define BN_TBIT ( 0x8000000000000000LL ) # define BN_DEC_CONV ( 10000000000000000000ULL ) # define BN_DEC_FMT1 "%llu" # define BN_DEC_FMT2 "%019llu" # define BN_DEC_NUM 19 # define BN_HEX_FMT1 "%llX" # define BN_HEX_FMT2 "%016llX" # endif # ifdef THIRTY_TWO_BIT # ifdef BN_LLONG # if defined ( _WIN32 ) && ! defined ( __GNUC__ ) # define BN_ULLONG unsigned __int64 # define BN_MASK ( 0xffffffffffffffffI64 ) # else # define BN_ULLONG unsigned long long # define BN_MASK ( 0xffffffffffffffffLL ) # endif # endif # define BN_ULONG unsigned int # define BN_LONG int # define BN_BITS 64 # define BN_BYTES 4 # define BN_BITS2 32 # define BN_BITS4 16 # define BN_MASK2 ( 0xffffffffL ) # define BN_MASK2l ( 0xffff ) # define BN_MASK2h1 ( 0xffff8000L ) # define BN_MASK2h ( 0xffff0000L ) # define BN_TBIT ( 0x80000000L ) # define BN_DEC_CONV ( 1000000000L ) # define BN_DEC_FMT1 "%u" # define BN_DEC_FMT2 "%09u" # define BN_DEC_NUM 9 # define BN_HEX_FMT1 "%X" # define BN_HEX_FMT2 "%08X" # endif # define BN_DEFAULT_BITS 1280 # define BN_FLG_MALLOCED 0x01 # define BN_FLG_STATIC_DATA 0x02 # define BN_FLG_CONSTTIME 0x04 # ifndef OPENSSL_NO_DEPRECATED # define BN_FLG_EXP_CONSTTIME BN_FLG_CONSTTIME # endif # ifndef OPENSSL_NO_DEPRECATED # define BN_FLG_FREE 0x8000 # endif # define BN_set_flags ( b , n ) ( ( b ) -> flags |= ( n ) ) # define BN_get_flags ( b , n ) ( ( b ) -> flags & ( n ) ) # define BN_with_flags ( dest , b , n ) ( ( dest ) -> d = ( b ) -> d , \ ( dest ) -> top = ( b ) -> top , \ ( dest ) -> dmax = ( b ) -> dmax , \ ( dest ) -> neg = ( b ) -> neg , \ ( dest ) -> flags = ( ( ( dest ) -> flags & BN_FLG_MALLOCED ) \ | ( ( b ) -> flags & ~ BN_FLG_MALLOCED ) \ | BN_FLG_STATIC_DATA \ | ( n ) ) ) # if 0 typedef struct bignum_st BIGNUM ;
typedef struct bignum_ctx BN_CTX ;
typedef struct bn_blinding_st BN_BLINDING ;
typedef struct bn_mont_ctx_st BN_MONT_CTX ;
typedef struct bn_recp_ctx_st BN_RECP_CTX ;
typedef struct bn_gencb_st BN_GENCB ;
# endif struct bignum_st {
BN_ULONG * d ;
int top ;
int dmax ;
int neg ;
int flags ;
}
;
struct bn_mont_ctx_st {
int ri ;
BIGNUM RR ;
BIGNUM N ;
BIGNUM Ni ;
BN_ULONG n0 [ 2 ] ;
int flags ;
}
;
struct bn_recp_ctx_st {
BIGNUM N ;
BIGNUM Nr ;
int num_bits ;
int shift ;
int flags ;
}
;
struct bn_gencb_st {
unsigned int ver ;
void * arg ;
union {
void ( * cb_1 ) ( int , int , void * ) ;
int ( * cb_2 ) ( int , int , BN_GENCB * ) ;
}
cb ;
}
;
int BN_GENCB_call ( BN_GENCB * cb , int a , int b ) ;
# define BN_GENCB_set_old ( gencb , callback , cb_arg ) {
\ BN_GENCB * tmp_gencb = ( gencb ) ;
\ tmp_gencb -> ver = 1 ;
\ tmp_gencb -> arg = ( cb_arg ) ;
\ tmp_gencb -> cb . cb_1 = ( callback ) ;
}
# define BN_GENCB_set ( gencb , callback , cb_arg ) {
\ BN_GENCB * tmp_gencb = ( gencb ) ;
\ tmp_gencb -> ver = 2 ;
\ tmp_gencb -> arg = ( cb_arg ) ;
\ tmp_gencb -> cb . cb_2 = ( callback ) ;
}
# define BN_prime_checks 0 # define BN_prime_checks_for_size ( b ) ( ( b ) >= 1300 ? 2 : \ ( b ) >= 850 ? 3 : \ ( b ) >= 650 ? 4 : \ ( b ) >= 550 ? 5 : \ ( b ) >= 450 ? 6 : \ ( b ) >= 400 ? 7 : \ ( b ) >= 350 ? 8 : \ ( b ) >= 300 ? 9 : \ ( b ) >= 250 ? 12 : \ ( b ) >= 200 ? 15 : \ ( b ) >= 150 ? 18 : \ 27 ) # define BN_num_bytes ( a ) ( ( BN_num_bits ( a ) + 7 ) / 8 ) # define BN_abs_is_word ( a , w ) ( ( ( ( a ) -> top == 1 ) && ( ( a ) -> d [ 0 ] == ( BN_ULONG ) ( w ) ) ) || \ ( ( ( w ) == 0 ) && ( ( a ) -> top == 0 ) ) ) # define BN_is_zero ( a ) ( ( a ) -> top == 0 ) # define BN_is_one ( a ) ( BN_abs_is_word ( ( a ) , 1 ) && ! ( a ) -> neg ) # define BN_is_word ( a , w ) ( BN_abs_is_word ( ( a ) , ( w ) ) && ( ! ( w ) || ! ( a ) -> neg ) ) # define BN_is_odd ( a ) ( ( ( a ) -> top > 0 ) && ( ( a ) -> d [ 0 ] & 1 ) ) # define BN_one ( a ) ( BN_set_word ( ( a ) , 1 ) ) # define BN_zero_ex ( a ) \ do {
\ BIGNUM * _tmp_bn = ( a ) ;
\ _tmp_bn -> top = 0 ;
\ _tmp_bn -> neg = 0 ;
\ }
while ( 0 ) # ifdef OPENSSL_NO_DEPRECATED # define BN_zero ( a ) BN_zero_ex ( a ) # else # define BN_zero ( a ) ( BN_set_word ( ( a ) , 0 ) ) # endif const BIGNUM * BN_value_one ( void ) ;
char * BN_options ( void ) ;
BN_CTX * BN_CTX_new ( void ) ;
# ifndef OPENSSL_NO_DEPRECATED void BN_CTX_init ( BN_CTX * c ) ;
# endif void BN_CTX_free ( BN_CTX * c ) ;
void BN_CTX_start ( BN_CTX * ctx ) ;
BIGNUM * BN_CTX_get ( BN_CTX * ctx ) ;
void BN_CTX_end ( BN_CTX * ctx ) ;
int BN_rand ( BIGNUM * rnd , int bits , int top , int bottom ) ;
int BN_pseudo_rand ( BIGNUM * rnd , int bits , int top , int bottom ) ;
int BN_rand_range ( BIGNUM * rnd , const BIGNUM * range ) ;
int BN_pseudo_rand_range ( BIGNUM * rnd , const BIGNUM * range ) ;
int BN_num_bits ( const BIGNUM * a ) ;
int BN_num_bits_word ( BN_ULONG l ) ;
BIGNUM * BN_new ( void ) ;
void BN_init ( BIGNUM * ) ;
void BN_clear_free ( BIGNUM * a ) ;
BIGNUM * BN_copy ( BIGNUM * a , const BIGNUM * b ) ;
void BN_swap ( BIGNUM * a , BIGNUM * b ) ;
BIGNUM * BN_bin2bn ( const unsigned char * s , int len , BIGNUM * ret ) ;
int BN_bn2bin ( const BIGNUM * a , unsigned char * to ) ;
BIGNUM * BN_mpi2bn ( const unsigned char * s , int len , BIGNUM * ret ) ;
int BN_bn2mpi ( const BIGNUM * a , unsigned char * to ) ;
int BN_sub ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b ) ;
int BN_usub ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b ) ;
int BN_uadd ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b ) ;
int BN_add ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b ) ;
int BN_mul ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , BN_CTX * ctx ) ;
int BN_sqr ( BIGNUM * r , const BIGNUM * a , BN_CTX * ctx ) ;
void BN_set_negative ( BIGNUM * b , int n ) ;
# define BN_is_negative ( a ) ( ( a ) -> neg != 0 ) int BN_div ( BIGNUM * dv , BIGNUM * rem , const BIGNUM * m , const BIGNUM * d , BN_CTX * ctx ) ;
# define BN_mod ( rem , m , d , ctx ) BN_div ( NULL , ( rem ) , ( m ) , ( d ) , ( ctx ) ) int BN_nnmod ( BIGNUM * r , const BIGNUM * m , const BIGNUM * d , BN_CTX * ctx ) ;
int BN_mod_add ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , const BIGNUM * m , BN_CTX * ctx ) ;
int BN_mod_add_quick ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , const BIGNUM * m ) ;
int BN_mod_sub ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , const BIGNUM * m , BN_CTX * ctx ) ;
int BN_mod_sub_quick ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , const BIGNUM * m ) ;
int BN_mod_mul ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , const BIGNUM * m , BN_CTX * ctx ) ;
int BN_mod_sqr ( BIGNUM * r , const BIGNUM * a , const BIGNUM * m , BN_CTX * ctx ) ;
int BN_mod_lshift1 ( BIGNUM * r , const BIGNUM * a , const BIGNUM * m , BN_CTX * ctx ) ;
int BN_mod_lshift1_quick ( BIGNUM * r , const BIGNUM * a , const BIGNUM * m ) ;
int BN_mod_lshift ( BIGNUM * r , const BIGNUM * a , int n , const BIGNUM * m , BN_CTX * ctx ) ;
int BN_mod_lshift_quick ( BIGNUM * r , const BIGNUM * a , int n , const BIGNUM * m ) ;
BN_ULONG BN_mod_word ( const BIGNUM * a , BN_ULONG w ) ;
BN_ULONG BN_div_word ( BIGNUM * a , BN_ULONG w ) ;
int BN_mul_word ( BIGNUM * a , BN_ULONG w ) ;
int BN_add_word ( BIGNUM * a , BN_ULONG w ) ;
int BN_sub_word ( BIGNUM * a , BN_ULONG w ) ;
int BN_set_word ( BIGNUM * a , BN_ULONG w ) ;
BN_ULONG BN_get_word ( const BIGNUM * a ) ;
int BN_cmp ( const BIGNUM * a , const BIGNUM * b ) ;
void BN_free ( BIGNUM * a ) ;
int BN_is_bit_set ( const BIGNUM * a , int n ) ;
int BN_lshift ( BIGNUM * r , const BIGNUM * a , int n ) ;
int BN_lshift1 ( BIGNUM * r , const BIGNUM * a ) ;
int BN_exp ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , BN_CTX * ctx ) ;
int BN_mod_exp ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , const BIGNUM * m , BN_CTX * ctx ) ;
int BN_mod_exp_mont ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , const BIGNUM * m , BN_CTX * ctx , BN_MONT_CTX * m_ctx ) ;
int BN_mod_exp_mont_consttime ( BIGNUM * rr , const BIGNUM * a , const BIGNUM * p , const BIGNUM * m , BN_CTX * ctx , BN_MONT_CTX * in_mont ) ;
int BN_mod_exp_mont_word ( BIGNUM * r , BN_ULONG a , const BIGNUM * p , const BIGNUM * m , BN_CTX * ctx , BN_MONT_CTX * m_ctx ) ;
int BN_mod_exp2_mont ( BIGNUM * r , const BIGNUM * a1 , const BIGNUM * p1 , const BIGNUM * a2 , const BIGNUM * p2 , const BIGNUM * m , BN_CTX * ctx , BN_MONT_CTX * m_ctx ) ;
int BN_mod_exp_simple ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , const BIGNUM * m , BN_CTX * ctx ) ;
int BN_mask_bits ( BIGNUM * a , int n ) ;
# ifndef OPENSSL_NO_FP_API int BN_print_fp ( FILE * fp , const BIGNUM * a ) ;
# endif # ifdef HEADER_BIO_H int BN_print ( BIO * fp , const BIGNUM * a ) ;
# else int BN_print ( void * fp , const BIGNUM * a ) ;
# endif int BN_reciprocal ( BIGNUM * r , const BIGNUM * m , int len , BN_CTX * ctx ) ;
int BN_rshift ( BIGNUM * r , const BIGNUM * a , int n ) ;
int BN_rshift1 ( BIGNUM * r , const BIGNUM * a ) ;
void BN_clear ( BIGNUM * a ) ;
BIGNUM * BN_dup ( const BIGNUM * a ) ;
int BN_ucmp ( const BIGNUM * a , const BIGNUM * b ) ;
int BN_set_bit ( BIGNUM * a , int n ) ;
int BN_clear_bit ( BIGNUM * a , int n ) ;
char * BN_bn2hex ( const BIGNUM * a ) ;
char * BN_bn2dec ( const BIGNUM * a ) ;
int BN_hex2bn ( BIGNUM * * a , const char * str ) ;
int BN_dec2bn ( BIGNUM * * a , const char * str ) ;
int BN_asc2bn ( BIGNUM * * a , const char * str ) ;
int BN_gcd ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , BN_CTX * ctx ) ;
int BN_kronecker ( const BIGNUM * a , const BIGNUM * b , BN_CTX * ctx ) ;
BIGNUM * BN_mod_inverse ( BIGNUM * ret , const BIGNUM * a , const BIGNUM * n , BN_CTX * ctx ) ;
BIGNUM * BN_mod_sqrt ( BIGNUM * ret , const BIGNUM * a , const BIGNUM * n , BN_CTX * ctx ) ;
# ifndef OPENSSL_NO_DEPRECATED BIGNUM * BN_generate_prime ( BIGNUM * ret , int bits , int safe , const BIGNUM * add , const BIGNUM * rem , void ( * callback ) ( int , int , void * ) , void * cb_arg ) ;
int BN_is_prime ( const BIGNUM * p , int nchecks , void ( * callback ) ( int , int , void * ) , BN_CTX * ctx , void * cb_arg ) ;
int BN_is_prime_fasttest ( const BIGNUM * p , int nchecks , void ( * callback ) ( int , int , void * ) , BN_CTX * ctx , void * cb_arg , int do_trial_division ) ;
# endif int BN_generate_prime_ex ( BIGNUM * ret , int bits , int safe , const BIGNUM * add , const BIGNUM * rem , BN_GENCB * cb ) ;
int BN_is_prime_ex ( const BIGNUM * p , int nchecks , BN_CTX * ctx , BN_GENCB * cb ) ;
int BN_is_prime_fasttest_ex ( const BIGNUM * p , int nchecks , BN_CTX * ctx , int do_trial_division , BN_GENCB * cb ) ;
int BN_X931_generate_Xpq ( BIGNUM * Xp , BIGNUM * Xq , int nbits , BN_CTX * ctx ) ;
int BN_X931_derive_prime_ex ( BIGNUM * p , BIGNUM * p1 , BIGNUM * p2 , const BIGNUM * Xp , const BIGNUM * Xp1 , const BIGNUM * Xp2 , const BIGNUM * e , BN_CTX * ctx , BN_GENCB * cb ) ;
int BN_X931_generate_prime_ex ( BIGNUM * p , BIGNUM * p1 , BIGNUM * p2 , BIGNUM * Xp1 , BIGNUM * Xp2 , const BIGNUM * Xp , const BIGNUM * e , BN_CTX * ctx , BN_GENCB * cb ) ;
BN_MONT_CTX * BN_MONT_CTX_new ( void ) ;
void BN_MONT_CTX_init ( BN_MONT_CTX * ctx ) ;
int BN_mod_mul_montgomery ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , BN_MONT_CTX * mont , BN_CTX * ctx ) ;
# define BN_to_montgomery ( r , a , mont , ctx ) BN_mod_mul_montgomery ( \ ( r ) , ( a ) , & ( ( mont ) -> RR ) , ( mont ) , ( ctx ) ) int BN_from_montgomery ( BIGNUM * r , const BIGNUM * a , BN_MONT_CTX * mont , BN_CTX * ctx ) ;
void BN_MONT_CTX_free ( BN_MONT_CTX * mont ) ;
int BN_MONT_CTX_set ( BN_MONT_CTX * mont , const BIGNUM * mod , BN_CTX * ctx ) ;
BN_MONT_CTX * BN_MONT_CTX_copy ( BN_MONT_CTX * to , BN_MONT_CTX * from ) ;
BN_MONT_CTX * BN_MONT_CTX_set_locked ( BN_MONT_CTX * * pmont , int lock , const BIGNUM * mod , BN_CTX * ctx ) ;
# define BN_BLINDING_NO_UPDATE 0x00000001 # define BN_BLINDING_NO_RECREATE 0x00000002 BN_BLINDING * BN_BLINDING_new ( const BIGNUM * A , const BIGNUM * Ai , BIGNUM * mod ) ;
void BN_BLINDING_free ( BN_BLINDING * b ) ;
int BN_BLINDING_update ( BN_BLINDING * b , BN_CTX * ctx ) ;
int BN_BLINDING_convert ( BIGNUM * n , BN_BLINDING * b , BN_CTX * ctx ) ;
int BN_BLINDING_invert ( BIGNUM * n , BN_BLINDING * b , BN_CTX * ctx ) ;
int BN_BLINDING_convert_ex ( BIGNUM * n , BIGNUM * r , BN_BLINDING * b , BN_CTX * ) ;
int BN_BLINDING_invert_ex ( BIGNUM * n , const BIGNUM * r , BN_BLINDING * b , BN_CTX * ) ;
# ifndef OPENSSL_NO_DEPRECATED unsigned long BN_BLINDING_get_thread_id ( const BN_BLINDING * ) ;
void BN_BLINDING_set_thread_id ( BN_BLINDING * , unsigned long ) ;
# endif CRYPTO_THREADID * BN_BLINDING_thread_id ( BN_BLINDING * ) ;
unsigned long BN_BLINDING_get_flags ( const BN_BLINDING * ) ;
void BN_BLINDING_set_flags ( BN_BLINDING * , unsigned long ) ;
BN_BLINDING * BN_BLINDING_create_param ( BN_BLINDING * b , const BIGNUM * e , BIGNUM * m , BN_CTX * ctx , int ( * bn_mod_exp ) ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , const BIGNUM * m , BN_CTX * ctx , BN_MONT_CTX * m_ctx ) , BN_MONT_CTX * m_ctx ) ;
# ifndef OPENSSL_NO_DEPRECATED void BN_set_params ( int mul , int high , int low , int mont ) ;
int BN_get_params ( int which ) ;
# endif void BN_RECP_CTX_init ( BN_RECP_CTX * recp ) ;
BN_RECP_CTX * BN_RECP_CTX_new ( void ) ;
void BN_RECP_CTX_free ( BN_RECP_CTX * recp ) ;
int BN_RECP_CTX_set ( BN_RECP_CTX * recp , const BIGNUM * rdiv , BN_CTX * ctx ) ;
int BN_mod_mul_reciprocal ( BIGNUM * r , const BIGNUM * x , const BIGNUM * y , BN_RECP_CTX * recp , BN_CTX * ctx ) ;
int BN_mod_exp_recp ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , const BIGNUM * m , BN_CTX * ctx ) ;
int BN_div_recp ( BIGNUM * dv , BIGNUM * rem , const BIGNUM * m , BN_RECP_CTX * recp , BN_CTX * ctx ) ;
# ifndef OPENSSL_NO_EC2M int BN_GF2m_add ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b ) ;
# define BN_GF2m_sub ( r , a , b ) BN_GF2m_add ( r , a , b ) int BN_GF2m_mod ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p ) ;
int BN_GF2m_mod_mul ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , const BIGNUM * p , BN_CTX * ctx ) ;
int BN_GF2m_mod_sqr ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , BN_CTX * ctx ) ;
int BN_GF2m_mod_inv ( BIGNUM * r , const BIGNUM * b , const BIGNUM * p , BN_CTX * ctx ) ;
int BN_GF2m_mod_div ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , const BIGNUM * p , BN_CTX * ctx ) ;
int BN_GF2m_mod_exp ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , const BIGNUM * p , BN_CTX * ctx ) ;
int BN_GF2m_mod_sqrt ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , BN_CTX * ctx ) ;
int BN_GF2m_mod_solve_quad ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , BN_CTX * ctx ) ;
# define BN_GF2m_cmp ( a , b ) BN_ucmp ( ( a ) , ( b ) ) int BN_GF2m_mod_arr ( BIGNUM * r , const BIGNUM * a , const int p [ ] ) ;
int BN_GF2m_mod_mul_arr ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , const int p [ ] , BN_CTX * ctx ) ;
int BN_GF2m_mod_sqr_arr ( BIGNUM * r , const BIGNUM * a , const int p [ ] , BN_CTX * ctx ) ;
int BN_GF2m_mod_inv_arr ( BIGNUM * r , const BIGNUM * b , const int p [ ] , BN_CTX * ctx ) ;
int BN_GF2m_mod_div_arr ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , const int p [ ] , BN_CTX * ctx ) ;
int BN_GF2m_mod_exp_arr ( BIGNUM * r , const BIGNUM * a , const BIGNUM * b , const int p [ ] , BN_CTX * ctx ) ;
int BN_GF2m_mod_sqrt_arr ( BIGNUM * r , const BIGNUM * a , const int p [ ] , BN_CTX * ctx ) ;
int BN_GF2m_mod_solve_quad_arr ( BIGNUM * r , const BIGNUM * a , const int p [ ] , BN_CTX * ctx ) ;
int BN_GF2m_poly2arr ( const BIGNUM * a , int p [ ] , int max ) ;
int BN_GF2m_arr2poly ( const int p [ ] , BIGNUM * a ) ;
# endif int BN_nist_mod_192 ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , BN_CTX * ctx ) ;
int BN_nist_mod_224 ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , BN_CTX * ctx ) ;
int BN_nist_mod_256 ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , BN_CTX * ctx ) ;
int BN_nist_mod_384 ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , BN_CTX * ctx ) ;
int BN_nist_mod_521 ( BIGNUM * r , const BIGNUM * a , const BIGNUM * p , BN_CTX * ctx ) ;
const BIGNUM * BN_get0_nist_prime_192 ( void ) ;
const BIGNUM * BN_get0_nist_prime_224 ( void ) ;
const BIGNUM * BN_get0_nist_prime_256 ( void ) ;
const BIGNUM * BN_get0_nist_prime_384 ( void ) ;
const BIGNUM * BN_get0_nist_prime_521 ( void ) ;
int ( * BN_nist_mod_func ( const BIGNUM * p ) ) ( BIGNUM * r , const BIGNUM * a , const BIGNUM * field , BN_CTX * ctx ) ;
int BN_generate_dsa_nonce ( BIGNUM * out , const BIGNUM * range , const BIGNUM * priv , const unsigned char * message , size_t message_len , BN_CTX * ctx ) ;
# define bn_expand ( a , bits ) ( ( ( ( ( ( bits + BN_BITS2 - 1 ) ) / BN_BITS2 ) ) <= ( a ) -> dmax ) ? \ ( a ) : bn_expand2 ( ( a ) , ( bits + BN_BITS2 - 1 ) / BN_BITS2 ) ) # define bn_wexpand ( a , words ) ( ( ( words ) <= ( a ) -> dmax ) ? ( a ) : bn_expand2 ( ( a ) , ( words ) ) ) BIGNUM * bn_expand2 ( BIGNUM * a , int words ) ;
# ifndef OPENSSL_NO_DEPRECATED BIGNUM * bn_dup_expand ( const BIGNUM * a , int words ) ;
# endif # ifdef BN_DEBUG # include < assert . h > # ifdef BN_DEBUG_RAND # ifndef RAND_pseudo_bytes int RAND_pseudo_bytes ( unsigned char * buf , int num ) ;
# define BN_DEBUG_TRIX # endif # define bn_pollute ( a ) \ do {
\ const BIGNUM * _bnum1 = ( a ) ;
\ if ( _bnum1 -> top < _bnum1 -> dmax ) {
\ unsigned char _tmp_char ;
\ \ BN_ULONG * _not_const ;
\ memcpy ( & _not_const , & _bnum1 -> d , sizeof ( BN_ULONG * ) ) ;
\ RAND_pseudo_bytes ( & _tmp_char , 1 ) ;
\ memset ( ( unsigned char * ) ( _not_const + _bnum1 -> top ) , _tmp_char , \ ( _bnum1 -> dmax - _bnum1 -> top ) * sizeof ( BN_ULONG ) ) ;
\ }
\ }
while ( 0 ) # ifdef BN_DEBUG_TRIX # undef RAND_pseudo_bytes # endif # else # define bn_pollute ( a ) # endif # define bn_check_top ( a ) \ do {
\ const BIGNUM * _bnum2 = ( a ) ;
\ if ( _bnum2 != NULL ) {
\ assert ( ( _bnum2 -> top == 0 ) || \ ( _bnum2 -> d [ _bnum2 -> top - 1 ] != 0 ) ) ;
\ bn_pollute ( _bnum2 ) ;
\ }
\ }
while ( 0 ) # define bn_fix_top ( a ) bn_check_top ( a ) # else # define bn_pollute ( a ) # define bn_check_top ( a ) # define bn_fix_top ( a ) bn_correct_top ( a ) # endif # define bn_correct_top ( a ) \ {
\ BN_ULONG * ftl ;
\ int tmp_top = ( a ) -> top ;
\ if ( tmp_top > 0 ) \ {
\ for ( ftl = & ( ( a ) -> d [ tmp_top - 1 ] ) ;
tmp_top > 0 ;
tmp_top -- ) \ if ( * ( ftl -- ) ) break ;
\ ( a ) -> top = tmp_top ;
\ }
\ bn_pollute ( a ) ;
\ }
BN_ULONG bn_mul_add_words ( BN_ULONG * rp , const BN_ULONG * ap , int num , BN_ULONG w )
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void dissect_q931_reverse_charge_ind_ie ( tvbuff_t * tvb , int offset , int len , proto_tree * tree ) {
if ( len == 0 ) return ;
proto_tree_add_item ( tree , hf_q931_reverse_charging_ind , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int32_t u_scanf_scidbl_handler ( UFILE * input , u_scanf_spec_info * info , ufmt_args * args , const UChar * fmt , int32_t * fmtConsumed , int32_t * argConverted ) {
int32_t len ;
double num ;
UNumberFormat * scientificFormat , * genericFormat ;
double scientificResult , genericResult ;
int32_t scientificParsePos = 0 , genericParsePos = 0 , parsePos = 0 ;
int32_t skipped ;
UErrorCode scientificStatus = U_ZERO_ERROR ;
UErrorCode genericStatus = U_ZERO_ERROR ;
skipped = u_scanf_skip_leading_ws ( input , info -> fPadChar ) ;
ufile_fill_uchar_buffer ( input ) ;
len = ( int32_t ) ( input -> str . fLimit - input -> str . fPos ) ;
if ( info -> fWidth != - 1 ) len = ufmt_min ( len , info -> fWidth ) ;
scientificFormat = u_locbund_getNumberFormat ( & input -> str . fBundle , UNUM_SCIENTIFIC ) ;
genericFormat = u_locbund_getNumberFormat ( & input -> str . fBundle , UNUM_DECIMAL ) ;
if ( scientificFormat == 0 || genericFormat == 0 ) return 0 ;
skipped += u_scanf_skip_leading_positive_sign ( input , genericFormat , & genericStatus ) ;
scientificResult = unum_parseDouble ( scientificFormat , input -> str . fPos , len , & scientificParsePos , & scientificStatus ) ;
genericResult = unum_parseDouble ( genericFormat , input -> str . fPos , len , & genericParsePos , & genericStatus ) ;
if ( scientificParsePos > genericParsePos ) {
num = scientificResult ;
parsePos += scientificParsePos ;
}
else {
num = genericResult ;
parsePos += genericParsePos ;
}
input -> str . fPos += parsePos ;
if ( ! info -> fSkipArg ) {
if ( info -> fIsLong ) * ( double * ) ( args [ 0 ] . ptrValue ) = num ;
else if ( info -> fIsLongDouble ) * ( long double * ) ( args [ 0 ] . ptrValue ) = num ;
else * ( float * ) ( args [ 0 ] . ptrValue ) = ( float ) num ;
}
* argConverted = ! info -> fSkipArg ;
return parsePos + skipped ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_h225_T_tunnelledSignallingMessage ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
# line 768 "./asn1/h225/h225.cnf" tp_handle = NULL ;
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h225_T_tunnelledSignallingMessage , T_tunnelledSignallingMessage_sequence ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int dissect_h245_OpenLogicalChannel ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
# line 129 "../../asn1/h245/h245.cnf" gint32 temp ;
upcoming_olc = ( ! actx -> pinfo -> fd -> flags . visited ) ? wmem_new0 ( wmem_file_scope ( ) , olc_info_t ) : NULL ;
h223_fw_lc_num = 0 ;
h223_lc_params_temp = NULL ;
offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h245_OpenLogicalChannel , OpenLogicalChannel_sequence ) ;
if ( h223_fw_lc_num != 0 && h223_fw_lc_params ) {
h223_pending_olc * pending = wmem_new ( wmem_file_scope ( ) , h223_pending_olc ) ;
pending -> fw_channel_params = h223_fw_lc_params ;
pending -> rev_channel_params = h223_rev_lc_params ;
temp = h223_fw_lc_num ;
if ( actx -> pinfo -> p2p_dir > - 1 ) g_hash_table_insert ( h223_pending_olc_reqs [ actx -> pinfo -> p2p_dir ] , GINT_TO_POINTER ( temp ) , pending ) ;
}
if ( upcoming_olc ) {
if ( fast_start ) {
h245_setup_channels ( actx -> pinfo , & upcoming_olc -> rev_lc ) ;
}
else {
g_hash_table_insert ( h245_pending_olc_reqs , wmem_strdup ( wmem_file_scope ( ) , gen_olc_key ( upcoming_olc -> fwd_lc_num , & actx -> pinfo -> dst , & actx -> pinfo -> src ) ) , upcoming_olc ) ;
}
}
upcoming_olc = NULL ;
if ( h245_pi != NULL ) h245_pi -> msg_type = H245_OpenLogChn ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void inc_thread_created ( void ) {
thread_created ++ ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
SPL_METHOD ( SplFileInfo , _bad_state_ex ) {
zend_throw_exception_ex ( spl_ce_LogicException , 0 TSRMLS_CC , "The parent constructor was not called: the object is in an " "invalid state " ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int spl_filesystem_file_read_line_ex ( zval * this_ptr , spl_filesystem_object * intern , int silent TSRMLS_DC ) {
zval * retval = NULL ;
if ( SPL_HAS_FLAG ( intern -> flags , SPL_FILE_OBJECT_READ_CSV ) || intern -> u . file . func_getCurr -> common . scope != spl_ce_SplFileObject ) {
if ( php_stream_eof ( intern -> u . file . stream ) ) {
if ( ! silent ) {
zend_throw_exception_ex ( spl_ce_RuntimeException , 0 TSRMLS_CC , "Cannot read from file %s" , intern -> file_name ) ;
}
return FAILURE ;
}
if ( SPL_HAS_FLAG ( intern -> flags , SPL_FILE_OBJECT_READ_CSV ) ) {
return spl_filesystem_file_read_csv ( intern , intern -> u . file . delimiter , intern -> u . file . enclosure , intern -> u . file . escape , NULL TSRMLS_CC ) ;
}
else {
zend_call_method_with_0_params ( & this_ptr , Z_OBJCE_P ( getThis ( ) ) , & intern -> u . file . func_getCurr , "getCurrentLine" , & retval ) ;
}
if ( retval ) {
if ( intern -> u . file . current_line || intern -> u . file . current_zval ) {
intern -> u . file . current_line_num ++ ;
}
spl_filesystem_file_free_line ( intern TSRMLS_CC ) ;
if ( Z_TYPE_P ( retval ) == IS_STRING ) {
intern -> u . file . current_line = estrndup ( Z_STRVAL_P ( retval ) , Z_STRLEN_P ( retval ) ) ;
intern -> u . file . current_line_len = Z_STRLEN_P ( retval ) ;
}
else {
MAKE_STD_ZVAL ( intern -> u . file . current_zval ) ;
ZVAL_ZVAL ( intern -> u . file . current_zval , retval , 1 , 0 ) ;
}
zval_ptr_dtor ( & retval ) ;
return SUCCESS ;
}
else {
return FAILURE ;
}
}
else {
return spl_filesystem_file_read ( intern , silent TSRMLS_CC ) ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
void setup_outgoing_connection ( outgoing_t * outgoing ) {
connection_t * c ;
node_t * n ;
outgoing -> event = NULL ;
n = lookup_node ( outgoing -> name ) ;
if ( n ) if ( n -> connection ) {
ifdebug ( CONNECTIONS ) logger ( LOG_INFO , "Already connected to %s" , outgoing -> name ) ;
n -> connection -> outgoing = outgoing ;
return ;
}
c = new_connection ( ) ;
c -> name = xstrdup ( outgoing -> name ) ;
c -> outcipher = myself -> connection -> outcipher ;
c -> outdigest = myself -> connection -> outdigest ;
c -> outmaclength = myself -> connection -> outmaclength ;
c -> outcompression = myself -> connection -> outcompression ;
init_configuration ( & c -> config_tree ) ;
if ( ! read_connection_config ( c ) ) {
free_connection ( c ) ;
outgoing -> timeout = maxtimeout ;
retry_outgoing ( outgoing ) ;
return ;
}
outgoing -> cfg = lookup_config ( c -> config_tree , "Address" ) ;
if ( ! outgoing -> cfg ) {
logger ( LOG_ERR , "No address specified for %s" , c -> name ) ;
free_connection ( c ) ;
outgoing -> timeout = maxtimeout ;
retry_outgoing ( outgoing ) ;
return ;
}
c -> outgoing = outgoing ;
c -> last_ping_time = now ;
connection_add ( c ) ;
do_outgoing_connection ( c ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
IN_PROC_BROWSER_TEST_F ( FastUnloadTest , BrowserListForceCloseWithBeforeUnloadWithFastUnload ) {
NavigateToDataURL ( BEFORE_UNLOAD_HTML , "beforeunload" ) ;
content : : WindowedNotificationObserver window_observer ( chrome : : NOTIFICATION_BROWSER_CLOSED , content : : NotificationService : : AllSources ( ) ) ;
UnloadResults unload_results ;
BrowserList : : CloseAllBrowsersWithProfile ( browser ( ) -> profile ( ) , base : : Bind ( & UnloadResults : : AddSuccess , base : : Unretained ( & unload_results ) ) , base : : Bind ( & UnloadResults : : AddAbort , base : : Unretained ( & unload_results ) ) , true ) ;
window_observer . Wait ( ) ;
EXPECT_EQ ( 1 , unload_results . get_successes ( ) ) ;
EXPECT_EQ ( 0 , unload_results . get_aborts ( ) ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int read_frame ( struct VpxInputContext * input_ctx , vpx_image_t * img ) {
FILE * f = input_ctx -> file ;
y4m_input * y4m = & input_ctx -> y4m ;
int shortread = 0 ;
if ( input_ctx -> file_type == FILE_TYPE_Y4M ) {
if ( y4m_input_fetch_frame ( y4m , f , img ) < 1 ) return 0 ;
}
else {
shortread = read_yuv_frame ( input_ctx , img ) ;
}
return ! shortread ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
extern int name ( int , locale_t ) __THROW __exctype_l ( isalnum_l ) ;
__exctype_l ( isalpha_l ) ;
__exctype_l ( iscntrl_l ) ;
__exctype_l ( isdigit_l ) ;
__exctype_l ( islower_l )
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
TEST_F ( TemplateURLTest , ReplaceArbitrarySearchTerms ) {
struct TestData {
const std : : string encoding ;
const base : : string16 search_term ;
const std : : string url ;
const std : : string expected_result ;
}
test_data [ ] = {
{
"BIG5" , base : : WideToUTF16 ( L"\x60BD" ) , "http://foo/?{
searchTerms}
{
inputEncoding}
" , "http://foo/?%B1~BIG5" }
, {
"UTF-8" , ASCIIToUTF16 ( "blah" ) , "http://foo/?{
searchTerms}
{
inputEncoding}
" , "http://foo/?blahUTF-8" }
, {
"Shift_JIS" , base : : UTF8ToUTF16 ( "\xe3\x81\x82" ) , "http://foo/{
searchTerms}
/bar" , "http://foo/%82%A0/bar" }
, {
"Shift_JIS" , base : : UTF8ToUTF16 ( "\xe3\x81\x82 \xe3\x81\x84" ) , "http://foo/{
searchTerms}
/bar" , "http://foo/%82%A0%20%82%A2/bar" }
, }
;
TemplateURLData data ;
for ( size_t i = 0 ;
i < arraysize ( test_data ) ;
++ i ) {
data . SetURL ( test_data [ i ] . url ) ;
data . input_encodings . clear ( ) ;
data . input_encodings . push_back ( test_data [ i ] . encoding ) ;
TemplateURL url ( data ) ;
EXPECT_TRUE ( url . url_ref ( ) . IsValid ( search_terms_data_ ) ) ;
ASSERT_TRUE ( url . url_ref ( ) . SupportsReplacement ( search_terms_data_ ) ) ;
GURL result ( url . url_ref ( ) . ReplaceSearchTerms ( TemplateURLRef : : SearchTermsArgs ( test_data [ i ] . search_term ) , search_terms_data_ ) ) ;
ASSERT_TRUE ( result . is_valid ( ) ) ;
EXPECT_EQ ( test_data [ i ] . expected_result , result . spec ( ) ) ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int jpc_encode ( jas_image_t * image , jas_stream_t * out , const char * optstr ) {
jpc_enc_t * enc ;
jpc_enc_cp_t * cp ;
enc = 0 ;
cp = 0 ;
jpc_initluts ( ) ;
if ( ! ( cp = cp_create ( optstr , image ) ) ) {
jas_eprintf ( "invalid JP encoder options\n" ) ;
goto error ;
}
if ( ! ( enc = jpc_enc_create ( cp , out , image ) ) ) {
goto error ;
}
cp = 0 ;
if ( jpc_enc_encodemainhdr ( enc ) ) {
goto error ;
}
if ( jpc_enc_encodemainbody ( enc ) ) {
goto error ;
}
if ( ! ( enc -> mrk = jpc_ms_create ( JPC_MS_EOC ) ) ) {
goto error ;
}
if ( jpc_putms ( enc -> out , enc -> cstate , enc -> mrk ) ) {
jas_eprintf ( "cannot write EOI marker\n" ) ;
goto error ;
}
jpc_ms_destroy ( enc -> mrk ) ;
enc -> mrk = 0 ;
if ( jas_stream_flush ( enc -> out ) ) {
goto error ;
}
jpc_enc_destroy ( enc ) ;
return 0 ;
error : if ( cp ) {
jpc_enc_cp_destroy ( cp ) ;
}
if ( enc ) {
jpc_enc_destroy ( enc ) ;
}
return - 1 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void append_user ( String * str , LEX_USER * user ) {
if ( str -> length ( ) ) str -> append ( ',' ) ;
str -> append ( '\'' ) ;
str -> append ( user -> user . str ) ;
str -> append ( STRING_WITH_LEN ( "'@'" ) ) ;
str -> append ( user -> host . str ) ;
str -> append ( '\'' ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
int ossl_statem_server_construct_message ( SSL * s ) {
OSSL_STATEM * st = & s -> statem ;
switch ( st -> hand_state ) {
case DTLS_ST_SW_HELLO_VERIFY_REQUEST : return dtls_construct_hello_verify_request ( s ) ;
case TLS_ST_SW_HELLO_REQ : return tls_construct_hello_request ( s ) ;
case TLS_ST_SW_SRVR_HELLO : return tls_construct_server_hello ( s ) ;
case TLS_ST_SW_CERT : return tls_construct_server_certificate ( s ) ;
case TLS_ST_SW_KEY_EXCH : return tls_construct_server_key_exchange ( s ) ;
case TLS_ST_SW_CERT_REQ : return tls_construct_certificate_request ( s ) ;
case TLS_ST_SW_SRVR_DONE : return tls_construct_server_done ( s ) ;
case TLS_ST_SW_SESSION_TICKET : return tls_construct_new_session_ticket ( s ) ;
case TLS_ST_SW_CERT_STATUS : return tls_construct_cert_status ( s ) ;
case TLS_ST_SW_CHANGE : if ( SSL_IS_DTLS ( s ) ) return dtls_construct_change_cipher_spec ( s ) ;
else return tls_construct_change_cipher_spec ( s ) ;
case TLS_ST_SW_FINISHED : return tls_construct_finished ( s , s -> method -> ssl3_enc -> server_finished_label , s -> method -> ssl3_enc -> server_finished_label_len ) ;
default : break ;
}
return 0 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void dissect_q931_notification_indicator_ie ( tvbuff_t * tvb , int offset , int len , proto_tree * tree ) {
if ( len == 0 ) return ;
proto_tree_add_item ( tree , hf_q931_notification_description , tvb , offset , 1 , ENC_BIG_ENDIAN ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_btgatt_microbit_pwm_control ( tvbuff_t * tvb , packet_info * pinfo _U_ , proto_tree * tree , void * data ) {
btatt_data_t * att_data = ( btatt_data_t * ) data ;
if ( bluetooth_gatt_has_no_parameter ( att_data -> opcode ) ) return - 1 ;
proto_tree_add_item ( tree , hf_gatt_microbit_pwm_control , tvb , 0 , tvb_captured_length ( tvb ) , ENC_UTF_8 ) ;
return tvb_captured_length ( tvb ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static gboolean gst_asf_demux_get_stream_audio ( asf_stream_audio * audio , guint8 * * p_data , guint64 * p_size ) {
if ( * p_size < ( 2 + 2 + 4 + 4 + 2 + 2 + 2 ) ) return FALSE ;
audio -> codec_tag = gst_asf_demux_get_uint16 ( p_data , p_size ) ;
audio -> channels = gst_asf_demux_get_uint16 ( p_data , p_size ) ;
audio -> sample_rate = gst_asf_demux_get_uint32 ( p_data , p_size ) ;
audio -> byte_rate = gst_asf_demux_get_uint32 ( p_data , p_size ) ;
audio -> block_align = gst_asf_demux_get_uint16 ( p_data , p_size ) ;
audio -> word_size = gst_asf_demux_get_uint16 ( p_data , p_size ) ;
audio -> size = gst_asf_demux_get_uint16 ( p_data , p_size ) ;
if ( audio -> size > * p_size ) {
GST_WARNING ( "Corrupted audio codec_data (should be at least %u bytes, is %" G_GUINT64_FORMAT " long)" , audio -> size , * p_size ) ;
return FALSE ;
}
return TRUE ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void evdns_request_insert ( struct request * req , struct request * * head ) {
if ( ! * head ) {
* head = req ;
req -> next = req -> prev = req ;
return ;
}
req -> prev = ( * head ) -> prev ;
req -> prev -> next = req ;
req -> next = * head ;
( * head ) -> prev = req ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int connected ( struct usb_dev_state * ps ) {
return ( ! list_empty ( & ps -> list ) && ps -> dev -> state != USB_STATE_NOTATTACHED ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void ohci_pci_class_init ( ObjectClass * klass , void * data ) {
DeviceClass * dc = DEVICE_CLASS ( klass ) ;
PCIDeviceClass * k = PCI_DEVICE_CLASS ( klass ) ;
k -> realize = usb_ohci_realize_pci ;
k -> exit = usb_ohci_exit ;
k -> vendor_id = PCI_VENDOR_ID_APPLE ;
k -> device_id = PCI_DEVICE_ID_APPLE_IPID_USB ;
k -> class_id = PCI_CLASS_SERIAL_USB ;
set_bit ( DEVICE_CATEGORY_USB , dc -> categories ) ;
dc -> desc = "Apple USB Controller" ;
dc -> props = ohci_pci_properties ;
dc -> hotpluggable = false ;
dc -> vmsd = & vmstate_ohci ;
dc -> reset = usb_ohci_reset_pci ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void kadmin_addmodpol_usage ( char * func ) {
fprintf ( stderr , _ ( "usage;
%s [options] policy\n" ) , func ) ;
fprintf ( stderr , _ ( "\toptions are:\n" ) ) ;
fprintf ( stderr , _ ( "\t\t[-maxlife time] [-minlife time] [-minlength length]\n" "\t\t[-minclasses number] [-history number]\n" "\t\t[-maxfailure number] [-failurecountinterval time]\n" "\t\t[-allowedkeysalts keysalts]\n" ) ) ;
fprintf ( stderr , _ ( "\t\t[-lockoutduration time]\n" ) ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
const EVP_CIPHER * EVP_aes_256_wrap ( void ) {
return & aes_256_wrap ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static smb_fid_info_t * find_fid_info ( smb_info_t * si ) {
smb_fid_info_t * fid_info = NULL ;
smb_transact_info_t * tri = ( smb_transact_info_t * ) ( ( si -> sip && ( si -> sip -> extra_info_type == SMB_EI_TRI ) ) ? si -> sip -> extra_info : NULL ) ;
GSList * iter ;
guint32 fid = 0 ;
if ( tri == NULL ) {
if ( si -> sip && ( si -> sip -> extra_info_type == SMB_EI_RWINFO ) ) {
fid = si -> sip -> fid ;
}
}
else {
fid = tri -> fid ;
}
if ( ! fid ) {
return NULL ;
}
for ( iter = si -> ct -> GSL_fid_info ;
iter ;
iter = iter -> next ) {
smb_fid_info_t * info = ( smb_fid_info_t * ) iter -> data ;
if ( ( info -> tid == si -> tid ) && ( info -> fid == fid ) ) {
fid_info = info ;
break ;
}
}
return fid_info ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static gboolean has_fs_id ( GFile * file , const char * fs_id ) {
const char * id ;
GFileInfo * info ;
gboolean res ;
res = FALSE ;
info = g_file_query_info ( file , G_FILE_ATTRIBUTE_ID_FILESYSTEM , G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS , NULL , NULL ) ;
if ( info ) {
id = g_file_info_get_attribute_string ( info , G_FILE_ATTRIBUTE_ID_FILESYSTEM ) ;
if ( id && strcmp ( id , fs_id ) == 0 ) {
res = TRUE ;
}
g_object_unref ( info ) ;
}
return res ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
SPL_METHOD ( DirectoryIterator , rewind ) {
spl_filesystem_object * intern = ( spl_filesystem_object * ) zend_object_store_get_object ( getThis ( ) TSRMLS_CC ) ;
if ( zend_parse_parameters_none ( ) == FAILURE ) {
return ;
}
intern -> u . dir . index = 0 ;
if ( intern -> u . dir . dirp ) {
php_stream_rewinddir ( intern -> u . dir . dirp ) ;
}
spl_filesystem_dir_read ( intern TSRMLS_CC ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void update_layer_buffer_level ( SVC * svc , int encoded_frame_size ) {
int temporal_layer = 0 ;
int current_temporal_layer = svc -> temporal_layer_id ;
for ( temporal_layer = current_temporal_layer + 1 ;
temporal_layer < svc -> number_temporal_layers ;
++ temporal_layer ) {
LAYER_CONTEXT * lc = & svc -> layer_context [ temporal_layer ] ;
RATE_CONTROL * lrc = & lc -> rc ;
int bits_off_for_this_layer = ( int ) ( lc -> target_bandwidth / lc -> framerate - encoded_frame_size ) ;
lrc -> bits_off_target += bits_off_for_this_layer ;
lrc -> bits_off_target = MIN ( lrc -> bits_off_target , lrc -> maximum_buffer_size ) ;
lrc -> buffer_level = lrc -> bits_off_target ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
IN_PROC_BROWSER_TEST_F ( UnloadTest , BrowserCloseNoUnloadListeners ) {
LoadUrlAndQuitBrowser ( NOLISTENERS_HTML , "nolisteners" ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static off_t mspack_fmap_tell ( struct mspack_file * file ) {
struct mspack_handle * mspack_handle = ( struct mspack_handle * ) file ;
if ( ! mspack_handle ) return - 1 ;
if ( mspack_handle -> type == FILETYPE_FMAP ) return mspack_handle -> offset ;
return ( off_t ) ftell ( mspack_handle -> f ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void xmessage_fork ( struct proclistlist * pll ) {
char message [ 5000 ] ;
set_pid_priority ( 0 , SCHED_FIFO , sched_get_priority_min ( SCHED_FIFO ) , "Unable to set SCHED_FIFO for %d (\"%s\"). (%s)" , "the xmessage fork" ) ;
setenv ( "DISPLAY" , ":0.0" , 1 ) ;
if ( ! xmessage_found ) sprintf ( message , "xmessage \"WARNING! das_watchdog pauses realtime operations for %d seconds.\"" , waittime ) ;
else sprintf ( message , "%s \"WARNING! das_watchdog pauses realtime operations for %d seconds.\"" , WHICH_XMESSAGE , waittime ) ;
if ( send_xmessage_using_uids ( pll , message ) == 0 ) {
set_pid_priority ( 0 , SCHED_OTHER , 0 , "Unable to set SCHED_OTHER for %d (\"%s\"). (%s)" , "the xmessage fork" ) ;
send_xmessage_using_XAUTHORITY ( pll , 0 , message ) ;
}
pll_delete ( pll ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void postfilter ( WMAVoiceContext * s , const float * synth , float * samples , int size , const float * lpcs , float * zero_exc_pf , int fcb_type , int pitch ) {
float synth_filter_in_buf [ MAX_FRAMESIZE / 2 ] , * synth_pf = & s -> synth_filter_out_buf [ MAX_LSPS_ALIGN16 ] , * synth_filter_in = zero_exc_pf ;
assert ( size <= MAX_FRAMESIZE / 2 ) ;
ff_celp_lp_zero_synthesis_filterf ( zero_exc_pf , lpcs , synth , size , s -> lsps ) ;
if ( fcb_type >= FCB_TYPE_AW_PULSES && ! kalman_smoothen ( s , pitch , zero_exc_pf , synth_filter_in_buf , size ) ) synth_filter_in = synth_filter_in_buf ;
ff_celp_lp_synthesis_filterf ( synth_pf , lpcs , synth_filter_in , size , s -> lsps ) ;
memcpy ( & synth_pf [ - s -> lsps ] , & synth_pf [ size - s -> lsps ] , sizeof ( synth_pf [ 0 ] ) * s -> lsps ) ;
wiener_denoise ( s , fcb_type , synth_pf , size , lpcs ) ;
adaptive_gain_control ( samples , synth_pf , synth , size , 0.99 , & s -> postfilter_agc ) ;
if ( s -> dc_level > 8 ) {
ff_acelp_apply_order_2_transfer_function ( samples , samples , ( const float [ 2 ] ) {
- 1.99997 , 1.0 }
, ( const float [ 2 ] ) {
- 1.9330735188 , 0.93589198496 }
, 0.93980580475 , s -> dcf_mem , size ) ;
}
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int aes_cfb8_cipher ( EVP_CIPHER_CTX * ctx , unsigned char * out , const unsigned char * in , size_t len ) {
EVP_AES_KEY * dat = EVP_C_DATA ( EVP_AES_KEY , ctx ) ;
int num = EVP_CIPHER_CTX_num ( ctx ) ;
CRYPTO_cfb128_8_encrypt ( in , out , len , & dat -> ks , EVP_CIPHER_CTX_iv_noconst ( ctx ) , & num , EVP_CIPHER_CTX_encrypting ( ctx ) , dat -> block ) ;
EVP_CIPHER_CTX_set_num ( ctx , num ) ;
return 1 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_h225_BMPString_SIZE_1_80 ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
offset = dissect_per_BMPString ( tvb , offset , actx , tree , hf_index , 1 , 80 , FALSE ) ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static int dissect_h225_T_guid ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) {
# line 724 "./asn1/h225/h225.cnf" tvbuff_t * guid_tvb = NULL ;
actx -> value_ptr = & guid_tvb ;
offset = dissect_h225_GloballyUniqueID ( tvb , offset , actx , tree , hf_index ) ;
if ( guid_tvb ) tvb_get_ntohguid ( guid_tvb , 0 , call_id_guid = wmem_new ( wmem_packet_scope ( ) , e_guid_t ) ) ;
actx -> value_ptr = NULL ;
return offset ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
static void mspack_fmap_close ( struct mspack_file * file ) {
struct mspack_handle * mspack_handle = ( struct mspack_handle * ) file ;
if ( ! mspack_handle ) return ;
if ( mspack_handle -> type == FILETYPE_FILENAME ) fclose ( mspack_handle -> f ) ;
free ( mspack_handle ) ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
PyObject * PyString_DecodeEscape ( const char * s , Py_ssize_t len , const char * errors , Py_ssize_t unicode , const char * recode_encoding ) {
int c ;
char * p , * buf ;
const char * end ;
PyObject * v ;
Py_ssize_t newlen = recode_encoding ? 4 * len : len ;
v = PyString_FromStringAndSize ( ( char * ) NULL , newlen ) ;
if ( v == NULL ) return NULL ;
p = buf = PyString_AsString ( v ) ;
end = s + len ;
while ( s < end ) {
if ( * s != '\\' ) {
non_esc : # ifdef Py_USING_UNICODE if ( recode_encoding && ( * s & 0x80 ) ) {
PyObject * u , * w ;
char * r ;
const char * t ;
Py_ssize_t rn ;
t = s ;
while ( t < end && ( * t & 0x80 ) ) t ++ ;
u = PyUnicode_DecodeUTF8 ( s , t - s , errors ) ;
if ( ! u ) goto failed ;
w = PyUnicode_AsEncodedString ( u , recode_encoding , errors ) ;
Py_DECREF ( u ) ;
if ( ! w ) goto failed ;
assert ( PyString_Check ( w ) ) ;
r = PyString_AS_STRING ( w ) ;
rn = PyString_GET_SIZE ( w ) ;
Py_MEMCPY ( p , r , rn ) ;
p += rn ;
Py_DECREF ( w ) ;
s = t ;
}
else {
* p ++ = * s ++ ;
}
# else * p ++ = * s ++ ;
# endif continue ;
}
s ++ ;
if ( s == end ) {
PyErr_SetString ( PyExc_ValueError , "Trailing \\ in string" ) ;
goto failed ;
}
switch ( * s ++ ) {
case '\n' : break ;
case '\\' : * p ++ = '\\' ;
break ;
case '\'' : * p ++ = '\'' ;
break ;
case '\"' : * p ++ = '\"' ;
break ;
case 'b' : * p ++ = '\b' ;
break ;
case 'f' : * p ++ = '\014' ;
break ;
case 't' : * p ++ = '\t' ;
break ;
case 'n' : * p ++ = '\n' ;
break ;
case 'r' : * p ++ = '\r' ;
break ;
case 'v' : * p ++ = '\013' ;
break ;
case 'a' : * p ++ = '\007' ;
break ;
case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : c = s [ - 1 ] - '0' ;
if ( s < end && '0' <= * s && * s <= '7' ) {
c = ( c << 3 ) + * s ++ - '0' ;
if ( s < end && '0' <= * s && * s <= '7' ) c = ( c << 3 ) + * s ++ - '0' ;
}
* p ++ = c ;
break ;
case 'x' : if ( s + 1 < end && isxdigit ( Py_CHARMASK ( s [ 0 ] ) ) && isxdigit ( Py_CHARMASK ( s [ 1 ] ) ) ) {
unsigned int x = 0 ;
c = Py_CHARMASK ( * s ) ;
s ++ ;
if ( isdigit ( c ) ) x = c - '0' ;
else if ( islower ( c ) ) x = 10 + c - 'a' ;
else x = 10 + c - 'A' ;
x = x << 4 ;
c = Py_CHARMASK ( * s ) ;
s ++ ;
if ( isdigit ( c ) ) x += c - '0' ;
else if ( islower ( c ) ) x += 10 + c - 'a' ;
else x += 10 + c - 'A' ;
* p ++ = x ;
break ;
}
if ( ! errors || strcmp ( errors , "strict" ) == 0 ) {
PyErr_SetString ( PyExc_ValueError , "invalid \\x escape" ) ;
goto failed ;
}
if ( strcmp ( errors , "replace" ) == 0 ) {
* p ++ = '?' ;
}
else if ( strcmp ( errors , "ignore" ) == 0 ) ;
else {
PyErr_Format ( PyExc_ValueError , "decoding error;
" "unknown error handling code: %.400s" , errors ) ;
goto failed ;
}
if ( s < end && isxdigit ( Py_CHARMASK ( s [ 0 ] ) ) ) s ++ ;
break ;
# ifndef Py_USING_UNICODE case 'u' : case 'U' : case 'N' : if ( unicode ) {
PyErr_SetString ( PyExc_ValueError , "Unicode escapes not legal " "when Unicode disabled" ) ;
goto failed ;
}
# endif default : * p ++ = '\\' ;
s -- ;
goto non_esc ;
}
}
if ( p - buf < newlen ) _PyString_Resize ( & v , p - buf ) ;
return v ;
failed : Py_DECREF ( v ) ;
return NULL ;
}
| 1True
|
Categorize the following code snippet as vulnerable or not. True or False
|
void mime_field_init ( MIMEField * field ) {
memset ( field , 0 , sizeof ( MIMEField ) ) ;
field -> m_readiness = MIME_FIELD_SLOT_READINESS_DETACHED ;
field -> m_wks_idx = - 1 ;
}
| 0False
|
Categorize the following code snippet as vulnerable or not. True or False
|
inline MIMEHdrImpl * _hdr_obj_to_mime_hdr_impl ( HdrHeapObjImpl * obj ) {
MIMEHdrImpl * impl ;
if ( obj -> m_type == HDR_HEAP_OBJ_HTTP_HEADER ) {
impl = ( ( HTTPHdrImpl * ) obj ) -> m_fields_impl ;
}
else if ( obj -> m_type == HDR_HEAP_OBJ_MIME_HEADER ) {
impl = ( MIMEHdrImpl * ) obj ;
}
else {
ink_release_assert ( ! "mloc not a header type" ) ;
impl = nullptr ;
}
return impl ;
}
| 0False
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.