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
IN_PROC_BROWSER_TEST_F ( PrintPreviewDialogControllerBrowserTest , PdfPluginDisabled ) { { base : : RunLoop run_loop ; content : : PluginService : : GetInstance ( ) -> GetPlugins ( base : : Bind ( & PluginsLoadedCallback , run_loop . QuitClosure ( ) ) ) ; run_loop . Run ( ) ; } content : : WebPluginInfo pdf_plugin_info ; ASSERT_TRUE ( GetPdfPluginInfo ( & pdf_plugin_info ) ) ; { base : : RunLoop run_loop ; PluginPrefs : : GetForProfile ( browser ( ) -> profile ( ) ) -> EnablePlugin ( false , base : : FilePath : : FromUTF8Unsafe ( ChromeContentClient : : kPDFPluginPath ) , base : : Bind ( & PluginEnabledCallback , run_loop . QuitClosure ( ) ) ) ; run_loop . Run ( ) ; } ChromePluginServiceFilter * filter = ChromePluginServiceFilter : : GetInstance ( ) ; content : : WebPluginInfo dummy_pdf_plugin_info = pdf_plugin_info ; EXPECT_FALSE ( filter -> IsPluginAvailable ( initiator ( ) -> GetRenderProcessHost ( ) -> GetID ( ) , initiator ( ) -> GetMainFrame ( ) -> GetRoutingID ( ) , browser ( ) -> profile ( ) -> GetResourceContext ( ) , GURL ( ) , url : : Origin ( GURL ( "http://google.com" ) ) , & dummy_pdf_plugin_info ) ) ; PrintPreview ( ) ; WebContents * preview_dialog = GetPrintPreviewDialog ( ) ; ASSERT_TRUE ( preview_dialog ) ; ASSERT_NE ( initiator ( ) , preview_dialog ) ; const int kExpectedFrameCount = 2 ; int frame_count ; do { base : : RunLoop run_loop ; base : : ThreadTaskRunnerHandle : : Get ( ) -> PostDelayedTask ( FROM_HERE , run_loop . QuitClosure ( ) , base : : TimeDelta : : FromSeconds ( 1 ) ) ; run_loop . Run ( ) ; frame_count = 0 ; preview_dialog -> ForEachFrame ( base : : Bind ( & CountFrames , base : : Unretained ( & frame_count ) ) ) ; } while ( frame_count < kExpectedFrameCount ) ; ASSERT_EQ ( kExpectedFrameCount , frame_count ) ; preview_dialog -> ForEachFrame ( base : : Bind ( & CheckPdfPluginForRenderFrame ) ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void ctl_putarray ( const char * tag , double * arr , int start ) { register char * cp ; register const char * cq ; char buffer [ 200 ] ; int i ; cp = buffer ; cq = tag ; while ( * cq != '\0' ) * cp ++ = * cq ++ ; * cp ++ = '=' ; i = start ; do { if ( i == 0 ) i = NTP_SHIFT ; i -- ; INSIST ( ( cp - buffer ) < ( int ) sizeof ( buffer ) ) ; snprintf ( cp , sizeof ( buffer ) - ( cp - buffer ) , " %.2f" , arr [ i ] * 1e3 ) ; cp += strlen ( cp ) ; } while ( i != start ) ; ctl_putdata ( buffer , ( unsigned ) ( cp - buffer ) , 0 ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static long timelib_parse_tz_cor ( char * * ptr ) { char * begin = * ptr , * end ; long tmp ; while ( isdigit ( * * ptr ) || * * ptr == ':' ) { ++ * ptr ; } end = * ptr ; switch ( end - begin ) { case 1 : case 2 : return HOUR ( strtol ( begin , NULL , 10 ) ) ; break ; case 3 : case 4 : if ( begin [ 1 ] == ':' ) { tmp = HOUR ( strtol ( begin , NULL , 10 ) ) + strtol ( begin + 2 , NULL , 10 ) ; return tmp ; } else if ( begin [ 2 ] == ':' ) { tmp = HOUR ( strtol ( begin , NULL , 10 ) ) + strtol ( begin + 3 , NULL , 10 ) ; return tmp ; } else { tmp = strtol ( begin , NULL , 10 ) ; return HOUR ( tmp / 100 ) + tmp % 100 ; } case 5 : tmp = HOUR ( strtol ( begin , NULL , 10 ) ) + strtol ( begin + 3 , NULL , 10 ) ; return tmp ; } return 0 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int mp_decode_frame ( MPADecodeContext * s , OUT_INT * * samples , const uint8_t * buf , int buf_size ) { int i , nb_frames , ch , ret ; OUT_INT * samples_ptr ; init_get_bits ( & s -> gb , buf + HEADER_SIZE , ( buf_size - HEADER_SIZE ) * 8 ) ; if ( s -> error_protection ) skip_bits ( & s -> gb , 16 ) ; switch ( s -> layer ) { case 1 : s -> avctx -> frame_size = 384 ; nb_frames = mp_decode_layer1 ( s ) ; break ; case 2 : s -> avctx -> frame_size = 1152 ; nb_frames = mp_decode_layer2 ( s ) ; break ; case 3 : s -> avctx -> frame_size = s -> lsf ? 576 : 1152 ; default : nb_frames = mp_decode_layer3 ( s ) ; if ( nb_frames < 0 ) return nb_frames ; s -> last_buf_size = 0 ; if ( s -> in_gb . buffer ) { align_get_bits ( & s -> gb ) ; i = get_bits_left ( & s -> gb ) >> 3 ; if ( i >= 0 && i <= BACKSTEP_SIZE ) { memmove ( s -> last_buf , s -> gb . buffer + ( get_bits_count ( & s -> gb ) >> 3 ) , i ) ; s -> last_buf_size = i ; } else av_log ( s -> avctx , AV_LOG_ERROR , "invalid old backstep %d\n" , i ) ; s -> gb = s -> in_gb ; s -> in_gb . buffer = NULL ; } align_get_bits ( & s -> gb ) ; assert ( ( get_bits_count ( & s -> gb ) & 7 ) == 0 ) ; i = get_bits_left ( & s -> gb ) >> 3 ; if ( i < 0 || i > BACKSTEP_SIZE || nb_frames < 0 ) { if ( i < 0 ) av_log ( s -> avctx , AV_LOG_ERROR , "invalid new backstep %d\n" , i ) ; i = FFMIN ( BACKSTEP_SIZE , buf_size - HEADER_SIZE ) ; } assert ( i <= buf_size - HEADER_SIZE && i >= 0 ) ; memcpy ( s -> last_buf + s -> last_buf_size , s -> gb . buffer + buf_size - HEADER_SIZE - i , i ) ; s -> last_buf_size += i ; } if ( ! samples ) { av_assert0 ( s -> frame != NULL ) ; s -> frame -> nb_samples = s -> avctx -> frame_size ; if ( ( ret = ff_get_buffer ( s -> avctx , s -> frame ) ) < 0 ) { av_log ( s -> avctx , AV_LOG_ERROR , "get_buffer() failed\n" ) ; return ret ; } samples = ( OUT_INT * * ) s -> frame -> extended_data ; } for ( ch = 0 ; ch < s -> nb_channels ; ch ++ ) { int sample_stride ; if ( s -> avctx -> sample_fmt == OUT_FMT_P ) { samples_ptr = samples [ ch ] ; sample_stride = 1 ; } else { samples_ptr = samples [ 0 ] + ch ; sample_stride = s -> nb_channels ; } for ( i = 0 ; i < nb_frames ; i ++ ) { RENAME ( ff_mpa_synth_filter ) ( & s -> mpadsp , s -> synth_buf [ ch ] , & ( s -> synth_buf_offset [ ch ] ) , RENAME ( ff_mpa_synth_window ) , & s -> dither_state , samples_ptr , sample_stride , s -> sb_samples [ ch ] [ i ] ) ; samples_ptr += 32 * sample_stride ; } } return nb_frames * 32 * sizeof ( OUT_INT ) * s -> nb_channels ; }
1True
Categorize the following code snippet as vulnerable or not. True or False
static int phar_tar_process_metadata ( phar_entry_info * entry , php_stream * fp TSRMLS_DC ) { char * metadata ; size_t save = php_stream_tell ( fp ) , read ; phar_entry_info * mentry ; metadata = ( char * ) safe_emalloc ( 1 , entry -> uncompressed_filesize , 1 ) ; read = php_stream_read ( fp , metadata , entry -> uncompressed_filesize ) ; if ( read != entry -> uncompressed_filesize ) { efree ( metadata ) ; php_stream_seek ( fp , save , SEEK_SET ) ; return FAILURE ; } if ( phar_parse_metadata ( & metadata , & entry -> metadata , entry -> uncompressed_filesize TSRMLS_CC ) == FAILURE ) { efree ( metadata ) ; php_stream_seek ( fp , save , SEEK_SET ) ; return FAILURE ; } if ( entry -> filename_len == sizeof ( ".phar/.metadata.bin" ) - 1 && ! memcmp ( entry -> filename , ".phar/.metadata.bin" , sizeof ( ".phar/.metadata.bin" ) - 1 ) ) { entry -> phar -> metadata = entry -> metadata ; entry -> metadata = NULL ; } else if ( entry -> filename_len >= sizeof ( ".phar/.metadata/" ) + sizeof ( "/.metadata.bin" ) - 1 && SUCCESS == zend_hash_find ( & ( entry -> phar -> manifest ) , entry -> filename + sizeof ( ".phar/.metadata/" ) - 1 , entry -> filename_len - ( sizeof ( "/.metadata.bin" ) - 1 + sizeof ( ".phar/.metadata/" ) - 1 ) , ( void * ) & mentry ) ) { mentry -> metadata = entry -> metadata ; entry -> metadata = NULL ; } efree ( metadata ) ; php_stream_seek ( fp , save , SEEK_SET ) ; return SUCCESS ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int32_t offsetTOCPrefixBinarySearch ( const char * s , const char * names , const UDataOffsetTOCEntry * toc , int32_t count ) { int32_t start = 0 ; int32_t limit = count ; int32_t startPrefixLength = 0 ; int32_t limitPrefixLength = 0 ; if ( count == 0 ) { return - 1 ; } if ( 0 == strcmpAfterPrefix ( s , names + toc [ 0 ] . nameOffset , & startPrefixLength ) ) { return 0 ; } ++ start ; -- limit ; if ( 0 == strcmpAfterPrefix ( s , names + toc [ limit ] . nameOffset , & limitPrefixLength ) ) { return limit ; } while ( start < limit ) { int32_t i = ( start + limit ) / 2 ; int32_t prefixLength = MIN ( startPrefixLength , limitPrefixLength ) ; int32_t cmp = strcmpAfterPrefix ( s , names + toc [ i ] . nameOffset , & prefixLength ) ; if ( cmp < 0 ) { limit = i ; limitPrefixLength = prefixLength ; } else if ( cmp == 0 ) { return i ; } else { start = i + 1 ; startPrefixLength = prefixLength ; } } return - 1 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int x ( struct vcache * avc , int afun , struct vrequest * areq , \ struct afs_pdata * ain , struct afs_pdata * aout , \ afs_ucred_t * * acred ) DECL_PIOCTL ( PGetFID ) ; DECL_PIOCTL ( PSetAcl ) ; DECL_PIOCTL ( PStoreBehind ) ; DECL_PIOCTL ( PGCPAGs ) ; DECL_PIOCTL ( PGetAcl ) ; DECL_PIOCTL ( PNoop ) ; DECL_PIOCTL ( PBogus ) ; DECL_PIOCTL ( PGetFileCell ) ; DECL_PIOCTL ( PGetWSCell ) ; DECL_PIOCTL ( PGetUserCell ) ; DECL_PIOCTL ( PSetTokens ) ; DECL_PIOCTL ( PGetVolumeStatus ) ; DECL_PIOCTL ( PSetVolumeStatus ) ; DECL_PIOCTL ( PFlush ) ; DECL_PIOCTL ( PNewStatMount ) ; DECL_PIOCTL ( PGetTokens ) ; DECL_PIOCTL ( PUnlog ) ; DECL_PIOCTL ( PMariner ) ; DECL_PIOCTL ( PCheckServers ) ; DECL_PIOCTL ( PCheckVolNames ) ; DECL_PIOCTL ( PCheckAuth ) ; DECL_PIOCTL ( PFindVolume ) ; DECL_PIOCTL ( PViceAccess ) ; DECL_PIOCTL ( PSetCacheSize )
0False
Categorize the following code snippet as vulnerable or not. True or False
static Selectivity mcelem_array_contain_overlap_selec ( Datum * mcelem , int nmcelem , float4 * numbers , int nnumbers , Datum * array_data , int nitems , Oid operator , FmgrInfo * cmpfunc ) { Selectivity selec , elem_selec ; int mcelem_index , i ; bool use_bsearch ; float4 minfreq ; if ( nnumbers != nmcelem + 3 ) { numbers = NULL ; nnumbers = 0 ; } if ( numbers ) { minfreq = numbers [ nmcelem ] ; } else { minfreq = 2 * ( float4 ) DEFAULT_CONTAIN_SEL ; } if ( nitems * floor_log2 ( ( uint32 ) nmcelem ) < nmcelem + nitems ) use_bsearch = true ; else use_bsearch = false ; if ( operator == OID_ARRAY_CONTAINS_OP ) { selec = 1.0 ; } else { selec = 0.0 ; } mcelem_index = 0 ; for ( i = 0 ; i < nitems ; i ++ ) { bool match = false ; if ( i > 0 && element_compare ( & array_data [ i - 1 ] , & array_data [ i ] , cmpfunc ) == 0 ) continue ; if ( use_bsearch ) { match = find_next_mcelem ( mcelem , nmcelem , array_data [ i ] , & mcelem_index , cmpfunc ) ; } else { while ( mcelem_index < nmcelem ) { int cmp = element_compare ( & mcelem [ mcelem_index ] , & array_data [ i ] , cmpfunc ) ; if ( cmp < 0 ) mcelem_index ++ ; else { if ( cmp == 0 ) match = true ; break ; } } } if ( match && numbers ) { elem_selec = numbers [ mcelem_index ] ; mcelem_index ++ ; } else { elem_selec = Min ( DEFAULT_CONTAIN_SEL , minfreq / 2 ) ; } if ( operator == OID_ARRAY_CONTAINS_OP ) selec *= elem_selec ; else selec = selec + elem_selec - selec * elem_selec ; CLAMP_PROBABILITY ( selec ) ; } return selec ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void qemuMonitorJSONHandleVNCConnect ( qemuMonitorPtr mon , virJSONValuePtr data ) { qemuMonitorJSONHandleVNC ( mon , data , VIR_DOMAIN_EVENT_GRAPHICS_CONNECT ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void tee_print_sized_data ( const char * data , unsigned int data_length , unsigned int total_bytes_to_send , bool right_justified ) { unsigned int i ; const char * p ; if ( right_justified ) for ( i = data_length ; i < total_bytes_to_send ; i ++ ) tee_putc ( ( int ) ' ' , PAGER ) ; for ( i = 0 , p = data ; i < data_length ; i += 1 , p += 1 ) { if ( * p == '\0' ) tee_putc ( ( int ) ' ' , PAGER ) ; else tee_putc ( ( int ) * p , PAGER ) ; } if ( ! right_justified ) for ( i = data_length ; i < total_bytes_to_send ; i ++ ) tee_putc ( ( int ) ' ' , PAGER ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_h245_INTEGER_0_4294967295 ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) { offset = dissect_per_constrained_integer ( tvb , offset , actx , tree , hf_index , 0U , 4294967295U , NULL , FALSE ) ; return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void xhci_event ( XHCIState * xhci , XHCIEvent * event , int v ) { XHCIInterrupter * intr ; dma_addr_t erdp ; unsigned int dp_idx ; if ( v >= xhci -> numintrs ) { DPRINTF ( "intr nr out of range (%d >= %d)\n" , v , xhci -> numintrs ) ; return ; } intr = & xhci -> intr [ v ] ; if ( intr -> er_full ) { DPRINTF ( "xhci_event(): ER full, queueing\n" ) ; if ( ( ( intr -> ev_buffer_put + 1 ) % EV_QUEUE ) == intr -> ev_buffer_get ) { DPRINTF ( "xhci: event queue full, dropping event!\n" ) ; return ; } intr -> ev_buffer [ intr -> ev_buffer_put ++ ] = * event ; if ( intr -> ev_buffer_put == EV_QUEUE ) { intr -> ev_buffer_put = 0 ; } return ; } erdp = xhci_addr64 ( intr -> erdp_low , intr -> erdp_high ) ; if ( erdp < intr -> er_start || erdp >= ( intr -> er_start + TRB_SIZE * intr -> er_size ) ) { DPRINTF ( "xhci: ERDP out of bounds: " DMA_ADDR_FMT "\n" , erdp ) ; DPRINTF ( "xhci: ER[%d] at " DMA_ADDR_FMT " len %d\n" , v , intr -> er_start , intr -> er_size ) ; xhci_die ( xhci ) ; return ; } dp_idx = ( erdp - intr -> er_start ) / TRB_SIZE ; assert ( dp_idx < intr -> er_size ) ; if ( ( intr -> er_ep_idx + 1 ) % intr -> er_size == dp_idx ) { DPRINTF ( "xhci_event(): ER full, queueing\n" ) ; # ifndef ER_FULL_HACK XHCIEvent full = { ER_HOST_CONTROLLER , CC_EVENT_RING_FULL_ERROR } ; xhci_write_event ( xhci , & full ) ; # endif intr -> er_full = 1 ; if ( ( ( intr -> ev_buffer_put + 1 ) % EV_QUEUE ) == intr -> ev_buffer_get ) { DPRINTF ( "xhci: event queue full, dropping event!\n" ) ; return ; } intr -> ev_buffer [ intr -> ev_buffer_put ++ ] = * event ; if ( intr -> ev_buffer_put == EV_QUEUE ) { intr -> ev_buffer_put = 0 ; } } else { xhci_write_event ( xhci , event , v ) ; } xhci_intr_raise ( xhci , v ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void dissect_zcl_color_control_move_color_temp ( tvbuff_t * tvb , proto_tree * tree , guint * offset ) { proto_tree_add_item ( tree , hf_zbee_zcl_color_control_move_mode , tvb , * offset , 1 , ENC_LITTLE_ENDIAN ) ; * offset += 1 ; proto_tree_add_item ( tree , hf_zbee_zcl_color_control_enhanced_rate , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ; * offset += 2 ; proto_tree_add_item ( tree , hf_zbee_zcl_color_control_color_temp_min , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ; * offset += 2 ; proto_tree_add_item ( tree , hf_zbee_zcl_color_control_color_temp_max , tvb , * offset , 2 , ENC_LITTLE_ENDIAN ) ; * offset += 2 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
int dissect_ber_octet_string ( gboolean implicit_tag , asn1_ctx_t * actx , proto_tree * tree , tvbuff_t * tvb , int offset , gint hf_id , tvbuff_t * * out_tvb ) { return dissect_ber_constrained_octet_string ( implicit_tag , actx , tree , tvb , offset , NO_BOUND , NO_BOUND , hf_id , out_tvb ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_h245_RequestMultiplexEntryAck ( 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_RequestMultiplexEntryAck , RequestMultiplexEntryAck_sequence ) ; return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static gboolean check_lbmpdm_encoding ( tvbuff_t * tvb , int offset , int * encoding ) { guint8 magic_byte_1 ; guint8 magic_byte_2 ; guint8 magic_byte_3 ; guint8 magic_byte_4 ; gboolean result = TRUE ; magic_byte_1 = tvb_get_guint8 ( tvb , offset ) ; magic_byte_2 = tvb_get_guint8 ( tvb , offset + 1 ) ; magic_byte_3 = tvb_get_guint8 ( tvb , offset + 2 ) ; magic_byte_4 = tvb_get_guint8 ( tvb , offset + 3 ) ; if ( ( magic_byte_1 == PDM_MSG_HDR_BE_MAGIC_BYTE_1 ) && ( magic_byte_2 == PDM_MSG_HDR_BE_MAGIC_BYTE_2 ) && ( magic_byte_3 == PDM_MSG_HDR_BE_MAGIC_BYTE_3 ) && ( magic_byte_4 == PDM_MSG_HDR_BE_MAGIC_BYTE_4 ) ) { * encoding = ENC_BIG_ENDIAN ; } else if ( ( magic_byte_1 == PDM_MSG_HDR_LE_MAGIC_BYTE_1 ) && ( magic_byte_2 == PDM_MSG_HDR_LE_MAGIC_BYTE_2 ) && ( magic_byte_3 == PDM_MSG_HDR_LE_MAGIC_BYTE_3 ) && ( magic_byte_4 == PDM_MSG_HDR_LE_MAGIC_BYTE_4 ) ) { * encoding = ENC_LITTLE_ENDIAN ; } else { result = FALSE ; } return ( result ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static inline void SetPixelY ( const Image * restrict image , const Quantum y , Quantum * restrict pixel ) { pixel [ image -> channel_map [ YPixelChannel ] . offset ] = y ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
TEST_F ( WebFrameTest , LocalFrameWithRemoteParentIsTransparent ) { FrameTestHelpers : : WebViewHelper helper ; helper . InitializeRemote ( ) ; WebLocalFrameImpl * local_frame = FrameTestHelpers : : CreateLocalChild ( * helper . RemoteMainFrame ( ) ) ; FrameTestHelpers : : LoadFrame ( local_frame , "data:text/html,some page" ) ; Color color = local_frame -> GetFrameView ( ) -> BaseBackgroundColor ( ) ; EXPECT_EQ ( Color : : kTransparent , color ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int vorbis_parse_setup_hdr_residues ( vorbis_context * vc ) { GetBitContext * gb = & vc -> gb ; unsigned i , j , k ; vc -> residue_count = get_bits ( gb , 6 ) + 1 ; vc -> residues = av_mallocz ( vc -> residue_count * sizeof ( * vc -> residues ) ) ; if ( ! vc -> residues ) return AVERROR ( ENOMEM ) ; av_dlog ( NULL , " There are %d residues. \n" , vc -> residue_count ) ; for ( i = 0 ; i < vc -> residue_count ; ++ i ) { vorbis_residue * res_setup = & vc -> residues [ i ] ; uint8_t cascade [ 64 ] ; unsigned high_bits , low_bits ; res_setup -> type = get_bits ( gb , 16 ) ; av_dlog ( NULL , " %u. residue type %d\n" , i , res_setup -> type ) ; res_setup -> begin = get_bits ( gb , 24 ) ; res_setup -> end = get_bits ( gb , 24 ) ; res_setup -> partition_size = get_bits ( gb , 24 ) + 1 ; if ( res_setup -> begin > res_setup -> end || res_setup -> end > ( res_setup -> type == 2 ? vc -> avctx -> channels : 1 ) * vc -> blocksize [ 1 ] / 2 || ( res_setup -> end - res_setup -> begin ) / res_setup -> partition_size > V_MAX_PARTITIONS ) { av_log ( vc -> avctx , AV_LOG_ERROR , "partition out of bounds: type, begin, end, size, blocksize: %" PRIu16 ", %" PRIu32 ", %" PRIu32 ", %u, %" PRIu32 "\n" , res_setup -> type , res_setup -> begin , res_setup -> end , res_setup -> partition_size , vc -> blocksize [ 1 ] / 2 ) ; return AVERROR_INVALIDDATA ; } res_setup -> classifications = get_bits ( gb , 6 ) + 1 ; GET_VALIDATED_INDEX ( res_setup -> classbook , 8 , vc -> codebook_count ) res_setup -> ptns_to_read = ( res_setup -> end - res_setup -> begin ) / res_setup -> partition_size ; res_setup -> classifs = av_malloc ( res_setup -> ptns_to_read * vc -> audio_channels * sizeof ( * res_setup -> classifs ) ) ; if ( ! res_setup -> classifs ) return AVERROR ( ENOMEM ) ; av_dlog ( NULL , " begin %d end %d part.size %d classif.s %d classbook %d \n" , res_setup -> begin , res_setup -> end , res_setup -> partition_size , res_setup -> classifications , res_setup -> classbook ) ; for ( j = 0 ; j < res_setup -> classifications ; ++ j ) { high_bits = 0 ; low_bits = get_bits ( gb , 3 ) ; if ( get_bits1 ( gb ) ) high_bits = get_bits ( gb , 5 ) ; cascade [ j ] = ( high_bits << 3 ) + low_bits ; av_dlog ( NULL , " %u class cascade depth: %d\n" , j , ilog ( cascade [ j ] ) ) ; } res_setup -> maxpass = 0 ; for ( j = 0 ; j < res_setup -> classifications ; ++ j ) { for ( k = 0 ; k < 8 ; ++ k ) { if ( cascade [ j ] & ( 1 << k ) ) { GET_VALIDATED_INDEX ( res_setup -> books [ j ] [ k ] , 8 , vc -> codebook_count ) av_dlog ( NULL , " %u class cascade depth %u book: %d\n" , j , k , res_setup -> books [ j ] [ k ] ) ; if ( k > res_setup -> maxpass ) res_setup -> maxpass = k ; } else { res_setup -> books [ j ] [ k ] = - 1 ; } } } } return 0 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static TX_MODE select_tx_mode ( const VP9_COMP * cpi ) { if ( cpi -> mb . e_mbd . lossless ) return ONLY_4X4 ; if ( cpi -> sf . tx_size_search_method == USE_LARGESTALL ) return ALLOW_32X32 ; else if ( cpi -> sf . tx_size_search_method == USE_FULL_RD || cpi -> sf . tx_size_search_method == USE_TX_8X8 ) return TX_MODE_SELECT ; else return cpi -> common . tx_mode ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void dissect_rsvp_hop ( proto_item * ti , packet_info * pinfo , proto_tree * rsvp_object_tree , tvbuff_t * tvb , int offset , int obj_length , int rsvp_class _U_ , int type ) { int offset2 = offset + 4 ; switch ( type ) { case 1 : proto_tree_add_uint_format_value ( rsvp_object_tree , hf_rsvp_ctype , tvb , offset + 3 , 1 , type , "1 - IPv4" ) ; proto_tree_add_item ( rsvp_object_tree , hf_rsvp_hop_neighbor_address_ipv4 , tvb , offset2 , 4 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( rsvp_object_tree , hf_rsvp_hop_logical_interface , tvb , offset2 + 4 , 4 , ENC_BIG_ENDIAN ) ; proto_item_set_text ( ti , "HOP: IPv4, %s" , tvb_ip_to_str ( tvb , offset2 ) ) ; break ; case 2 : proto_tree_add_uint_format_value ( rsvp_object_tree , hf_rsvp_ctype , tvb , offset + 3 , 1 , type , "2 - IPv6" ) ; proto_tree_add_item ( rsvp_object_tree , hf_rsvp_hop_neighbor_address_ipv6 , tvb , offset2 , 16 , ENC_NA ) ; proto_tree_add_item ( rsvp_object_tree , hf_rsvp_hop_logical_interface , tvb , offset2 + 16 , 4 , ENC_BIG_ENDIAN ) ; break ; case 3 : proto_tree_add_uint_format_value ( rsvp_object_tree , hf_rsvp_ctype , tvb , offset + 3 , 1 , type , "3 - IPv4 IF-ID" ) ; proto_tree_add_item ( rsvp_object_tree , hf_rsvp_hop_neighbor_address_ipv4 , tvb , offset2 , 4 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( rsvp_object_tree , hf_rsvp_hop_logical_interface , tvb , offset2 + 4 , 4 , ENC_BIG_ENDIAN ) ; proto_item_set_text ( ti , "HOP: IPv4 IF-ID. Control IPv4: %s. " , tvb_ip_to_str ( tvb , offset2 ) ) ; dissect_rsvp_ifid_tlv ( ti , pinfo , rsvp_object_tree , tvb , offset + 12 , obj_length - 12 , TREE ( TT_HOP_SUBOBJ ) ) ; break ; case 4 : proto_tree_add_uint_format_value ( rsvp_object_tree , hf_rsvp_ctype , tvb , offset + 3 , 1 , type , "4 - IPv6 IF-ID" ) ; proto_tree_add_item ( rsvp_object_tree , hf_rsvp_hop_neighbor_address_ipv6 , tvb , offset2 , 16 , ENC_NA ) ; proto_tree_add_item ( rsvp_object_tree , hf_rsvp_hop_logical_interface , tvb , offset2 + 16 , 4 , ENC_BIG_ENDIAN ) ; proto_item_set_text ( ti , "HOP: IPv6 IF-ID. Control IPv6: %s. " , tvb_ip6_to_str ( tvb , offset2 ) ) ; dissect_rsvp_ifid_tlv ( ti , pinfo , rsvp_object_tree , tvb , offset + 24 , obj_length - 24 , TREE ( TT_HOP_SUBOBJ ) ) ; break ; default : proto_tree_add_uint_format_value ( rsvp_object_tree , hf_rsvp_ctype , tvb , offset + 3 , 1 , type , "Unknown (%u)" , type ) ; proto_tree_add_item ( rsvp_object_tree , hf_rsvp_hop_data , tvb , offset2 , obj_length - 4 , ENC_NA ) ; break ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void e1000e_vm_state_change ( void * opaque , int running , RunState state ) { E1000ECore * core = opaque ; if ( running ) { trace_e1000e_vm_state_running ( ) ; e1000e_intrmgr_resume ( core ) ; e1000e_autoneg_resume ( core ) ; } else { trace_e1000e_vm_state_stopped ( ) ; e1000e_autoneg_pause ( core ) ; e1000e_intrmgr_pause ( core ) ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
SPL_METHOD ( SplDoublyLinkedList , valid ) { spl_dllist_object * intern = ( spl_dllist_object * ) zend_object_store_get_object ( getThis ( ) TSRMLS_CC ) ; if ( zend_parse_parameters_none ( ) == FAILURE ) { return ; } RETURN_BOOL ( intern -> traverse_pointer != NULL ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static INTERP_FILTER read_interp_filter ( struct vp9_read_bit_buffer * rb ) { const INTERP_FILTER literal_to_filter [ ] = { EIGHTTAP_SMOOTH , EIGHTTAP , EIGHTTAP_SHARP , BILINEAR } ; return vp9_rb_read_bit ( rb ) ? SWITCHABLE : literal_to_filter [ vp9_rb_read_literal ( rb , 2 ) ] ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
MV clamp_mv_to_umv_border_sb ( const MACROBLOCKD * xd , const MV * src_mv , int bw , int bh , int ss_x , int ss_y ) { const int spel_left = ( VP9_INTERP_EXTEND + bw ) << SUBPEL_BITS ; const int spel_right = spel_left - SUBPEL_SHIFTS ; const int spel_top = ( VP9_INTERP_EXTEND + bh ) << SUBPEL_BITS ; const int spel_bottom = spel_top - SUBPEL_SHIFTS ; MV clamped_mv = { src_mv -> row * ( 1 << ( 1 - ss_y ) ) , src_mv -> col * ( 1 << ( 1 - ss_x ) ) } ; assert ( ss_x <= 1 ) ; assert ( ss_y <= 1 ) ; clamp_mv ( & clamped_mv , xd -> mb_to_left_edge * ( 1 << ( 1 - ss_x ) ) - spel_left , xd -> mb_to_right_edge * ( 1 << ( 1 - ss_x ) ) + spel_right , xd -> mb_to_top_edge * ( 1 << ( 1 - ss_y ) ) - spel_top , xd -> mb_to_bottom_edge * ( 1 << ( 1 - ss_y ) ) + spel_bottom ) ; return clamped_mv ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_h225_SupportedPrefix ( 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_h225_SupportedPrefix , SupportedPrefix_sequence ) ; return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int rm_probe ( AVProbeData * p ) { if ( ( p -> buf [ 0 ] == '.' && p -> buf [ 1 ] == 'R' && p -> buf [ 2 ] == 'M' && p -> buf [ 3 ] == 'F' && p -> buf [ 4 ] == 0 && p -> buf [ 5 ] == 0 ) || ( p -> buf [ 0 ] == '.' && p -> buf [ 1 ] == 'r' && p -> buf [ 2 ] == 'a' && p -> buf [ 3 ] == 0xfd ) ) return AVPROBE_SCORE_MAX ; else return 0 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void convolve_vert ( const uint8_t * src , ptrdiff_t src_stride , uint8_t * dst , ptrdiff_t dst_stride , const InterpKernel * y_filters , int y0_q4 , int y_step_q4 , int w , int h ) { int x , y ; src -= src_stride * ( SUBPEL_TAPS / 2 - 1 ) ; for ( x = 0 ; x < w ; ++ x ) { int y_q4 = y0_q4 ; for ( y = 0 ; y < h ; ++ y ) { const unsigned char * src_y = & src [ ( y_q4 >> SUBPEL_BITS ) * src_stride ] ; const int16_t * const y_filter = y_filters [ y_q4 & SUBPEL_MASK ] ; int k , sum = 0 ; for ( k = 0 ; k < SUBPEL_TAPS ; ++ k ) sum += src_y [ k * src_stride ] * y_filter [ k ] ; dst [ y * dst_stride ] = clip_pixel ( ROUND_POWER_OF_TWO ( sum , FILTER_BITS ) ) ; y_q4 += y_step_q4 ; } ++ src ; ++ dst ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
TEST_F ( AccountChooserDialogAndroidTest , CheckHistogramsReportingOneAccountChoosenViaSigninButton ) { base : : HistogramTester histogram_tester ; AccountChooserDialogAndroid * dialog = CreateDialogOneAccount ( ) ; dialog -> OnCredentialClicked ( base : : android : : AttachCurrentThread ( ) , nullptr , , static_cast < int > ( password_manager : : CredentialType : : CREDENTIAL_TYPE_PASSWORD ) , true ) ; dialog -> Destroy ( base : : android : : AttachCurrentThread ( ) , nullptr ) ; histogram_tester . ExpectUniqueSample ( "PasswordManager.AccountChooserDialog" , password_manager : : metrics_util : : ACCOUNT_CHOOSER_SIGN_IN , 1 ) ; histogram_tester . ExpectUniqueSample ( "PasswordManager.AccountChooserDialogOneAccount" , password_manager : : metrics_util : : ACCOUNT_CHOOSER_SIGN_IN , 1 ) ; histogram_tester . ExpectTotalCount ( "PasswordManager.AccountChooserDialogMultipleAccounts" , 0 ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
void * _TSmalloc ( size_t size , const char * ) { return ats_malloc ( size ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void test_bug9643 ( ) { MYSQL_STMT * stmt ; MYSQL_BIND my_bind [ 1 ] ; int32 a ; int rc ; const char * stmt_text ; int num_rows = 0 ; ulong type ; ulong prefetch_rows = 5 ; myheader ( "test_bug9643" ) ; mysql_query ( mysql , "drop table if exists t1" ) ; mysql_query ( mysql , "create table t1 (id integer not null primary key)" ) ; rc = mysql_query ( mysql , "insert into t1 (id) values " " (1), (2), (3), (4), (5), (6), (7), (8), (9)" ) ; myquery ( rc ) ; stmt = mysql_stmt_init ( mysql ) ; type = ( ulong ) CURSOR_TYPE_SCROLLABLE ; rc = mysql_stmt_attr_set ( stmt , STMT_ATTR_CURSOR_TYPE , ( void * ) & type ) ; DIE_UNLESS ( rc ) ; if ( ! opt_silent ) printf ( "Got error (as expected): %s\n" , mysql_stmt_error ( stmt ) ) ; type = ( ulong ) CURSOR_TYPE_READ_ONLY ; rc = mysql_stmt_attr_set ( stmt , STMT_ATTR_CURSOR_TYPE , ( void * ) & type ) ; check_execute ( stmt , rc ) ; rc = mysql_stmt_attr_set ( stmt , STMT_ATTR_PREFETCH_ROWS , ( void * ) & prefetch_rows ) ; check_execute ( stmt , rc ) ; stmt_text = "select * from t1" ; rc = mysql_stmt_prepare ( stmt , stmt_text , strlen ( stmt_text ) ) ; check_execute ( stmt , rc ) ; memset ( my_bind , 0 , sizeof ( my_bind ) ) ; my_bind [ 0 ] . buffer_type = MYSQL_TYPE_LONG ; my_bind [ 0 ] . buffer = ( void * ) & a ; my_bind [ 0 ] . buffer_length = sizeof ( a ) ; mysql_stmt_bind_result ( stmt , my_bind ) ; rc = mysql_stmt_execute ( stmt ) ; check_execute ( stmt , rc ) ; while ( ( rc = mysql_stmt_fetch ( stmt ) ) == 0 ) ++ num_rows ; DIE_UNLESS ( num_rows == 9 ) ; rc = mysql_stmt_close ( stmt ) ; DIE_UNLESS ( rc == 0 ) ; rc = mysql_query ( mysql , "drop table t1" ) ; myquery ( rc ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void pdf_show_string ( fz_context * ctx , pdf_run_processor * pr , unsigned char * buf , int len ) { pdf_gstate * gstate = pr -> gstate + pr -> gtop ; pdf_font_desc * fontdesc = gstate -> text . font ; if ( ! fontdesc ) { fz_warn ( ctx , "cannot draw text since font and size not set" ) ; return ; } show_string ( ctx , pr , buf , len ) ; }
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 ] = mi + index ; mi_8x8 [ index ] -> mbmi . sb_type = find_partition_size ( bsize , row8x8_remaining - r , col8x8_remaining - c , & bh , & bw ) ; } } }
1True
Categorize the following code snippet as vulnerable or not. True or False
TEST ( DownloadPrefsTest , PrefsInitializationSkipsInvalidFileTypes ) { content : : TestBrowserThreadBundle threads_are_required_for_testing_profile ; TestingProfile profile ; profile . GetPrefs ( ) -> SetString ( prefs : : kDownloadExtensionsToOpen , "swf:txt::.foo:baz" ) ; DownloadPrefs prefs ( & profile ) ; prefs . DisableAutoOpenBasedOnExtension ( base : : FilePath ( FILE_PATH_LITERAL ( "x.baz" ) ) ) ; EXPECT_FALSE ( prefs . IsAutoOpenEnabledBasedOnExtension ( base : : FilePath ( FILE_PATH_LITERAL ( "x.swf" ) ) ) ) ; EXPECT_TRUE ( prefs . IsAutoOpenEnabledBasedOnExtension ( base : : FilePath ( FILE_PATH_LITERAL ( "x.txt" ) ) ) ) ; EXPECT_FALSE ( prefs . IsAutoOpenEnabledBasedOnExtension ( base : : FilePath ( FILE_PATH_LITERAL ( "x.foo" ) ) ) ) ; EXPECT_STREQ ( "txt" , profile . GetPrefs ( ) -> GetString ( prefs : : kDownloadExtensionsToOpen ) . c_str ( ) ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void var_read_metadata ( AVFormatContext * avctx , const char * tag , int size ) { char * value = var_read_string ( avctx -> pb , size ) ; if ( value ) av_dict_set ( & avctx -> metadata , tag , value , AV_DICT_DONT_STRDUP_VAL ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
IN_PROC_BROWSER_TEST_P ( BrowserCloseManagerBrowserTest , MAYBE_TestBeforeUnloadMultipleSlowWindows ) { const int kBrowserCount = 5 ; const int kResposiveBrowserIndex = 2 ; for ( int i = 0 ; i < kBrowserCount ; i ++ ) { if ( i ) browsers_ . push_back ( CreateBrowser ( browser ( ) -> profile ( ) ) ) ; ASSERT_NO_FATAL_FAILURE ( ui_test_utils : : NavigateToURL ( browsers_ [ i ] , embedded_test_server ( ) -> GetURL ( ( i == kResposiveBrowserIndex ) ? "/beforeunload.html" : "/beforeunload_slow.html" ) ) ) ; } PrepareForDialog ( browsers_ [ kResposiveBrowserIndex ] ) ; RepeatedNotificationObserver cancel_observer ( chrome : : NOTIFICATION_BROWSER_CLOSE_CANCELLED , kResposiveBrowserIndex + 1 ) ; chrome : : CloseAllBrowsersAndQuit ( ) ; ASSERT_NO_FATAL_FAILURE ( CancelClose ( ) ) ; cancel_observer . Wait ( ) ; EXPECT_FALSE ( browser_shutdown : : IsTryingToQuit ( ) ) ; for ( int i = 0 ; i < kBrowserCount ; i ++ ) EXPECT_EQ ( 1 , browsers_ [ i ] -> tab_strip_model ( ) -> count ( ) ) ; RepeatedNotificationObserver close_observer ( chrome : : NOTIFICATION_BROWSER_CLOSED , kBrowserCount ) ; chrome : : CloseAllBrowsersAndQuit ( ) ; ASSERT_NO_FATAL_FAILURE ( AcceptClose ( ) ) ; close_observer . Wait ( ) ; EXPECT_TRUE ( browser_shutdown : : IsTryingToQuit ( ) ) ; EXPECT_TRUE ( BrowserList : : GetInstance ( ) -> empty ( ) ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_h225_OCTET_STRING_SIZE_1 ( 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 , 1 , 1 , FALSE , NULL ) ; return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
void remove_tap_listener_skinny_calls ( void ) { remove_tap_listener ( & ( the_tapinfo_struct . skinny_dummy ) ) ; have_skinny_tap_listener = FALSE ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void xhci_mfwrap_update ( XHCIState * xhci ) { const uint32_t bits = USBCMD_RS | USBCMD_EWE ; uint32_t mfindex , left ; int64_t now ; if ( ( xhci -> usbcmd & bits ) == bits ) { now = qemu_clock_get_ns ( QEMU_CLOCK_VIRTUAL ) ; mfindex = ( ( now - xhci -> mfindex_start ) / 125000 ) & 0x3fff ; left = 0x4000 - mfindex ; timer_mod ( xhci -> mfwrap_timer , now + left * 125000 ) ; } else { timer_del ( xhci -> mfwrap_timer ) ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
int mi_repair_by_sort ( MI_CHECK * param , register MI_INFO * info , const char * name , int rep_quick , my_bool no_copy_stat ) { int got_error ; uint i ; ulong length ; ha_rows start_records ; my_off_t new_header_length , del ; File new_file ; MI_SORT_PARAM sort_param ; MYISAM_SHARE * share = info -> s ; HA_KEYSEG * keyseg ; ulong * rec_per_key_part ; char llbuff [ 22 ] ; SORT_INFO sort_info ; ulonglong UNINIT_VAR ( key_map ) ; DBUG_ENTER ( "mi_repair_by_sort" ) ; start_records = info -> state -> records ; got_error = 1 ; new_file = - 1 ; new_header_length = ( param -> testflag & T_UNPACK ) ? 0 : share -> pack . header_length ; if ( ! ( param -> testflag & T_SILENT ) ) { printf ( "- recovering (with sort) MyISAM-table '%s'\n" , name ) ; printf ( "Data records: %s\n" , llstr ( start_records , llbuff ) ) ; } param -> testflag |= T_REP ; if ( info -> s -> options & ( HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD ) ) param -> testflag |= T_CALC_CHECKSUM ; bzero ( ( char * ) & sort_info , sizeof ( sort_info ) ) ; bzero ( ( char * ) & sort_param , sizeof ( sort_param ) ) ; if ( ! ( sort_info . key_block = alloc_key_blocks ( param , ( uint ) param -> sort_key_blocks , share -> base . max_key_block_length ) ) || init_io_cache ( & param -> read_cache , info -> dfile , ( uint ) param -> read_buffer_length , READ_CACHE , share -> pack . header_length , 1 , MYF ( MY_WME ) ) || ( ! rep_quick && init_io_cache ( & info -> rec_cache , info -> dfile , ( uint ) param -> write_buffer_length , WRITE_CACHE , new_header_length , 1 , MYF ( MY_WME | MY_WAIT_IF_FULL ) & param -> myf_rw ) ) ) goto err ; sort_info . key_block_end = sort_info . key_block + param -> sort_key_blocks ; info -> opt_flag |= WRITE_CACHE_USED ; info -> rec_cache . file = info -> dfile ; if ( ! mi_alloc_rec_buff ( info , - 1 , & sort_param . record ) || ! mi_alloc_rec_buff ( info , - 1 , & sort_param . rec_buff ) ) { mi_check_print_error ( param , "Not enough memory for extra record" ) ; goto err ; } if ( ! rep_quick ) { if ( ( new_file = mysql_file_create ( mi_key_file_datatmp , fn_format ( param -> temp_filename , share -> data_file_name , "" , DATA_TMP_EXT , 2 + 4 ) , 0 , param -> tmpfile_createflag , MYF ( 0 ) ) ) < 0 ) { mi_check_print_error ( param , "Can't create new tempfile: '%s'" , param -> temp_filename ) ; goto err ; } if ( new_header_length && filecopy ( param , new_file , info -> dfile , 0L , new_header_length , "datafile-header" ) ) goto err ; if ( param -> testflag & T_UNPACK ) { share -> options &= ~ HA_OPTION_COMPRESS_RECORD ; mi_int2store ( share -> state . header . options , share -> options ) ; } share -> state . dellink = HA_OFFSET_ERROR ; info -> rec_cache . file = new_file ; } info -> update = ( short ) ( HA_STATE_CHANGED | HA_STATE_ROW_CHANGED ) ; mi_drop_all_indexes ( param , info , FALSE ) ; key_map = share -> state . key_map ; if ( param -> testflag & T_CREATE_MISSING_KEYS ) { key_map = ~ key_map ; } sort_info . info = info ; sort_info . param = param ; set_data_file_type ( & sort_info , share ) ; sort_param . filepos = new_header_length ; sort_info . dupp = 0 ; sort_info . buff = 0 ; param -> read_cache . end_of_file = sort_info . filelength = mysql_file_seek ( param -> read_cache . file , 0L , MY_SEEK_END , MYF ( 0 ) ) ; sort_param . wordlist = NULL ; init_alloc_root ( & sort_param . wordroot , FTPARSER_MEMROOT_ALLOC_SIZE , 0 ) ; if ( share -> data_file_type == DYNAMIC_RECORD ) length = max ( share -> base . min_pack_length + 1 , share -> base . min_block_length ) ; else if ( share -> data_file_type == COMPRESSED_RECORD ) length = share -> base . min_block_length ; else length = share -> base . pack_reclength ; sort_info . max_records = ( ( param -> testflag & T_CREATE_MISSING_KEYS ) ? info -> state -> records : ( ha_rows ) ( sort_info . filelength / length + 1 ) ) ; sort_param . key_cmp = sort_key_cmp ; sort_param . lock_in_memory = lock_memory ; sort_param . tmpdir = param -> tmpdir ; sort_param . sort_info = & sort_info ; sort_param . fix_datafile = ( my_bool ) ( ! rep_quick ) ; sort_param . master = 1 ; del = info -> state -> del ; param -> glob_crc = 0 ; if ( param -> testflag & T_CALC_CHECKSUM ) sort_param . calc_checksum = 1 ; rec_per_key_part = param -> rec_per_key_part ; for ( sort_param . key = 0 ; sort_param . key < share -> base . keys ; rec_per_key_part += sort_param . keyinfo -> keysegs , sort_param . key ++ ) { sort_param . read_cache = param -> read_cache ; sort_param . keyinfo = share -> keyinfo + sort_param . key ; sort_param . seg = sort_param . keyinfo -> seg ; if ( ! mi_is_key_active ( key_map , sort_param . key ) ) { memcpy ( ( char * ) rec_per_key_part , ( char * ) ( share -> state . rec_per_key_part + ( uint ) ( rec_per_key_part - param -> rec_per_key_part ) ) , sort_param . keyinfo -> keysegs * sizeof ( * rec_per_key_part ) ) ; DBUG_PRINT ( "repair" , ( "skipping seemingly disabled index #: %u" , sort_param . key ) ) ; continue ; } if ( ( ! ( param -> testflag & T_SILENT ) ) ) printf ( "- Fixing index %d\n" , sort_param . key + 1 ) ; sort_param . max_pos = sort_param . pos = share -> pack . header_length ; keyseg = sort_param . seg ; bzero ( ( char * ) sort_param . unique , sizeof ( sort_param . unique ) ) ; sort_param . key_length = share -> rec_reflength ; for ( i = 0 ; keyseg [ i ] . type != HA_KEYTYPE_END ; i ++ ) { sort_param . key_length += keyseg [ i ] . length ; if ( keyseg [ i ] . flag & HA_SPACE_PACK ) sort_param . key_length += get_pack_length ( keyseg [ i ] . length ) ; if ( keyseg [ i ] . flag & ( HA_BLOB_PART | HA_VAR_LENGTH_PART ) ) sort_param . key_length += 2 + test ( keyseg [ i ] . length >= 127 ) ; if ( keyseg [ i ] . flag & HA_NULL_PART ) sort_param . key_length ++ ; } info -> state -> records = info -> state -> del = share -> state . split = 0 ; info -> state -> empty = 0 ; if ( sort_param . keyinfo -> flag & HA_FULLTEXT ) { uint ft_max_word_len_for_sort = FT_MAX_WORD_LEN_FOR_SORT * sort_param . keyinfo -> seg -> charset -> mbmaxlen ; sort_param . key_length += ft_max_word_len_for_sort - HA_FT_MAXBYTELEN ; if ( sort_param . keyinfo -> parser == & ft_default_parser ) { sort_info . max_records = ( ha_rows ) ( sort_info . filelength / ft_min_word_len + 1 ) ; } else { sort_info . max_records = 10 * max ( param -> sort_buffer_length , MIN_SORT_BUFFER ) / sort_param . key_length ; } sort_param . key_read = sort_ft_key_read ; sort_param . key_write = sort_ft_key_write ; } else { sort_param . key_read = sort_key_read ; sort_param . key_write = sort_key_write ; } if ( _create_index_by_sort ( & sort_param , ( my_bool ) ( ! ( param -> testflag & T_VERBOSE ) ) , param -> sort_buffer_length ) ) { param -> retry_repair = 1 ; goto err ; } sort_param . calc_checksum = 0 ; free_root ( & sort_param . wordroot , MYF ( 0 ) ) ; sort_info . max_records = ( ha_rows ) info -> state -> records ; if ( param -> testflag & T_STATISTICS ) update_key_parts ( sort_param . keyinfo , rec_per_key_part , sort_param . unique , param -> stats_method == MI_STATS_METHOD_IGNORE_NULLS ? sort_param . notnull : NULL , ( ulonglong ) info -> state -> records ) ; mi_set_key_active ( share -> state . key_map , sort_param . key ) ; DBUG_PRINT ( "repair" , ( "set enabled index #: %u" , sort_param . key ) ) ; if ( sort_param . fix_datafile ) { param -> read_cache . end_of_file = sort_param . filepos ; if ( write_data_suffix ( & sort_info , 1 ) || end_io_cache ( & info -> rec_cache ) ) goto err ; if ( param -> testflag & T_SAFE_REPAIR ) { if ( info -> state -> records + 1 < start_records ) { info -> state -> records = start_records ; goto err ; } } share -> state . state . data_file_length = info -> state -> data_file_length = sort_param . filepos ; share -> state . version = ( ulong ) time ( ( time_t * ) 0 ) ; mysql_file_close ( info -> dfile , MYF ( 0 ) ) ; info -> dfile = new_file ; share -> data_file_type = sort_info . new_data_file_type ; share -> pack . header_length = ( ulong ) new_header_length ; sort_param . fix_datafile = 0 ; } else info -> state -> data_file_length = sort_param . max_pos ; param -> read_cache . file = info -> dfile ; reinit_io_cache ( & param -> read_cache , READ_CACHE , share -> pack . header_length , 1 , 1 ) ; } if ( param -> testflag & T_WRITE_LOOP ) { ( void ) fputs ( " \r" , stdout ) ; ( void ) fflush ( stdout ) ; } if ( rep_quick && del + sort_info . dupp != info -> state -> del ) { mi_check_print_error ( param , "Couldn't fix table with quick recovery: Found wrong number of deleted records" ) ; mi_check_print_error ( param , "Run recovery again without -q" ) ; got_error = 1 ; param -> retry_repair = 1 ; param -> testflag |= T_RETRY_WITHOUT_QUICK ; goto err ; } if ( rep_quick & T_FORCE_UNIQUENESS ) { my_off_t skr = info -> state -> data_file_length + ( share -> options & HA_OPTION_COMPRESS_RECORD ? MEMMAP_EXTRA_MARGIN : 0 ) ; # ifdef USE_RELOC if ( share -> data_file_type == STATIC_RECORD && skr < share -> base . reloc * share -> base . min_pack_length ) skr = share -> base . reloc * share -> base . min_pack_length ; # endif if ( skr != sort_info . filelength ) if ( mysql_file_chsize ( info -> dfile , skr , 0 , MYF ( 0 ) ) ) mi_check_print_warning ( param , "Can't change size of datafile, error: %d" , my_errno ) ; } if ( param -> testflag & T_CALC_CHECKSUM ) info -> state -> checksum = param -> glob_crc ; if ( mysql_file_chsize ( share -> kfile , info -> state -> key_file_length , 0 , MYF ( 0 ) ) ) mi_check_print_warning ( param , "Can't change size of indexfile, error: %d" , my_errno ) ; if ( ! ( param -> testflag & T_SILENT ) ) { if ( start_records != info -> state -> records ) printf ( "Data records: %s\n" , llstr ( info -> state -> records , llbuff ) ) ; if ( sort_info . dupp ) mi_check_print_warning ( param , "%s records have been removed" , llstr ( sort_info . dupp , llbuff ) ) ; } got_error = 0 ; if ( & share -> state . state != info -> state ) memcpy ( & share -> state . state , info -> state , sizeof ( * info -> state ) ) ; err : got_error |= flush_blocks ( param , share -> key_cache , share -> kfile ) ; ( void ) end_io_cache ( & info -> rec_cache ) ; if ( ! got_error ) { if ( new_file >= 0 ) { myf flags = 0 ; if ( param -> testflag & T_BACKUP_DATA ) flags |= MY_REDEL_MAKE_BACKUP ; if ( no_copy_stat ) flags |= MY_REDEL_NO_COPY_STAT ; mysql_file_close ( new_file , MYF ( 0 ) ) ; info -> dfile = new_file = - 1 ; if ( change_to_newfile ( share -> data_file_name , MI_NAME_DEXT , DATA_TMP_EXT , flags ) || mi_open_datafile ( info , share , name , - 1 ) ) got_error = 1 ; } } if ( got_error ) { if ( ! param -> error_printed ) mi_check_print_error ( param , "%d when fixing table" , my_errno ) ; if ( new_file >= 0 ) { ( void ) mysql_file_close ( new_file , MYF ( 0 ) ) ; ( void ) mysql_file_delete ( mi_key_file_datatmp , param -> temp_filename , MYF ( MY_WME ) ) ; if ( info -> dfile == new_file ) if ( unlikely ( mi_open_datafile ( info , share , name , - 1 ) ) ) param -> retry_repair = 0 ; } mi_mark_crashed_on_repair ( info ) ; } else if ( key_map == share -> state . key_map ) share -> state . changed &= ~ STATE_NOT_OPTIMIZED_KEYS ; share -> state . changed |= STATE_NOT_SORTED_PAGES ; my_free ( mi_get_rec_buff_ptr ( info , sort_param . rec_buff ) ) ; my_free ( mi_get_rec_buff_ptr ( info , sort_param . record ) ) ; my_free ( sort_info . key_block ) ; my_free ( sort_info . ft_buf ) ; my_free ( sort_info . buff ) ; ( void ) end_io_cache ( & param -> read_cache ) ; info -> opt_flag &= ~ ( READ_CACHE_USED | WRITE_CACHE_USED ) ; if ( ! got_error && ( param -> testflag & T_UNPACK ) ) { share -> state . header . options [ 0 ] &= ( uchar ) ~ HA_OPTION_COMPRESS_RECORD ; share -> pack . header_length = 0 ; } DBUG_RETURN ( got_error ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
hb_script_t hb_icu_script_to_script ( UScriptCode script ) { if ( unlikely ( script == USCRIPT_INVALID_CODE ) ) return HB_SCRIPT_INVALID ; return hb_script_from_string ( uscript_getShortName ( script ) , - 1 ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static ossl_inline type * lh_ ## type ## _delete ( LHASH_OF ( type ) * lh , const type * d ) { return ( type * ) OPENSSL_LH_delete ( ( OPENSSL_LHASH * ) lh , d ) ; } static ossl_inline type * lh_ ## type ## _retrieve ( LHASH_OF ( type ) * lh , const type * d ) { return ( type * ) OPENSSL_LH_retrieve ( ( OPENSSL_LHASH * ) lh , d ) ; } static ossl_inline int lh_ ## type ## _error ( LHASH_OF ( type ) * lh ) { return OPENSSL_LH_error ( ( OPENSSL_LHASH * ) lh ) ; } static ossl_inline unsigned long lh_ ## type ## _num_items ( LHASH_OF ( type ) * lh ) { return OPENSSL_LH_num_items ( ( OPENSSL_LHASH * ) lh ) ; } static ossl_inline void lh_ ## type ## _node_stats_bio ( const LHASH_OF ( type ) * lh , BIO * out ) { OPENSSL_LH_node_stats_bio ( ( const OPENSSL_LHASH * ) lh , out ) ; } static ossl_inline void lh_ ## type ## _node_usage_stats_bio ( const LHASH_OF ( type ) * lh , BIO * out ) { OPENSSL_LH_node_usage_stats_bio ( ( const OPENSSL_LHASH * ) lh , out ) ; } static ossl_inline void lh_ ## type ## _stats_bio ( const LHASH_OF ( type ) * lh , BIO * out ) { OPENSSL_LH_stats_bio ( ( const OPENSSL_LHASH * ) lh , out ) ; } static ossl_inline unsigned long lh_ ## type ## _get_down_load ( LHASH_OF ( type ) * lh ) { return OPENSSL_LH_get_down_load ( ( OPENSSL_LHASH * ) lh ) ; } static ossl_inline void lh_ ## type ## _set_down_load ( LHASH_OF ( type ) * lh , unsigned long dl ) { OPENSSL_LH_set_down_load ( ( OPENSSL_LHASH * ) lh , dl ) ; } static ossl_inline void lh_ ## type ## _doall ( LHASH_OF ( type ) * lh , void ( * doall ) ( type * ) ) { OPENSSL_LH_doall ( ( OPENSSL_LHASH * ) lh , ( OPENSSL_LH_DOALL_FUNC ) doall ) ; } LHASH_OF ( type ) # define IMPLEMENT_LHASH_DOALL_ARG_CONST ( type , argtype ) int_implement_lhash_doall ( type , argtype , const type ) # define IMPLEMENT_LHASH_DOALL_ARG ( type , argtype ) int_implement_lhash_doall ( type , argtype , type ) # define int_implement_lhash_doall ( type , argtype , cbargtype ) static ossl_inline void lh_ ## type ## _doall_ ## argtype ( LHASH_OF ( type ) * lh , void ( * fn ) ( cbargtype * , argtype * ) , argtype * arg ) { OPENSSL_LH_doall_arg ( ( OPENSSL_LHASH * ) lh , ( OPENSSL_LH_DOALL_FUNCARG ) fn , ( void * ) arg ) ; } LHASH_OF ( type ) DEFINE_LHASH_OF ( OPENSSL_STRING )
1True
Categorize the following code snippet as vulnerable or not. True or False
static void vmsvga_update_display ( void * opaque ) { struct vmsvga_state_s * s = opaque ; DisplaySurface * surface ; bool dirty = false ; if ( ! s -> enable ) { s -> vga . hw_ops -> gfx_update ( & s -> vga ) ; return ; } vmsvga_check_size ( s ) ; surface = qemu_console_surface ( s -> vga . con ) ; vmsvga_fifo_run ( s ) ; vmsvga_update_rect_flush ( s ) ; if ( memory_region_is_logging ( & s -> vga . vram ) ) { vga_sync_dirty_bitmap ( & s -> vga ) ; dirty = memory_region_get_dirty ( & s -> vga . vram , 0 , surface_stride ( surface ) * surface_height ( surface ) , DIRTY_MEMORY_VGA ) ; } if ( s -> invalidated || dirty ) { s -> invalidated = 0 ; dpy_gfx_update ( s -> vga . con , 0 , 0 , surface_width ( surface ) , surface_height ( surface ) ) ; } if ( dirty ) { memory_region_reset_dirty ( & s -> vga . vram , 0 , surface_stride ( surface ) * surface_height ( surface ) , DIRTY_MEMORY_VGA ) ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
static jboolean ShouldUseSmartLockBranding ( JNIEnv * env , const JavaParamRef < jclass > & ) { const ProfileSyncService * sync_service = ProfileSyncServiceFactory : : GetForProfile ( ProfileManager : : GetLastUsedProfile ( ) ) ; return password_bubble_experiment : : IsSmartLockBrandingEnabled ( sync_service ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static bool login_settings_check ( void * _set , pool_t pool , const char * * error_r ATTR_UNUSED ) { struct login_settings * set = _set ; set -> log_format_elements_split = p_strsplit ( pool , set -> login_log_format_elements , " " ) ; if ( set -> auth_debug_passwords ) set -> auth_debug = TRUE ; if ( set -> auth_debug ) set -> auth_verbose = TRUE ; return TRUE ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void test_ps_conj_select ( ) { MYSQL_STMT * stmt ; int rc ; MYSQL_BIND my_bind [ 2 ] ; int32 int_data ; char str_data [ 32 ] ; unsigned long str_length ; char query [ MAX_TEST_QUERY_LENGTH ] ; myheader ( "test_ps_conj_select" ) ; rc = mysql_query ( mysql , "drop table if exists t1" ) ; myquery ( rc ) ; rc = mysql_query ( mysql , "create table t1 (id1 int(11) NOT NULL default '0', " "value2 varchar(100), value1 varchar(100))" ) ; myquery ( rc ) ; rc = mysql_query ( mysql , "insert into t1 values (1, 'hh', 'hh'), " "(2, 'hh', 'hh'), (1, 'ii', 'ii'), (2, 'ii', 'ii')" ) ; myquery ( rc ) ; strmov ( query , "select id1, value1 from t1 where id1= ? or " "CONVERT(value1 USING utf8)= ?" ) ; stmt = mysql_simple_prepare ( mysql , query ) ; check_stmt ( stmt ) ; verify_param_count ( stmt , 2 ) ; memset ( my_bind , 0 , sizeof ( my_bind ) ) ; my_bind [ 0 ] . buffer_type = MYSQL_TYPE_LONG ; my_bind [ 0 ] . buffer = ( void * ) & int_data ; my_bind [ 1 ] . buffer_type = MYSQL_TYPE_VAR_STRING ; my_bind [ 1 ] . buffer = ( void * ) str_data ; my_bind [ 1 ] . buffer_length = array_elements ( str_data ) ; my_bind [ 1 ] . length = & str_length ; rc = mysql_stmt_bind_param ( stmt , my_bind ) ; check_execute ( stmt , rc ) ; int_data = 1 ; strmov ( str_data , "hh" ) ; str_length = strlen ( str_data ) ; rc = mysql_stmt_execute ( stmt ) ; check_execute ( stmt , rc ) ; rc = my_process_stmt_result ( stmt ) ; DIE_UNLESS ( rc == 3 ) ; mysql_stmt_close ( stmt ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
int libevt_record_values_get_type ( libevt_record_values_t * record_values , uint8_t * type , libcerror_error_t * * error ) { static char * function = "libevt_record_values_get_type" ; if ( record_values == NULL ) { libcerror_error_set ( error , LIBCERROR_ERROR_DOMAIN_ARGUMENTS , LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE , "%s: invalid record values." , function ) ; return ( - 1 ) ; } if ( type == NULL ) { libcerror_error_set ( error , LIBCERROR_ERROR_DOMAIN_ARGUMENTS , LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE , "%s: invalid type." , function ) ; return ( - 1 ) ; } * type = record_values -> type ; return ( 1 ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
void vp9_loop_filter_alloc ( VP9LfSync * lf_sync , VP9_COMMON * cm , int rows , int width ) { lf_sync -> rows = rows ; # if CONFIG_MULTITHREAD { int i ; CHECK_MEM_ERROR ( cm , lf_sync -> mutex_ , vpx_malloc ( sizeof ( * lf_sync -> mutex_ ) * rows ) ) ; for ( i = 0 ; i < rows ; ++ i ) { pthread_mutex_init ( & lf_sync -> mutex_ [ i ] , NULL ) ; } CHECK_MEM_ERROR ( cm , lf_sync -> cond_ , vpx_malloc ( sizeof ( * lf_sync -> cond_ ) * rows ) ) ; for ( i = 0 ; i < rows ; ++ i ) { pthread_cond_init ( & lf_sync -> cond_ [ i ] , NULL ) ; } } # endif CHECK_MEM_ERROR ( cm , lf_sync -> cur_sb_col , vpx_malloc ( sizeof ( * lf_sync -> cur_sb_col ) * rows ) ) ; lf_sync -> sync_range = get_sync_range ( width ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_h245_GenericInformation ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) { # line 656 "../../asn1/h245/h245.cnf" void * priv_data = actx -> private_data ; actx -> private_data = gef_ctx_alloc ( NULL , "GenericInformation" ) ; offset = dissect_h245_GenericMessage ( tvb , offset , actx , tree , hf_index ) ; # line 659 "../../asn1/h245/h245.cnf" actx -> private_data = priv_data ; return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static long dtls1_get_message_fragment ( SSL * s , int st1 , int stn , long max , int * ok ) { unsigned char wire [ DTLS1_HM_HEADER_LENGTH ] ; unsigned long len , frag_off , frag_len ; int i , al ; struct hm_header_st msg_hdr ; if ( ( frag_len = dtls1_retrieve_buffered_fragment ( s , max , ok ) ) || * ok ) { if ( * ok ) s -> init_num = frag_len ; return frag_len ; } i = s -> method -> ssl_read_bytes ( s , SSL3_RT_HANDSHAKE , wire , DTLS1_HM_HEADER_LENGTH , 0 ) ; if ( i <= 0 ) { s -> rwstate = SSL_READING ; * ok = 0 ; return i ; } if ( i != DTLS1_HM_HEADER_LENGTH ) { al = SSL_AD_UNEXPECTED_MESSAGE ; SSLerr ( SSL_F_DTLS1_GET_MESSAGE_FRAGMENT , SSL_R_UNEXPECTED_MESSAGE ) ; goto f_err ; } dtls1_get_message_header ( wire , & msg_hdr ) ; if ( msg_hdr . seq != s -> d1 -> handshake_read_seq && ! ( s -> d1 -> listen && msg_hdr . seq == 1 ) ) return dtls1_process_out_of_seq_message ( s , & msg_hdr , ok ) ; len = msg_hdr . msg_len ; frag_off = msg_hdr . frag_off ; frag_len = msg_hdr . frag_len ; if ( frag_len && frag_len < len ) return dtls1_reassemble_fragment ( s , & msg_hdr , ok ) ; if ( ! s -> server && s -> d1 -> r_msg_hdr . frag_off == 0 && wire [ 0 ] == SSL3_MT_HELLO_REQUEST ) { if ( wire [ 1 ] == 0 && wire [ 2 ] == 0 && wire [ 3 ] == 0 ) { if ( s -> msg_callback ) s -> msg_callback ( 0 , s -> version , SSL3_RT_HANDSHAKE , wire , DTLS1_HM_HEADER_LENGTH , s , s -> msg_callback_arg ) ; s -> init_num = 0 ; return dtls1_get_message_fragment ( s , st1 , stn , max , ok ) ; } else { al = SSL_AD_UNEXPECTED_MESSAGE ; SSLerr ( SSL_F_DTLS1_GET_MESSAGE_FRAGMENT , SSL_R_UNEXPECTED_MESSAGE ) ; goto f_err ; } } if ( ( al = dtls1_preprocess_fragment ( s , & msg_hdr , max ) ) ) goto f_err ; s -> state = stn ; if ( frag_len > 0 ) { unsigned char * p = ( unsigned char * ) s -> init_buf -> data + DTLS1_HM_HEADER_LENGTH ; i = s -> method -> ssl_read_bytes ( s , SSL3_RT_HANDSHAKE , & p [ frag_off ] , frag_len , 0 ) ; if ( i <= 0 ) { s -> rwstate = SSL_READING ; * ok = 0 ; return i ; } } else i = 0 ; if ( i != ( int ) frag_len ) { al = SSL3_AD_ILLEGAL_PARAMETER ; SSLerr ( SSL_F_DTLS1_GET_MESSAGE_FRAGMENT , SSL3_AD_ILLEGAL_PARAMETER ) ; goto f_err ; } * ok = 1 ; s -> init_num = frag_len ; return frag_len ; f_err : ssl3_send_alert ( s , SSL3_AL_FATAL , al ) ; s -> init_num = 0 ; * ok = 0 ; return ( - 1 ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static inline double freq2bark ( double freq ) { return 3.5 * atan ( ( freq / 7500.0 ) * ( freq / 7500.0 ) ) + 13.0 * atan ( freq * 0.00076 ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_h225_ReleaseComplete_UUIE ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) { # line 515 "./asn1/h225/h225.cnf" h225_packet_info * h225_pi ; offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h225_ReleaseComplete_UUIE , ReleaseComplete_UUIE_sequence ) ; # line 519 "./asn1/h225/h225.cnf" h225_pi = ( h225_packet_info * ) p_get_proto_data ( wmem_packet_scope ( ) , actx -> pinfo , proto_h225 , 0 ) ; if ( h225_pi != NULL ) { h225_pi -> cs_type = H225_RELEASE_COMPLET ; g_snprintf ( h225_pi -> frame_label , 50 , "%s" , val_to_str ( h225_pi -> cs_type , T_h323_message_body_vals , "<unknown>" ) ) ; } return offset ; }
1True
Categorize the following code snippet as vulnerable or not. True or False
static gboolean gsm_a_dtap_cc_stat_packet ( void * tapdata , packet_info * pinfo _U_ , epan_dissect_t * edt _U_ , const void * gatr_ptr ) { return gsm_a_stat_packet ( tapdata , gatr_ptr , BSSAP_PDU_TYPE_DTAP , PD_CC ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void netbios_cleanup ( void ) { reassembly_table_destroy ( & netbios_reassembly_table ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
void vp9_quantize_fp_32x32_c ( const tran_low_t * coeff_ptr , intptr_t n_coeffs , int skip_block , const int16_t * zbin_ptr , const int16_t * round_ptr , const int16_t * quant_ptr , const int16_t * quant_shift_ptr , tran_low_t * qcoeff_ptr , tran_low_t * dqcoeff_ptr , const int16_t * dequant_ptr , int zbin_oq_value , uint16_t * eob_ptr , const int16_t * scan , const int16_t * iscan ) { int i , eob = - 1 ; ( void ) zbin_ptr ; ( void ) quant_shift_ptr ; ( void ) zbin_oq_value ; ( void ) iscan ; vpx_memset ( qcoeff_ptr , 0 , n_coeffs * sizeof ( * qcoeff_ptr ) ) ; vpx_memset ( dqcoeff_ptr , 0 , n_coeffs * sizeof ( * dqcoeff_ptr ) ) ; if ( ! skip_block ) { for ( i = 0 ; i < n_coeffs ; i ++ ) { const int rc = scan [ i ] ; const int coeff = coeff_ptr [ rc ] ; const int coeff_sign = ( coeff >> 31 ) ; int tmp = 0 ; int abs_coeff = ( coeff ^ coeff_sign ) - coeff_sign ; if ( abs_coeff >= ( dequant_ptr [ rc != 0 ] >> 2 ) ) { abs_coeff += ROUND_POWER_OF_TWO ( round_ptr [ rc != 0 ] , 1 ) ; abs_coeff = clamp ( abs_coeff , INT16_MIN , INT16_MAX ) ; tmp = ( abs_coeff * quant_ptr [ rc != 0 ] ) >> 15 ; qcoeff_ptr [ rc ] = ( tmp ^ coeff_sign ) - coeff_sign ; dqcoeff_ptr [ rc ] = qcoeff_ptr [ rc ] * dequant_ptr [ rc != 0 ] / 2 ; } if ( tmp ) eob = i ; } } * eob_ptr = eob + 1 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
void ff_svq3_add_idct_c ( uint8_t * dst , int16_t * block , int stride , int qp , int dc ) { const int qmul = svq3_dequant_coeff [ qp ] ; int i ; if ( dc ) { dc = 13 * 13 * ( dc == 1 ? 1538 * block [ 0 ] : qmul * ( block [ 0 ] >> 3 ) / 2 ) ; block [ 0 ] = 0 ; } for ( i = 0 ; i < 4 ; i ++ ) { const int z0 = 13 * ( block [ 0 + 4 * i ] + block [ 2 + 4 * i ] ) ; const int z1 = 13 * ( block [ 0 + 4 * i ] - block [ 2 + 4 * i ] ) ; const int z2 = 7 * block [ 1 + 4 * i ] - 17 * block [ 3 + 4 * i ] ; const int z3 = 17 * block [ 1 + 4 * i ] + 7 * block [ 3 + 4 * i ] ; block [ 0 + 4 * i ] = z0 + z3 ; block [ 1 + 4 * i ] = z1 + z2 ; block [ 2 + 4 * i ] = z1 - z2 ; block [ 3 + 4 * i ] = z0 - z3 ; } for ( i = 0 ; i < 4 ; i ++ ) { const int z0 = 13 * ( block [ i + 4 * 0 ] + block [ i + 4 * 2 ] ) ; const int z1 = 13 * ( block [ i + 4 * 0 ] - block [ i + 4 * 2 ] ) ; const int z2 = 7 * block [ i + 4 * 1 ] - 17 * block [ i + 4 * 3 ] ; const int z3 = 17 * block [ i + 4 * 1 ] + 7 * block [ i + 4 * 3 ] ; const int rr = ( dc + 0x80000 ) ; dst [ i + stride * 0 ] = av_clip_uint8 ( dst [ i + stride * 0 ] + ( ( z0 + z3 ) * qmul + rr >> 20 ) ) ; dst [ i + stride * 1 ] = av_clip_uint8 ( dst [ i + stride * 1 ] + ( ( z1 + z2 ) * qmul + rr >> 20 ) ) ; dst [ i + stride * 2 ] = av_clip_uint8 ( dst [ i + stride * 2 ] + ( ( z1 - z2 ) * qmul + rr >> 20 ) ) ; dst [ i + stride * 3 ] = av_clip_uint8 ( dst [ i + stride * 3 ] + ( ( z0 - z3 ) * qmul + rr >> 20 ) ) ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int estimate_best_b_count ( MpegEncContext * s ) { AVCodec * codec = avcodec_find_encoder ( s -> avctx -> codec_id ) ; AVCodecContext * c = avcodec_alloc_context3 ( NULL ) ; AVFrame input [ FF_MAX_B_FRAMES + 2 ] ; const int scale = s -> avctx -> brd_scale ; int i , j , out_size , p_lambda , b_lambda , lambda2 ; int64_t best_rd = INT64_MAX ; int best_b_count = - 1 ; assert ( scale >= 0 && scale <= 3 ) ; p_lambda = s -> last_lambda_for [ AV_PICTURE_TYPE_P ] ; b_lambda = s -> last_lambda_for [ AV_PICTURE_TYPE_B ] ; if ( ! b_lambda ) b_lambda = p_lambda ; lambda2 = ( b_lambda * b_lambda + ( 1 << FF_LAMBDA_SHIFT ) / 2 ) >> FF_LAMBDA_SHIFT ; c -> width = s -> width >> scale ; c -> height = s -> height >> scale ; c -> flags = CODEC_FLAG_QSCALE | CODEC_FLAG_PSNR | CODEC_FLAG_INPUT_PRESERVED ; c -> flags |= s -> avctx -> flags & CODEC_FLAG_QPEL ; c -> mb_decision = s -> avctx -> mb_decision ; c -> me_cmp = s -> avctx -> me_cmp ; c -> mb_cmp = s -> avctx -> mb_cmp ; c -> me_sub_cmp = s -> avctx -> me_sub_cmp ; c -> pix_fmt = AV_PIX_FMT_YUV420P ; c -> time_base = s -> avctx -> time_base ; c -> max_b_frames = s -> max_b_frames ; if ( avcodec_open2 ( c , codec , NULL ) < 0 ) return - 1 ; for ( i = 0 ; i < s -> max_b_frames + 2 ; i ++ ) { int ysize = c -> width * c -> height ; int csize = ( c -> width / 2 ) * ( c -> height / 2 ) ; Picture pre_input , * pre_input_ptr = i ? s -> input_picture [ i - 1 ] : s -> next_picture_ptr ; avcodec_get_frame_defaults ( & input [ i ] ) ; input [ i ] . data [ 0 ] = av_malloc ( ysize + 2 * csize ) ; input [ i ] . data [ 1 ] = input [ i ] . data [ 0 ] + ysize ; input [ i ] . data [ 2 ] = input [ i ] . data [ 1 ] + csize ; input [ i ] . linesize [ 0 ] = c -> width ; input [ i ] . linesize [ 1 ] = input [ i ] . linesize [ 2 ] = c -> width / 2 ; if ( pre_input_ptr && ( ! i || s -> input_picture [ i - 1 ] ) ) { pre_input = * pre_input_ptr ; if ( pre_input . f . type != FF_BUFFER_TYPE_SHARED && i ) { pre_input . f . data [ 0 ] += INPLACE_OFFSET ; pre_input . f . data [ 1 ] += INPLACE_OFFSET ; pre_input . f . data [ 2 ] += INPLACE_OFFSET ; } s -> dsp . shrink [ scale ] ( input [ i ] . data [ 0 ] , input [ i ] . linesize [ 0 ] , pre_input . f . data [ 0 ] , pre_input . f . linesize [ 0 ] , c -> width , c -> height ) ; s -> dsp . shrink [ scale ] ( input [ i ] . data [ 1 ] , input [ i ] . linesize [ 1 ] , pre_input . f . data [ 1 ] , pre_input . f . linesize [ 1 ] , c -> width >> 1 , c -> height >> 1 ) ; s -> dsp . shrink [ scale ] ( input [ i ] . data [ 2 ] , input [ i ] . linesize [ 2 ] , pre_input . f . data [ 2 ] , pre_input . f . linesize [ 2 ] , c -> width >> 1 , c -> height >> 1 ) ; } } for ( j = 0 ; j < s -> max_b_frames + 1 ; j ++ ) { int64_t rd = 0 ; if ( ! s -> input_picture [ j ] ) break ; c -> error [ 0 ] = c -> error [ 1 ] = c -> error [ 2 ] = 0 ; input [ 0 ] . pict_type = AV_PICTURE_TYPE_I ; input [ 0 ] . quality = 1 * FF_QP2LAMBDA ; out_size = encode_frame ( c , & input [ 0 ] ) ; for ( i = 0 ; i < s -> max_b_frames + 1 ; i ++ ) { int is_p = i % ( j + 1 ) == j || i == s -> max_b_frames ; input [ i + 1 ] . pict_type = is_p ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_B ; input [ i + 1 ] . quality = is_p ? p_lambda : b_lambda ; out_size = encode_frame ( c , & input [ i + 1 ] ) ; rd += ( out_size * lambda2 ) >> ( FF_LAMBDA_SHIFT - 3 ) ; } while ( out_size ) { out_size = encode_frame ( c , NULL ) ; rd += ( out_size * lambda2 ) >> ( FF_LAMBDA_SHIFT - 3 ) ; } rd += c -> error [ 0 ] + c -> error [ 1 ] + c -> error [ 2 ] ; if ( rd < best_rd ) { best_rd = rd ; best_b_count = j ; } } avcodec_close ( c ) ; av_freep ( & c ) ; for ( i = 0 ; i < s -> max_b_frames + 2 ; i ++ ) { av_freep ( & input [ i ] . data [ 0 ] ) ; } return best_b_count ; }
1True
Categorize the following code snippet as vulnerable or not. True or False
static void idct32 ( const int16_t * input , int16_t * output ) { int16_t step1 [ 32 ] , step2 [ 32 ] ; int temp1 , temp2 ; step1 [ 0 ] = input [ 0 ] ; step1 [ 1 ] = input [ 16 ] ; step1 [ 2 ] = input [ 8 ] ; step1 [ 3 ] = input [ 24 ] ; step1 [ 4 ] = input [ 4 ] ; step1 [ 5 ] = input [ 20 ] ; step1 [ 6 ] = input [ 12 ] ; step1 [ 7 ] = input [ 28 ] ; step1 [ 8 ] = input [ 2 ] ; step1 [ 9 ] = input [ 18 ] ; step1 [ 10 ] = input [ 10 ] ; step1 [ 11 ] = input [ 26 ] ; step1 [ 12 ] = input [ 6 ] ; step1 [ 13 ] = input [ 22 ] ; step1 [ 14 ] = input [ 14 ] ; step1 [ 15 ] = input [ 30 ] ; temp1 = input [ 1 ] * cospi_31_64 - input [ 31 ] * cospi_1_64 ; temp2 = input [ 1 ] * cospi_1_64 + input [ 31 ] * cospi_31_64 ; step1 [ 16 ] = dct_const_round_shift ( temp1 ) ; step1 [ 31 ] = dct_const_round_shift ( temp2 ) ; temp1 = input [ 17 ] * cospi_15_64 - input [ 15 ] * cospi_17_64 ; temp2 = input [ 17 ] * cospi_17_64 + input [ 15 ] * cospi_15_64 ; step1 [ 17 ] = dct_const_round_shift ( temp1 ) ; step1 [ 30 ] = dct_const_round_shift ( temp2 ) ; temp1 = input [ 9 ] * cospi_23_64 - input [ 23 ] * cospi_9_64 ; temp2 = input [ 9 ] * cospi_9_64 + input [ 23 ] * cospi_23_64 ; step1 [ 18 ] = dct_const_round_shift ( temp1 ) ; step1 [ 29 ] = dct_const_round_shift ( temp2 ) ; temp1 = input [ 25 ] * cospi_7_64 - input [ 7 ] * cospi_25_64 ; temp2 = input [ 25 ] * cospi_25_64 + input [ 7 ] * cospi_7_64 ; step1 [ 19 ] = dct_const_round_shift ( temp1 ) ; step1 [ 28 ] = dct_const_round_shift ( temp2 ) ; temp1 = input [ 5 ] * cospi_27_64 - input [ 27 ] * cospi_5_64 ; temp2 = input [ 5 ] * cospi_5_64 + input [ 27 ] * cospi_27_64 ; step1 [ 20 ] = dct_const_round_shift ( temp1 ) ; step1 [ 27 ] = dct_const_round_shift ( temp2 ) ; temp1 = input [ 21 ] * cospi_11_64 - input [ 11 ] * cospi_21_64 ; temp2 = input [ 21 ] * cospi_21_64 + input [ 11 ] * cospi_11_64 ; step1 [ 21 ] = dct_const_round_shift ( temp1 ) ; step1 [ 26 ] = dct_const_round_shift ( temp2 ) ; temp1 = input [ 13 ] * cospi_19_64 - input [ 19 ] * cospi_13_64 ; temp2 = input [ 13 ] * cospi_13_64 + input [ 19 ] * cospi_19_64 ; step1 [ 22 ] = dct_const_round_shift ( temp1 ) ; step1 [ 25 ] = dct_const_round_shift ( temp2 ) ; temp1 = input [ 29 ] * cospi_3_64 - input [ 3 ] * cospi_29_64 ; temp2 = input [ 29 ] * cospi_29_64 + input [ 3 ] * cospi_3_64 ; step1 [ 23 ] = dct_const_round_shift ( temp1 ) ; step1 [ 24 ] = dct_const_round_shift ( temp2 ) ; step2 [ 0 ] = step1 [ 0 ] ; step2 [ 1 ] = step1 [ 1 ] ; step2 [ 2 ] = step1 [ 2 ] ; step2 [ 3 ] = step1 [ 3 ] ; step2 [ 4 ] = step1 [ 4 ] ; step2 [ 5 ] = step1 [ 5 ] ; step2 [ 6 ] = step1 [ 6 ] ; step2 [ 7 ] = step1 [ 7 ] ; temp1 = step1 [ 8 ] * cospi_30_64 - step1 [ 15 ] * cospi_2_64 ; temp2 = step1 [ 8 ] * cospi_2_64 + step1 [ 15 ] * cospi_30_64 ; step2 [ 8 ] = dct_const_round_shift ( temp1 ) ; step2 [ 15 ] = dct_const_round_shift ( temp2 ) ; temp1 = step1 [ 9 ] * cospi_14_64 - step1 [ 14 ] * cospi_18_64 ; temp2 = step1 [ 9 ] * cospi_18_64 + step1 [ 14 ] * cospi_14_64 ; step2 [ 9 ] = dct_const_round_shift ( temp1 ) ; step2 [ 14 ] = dct_const_round_shift ( temp2 ) ; temp1 = step1 [ 10 ] * cospi_22_64 - step1 [ 13 ] * cospi_10_64 ; temp2 = step1 [ 10 ] * cospi_10_64 + step1 [ 13 ] * cospi_22_64 ; step2 [ 10 ] = dct_const_round_shift ( temp1 ) ; step2 [ 13 ] = dct_const_round_shift ( temp2 ) ; temp1 = step1 [ 11 ] * cospi_6_64 - step1 [ 12 ] * cospi_26_64 ; temp2 = step1 [ 11 ] * cospi_26_64 + step1 [ 12 ] * cospi_6_64 ; step2 [ 11 ] = dct_const_round_shift ( temp1 ) ; step2 [ 12 ] = dct_const_round_shift ( temp2 ) ; step2 [ 16 ] = step1 [ 16 ] + step1 [ 17 ] ; step2 [ 17 ] = step1 [ 16 ] - step1 [ 17 ] ; step2 [ 18 ] = - step1 [ 18 ] + step1 [ 19 ] ; step2 [ 19 ] = step1 [ 18 ] + step1 [ 19 ] ; step2 [ 20 ] = step1 [ 20 ] + step1 [ 21 ] ; step2 [ 21 ] = step1 [ 20 ] - step1 [ 21 ] ; step2 [ 22 ] = - step1 [ 22 ] + step1 [ 23 ] ; step2 [ 23 ] = step1 [ 22 ] + step1 [ 23 ] ; step2 [ 24 ] = step1 [ 24 ] + step1 [ 25 ] ; step2 [ 25 ] = step1 [ 24 ] - step1 [ 25 ] ; step2 [ 26 ] = - step1 [ 26 ] + step1 [ 27 ] ; step2 [ 27 ] = step1 [ 26 ] + step1 [ 27 ] ; step2 [ 28 ] = step1 [ 28 ] + step1 [ 29 ] ; step2 [ 29 ] = step1 [ 28 ] - step1 [ 29 ] ; step2 [ 30 ] = - step1 [ 30 ] + step1 [ 31 ] ; step2 [ 31 ] = step1 [ 30 ] + step1 [ 31 ] ; step1 [ 0 ] = step2 [ 0 ] ; step1 [ 1 ] = step2 [ 1 ] ; step1 [ 2 ] = step2 [ 2 ] ; step1 [ 3 ] = step2 [ 3 ] ; temp1 = step2 [ 4 ] * cospi_28_64 - step2 [ 7 ] * cospi_4_64 ; temp2 = step2 [ 4 ] * cospi_4_64 + step2 [ 7 ] * cospi_28_64 ; step1 [ 4 ] = dct_const_round_shift ( temp1 ) ; step1 [ 7 ] = dct_const_round_shift ( temp2 ) ; temp1 = step2 [ 5 ] * cospi_12_64 - step2 [ 6 ] * cospi_20_64 ; temp2 = step2 [ 5 ] * cospi_20_64 + step2 [ 6 ] * cospi_12_64 ; step1 [ 5 ] = dct_const_round_shift ( temp1 ) ; step1 [ 6 ] = dct_const_round_shift ( temp2 ) ; step1 [ 8 ] = step2 [ 8 ] + step2 [ 9 ] ; step1 [ 9 ] = step2 [ 8 ] - step2 [ 9 ] ; step1 [ 10 ] = - step2 [ 10 ] + step2 [ 11 ] ; step1 [ 11 ] = step2 [ 10 ] + step2 [ 11 ] ; step1 [ 12 ] = step2 [ 12 ] + step2 [ 13 ] ; step1 [ 13 ] = step2 [ 12 ] - step2 [ 13 ] ; step1 [ 14 ] = - step2 [ 14 ] + step2 [ 15 ] ; step1 [ 15 ] = step2 [ 14 ] + step2 [ 15 ] ; step1 [ 16 ] = step2 [ 16 ] ; step1 [ 31 ] = step2 [ 31 ] ; temp1 = - step2 [ 17 ] * cospi_4_64 + step2 [ 30 ] * cospi_28_64 ; temp2 = step2 [ 17 ] * cospi_28_64 + step2 [ 30 ] * cospi_4_64 ; step1 [ 17 ] = dct_const_round_shift ( temp1 ) ; step1 [ 30 ] = dct_const_round_shift ( temp2 ) ; temp1 = - step2 [ 18 ] * cospi_28_64 - step2 [ 29 ] * cospi_4_64 ; temp2 = - step2 [ 18 ] * cospi_4_64 + step2 [ 29 ] * cospi_28_64 ; step1 [ 18 ] = dct_const_round_shift ( temp1 ) ; step1 [ 29 ] = dct_const_round_shift ( temp2 ) ; step1 [ 19 ] = step2 [ 19 ] ; step1 [ 20 ] = step2 [ 20 ] ; temp1 = - step2 [ 21 ] * cospi_20_64 + step2 [ 26 ] * cospi_12_64 ; temp2 = step2 [ 21 ] * cospi_12_64 + step2 [ 26 ] * cospi_20_64 ; step1 [ 21 ] = dct_const_round_shift ( temp1 ) ; step1 [ 26 ] = dct_const_round_shift ( temp2 ) ; temp1 = - step2 [ 22 ] * cospi_12_64 - step2 [ 25 ] * cospi_20_64 ; temp2 = - step2 [ 22 ] * cospi_20_64 + step2 [ 25 ] * cospi_12_64 ; step1 [ 22 ] = dct_const_round_shift ( temp1 ) ; step1 [ 25 ] = dct_const_round_shift ( temp2 ) ; step1 [ 23 ] = step2 [ 23 ] ; step1 [ 24 ] = step2 [ 24 ] ; step1 [ 27 ] = step2 [ 27 ] ; step1 [ 28 ] = step2 [ 28 ] ; temp1 = ( step1 [ 0 ] + step1 [ 1 ] ) * cospi_16_64 ; temp2 = ( step1 [ 0 ] - step1 [ 1 ] ) * cospi_16_64 ; step2 [ 0 ] = dct_const_round_shift ( temp1 ) ; step2 [ 1 ] = dct_const_round_shift ( temp2 ) ; temp1 = step1 [ 2 ] * cospi_24_64 - step1 [ 3 ] * cospi_8_64 ; temp2 = step1 [ 2 ] * cospi_8_64 + step1 [ 3 ] * cospi_24_64 ; step2 [ 2 ] = dct_const_round_shift ( temp1 ) ; step2 [ 3 ] = dct_const_round_shift ( temp2 ) ; step2 [ 4 ] = step1 [ 4 ] + step1 [ 5 ] ; step2 [ 5 ] = step1 [ 4 ] - step1 [ 5 ] ; step2 [ 6 ] = - step1 [ 6 ] + step1 [ 7 ] ; step2 [ 7 ] = step1 [ 6 ] + step1 [ 7 ] ; step2 [ 8 ] = step1 [ 8 ] ; step2 [ 15 ] = step1 [ 15 ] ; temp1 = - step1 [ 9 ] * cospi_8_64 + step1 [ 14 ] * cospi_24_64 ; temp2 = step1 [ 9 ] * cospi_24_64 + step1 [ 14 ] * cospi_8_64 ; step2 [ 9 ] = dct_const_round_shift ( temp1 ) ; step2 [ 14 ] = dct_const_round_shift ( temp2 ) ; temp1 = - step1 [ 10 ] * cospi_24_64 - step1 [ 13 ] * cospi_8_64 ; temp2 = - step1 [ 10 ] * cospi_8_64 + step1 [ 13 ] * cospi_24_64 ; step2 [ 10 ] = dct_const_round_shift ( temp1 ) ; step2 [ 13 ] = dct_const_round_shift ( temp2 ) ; step2 [ 11 ] = step1 [ 11 ] ; step2 [ 12 ] = step1 [ 12 ] ; step2 [ 16 ] = step1 [ 16 ] + step1 [ 19 ] ; step2 [ 17 ] = step1 [ 17 ] + step1 [ 18 ] ; step2 [ 18 ] = step1 [ 17 ] - step1 [ 18 ] ; step2 [ 19 ] = step1 [ 16 ] - step1 [ 19 ] ; step2 [ 20 ] = - step1 [ 20 ] + step1 [ 23 ] ; step2 [ 21 ] = - step1 [ 21 ] + step1 [ 22 ] ; step2 [ 22 ] = step1 [ 21 ] + step1 [ 22 ] ; step2 [ 23 ] = step1 [ 20 ] + step1 [ 23 ] ; step2 [ 24 ] = step1 [ 24 ] + step1 [ 27 ] ; step2 [ 25 ] = step1 [ 25 ] + step1 [ 26 ] ; step2 [ 26 ] = step1 [ 25 ] - step1 [ 26 ] ; step2 [ 27 ] = step1 [ 24 ] - step1 [ 27 ] ; step2 [ 28 ] = - step1 [ 28 ] + step1 [ 31 ] ; step2 [ 29 ] = - step1 [ 29 ] + step1 [ 30 ] ; step2 [ 30 ] = step1 [ 29 ] + step1 [ 30 ] ; step2 [ 31 ] = step1 [ 28 ] + step1 [ 31 ] ; step1 [ 0 ] = step2 [ 0 ] + step2 [ 3 ] ; step1 [ 1 ] = step2 [ 1 ] + step2 [ 2 ] ; step1 [ 2 ] = step2 [ 1 ] - step2 [ 2 ] ; step1 [ 3 ] = step2 [ 0 ] - step2 [ 3 ] ; step1 [ 4 ] = step2 [ 4 ] ; temp1 = ( step2 [ 6 ] - step2 [ 5 ] ) * cospi_16_64 ; temp2 = ( step2 [ 5 ] + step2 [ 6 ] ) * cospi_16_64 ; step1 [ 5 ] = dct_const_round_shift ( temp1 ) ; step1 [ 6 ] = dct_const_round_shift ( temp2 ) ; step1 [ 7 ] = step2 [ 7 ] ; step1 [ 8 ] = step2 [ 8 ] + step2 [ 11 ] ; step1 [ 9 ] = step2 [ 9 ] + step2 [ 10 ] ; step1 [ 10 ] = step2 [ 9 ] - step2 [ 10 ] ; step1 [ 11 ] = step2 [ 8 ] - step2 [ 11 ] ; step1 [ 12 ] = - step2 [ 12 ] + step2 [ 15 ] ; step1 [ 13 ] = - step2 [ 13 ] + step2 [ 14 ] ; step1 [ 14 ] = step2 [ 13 ] + step2 [ 14 ] ; step1 [ 15 ] = step2 [ 12 ] + step2 [ 15 ] ; step1 [ 16 ] = step2 [ 16 ] ; step1 [ 17 ] = step2 [ 17 ] ; temp1 = - step2 [ 18 ] * cospi_8_64 + step2 [ 29 ] * cospi_24_64 ; temp2 = step2 [ 18 ] * cospi_24_64 + step2 [ 29 ] * cospi_8_64 ; step1 [ 18 ] = dct_const_round_shift ( temp1 ) ; step1 [ 29 ] = dct_const_round_shift ( temp2 ) ; temp1 = - step2 [ 19 ] * cospi_8_64 + step2 [ 28 ] * cospi_24_64 ; temp2 = step2 [ 19 ] * cospi_24_64 + step2 [ 28 ] * cospi_8_64 ; step1 [ 19 ] = dct_const_round_shift ( temp1 ) ; step1 [ 28 ] = dct_const_round_shift ( temp2 ) ; temp1 = - step2 [ 20 ] * cospi_24_64 - step2 [ 27 ] * cospi_8_64 ; temp2 = - step2 [ 20 ] * cospi_8_64 + step2 [ 27 ] * cospi_24_64 ; step1 [ 20 ] = dct_const_round_shift ( temp1 ) ; step1 [ 27 ] = dct_const_round_shift ( temp2 ) ; temp1 = - step2 [ 21 ] * cospi_24_64 - step2 [ 26 ] * cospi_8_64 ; temp2 = - step2 [ 21 ] * cospi_8_64 + step2 [ 26 ] * cospi_24_64 ; step1 [ 21 ] = dct_const_round_shift ( temp1 ) ; step1 [ 26 ] = dct_const_round_shift ( temp2 ) ; step1 [ 22 ] = step2 [ 22 ] ; step1 [ 23 ] = step2 [ 23 ] ; step1 [ 24 ] = step2 [ 24 ] ; step1 [ 25 ] = step2 [ 25 ] ; step1 [ 30 ] = step2 [ 30 ] ; step1 [ 31 ] = step2 [ 31 ] ; step2 [ 0 ] = step1 [ 0 ] + step1 [ 7 ] ; step2 [ 1 ] = step1 [ 1 ] + step1 [ 6 ] ; step2 [ 2 ] = step1 [ 2 ] + step1 [ 5 ] ; step2 [ 3 ] = step1 [ 3 ] + step1 [ 4 ] ; step2 [ 4 ] = step1 [ 3 ] - step1 [ 4 ] ; step2 [ 5 ] = step1 [ 2 ] - step1 [ 5 ] ; step2 [ 6 ] = step1 [ 1 ] - step1 [ 6 ] ; step2 [ 7 ] = step1 [ 0 ] - step1 [ 7 ] ; step2 [ 8 ] = step1 [ 8 ] ; step2 [ 9 ] = step1 [ 9 ] ; temp1 = ( - step1 [ 10 ] + step1 [ 13 ] ) * cospi_16_64 ; temp2 = ( step1 [ 10 ] + step1 [ 13 ] ) * cospi_16_64 ; step2 [ 10 ] = dct_const_round_shift ( temp1 ) ; step2 [ 13 ] = dct_const_round_shift ( temp2 ) ; temp1 = ( - step1 [ 11 ] + step1 [ 12 ] ) * cospi_16_64 ; temp2 = ( step1 [ 11 ] + step1 [ 12 ] ) * cospi_16_64 ; step2 [ 11 ] = dct_const_round_shift ( temp1 ) ; step2 [ 12 ] = dct_const_round_shift ( temp2 ) ; step2 [ 14 ] = step1 [ 14 ] ; step2 [ 15 ] = step1 [ 15 ] ; step2 [ 16 ] = step1 [ 16 ] + step1 [ 23 ] ; step2 [ 17 ] = step1 [ 17 ] + step1 [ 22 ] ; step2 [ 18 ] = step1 [ 18 ] + step1 [ 21 ] ; step2 [ 19 ] = step1 [ 19 ] + step1 [ 20 ] ; step2 [ 20 ] = step1 [ 19 ] - step1 [ 20 ] ; step2 [ 21 ] = step1 [ 18 ] - step1 [ 21 ] ; step2 [ 22 ] = step1 [ 17 ] - step1 [ 22 ] ; step2 [ 23 ] = step1 [ 16 ] - step1 [ 23 ] ; step2 [ 24 ] = - step1 [ 24 ] + step1 [ 31 ] ; step2 [ 25 ] = - step1 [ 25 ] + step1 [ 30 ] ; step2 [ 26 ] = - step1 [ 26 ] + step1 [ 29 ] ; step2 [ 27 ] = - step1 [ 27 ] + step1 [ 28 ] ; step2 [ 28 ] = step1 [ 27 ] + step1 [ 28 ] ; step2 [ 29 ] = step1 [ 26 ] + step1 [ 29 ] ; step2 [ 30 ] = step1 [ 25 ] + step1 [ 30 ] ; step2 [ 31 ] = step1 [ 24 ] + step1 [ 31 ] ; step1 [ 0 ] = step2 [ 0 ] + step2 [ 15 ] ; step1 [ 1 ] = step2 [ 1 ] + step2 [ 14 ] ; step1 [ 2 ] = step2 [ 2 ] + step2 [ 13 ] ; step1 [ 3 ] = step2 [ 3 ] + step2 [ 12 ] ; step1 [ 4 ] = step2 [ 4 ] + step2 [ 11 ] ; step1 [ 5 ] = step2 [ 5 ] + step2 [ 10 ] ; step1 [ 6 ] = step2 [ 6 ] + step2 [ 9 ] ; step1 [ 7 ] = step2 [ 7 ] + step2 [ 8 ] ; step1 [ 8 ] = step2 [ 7 ] - step2 [ 8 ] ; step1 [ 9 ] = step2 [ 6 ] - step2 [ 9 ] ; step1 [ 10 ] = step2 [ 5 ] - step2 [ 10 ] ; step1 [ 11 ] = step2 [ 4 ] - step2 [ 11 ] ; step1 [ 12 ] = step2 [ 3 ] - step2 [ 12 ] ; step1 [ 13 ] = step2 [ 2 ] - step2 [ 13 ] ; step1 [ 14 ] = step2 [ 1 ] - step2 [ 14 ] ; step1 [ 15 ] = step2 [ 0 ] - step2 [ 15 ] ; step1 [ 16 ] = step2 [ 16 ] ; step1 [ 17 ] = step2 [ 17 ] ; step1 [ 18 ] = step2 [ 18 ] ; step1 [ 19 ] = step2 [ 19 ] ; temp1 = ( - step2 [ 20 ] + step2 [ 27 ] ) * cospi_16_64 ; temp2 = ( step2 [ 20 ] + step2 [ 27 ] ) * cospi_16_64 ; step1 [ 20 ] = dct_const_round_shift ( temp1 ) ; step1 [ 27 ] = dct_const_round_shift ( temp2 ) ; temp1 = ( - step2 [ 21 ] + step2 [ 26 ] ) * cospi_16_64 ; temp2 = ( step2 [ 21 ] + step2 [ 26 ] ) * cospi_16_64 ; step1 [ 21 ] = dct_const_round_shift ( temp1 ) ; step1 [ 26 ] = dct_const_round_shift ( temp2 ) ; temp1 = ( - step2 [ 22 ] + step2 [ 25 ] ) * cospi_16_64 ; temp2 = ( step2 [ 22 ] + step2 [ 25 ] ) * cospi_16_64 ; step1 [ 22 ] = dct_const_round_shift ( temp1 ) ; step1 [ 25 ] = dct_const_round_shift ( temp2 ) ; temp1 = ( - step2 [ 23 ] + step2 [ 24 ] ) * cospi_16_64 ; temp2 = ( step2 [ 23 ] + step2 [ 24 ] ) * cospi_16_64 ; step1 [ 23 ] = dct_const_round_shift ( temp1 ) ; step1 [ 24 ] = dct_const_round_shift ( temp2 ) ; step1 [ 28 ] = step2 [ 28 ] ; step1 [ 29 ] = step2 [ 29 ] ; step1 [ 30 ] = step2 [ 30 ] ; step1 [ 31 ] = step2 [ 31 ] ; output [ 0 ] = step1 [ 0 ] + step1 [ 31 ] ; output [ 1 ] = step1 [ 1 ] + step1 [ 30 ] ; output [ 2 ] = step1 [ 2 ] + step1 [ 29 ] ; output [ 3 ] = step1 [ 3 ] + step1 [ 28 ] ; output [ 4 ] = step1 [ 4 ] + step1 [ 27 ] ; output [ 5 ] = step1 [ 5 ] + step1 [ 26 ] ; output [ 6 ] = step1 [ 6 ] + step1 [ 25 ] ; output [ 7 ] = step1 [ 7 ] + step1 [ 24 ] ; output [ 8 ] = step1 [ 8 ] + step1 [ 23 ] ; output [ 9 ] = step1 [ 9 ] + step1 [ 22 ] ; output [ 10 ] = step1 [ 10 ] + step1 [ 21 ] ; output [ 11 ] = step1 [ 11 ] + step1 [ 20 ] ; output [ 12 ] = step1 [ 12 ] + step1 [ 19 ] ; output [ 13 ] = step1 [ 13 ] + step1 [ 18 ] ; output [ 14 ] = step1 [ 14 ] + step1 [ 17 ] ; output [ 15 ] = step1 [ 15 ] + step1 [ 16 ] ; output [ 16 ] = step1 [ 15 ] - step1 [ 16 ] ; output [ 17 ] = step1 [ 14 ] - step1 [ 17 ] ; output [ 18 ] = step1 [ 13 ] - step1 [ 18 ] ; output [ 19 ] = step1 [ 12 ] - step1 [ 19 ] ; output [ 20 ] = step1 [ 11 ] - step1 [ 20 ] ; output [ 21 ] = step1 [ 10 ] - step1 [ 21 ] ; output [ 22 ] = step1 [ 9 ] - step1 [ 22 ] ; output [ 23 ] = step1 [ 8 ] - step1 [ 23 ] ; output [ 24 ] = step1 [ 7 ] - step1 [ 24 ] ; output [ 25 ] = step1 [ 6 ] - step1 [ 25 ] ; output [ 26 ] = step1 [ 5 ] - step1 [ 26 ] ; output [ 27 ] = step1 [ 4 ] - step1 [ 27 ] ; output [ 28 ] = step1 [ 3 ] - step1 [ 28 ] ; output [ 29 ] = step1 [ 2 ] - step1 [ 29 ] ; output [ 30 ] = step1 [ 1 ] - step1 [ 30 ] ; output [ 31 ] = step1 [ 0 ] - step1 [ 31 ] ; }
1True
Categorize the following code snippet as vulnerable or not. True or False
static void psf_log_syserr ( SF_PRIVATE * psf , int error ) { if ( psf -> error == 0 ) { psf -> error = SFE_SYSTEM ; snprintf ( psf -> syserr , sizeof ( psf -> syserr ) , "System error : %s." , strerror ( error ) ) ; } ; return ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int32_t reduceToUMappings ( UCMTable * table ) { UCMapping * mappings ; int32_t * map ; int32_t i , j , count ; int8_t flag ; mappings = table -> mappings ; map = table -> reverseMap ; count = table -> mappingsLength ; for ( i = j = 0 ; i < count ; ++ i ) { flag = mappings [ map [ i ] ] . f ; if ( flag != 0 && flag != 3 ) { break ; } } for ( j = i ; i < count ; ++ i ) { flag = mappings [ map [ i ] ] . f ; if ( flag == 0 || flag == 3 ) { map [ j ++ ] = map [ i ] ; } } return j ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static struct object_entry * * compute_write_order ( void ) { unsigned int i , wo_end , last_untagged ; struct object_entry * * wo = xmalloc ( to_pack . nr_objects * sizeof ( * wo ) ) ; struct object_entry * objects = to_pack . objects ; for ( i = 0 ; i < to_pack . nr_objects ; i ++ ) { objects [ i ] . tagged = 0 ; objects [ i ] . filled = 0 ; objects [ i ] . delta_child = NULL ; objects [ i ] . delta_sibling = NULL ; } for ( i = to_pack . nr_objects ; i > 0 ; ) { struct object_entry * e = & objects [ -- i ] ; if ( ! e -> delta ) continue ; e -> delta_sibling = e -> delta -> delta_child ; e -> delta -> delta_child = e ; } for_each_tag_ref ( mark_tagged , NULL ) ; for ( i = wo_end = 0 ; i < to_pack . nr_objects ; i ++ ) { if ( objects [ i ] . tagged ) break ; add_to_write_order ( wo , & wo_end , & objects [ i ] ) ; } last_untagged = i ; for ( ; i < to_pack . nr_objects ; i ++ ) { if ( objects [ i ] . tagged ) add_to_write_order ( wo , & wo_end , & objects [ i ] ) ; } for ( i = last_untagged ; i < to_pack . nr_objects ; i ++ ) { if ( objects [ i ] . type != OBJ_COMMIT && objects [ i ] . type != OBJ_TAG ) continue ; add_to_write_order ( wo , & wo_end , & objects [ i ] ) ; } for ( i = last_untagged ; i < to_pack . nr_objects ; i ++ ) { if ( objects [ i ] . type != OBJ_TREE ) continue ; add_to_write_order ( wo , & wo_end , & objects [ i ] ) ; } for ( i = last_untagged ; i < to_pack . nr_objects ; i ++ ) { if ( ! objects [ i ] . filled ) add_family_to_write_order ( wo , & wo_end , & objects [ i ] ) ; } if ( wo_end != to_pack . nr_objects ) die ( "ordered %u objects, expected %" PRIu32 , wo_end , to_pack . nr_objects ) ; return wo ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void seekUntilNewline ( UCHARBUF * buf , struct UString * token , UErrorCode * status ) { UChar32 c ; if ( U_FAILURE ( * status ) ) { return ; } do { c = ucbuf_getc ( buf , status ) ; if ( token != NULL ) { ustr_u32cat ( token , c , status ) ; } } while ( ! isNewline ( c ) && c != U_EOF && * status == U_ZERO_ERROR ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void vga_draw_line32_be ( VGACommonState * s1 , uint8_t * d , const uint8_t * s , int width ) { # ifdef HOST_WORDS_BIGENDIAN memcpy ( d , s , width * 4 ) ; # else int w ; uint32_t r , g , b ; w = width ; do { r = s [ 1 ] ; g = s [ 2 ] ; b = s [ 3 ] ; ( ( uint32_t * ) d ) [ 0 ] = rgb_to_pixel32 ( r , g , b ) ; s += 4 ; d += 4 ; } while ( -- w != 0 ) ; # endif }
1True
Categorize the following code snippet as vulnerable or not. True or False
TEST ( BuildTime , TimeLooksValid ) { char build_time [ ] = "00:00:00" ; EXPECT_EQ ( 8u , strlen ( build_time ) ) ; EXPECT_EQ ( ':' , build_time [ 2 ] ) ; EXPECT_EQ ( ':' , build_time [ 5 ] ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static inline void pxa2xx_fir_update ( PXA2xxFIrState * s ) { static const int tresh [ 4 ] = { 8 , 16 , 32 , 0 } ; int intr = 0 ; if ( ( s -> control [ 0 ] & ( 1 << 4 ) ) && s -> rx_len >= tresh [ s -> control [ 2 ] & 3 ] ) s -> status [ 0 ] |= 1 << 4 ; else s -> status [ 0 ] &= ~ ( 1 << 4 ) ; if ( s -> control [ 0 ] & ( 1 << 3 ) ) s -> status [ 0 ] |= 1 << 3 ; else s -> status [ 0 ] &= ~ ( 1 << 3 ) ; if ( s -> rx_len ) s -> status [ 1 ] |= 1 << 2 ; else s -> status [ 1 ] &= ~ ( 1 << 2 ) ; if ( s -> control [ 0 ] & ( 1 << 4 ) ) s -> status [ 1 ] |= 1 << 0 ; else s -> status [ 1 ] &= ~ ( 1 << 0 ) ; intr |= ( s -> control [ 0 ] & ( 1 << 5 ) ) && ( s -> status [ 0 ] & ( 1 << 4 ) ) ; intr |= ( s -> control [ 0 ] & ( 1 << 6 ) ) && ( s -> status [ 0 ] & ( 1 << 3 ) ) ; intr |= ( s -> control [ 2 ] & ( 1 << 4 ) ) && ( s -> status [ 0 ] & ( 1 << 6 ) ) ; intr |= ( s -> control [ 0 ] & ( 1 << 2 ) ) && ( s -> status [ 0 ] & ( 1 << 1 ) ) ; intr |= s -> status [ 0 ] & 0x25 ; qemu_set_irq ( s -> rx_dma , ( s -> status [ 0 ] >> 4 ) & 1 ) ; qemu_set_irq ( s -> tx_dma , ( s -> status [ 0 ] >> 3 ) & 1 ) ; qemu_set_irq ( s -> irq , intr && s -> enable ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_h225_NULL ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) { offset = dissect_per_null ( tvb , offset , actx , tree , hf_index ) ; return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_h245_T_t38fax ( tvbuff_t * tvb _U_ , int offset _U_ , asn1_ctx_t * actx _U_ , proto_tree * tree _U_ , int hf_index _U_ ) { offset = dissect_per_sequence ( tvb , offset , actx , tree , hf_index , ett_h245_T_t38fax , T_t38fax_sequence ) ; return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
xmlGenericErrorFunc * __xmlGenericError ( void ) { if ( IS_MAIN_THREAD ) return ( & xmlGenericError ) ; else return ( & xmlGetGlobalState ( ) -> xmlGenericError ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
int qemuMonitorTextSetBalloon ( qemuMonitorPtr mon , unsigned long newmem ) { char * cmd ; char * reply = NULL ; int ret = - 1 ; if ( virAsprintf ( & cmd , "balloon %lu" , VIR_DIV_UP ( newmem , 1024 ) ) < 0 ) { virReportOOMError ( ) ; return - 1 ; } if ( qemuMonitorHMPCommand ( mon , cmd , & reply ) < 0 ) { qemuReportError ( VIR_ERR_OPERATION_FAILED , "%s" , _ ( "could not balloon memory allocation" ) ) ; VIR_FREE ( cmd ) ; return - 1 ; } VIR_FREE ( cmd ) ; if ( strstr ( reply , "unknown command:" ) ) { ret = 0 ; } else { ret = 1 ; } VIR_FREE ( reply ) ; return ret ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void dissect_rsvp_tspec ( proto_item * ti , packet_info * pinfo , proto_tree * rsvp_object_tree , tvbuff_t * tvb , int offset , int obj_length , int rsvp_class _U_ , int type ) { int offset2 = offset + 4 ; int mylen ; proto_tree * tspec_tree , * ti2 = NULL ; guint8 signal_type ; mylen = obj_length - 4 ; switch ( type ) { case 2 : proto_tree_add_uint_format_value ( rsvp_object_tree , hf_rsvp_ctype , tvb , offset + 3 , 1 , type , "2 - Integrated Services" ) ; proto_tree_add_item ( rsvp_object_tree , hf_rsvp_tspec_message_format_version , tvb , offset2 , 1 , ENC_BIG_ENDIAN ) ; proto_tree_add_uint_format_value ( rsvp_object_tree , hf_rsvp_data_length , tvb , offset2 + 2 , 2 , tvb_get_ntohs ( tvb , offset2 + 2 ) , "%u words, not including header" , tvb_get_ntohs ( tvb , offset2 + 2 ) ) ; mylen -= 4 ; offset2 += 4 ; proto_item_set_text ( ti , "SENDER TSPEC: IntServ, " ) ; while ( mylen > 0 ) { guint8 service_num ; guint8 param_id ; guint param_len , raw_len ; guint param_len_processed ; guint length ; service_num = tvb_get_guint8 ( tvb , offset2 ) ; proto_tree_add_item ( rsvp_object_tree , hf_rsvp_tspec_service_header , tvb , offset2 , 1 , ENC_BIG_ENDIAN ) ; length = tvb_get_ntohs ( tvb , offset2 + 2 ) ; proto_tree_add_uint_format ( rsvp_object_tree , hf_rsvp_data_length , tvb , offset2 + 2 , 2 , length , "Length of service %u data: %u words, not including header" , service_num , length ) ; mylen -= 4 ; offset2 += 4 ; param_len_processed = 0 ; while ( param_len_processed < length ) { param_id = tvb_get_guint8 ( tvb , offset2 ) ; ti2 = proto_tree_add_item ( rsvp_object_tree , hf_rsvp_parameter , tvb , offset2 , 1 , ENC_NA ) ; raw_len = tvb_get_ntohs ( tvb , offset2 + 2 ) ; param_len = raw_len + 1 ; switch ( param_id ) { case 127 : proto_item_set_len ( ti2 , param_len * 4 ) ; tspec_tree = proto_item_add_subtree ( ti2 , TREE ( TT_TSPEC_SUBTREE ) ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_parameter_flags , tvb , offset2 + 1 , 1 , ENC_NA ) ; proto_tree_add_uint_format_value ( tspec_tree , hf_rsvp_parameter_length , tvb , offset2 + 2 , 2 , raw_len , "%u words, not including header" , raw_len ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_tspec_token_bucket_rate , tvb , offset2 + 4 , 4 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_tspec_token_bucket_size , tvb , offset2 + 8 , 4 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_tspec_peak_data_rate , tvb , offset2 + 12 , 4 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_minimum_policed_unit , tvb , offset2 + 16 , 4 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_maximum_packet_size , tvb , offset2 + 20 , 4 , ENC_BIG_ENDIAN ) ; proto_item_append_text ( ti , "Token Bucket, %.10g bytes/sec. " , tvb_get_ntohieee_float ( tvb , offset2 + 4 ) ) ; proto_item_append_text ( ti2 , "Rate=%.10g Burst=%.10g Peak=%.10g m=%u M=%u" , tvb_get_ntohieee_float ( tvb , offset2 + 4 ) , tvb_get_ntohieee_float ( tvb , offset2 + 8 ) , tvb_get_ntohieee_float ( tvb , offset2 + 12 ) , tvb_get_ntohl ( tvb , offset2 + 16 ) , tvb_get_ntohl ( tvb , offset2 + 20 ) ) ; break ; case 128 : proto_item_set_len ( ti2 , param_len * 4 ) ; tspec_tree = proto_item_add_subtree ( ti2 , TREE ( TT_TSPEC_SUBTREE ) ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_parameter_flags , tvb , offset2 + 1 , 1 , ENC_NA ) ; proto_tree_add_uint_format_value ( tspec_tree , hf_rsvp_parameter_length , tvb , offset2 + 2 , 2 , raw_len , "%u words, not including header" , raw_len ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_maximum_packet_size , tvb , offset2 + 4 , 4 , ENC_BIG_ENDIAN ) ; proto_item_append_text ( ti , "Null Service. M=%u" , tvb_get_ntohl ( tvb , offset2 + 4 ) ) ; proto_item_append_text ( ti2 , "Max pkt size=%u" , tvb_get_ntohl ( tvb , offset2 + 4 ) ) ; break ; case 126 : proto_item_set_len ( ti2 , param_len * 4 ) ; tspec_tree = proto_item_add_subtree ( ti2 , TREE ( TT_TSPEC_SUBTREE ) ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_parameter_flags , tvb , offset2 + 1 , 1 , ENC_NA ) ; proto_tree_add_uint_format_value ( tspec_tree , hf_rsvp_parameter_length , tvb , offset2 + 2 , 2 , raw_len , "%u words, not including header" , raw_len ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_tspec_hint , tvb , offset2 + 4 , 4 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_compression_factor , tvb , offset2 + 4 , 4 , ENC_BIG_ENDIAN ) ; proto_item_append_text ( ti , "Compression Hint. Hint=%u, Factor=%u" , tvb_get_ntohl ( tvb , offset2 + 4 ) , tvb_get_ntohl ( tvb , offset2 + 8 ) ) ; proto_item_append_text ( ti2 , "Hint=%u, Factor=%u" , tvb_get_ntohl ( tvb , offset2 + 4 ) , tvb_get_ntohl ( tvb , offset2 + 8 ) ) ; break ; default : proto_item_set_len ( ti2 , param_len * 4 ) ; expert_add_info_format ( pinfo , ti2 , & ei_rsvp_parameter , "Unknown parameter %d, %d words" , param_id , param_len ) ; break ; } param_len_processed += param_len ; offset2 += param_len * 4 ; } mylen -= length * 4 ; } break ; case 4 : proto_item_set_text ( ti , "SENDER TSPEC: SONET/SDH, " ) ; proto_tree_add_uint_format_value ( rsvp_object_tree , hf_rsvp_ctype , tvb , offset + 3 , 1 , type , "4 - SONET/SDH" ) ; signal_type = tvb_get_guint8 ( tvb , offset2 ) ; proto_tree_add_item ( rsvp_object_tree , hf_rsvp_tspec_signal_type_sonet , tvb , offset2 , 1 , ENC_BIG_ENDIAN ) ; ti2 = proto_tree_add_item ( rsvp_object_tree , hf_rsvp_tspec_requested_concatenation , tvb , offset2 + 1 , 1 , ENC_BIG_ENDIAN ) ; tspec_tree = proto_item_add_subtree ( ti2 , TREE ( TT_TSPEC_SUBTREE ) ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_sender_tspec_standard_contiguous_concatenation , tvb , offset2 + 1 , 1 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_sender_tspec_arbitrary_contiguous_concatenation , tvb , offset2 + 1 , 1 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( rsvp_object_tree , hf_rsvp_tspec_number_of_contiguous_components , tvb , offset2 + 2 , 2 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( rsvp_object_tree , hf_rsvp_tspec_number_of_virtual_components , tvb , offset2 + 4 , 2 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( rsvp_object_tree , hf_rsvp_tspec_multiplier , tvb , offset2 + 6 , 2 , ENC_BIG_ENDIAN ) ; ti2 = proto_tree_add_item ( rsvp_object_tree , hf_rsvp_tspec_transparency , tvb , offset2 + 8 , 4 , ENC_BIG_ENDIAN ) ; tspec_tree = proto_item_add_subtree ( ti2 , TREE ( TT_TSPEC_SUBTREE ) ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_sender_tspec_regenerator_section , tvb , offset2 + 8 , 4 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_sender_tspec_multiplex_section , tvb , offset2 + 8 , 4 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_sender_tspec_J0_transparency , tvb , offset2 + 8 , 4 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_sender_tspec_SOH_RSOH_DCC_transparency , tvb , offset2 + 8 , 4 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_sender_tspec_LOH_MSOH_DCC_transparency , tvb , offset2 + 8 , 4 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_sender_tspec_LOH_MSOH_extended_DCC_transparency , tvb , offset2 + 8 , 4 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_sender_tspec_K1_K2_transparency , tvb , offset2 + 8 , 4 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_sender_tspec_E1_transparency , tvb , offset2 + 8 , 4 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_sender_tspec_F1_transparency , tvb , offset2 + 8 , 4 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_sender_tspec_E2_transparency , tvb , offset2 + 8 , 4 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_sender_tspec_B1_transparency , tvb , offset2 + 8 , 4 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_sender_tspec_B2_transparency , tvb , offset2 + 8 , 4 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_sender_tspec_M0_transparency , tvb , offset2 + 8 , 4 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( tspec_tree , hf_rsvp_sender_tspec_M1_transparency , tvb , offset2 + 8 , 4 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( rsvp_object_tree , hf_rsvp_tspec_profile , tvb , offset2 + 12 , 4 , ENC_BIG_ENDIAN ) ; proto_item_append_text ( ti , "Signal [%s], RCC %d, NCC %d, NVC %d, MT %d, Transparency %d, Profile %d" , val_to_str_ext_const ( signal_type , & gmpls_sonet_signal_type_str_ext , "Unknown" ) , tvb_get_guint8 ( tvb , offset2 + 1 ) , tvb_get_ntohs ( tvb , offset2 + 2 ) , tvb_get_ntohs ( tvb , offset2 + 4 ) , tvb_get_ntohs ( tvb , offset2 + 6 ) , tvb_get_ntohl ( tvb , offset2 + 8 ) , tvb_get_ntohl ( tvb , offset2 + 12 ) ) ; break ; case 5 : proto_item_set_text ( ti , "SENDER TSPEC: G.709, " ) ; proto_tree_add_uint_format_value ( rsvp_object_tree , hf_rsvp_ctype , tvb , offset + 3 , 1 , type , "5 - G.709" ) ; signal_type = tvb_get_guint8 ( tvb , offset2 ) ; proto_tree_add_item ( rsvp_object_tree , hf_rsvp_tspec_signal_type_g709 , tvb , offset2 , 1 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( rsvp_object_tree , hf_rsvp_tspec_number_of_multiplexed_components , tvb , offset2 + 2 , 2 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( rsvp_object_tree , hf_rsvp_tspec_number_of_virtual_components , tvb , offset2 + 4 , 2 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( rsvp_object_tree , hf_rsvp_tspec_multiplier , tvb , offset2 + 6 , 2 , ENC_BIG_ENDIAN ) ; proto_item_append_text ( ti , "Signal [%s], NMC %d, NVC %d, MT %d" , rval_to_str ( signal_type , gmpls_g709_signal_type_rvals , "Unknown" ) , tvb_get_ntohs ( tvb , offset2 + 2 ) , tvb_get_ntohs ( tvb , offset2 + 4 ) , tvb_get_ntohs ( tvb , offset2 + 6 ) ) ; break ; case 6 : proto_item_set_text ( ti , "SENDER TSPEC: Ethernet, " ) ; proto_tree_add_uint_format_value ( rsvp_object_tree , hf_rsvp_ctype , tvb , offset + 3 , 1 , type , "6 - Ethernet" ) ; proto_tree_add_item ( rsvp_object_tree , hf_rsvp_switching_granularity , tvb , offset2 , 2 , ENC_BIG_ENDIAN ) ; proto_tree_add_item ( rsvp_object_tree , hf_rsvp_tspec_mtu , tvb , offset2 + 2 , 2 , ENC_BIG_ENDIAN ) ; dissect_rsvp_eth_tspec_tlv ( ti , pinfo , rsvp_object_tree , tvb , offset + 8 , obj_length - 8 , TREE ( TT_TSPEC_SUBTREE ) ) ; break ; default : proto_tree_add_uint_format_value ( rsvp_object_tree , hf_rsvp_ctype , tvb , offset + 3 , 1 , type , "Unknown (%u)" , type ) ; proto_tree_add_item ( rsvp_object_tree , hf_rsvp_tspec_data , tvb , offset2 , obj_length - 4 , ENC_NA ) ; break ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
int qemuMonitorJSONAddUSBDeviceExact ( qemuMonitorPtr mon ATTRIBUTE_UNUSED , int bus ATTRIBUTE_UNUSED , int dev ATTRIBUTE_UNUSED ) { qemuReportError ( VIR_ERR_INTERNAL_ERROR , "%s" , _ ( "usb_add not suppported in JSON mode" ) ) ; return - 1 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void correctstack ( lua_State * L , TValue * oldstack ) { CallInfo * ci ; GCObject * up ; L -> top = ( L -> top - oldstack ) + L -> stack ; for ( up = L -> openupval ; up != NULL ; up = up -> gch . next ) gco2uv ( up ) -> v = ( gco2uv ( up ) -> v - oldstack ) + L -> stack ; for ( ci = L -> base_ci ; ci <= L -> ci ; ci ++ ) { ci -> top = ( ci -> top - oldstack ) + L -> stack ; ci -> base = ( ci -> base - oldstack ) + L -> stack ; ci -> func = ( ci -> func - oldstack ) + L -> stack ; } L -> base = ( L -> base - oldstack ) + L -> stack ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
TEST_F ( NativeBackendLibsecretTest , BasicRemoveLogin ) { NativeBackendLibsecret backend ( 42 ) ; VerifiedAdd ( & backend , form_google_ ) ; EXPECT_EQ ( 1u , global_mock_libsecret_items -> size ( ) ) ; if ( ! global_mock_libsecret_items -> empty ( ) ) CheckMockSecretItem ( ( * global_mock_libsecret_items ) [ 0 ] , form_google_ , "chrome-42" ) ; VerifiedRemove ( & backend , form_google_ ) ; EXPECT_TRUE ( global_mock_libsecret_items -> empty ( ) ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static vpx_codec_err_t ctrl_set_previewpp ( vpx_codec_alg_priv_t * ctx , va_list args ) { # if CONFIG_VP9_POSTPROC vp8_postproc_cfg_t * config = va_arg ( args , vp8_postproc_cfg_t * ) ; if ( config != NULL ) { ctx -> preview_ppcfg = * config ; return VPX_CODEC_OK ; } else { return VPX_CODEC_INVALID_PARAM ; } # else ( void ) ctx ; ( void ) args ; return VPX_CODEC_INCAPABLE ; # endif }
0False
Categorize the following code snippet as vulnerable or not. True or False
int i2d_RSA_PUBKEY_fp ( FILE * fp , RSA * rsa ) { return ASN1_i2d_fp ( ( I2D_OF ( void ) ) i2d_RSA_PUBKEY , fp , rsa ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
IN_PROC_BROWSER_TEST_F ( MediaStreamPermissionTest , TestSecureOriginAcceptIsSticky ) { content : : WebContents * tab_contents = LoadTestPageInTab ( ) ; EXPECT_TRUE ( content : : IsOriginSecure ( tab_contents -> GetLastCommittedURL ( ) ) ) ; EXPECT_TRUE ( GetUserMediaAndAccept ( tab_contents ) ) ; GetUserMediaAndExpectAutoAcceptWithoutPrompt ( tab_contents ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static inline TranslationBlock * tb_find_fast ( CPUArchState * env ) { TranslationBlock * tb ; target_ulong cs_base , pc ; int flags ; cpu_get_tb_cpu_state ( env , & pc , & cs_base , & flags ) ; tb = env -> tb_jmp_cache [ tb_jmp_cache_hash_func ( pc ) ] ; if ( unlikely ( ! tb || tb -> pc != pc || tb -> cs_base != cs_base || tb -> flags != flags ) ) { tb = tb_find_slow ( env , pc , cs_base , flags ) ; } return tb ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static ossl_inline t2 * sk_ ## t1 ## _pop ( STACK_OF ( t1 ) * sk ) { return ( t2 * ) OPENSSL_sk_pop ( ( OPENSSL_STACK * ) sk ) ; } static ossl_inline t2 * sk_ ## t1 ## _shift ( STACK_OF ( t1 ) * sk ) { return ( t2 * ) OPENSSL_sk_shift ( ( OPENSSL_STACK * ) sk ) ; } static ossl_inline void sk_ ## t1 ## _pop_free ( STACK_OF ( t1 ) * sk , sk_ ## t1 ## _freefunc freefunc ) { OPENSSL_sk_pop_free ( ( OPENSSL_STACK * ) sk , ( OPENSSL_sk_freefunc ) freefunc ) ; } static ossl_inline int sk_ ## t1 ## _insert ( STACK_OF ( t1 ) * sk , t2 * ptr , int idx ) { return OPENSSL_sk_insert ( ( OPENSSL_STACK * ) sk , ( const void * ) ptr , idx ) ; } static ossl_inline t2 * sk_ ## t1 ## _set ( STACK_OF ( t1 ) * sk , int idx , t2 * ptr ) { return ( t2 * ) OPENSSL_sk_set ( ( OPENSSL_STACK * ) sk , idx , ( const void * ) ptr ) ; } static ossl_inline int sk_ ## t1 ## _find ( STACK_OF ( t1 ) * sk , t2 * ptr ) { return OPENSSL_sk_find ( ( OPENSSL_STACK * ) sk , ( const void * ) ptr ) ; } static ossl_inline int sk_ ## t1 ## _find_ex ( STACK_OF ( t1 ) * sk , t2 * ptr ) { return OPENSSL_sk_find_ex ( ( OPENSSL_STACK * ) sk , ( const void * ) ptr ) ; } static ossl_inline void sk_ ## t1 ## _sort ( STACK_OF ( t1 ) * sk ) { OPENSSL_sk_sort ( ( OPENSSL_STACK * ) sk ) ; } static ossl_inline int sk_ ## t1 ## _is_sorted ( const STACK_OF ( t1 ) * sk ) { return OPENSSL_sk_is_sorted ( ( const OPENSSL_STACK * ) sk ) ; } static ossl_inline STACK_OF ( t1 ) * sk_ ## t1 ## _dup ( const STACK_OF ( t1 ) * sk ) { return ( STACK_OF ( t1 ) * ) OPENSSL_sk_dup ( ( const OPENSSL_STACK * ) sk ) ; } static ossl_inline STACK_OF ( t1 ) * sk_ ## t1 ## _deep_copy ( const STACK_OF ( t1 ) * sk , sk_ ## t1 ## _copyfunc copyfunc , sk_ ## t1 ## _freefunc freefunc ) { return ( STACK_OF ( t1 ) * ) OPENSSL_sk_deep_copy ( ( const OPENSSL_STACK * ) sk , ( OPENSSL_sk_copyfunc ) copyfunc , ( OPENSSL_sk_freefunc ) freefunc ) ; } static ossl_inline sk_ ## t1 ## _compfunc sk_ ## t1 ## _set_cmp_func ( STACK_OF ( t1 ) * sk , sk_ ## t1 ## _compfunc compare ) { return ( sk_ ## t1 ## _compfunc ) OPENSSL_sk_set_cmp_func ( ( OPENSSL_STACK * ) sk , ( OPENSSL_sk_compfunc ) compare ) ; } # define DEFINE_SPECIAL_STACK_OF ( t1 , t2 ) SKM_DEFINE_STACK_OF ( t1 , t2 , t2 ) # define DEFINE_STACK_OF ( t ) SKM_DEFINE_STACK_OF ( t , t , t ) # define DEFINE_SPECIAL_STACK_OF_CONST ( t1 , t2 ) SKM_DEFINE_STACK_OF ( t1 , const t2 , t2 ) # define DEFINE_STACK_OF_CONST ( t ) SKM_DEFINE_STACK_OF ( t , const t , t ) typedef char * OPENSSL_STRING ; typedef const char * OPENSSL_CSTRING ; DEFINE_SPECIAL_STACK_OF ( OPENSSL_STRING , char )
1True
Categorize the following code snippet as vulnerable or not. True or False
static const char * cmd_response_body_mime_types_clear ( cmd_parms * cmd , void * _dcfg ) { directory_config * dcfg = ( directory_config * ) _dcfg ; if ( dcfg == NULL ) return NULL ; dcfg -> of_mime_types_cleared = 1 ; if ( ( dcfg -> of_mime_types != NULL ) && ( dcfg -> of_mime_types != NOT_SET_P ) ) { apr_table_clear ( dcfg -> of_mime_types ) ; } return NULL ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
void * jbig2_alloc ( Jbig2Allocator * allocator , size_t size , size_t num ) { if ( num > 0 && size >= ( size_t ) - 0x100 / num ) return NULL ; return allocator -> alloc ( allocator , size * num ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
extern int name ( int ) __THROW __exctype ( isalnum ) ; __exctype ( isalpha ) ; __exctype ( iscntrl )
0False
Categorize the following code snippet as vulnerable or not. True or False
static void delete_task_thread_func ( GTask * task , gpointer source_object , gpointer task_data , GCancellable * cancellable ) { DeleteJob * job = task_data ; GList * to_trash_files ; GList * to_delete_files ; GList * l ; GFile * file ; gboolean confirmed ; CommonJob * common ; gboolean must_confirm_delete_in_trash ; gboolean must_confirm_delete ; int files_skipped ; common = ( CommonJob * ) job ; nautilus_progress_info_start ( job -> common . progress ) ; to_trash_files = NULL ; to_delete_files = NULL ; must_confirm_delete_in_trash = FALSE ; must_confirm_delete = FALSE ; files_skipped = 0 ; for ( l = job -> files ; l != NULL ; l = l -> next ) { file = l -> data ; if ( job -> try_trash && g_file_has_uri_scheme ( file , "trash" ) ) { must_confirm_delete_in_trash = TRUE ; to_delete_files = g_list_prepend ( to_delete_files , file ) ; } else if ( can_delete_without_confirm ( file ) ) { to_delete_files = g_list_prepend ( to_delete_files , file ) ; } else { if ( job -> try_trash ) { to_trash_files = g_list_prepend ( to_trash_files , file ) ; } else { must_confirm_delete = TRUE ; to_delete_files = g_list_prepend ( to_delete_files , file ) ; } } } if ( to_delete_files != NULL ) { to_delete_files = g_list_reverse ( to_delete_files ) ; confirmed = TRUE ; if ( must_confirm_delete_in_trash ) { confirmed = confirm_delete_from_trash ( common , to_delete_files ) ; } else if ( must_confirm_delete ) { confirmed = confirm_delete_directly ( common , to_delete_files ) ; } if ( confirmed ) { delete_files ( common , to_delete_files , & files_skipped ) ; } else { job -> user_cancel = TRUE ; } } if ( to_trash_files != NULL ) { to_trash_files = g_list_reverse ( to_trash_files ) ; trash_files ( common , to_trash_files , & files_skipped ) ; } g_list_free ( to_trash_files ) ; g_list_free ( to_delete_files ) ; if ( files_skipped == g_list_length ( job -> files ) ) { job -> user_cancel = TRUE ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
CURLcode Curl_add_custom_headers ( struct connectdata * conn , bool is_connect , Curl_send_buffer * req_buffer ) { char * ptr ; struct curl_slist * h [ 2 ] ; struct curl_slist * headers ; int numlists = 1 ; struct Curl_easy * data = conn -> data ; int i ; enum proxy_use proxy ; if ( is_connect ) proxy = HEADER_CONNECT ; else proxy = conn -> bits . httpproxy && ! conn -> bits . tunnel_proxy ? HEADER_PROXY : HEADER_SERVER ; switch ( proxy ) { case HEADER_SERVER : h [ 0 ] = data -> set . headers ; break ; case HEADER_PROXY : h [ 0 ] = data -> set . headers ; if ( data -> set . sep_headers ) { h [ 1 ] = data -> set . proxyheaders ; numlists ++ ; } break ; case HEADER_CONNECT : if ( data -> set . sep_headers ) h [ 0 ] = data -> set . proxyheaders ; else h [ 0 ] = data -> set . headers ; break ; } for ( i = 0 ; i < numlists ; i ++ ) { headers = h [ i ] ; while ( headers ) { ptr = strchr ( headers -> data , ':' ) ; if ( ptr ) { ptr ++ ; while ( * ptr && ISSPACE ( * ptr ) ) ptr ++ ; if ( * ptr ) { if ( conn -> allocptr . host && checkprefix ( "Host:" , headers -> data ) ) ; else if ( data -> set . httpreq == HTTPREQ_POST_FORM && checkprefix ( "Content-Type:" , headers -> data ) ) ; else if ( conn -> bits . authneg && checkprefix ( "Content-Length" , headers -> data ) ) ; else if ( conn -> allocptr . te && checkprefix ( "Connection" , headers -> data ) ) ; else if ( ( conn -> httpversion == 20 ) && checkprefix ( "Transfer-Encoding:" , headers -> data ) ) ; else { CURLcode result = Curl_add_bufferf ( req_buffer , "%s\r\n" , headers -> data ) ; if ( result ) return result ; } } } else { ptr = strchr ( headers -> data , '; ' ) ; if ( ptr ) { ptr ++ ; while ( * ptr && ISSPACE ( * ptr ) ) ptr ++ ; if ( * ptr ) { } else { if ( * ( -- ptr ) == '; ' ) { CURLcode result ; * ptr = ':' ; result = Curl_add_bufferf ( req_buffer , "%s\r\n" , headers -> data ) ; if ( result ) return result ; } } } } headers = headers -> next ; } } return CURLE_OK ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int dissect_h225_RasUsageSpecification_when ( 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_h225_RasUsageSpecification_when , RasUsageSpecification_when_sequence ) ; return offset ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
err_status_t srtp_protect_rtcp ( srtp_t ctx , void * rtcp_hdr , int * pkt_octet_len ) { srtcp_hdr_t * hdr = ( srtcp_hdr_t * ) rtcp_hdr ; uint32_t * enc_start ; uint32_t * auth_start ; uint32_t * trailer ; unsigned int enc_octet_len = 0 ; uint8_t * auth_tag = NULL ; err_status_t status ; int tag_len ; srtp_stream_ctx_t * stream ; int prefix_len ; uint32_t seq_num ; if ( * pkt_octet_len < octets_in_rtcp_header ) return err_status_bad_param ; stream = srtp_get_stream ( ctx , hdr -> ssrc ) ; if ( stream == NULL ) { if ( ctx -> stream_template != NULL ) { srtp_stream_ctx_t * new_stream ; status = srtp_stream_clone ( ctx -> stream_template , hdr -> ssrc , & new_stream ) ; if ( status ) return status ; new_stream -> next = ctx -> stream_list ; ctx -> stream_list = new_stream ; stream = new_stream ; } else { return err_status_no_ctx ; } } if ( stream -> direction != dir_srtp_sender ) { if ( stream -> direction == dir_unknown ) { stream -> direction = dir_srtp_sender ; } else { srtp_handle_event ( ctx , stream , event_ssrc_collision ) ; } } if ( stream -> rtp_cipher -> algorithm == AES_128_GCM || stream -> rtp_cipher -> algorithm == AES_256_GCM ) { return srtp_protect_rtcp_aead ( ctx , stream , rtcp_hdr , ( unsigned int * ) pkt_octet_len ) ; } tag_len = auth_get_tag_length ( stream -> rtcp_auth ) ; enc_start = ( uint32_t * ) hdr + uint32s_in_rtcp_header ; enc_octet_len = * pkt_octet_len - octets_in_rtcp_header ; trailer = ( uint32_t * ) ( ( char * ) enc_start + enc_octet_len ) ; if ( stream -> rtcp_services & sec_serv_conf ) { * trailer = htonl ( SRTCP_E_BIT ) ; } else { enc_start = NULL ; enc_octet_len = 0 ; * trailer = 0x00000000 ; } auth_start = ( uint32_t * ) hdr ; auth_tag = ( uint8_t * ) hdr + * pkt_octet_len + sizeof ( srtcp_trailer_t ) ; ekt_write_data ( stream -> ekt , auth_tag , tag_len , pkt_octet_len , rdbx_get_packet_index ( & stream -> rtp_rdbx ) ) ; status = rdb_increment ( & stream -> rtcp_rdb ) ; if ( status ) return status ; seq_num = rdb_get_value ( & stream -> rtcp_rdb ) ; * trailer |= htonl ( seq_num ) ; debug_print ( mod_srtp , "srtcp index: %x" , seq_num ) ; if ( stream -> rtcp_cipher -> type -> id == AES_ICM ) { v128_t iv ; iv . v32 [ 0 ] = 0 ; iv . v32 [ 1 ] = hdr -> ssrc ; iv . v32 [ 2 ] = htonl ( seq_num >> 16 ) ; iv . v32 [ 3 ] = htonl ( seq_num << 16 ) ; status = cipher_set_iv ( stream -> rtcp_cipher , & iv , direction_encrypt ) ; } else { v128_t iv ; iv . v32 [ 0 ] = 0 ; iv . v32 [ 1 ] = 0 ; iv . v32 [ 2 ] = 0 ; iv . v32 [ 3 ] = htonl ( seq_num ) ; status = cipher_set_iv ( stream -> rtcp_cipher , & iv , direction_encrypt ) ; } if ( status ) return err_status_cipher_fail ; if ( auth_start ) { prefix_len = auth_get_prefix_length ( stream -> rtcp_auth ) ; status = cipher_output ( stream -> rtcp_cipher , auth_tag , prefix_len ) ; debug_print ( mod_srtp , "keystream prefix: %s" , octet_string_hex_string ( auth_tag , prefix_len ) ) ; if ( status ) return err_status_cipher_fail ; } if ( enc_start ) { status = cipher_encrypt ( stream -> rtcp_cipher , ( uint8_t * ) enc_start , & enc_octet_len ) ; if ( status ) return err_status_cipher_fail ; } auth_start ( stream -> rtcp_auth ) ; status = auth_compute ( stream -> rtcp_auth , ( uint8_t * ) auth_start , ( * pkt_octet_len ) + sizeof ( srtcp_trailer_t ) , auth_tag ) ; debug_print ( mod_srtp , "srtcp auth tag: %s" , octet_string_hex_string ( auth_tag , tag_len ) ) ; if ( status ) return err_status_auth_fail ; * pkt_octet_len += ( tag_len + sizeof ( srtcp_trailer_t ) ) ; return err_status_ok ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void add_descendants_to_write_order ( struct object_entry * * wo , unsigned int * endp , struct object_entry * e ) { int add_to_order = 1 ; while ( e ) { if ( add_to_order ) { struct object_entry * s ; add_to_write_order ( wo , endp , e ) ; for ( s = e -> delta_sibling ; s ; s = s -> delta_sibling ) { add_to_write_order ( wo , endp , s ) ; } } if ( e -> delta_child ) { add_to_order = 1 ; e = e -> delta_child ; } else { add_to_order = 0 ; if ( e -> delta_sibling ) { e = e -> delta_sibling ; continue ; } e = e -> delta ; while ( e && ! e -> delta_sibling ) { e = e -> delta ; } if ( ! e ) { return ; } e = e -> delta_sibling ; } } ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void sliplink_print ( netdissect_options * ndo , register const u_char * p , register const struct ip * ip , register u_int length ) { int dir ; u_int hlen ; dir = p [ SLX_DIR ] ; ND_PRINT ( ( ndo , dir == SLIPDIR_IN ? "I " : "O " ) ) ; if ( ndo -> ndo_nflag ) { register int i ; for ( i = SLX_CHDR ; i < SLX_CHDR + CHDR_LEN - 1 ; ++ i ) ND_PRINT ( ( ndo , "%02x." , p [ i ] ) ) ; ND_PRINT ( ( ndo , "%02x: " , p [ SLX_CHDR + CHDR_LEN - 1 ] ) ) ; return ; } switch ( p [ SLX_CHDR ] & 0xf0 ) { case TYPE_IP : ND_PRINT ( ( ndo , "ip %d: " , length + SLIP_HDRLEN ) ) ; break ; case TYPE_UNCOMPRESSED_TCP : lastconn = ( ( const struct ip * ) & p [ SLX_CHDR ] ) -> ip_p ; hlen = IP_HL ( ip ) ; hlen += TH_OFF ( ( const struct tcphdr * ) & ( ( const int * ) ip ) [ hlen ] ) ; lastlen [ dir ] [ lastconn ] = length - ( hlen << 2 ) ; ND_PRINT ( ( ndo , "utcp %d: " , lastconn ) ) ; break ; default : if ( p [ SLX_CHDR ] & TYPE_COMPRESSED_TCP ) { compressed_sl_print ( ndo , & p [ SLX_CHDR ] , ip , length , dir ) ; ND_PRINT ( ( ndo , ": " ) ) ; } else ND_PRINT ( ( ndo , "slip-%d!: " , p [ SLX_CHDR ] ) ) ; } }
1True
Categorize the following code snippet as vulnerable or not. True or False
static int chacha20_poly1305_cleanup ( EVP_CIPHER_CTX * ctx ) { EVP_CHACHA_AEAD_CTX * actx = aead_data ( ctx ) ; if ( actx ) OPENSSL_cleanse ( ctx -> cipher_data , sizeof ( * ctx ) + Poly1305_ctx_size ( ) ) ; return 1 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static void filter_selectively_vert ( uint8_t * s , int pitch , unsigned int mask_16x16 , unsigned int mask_8x8 , unsigned int mask_4x4 , unsigned int mask_4x4_int , const loop_filter_info_n * lfi_n , const uint8_t * lfl ) { unsigned int mask ; for ( mask = mask_16x16 | mask_8x8 | mask_4x4 | mask_4x4_int ; mask ; mask >>= 1 ) { const loop_filter_thresh * lfi = lfi_n -> lfthr + * lfl ; if ( mask & 1 ) { if ( mask_16x16 & 1 ) { vp9_lpf_vertical_16 ( s , pitch , lfi -> mblim , lfi -> lim , lfi -> hev_thr ) ; } else if ( mask_8x8 & 1 ) { vp9_lpf_vertical_8 ( s , pitch , lfi -> mblim , lfi -> lim , lfi -> hev_thr , 1 ) ; } else if ( mask_4x4 & 1 ) { vp9_lpf_vertical_4 ( s , pitch , lfi -> mblim , lfi -> lim , lfi -> hev_thr , 1 ) ; } } if ( mask_4x4_int & 1 ) vp9_lpf_vertical_4 ( s + 4 , pitch , lfi -> mblim , lfi -> lim , lfi -> hev_thr , 1 ) ; s += 8 ; lfl += 1 ; mask_16x16 >>= 1 ; mask_8x8 >>= 1 ; mask_4x4 >>= 1 ; mask_4x4_int >>= 1 ; } }
0False
Categorize the following code snippet as vulnerable or not. True or False
void vp9_set_quantizer ( VP9_COMMON * cm , int q ) { cm -> base_qindex = q ; cm -> y_dc_delta_q = 0 ; cm -> uv_dc_delta_q = 0 ; cm -> uv_ac_delta_q = 0 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static struct archive_string_conv * find_sconv_object ( struct archive * a , const char * fc , const char * tc ) { struct archive_string_conv * sc ; if ( a == NULL ) return ( NULL ) ; for ( sc = a -> sconv ; sc != NULL ; sc = sc -> next ) { if ( strcmp ( sc -> from_charset , fc ) == 0 && strcmp ( sc -> to_charset , tc ) == 0 ) break ; } return ( sc ) ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
const EVP_CIPHER * EVP_aes_128_wrap_pad ( void ) { return & aes_128_wrap_pad ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static inline int copy_block ( AVCodecContext * avctx , uint8_t * to , uint8_t * from , int offset , int height , int stride ) { int i ; int width = height ; int from_x = offset % WIDTH ; int from_y = offset / WIDTH ; int overflow = from_x + width - WIDTH ; if ( ! from ) { return 0 ; } if ( from_y + height > HEIGHT ) { av_log ( avctx , AV_LOG_ERROR , "invalid offset %d during C93 decoding\n" , offset ) ; return AVERROR_INVALIDDATA ; } if ( overflow > 0 ) { width -= overflow ; for ( i = 0 ; i < height ; i ++ ) { memcpy ( & to [ i * stride + width ] , & from [ ( from_y + i ) * stride ] , overflow ) ; } } for ( i = 0 ; i < height ; i ++ ) { memcpy ( & to [ i * stride ] , & from [ ( from_y + i ) * stride + from_x ] , width ) ; } return 0 ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static uint8_t vmxnet_tx_pkt_get_gso_type ( struct VmxnetTxPkt * pkt , bool tso_enable ) { uint8_t rc = VIRTIO_NET_HDR_GSO_NONE ; uint16_t l3_proto ; l3_proto = eth_get_l3_proto ( pkt -> vec [ VMXNET_TX_PKT_L2HDR_FRAG ] . iov_base , pkt -> vec [ VMXNET_TX_PKT_L2HDR_FRAG ] . iov_len ) ; if ( ! tso_enable ) { goto func_exit ; } rc = eth_get_gso_type ( l3_proto , pkt -> vec [ VMXNET_TX_PKT_L3HDR_FRAG ] . iov_base , pkt -> l4proto ) ; func_exit : return rc ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static gboolean qio_channel_websock_source_check ( GSource * source ) { QIOChannelWebsockSource * wsource = ( QIOChannelWebsockSource * ) source ; GIOCondition cond = 0 ; if ( wsource -> wioc -> rawinput . offset || wsource -> wioc -> io_eof ) { cond |= G_IO_IN ; } if ( wsource -> wioc -> encoutput . offset < QIO_CHANNEL_WEBSOCK_MAX_BUFFER ) { cond |= G_IO_OUT ; } return cond & wsource -> condition ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
static int zeqproc ( i_ctx_t * i_ctx_p ) { os_ptr op = osp ; ref2_t stack [ MAX_DEPTH + 1 ] ; ref2_t * top = stack ; make_array ( & stack [ 0 ] . proc1 , 0 , 1 , op - 1 ) ; make_array ( & stack [ 0 ] . proc2 , 0 , 1 , op ) ; for ( ; ; ) { long i ; if ( r_size ( & top -> proc1 ) == 0 ) { if ( top == stack ) { make_true ( op - 1 ) ; pop ( 1 ) ; return 0 ; } -- top ; continue ; } i = r_size ( & top -> proc1 ) - 1 ; array_get ( imemory , & top -> proc1 , i , & top [ 1 ] . proc1 ) ; array_get ( imemory , & top -> proc2 , i , & top [ 1 ] . proc2 ) ; r_dec_size ( & top -> proc1 , 1 ) ; ++ top ; # if 0 if ( r_has_attr ( & top -> proc1 , a_executable ) != r_has_attr ( & top -> proc2 , a_executable ) ) break ; # endif if ( obj_eq ( imemory , & top -> proc1 , & top -> proc2 ) ) { if ( r_type ( & top -> proc1 ) != r_type ( & top -> proc2 ) && ( r_type ( & top -> proc1 ) == t_name || r_type ( & top -> proc2 ) == t_name ) ) break ; -- top ; continue ; } if ( r_is_array ( & top -> proc1 ) && r_is_array ( & top -> proc2 ) && r_size ( & top -> proc1 ) == r_size ( & top -> proc2 ) && top < stack + ( MAX_DEPTH - 1 ) ) { continue ; } break ; } make_false ( op - 1 ) ; pop ( 1 ) ; return 0 ; }
1True
Categorize the following code snippet as vulnerable or not. True or False
void name ## _free ( type * a ) ; # define DECLARE_ASN1_PRINT_FUNCTION ( stname ) DECLARE_ASN1_PRINT_FUNCTION_fname ( stname , stname ) # define DECLARE_ASN1_PRINT_FUNCTION_fname ( stname , fname ) int fname ## _print_ctx ( BIO * out , stname * x , int indent , const ASN1_PCTX * pctx ) ; # define D2I_OF ( type ) type * ( * ) ( type * * , const unsigned char * * , long ) # define I2D_OF ( type ) int ( * ) ( type * , unsigned char * * ) # define I2D_OF_const ( type ) int ( * ) ( const type * , unsigned char * * ) # define CHECKED_D2I_OF ( type , d2i ) ( ( d2i_of_void * ) ( 1 ? d2i : ( ( D2I_OF ( type ) ) 0 ) ) ) # define CHECKED_I2D_OF ( type , i2d ) ( ( i2d_of_void * ) ( 1 ? i2d : ( ( I2D_OF ( type ) ) 0 ) ) ) # define CHECKED_NEW_OF ( type , xnew ) ( ( void * ( * ) ( void ) ) ( 1 ? xnew : ( ( type * ( * ) ( void ) ) 0 ) ) ) # define CHECKED_PTR_OF ( type , p ) ( ( void * ) ( 1 ? p : ( type * ) 0 ) ) # define CHECKED_PPTR_OF ( type , p ) ( ( void * * ) ( 1 ? p : ( type * * ) 0 ) ) # define TYPEDEF_D2I_OF ( type ) typedef type * d2i_of_ ## type ( type * * , const unsigned char * * , long ) # define TYPEDEF_I2D_OF ( type ) typedef int i2d_of_ ## type ( type * , unsigned char * * ) # define TYPEDEF_D2I2D_OF ( type ) TYPEDEF_D2I_OF ( type ) ; TYPEDEF_I2D_OF ( type ) TYPEDEF_D2I2D_OF ( void ) ; # ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION typedef const ASN1_ITEM ASN1_ITEM_EXP ; # define ASN1_ITEM_ptr ( iptr ) ( iptr ) # define ASN1_ITEM_ref ( iptr ) ( & ( iptr ## _it ) ) # define ASN1_ITEM_rptr ( ref ) ( & ( ref ## _it ) ) # define DECLARE_ASN1_ITEM ( name ) OPENSSL_EXTERN const ASN1_ITEM name ## _it ; # else typedef const ASN1_ITEM * ASN1_ITEM_EXP ( void ) ; # define ASN1_ITEM_ptr ( iptr ) ( iptr ( ) ) # define ASN1_ITEM_ref ( iptr ) ( iptr ## _it ) # define ASN1_ITEM_rptr ( ref ) ( ref ## _it ( ) ) # define DECLARE_ASN1_ITEM ( name ) const ASN1_ITEM * name ## _it ( void ) ; # endif # define ASN1_STRFLGS_ESC_2253 1 # define ASN1_STRFLGS_ESC_CTRL 2 # define ASN1_STRFLGS_ESC_MSB 4 # define ASN1_STRFLGS_ESC_QUOTE 8 # define CHARTYPE_PRINTABLESTRING 0x10 # define CHARTYPE_FIRST_ESC_2253 0x20 # define CHARTYPE_LAST_ESC_2253 0x40 # define ASN1_STRFLGS_UTF8_CONVERT 0x10 # define ASN1_STRFLGS_IGNORE_TYPE 0x20 # define ASN1_STRFLGS_SHOW_TYPE 0x40 # define ASN1_STRFLGS_DUMP_ALL 0x80 # define ASN1_STRFLGS_DUMP_UNKNOWN 0x100 # define ASN1_STRFLGS_DUMP_DER 0x200 # define ASN1_STRFLGS_ESC_2254 0x400 # define ASN1_STRFLGS_RFC2253 ( ASN1_STRFLGS_ESC_2253 | ASN1_STRFLGS_ESC_CTRL | ASN1_STRFLGS_ESC_MSB | ASN1_STRFLGS_UTF8_CONVERT | ASN1_STRFLGS_DUMP_UNKNOWN | ASN1_STRFLGS_DUMP_DER ) DEFINE_STACK_OF ( ASN1_INTEGER ) DEFINE_STACK_OF ( ASN1_GENERALSTRING ) DEFINE_STACK_OF ( ASN1_UTF8STRING ) typedef struct asn1_type_st { int type ; union { char * ptr ; ASN1_BOOLEAN boolean ; ASN1_STRING * asn1_string ; ASN1_OBJECT * object ; ASN1_INTEGER * integer ; ASN1_ENUMERATED * enumerated ; ASN1_BIT_STRING * bit_string ; ASN1_OCTET_STRING * octet_string ; ASN1_PRINTABLESTRING * printablestring ; ASN1_T61STRING * t61string ; ASN1_IA5STRING * ia5string ; ASN1_GENERALSTRING * generalstring ; ASN1_BMPSTRING * bmpstring ; ASN1_UNIVERSALSTRING * universalstring ; ASN1_UTCTIME * utctime ; ASN1_GENERALIZEDTIME * generalizedtime ; ASN1_VISIBLESTRING * visiblestring ; ASN1_UTF8STRING * utf8string ; ASN1_STRING * set ; ASN1_STRING * sequence ; ASN1_VALUE * asn1_value ; } value ; } ASN1_TYPE ; DEFINE_STACK_OF ( ASN1_TYPE ) typedef STACK_OF ( ASN1_TYPE ) ASN1_SEQUENCE_ANY ; DECLARE_ASN1_ENCODE_FUNCTIONS_const ( ASN1_SEQUENCE_ANY , ASN1_SEQUENCE_ANY ) DECLARE_ASN1_ENCODE_FUNCTIONS_const ( ASN1_SEQUENCE_ANY , ASN1_SET_ANY ) typedef struct BIT_STRING_BITNAME_st { int bitnum ; const char * lname ; const char * sname ; } BIT_STRING_BITNAME ; # define B_ASN1_TIME B_ASN1_UTCTIME | B_ASN1_GENERALIZEDTIME # define B_ASN1_PRINTABLE B_ASN1_NUMERICSTRING | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING | B_ASN1_BIT_STRING | B_ASN1_UNIVERSALSTRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING | B_ASN1_SEQUENCE | B_ASN1_UNKNOWN # define B_ASN1_DIRECTORYSTRING B_ASN1_PRINTABLESTRING | B_ASN1_TELETEXSTRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING | B_ASN1_UTF8STRING # define B_ASN1_DISPLAYTEXT B_ASN1_IA5STRING | B_ASN1_VISIBLESTRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING DECLARE_ASN1_FUNCTIONS_fname ( ASN1_TYPE , ASN1_ANY , ASN1_TYPE )
0False
Categorize the following code snippet as vulnerable or not. True or False
GList * nautilus_mime_types_group_get_mimetypes ( gint group_index ) { GList * mimetypes ; gint i ; g_return_val_if_fail ( group_index < G_N_ELEMENTS ( mimetype_groups ) , NULL ) ; mimetypes = NULL ; for ( i = 0 ; mimetype_groups [ group_index ] . mimetypes [ i ] ; i ++ ) { mimetypes = g_list_append ( mimetypes , mimetype_groups [ group_index ] . mimetypes [ i ] ) ; } return mimetypes ; }
0False
Categorize the following code snippet as vulnerable or not. True or False
const char * SSL_alert_type_string_long ( int value ) { value >>= 8 ; if ( value == SSL3_AL_WARNING ) return ( "warning" ) ; else if ( value == SSL3_AL_FATAL ) return ( "fatal" ) ; else return ( "unknown" ) ; }
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 ) ; BN_ULONG bn_mul_words ( BN_ULONG * rp , const BN_ULONG * ap , int num , BN_ULONG w ) ; void bn_sqr_words ( BN_ULONG * rp , const BN_ULONG * ap , int num ) ; BN_ULONG bn_div_words ( BN_ULONG h , BN_ULONG l , BN_ULONG d )
1True