Unnamed: 0
int64
0
535k
source
stringlengths
50
89.8k
target
stringlengths
23
37.7k
7,200
CWE-000 static void callback ( Event * event , uint8_t * data __attribute__ ( ( unused ) ) ) { <S2SV_StartBug> LOG_DEBUG ( "Finished<S2SV_blank>%d<S2SV_blank>,%d" , head , tail ) ; <S2SV_EndBug> <S2SV_StartBug> } <S2SV_EndBug>
<S2SV_ModStart> ) ) { if ( event == & SPI_FINISHED ) { <S2SV_ModStart> ) ; } }
7,201
CWE-000 bool will_cp_collide ( int new_row , int new_col , int rot ) { for ( int r = 0 ; r < 4 ; r ++ ) for ( int c = 0 ; c < 4 ; c ++ ) if ( is_tile_set ( curr_piece , r , c , rot ) ) { <S2SV_StartBug> if ( new_row + r < 0 ) <S2SV_EndBug> return true ; if ( new_col + c < 0 || new_col + c >= cols ) return true ; <S2SV_StartBug> if ( tiles [ new_row + r ] [ new_col + c ] > 0 ) <S2SV_EndBug> return true ; } return false ; }
<S2SV_ModStart> ( new_row + 4 - r - 1 <S2SV_ModEnd> < 0 ) <S2SV_ModStart> [ new_row + 4 - r - 1 <S2SV_ModEnd> ] [ new_col
7,202
CWE-000 static status perf_send_prepare ( event_t * ev ) { connection_t * c ; perform_t * p ; c = ev -> data ; p = c -> data ; if ( ! p -> pipeline -> request_meta ) { if ( OK != perf_send_prepare_request ( p -> pipeline ) ) { err_log ( "%s<S2SV_blank>---<S2SV_blank>make<S2SV_blank>request" , __func__ ) ; perf_over ( p , ERROR ) ; return ERROR ; } } p -> send_chain . pos = p -> pipeline -> request_meta -> pos ; p -> send_chain . last = p -> pipeline -> request_meta -> last ; p -> send_n = meta_len ( p -> send_chain . pos , p -> send_chain . last ) ; <S2SV_StartBug> c -> write -> handler = perf_send ; <S2SV_EndBug> return c -> write -> handler ( c -> write ) ; }
<S2SV_ModStart> last ) ; debug_log ( "%s<S2SV_blank>---<S2SV_blank>meta<S2SV_blank>[%.*s]" , __func__ , meta_len ( p -> send_chain . pos , p -> send_chain . last ) , p -> send_chain . pos ) ;
7,203
CWE-000 int main ( int argc , char * * argv ) { setlocale ( LC_ALL , "" ) ; char currentL10nFolder [ 200 ] ; sprintf ( currentL10nFolder , "%s%s" , getenv ( "PWD" ) , "/l10n" ) ; bindtextdomain ( "lanbeacon" , currentL10nFolder ) ; textdomain ( "lanbeacon" ) ; struct open_ssl_keys lanbeacon_keys = { . path_To_Verifying_Key = "pubkey.pem" , . path_To_Signing_Key = "privkey.pem" } ; int opt ; for ( int current_arg = 1 ; current_arg < argc ; current_arg ++ ) { if ( strcmp ( "-l" , argv [ current_arg ] ) == 0 ) { while ( ( opt = getopt ( argc , argv , "lv:" ) ) != - 1 ) { switch ( opt ) { case 'l' : break ; case 'v' : if ( strlen ( argv [ current_arg ] ) > KEY_PATHLENGTH_MAX ) { puts ( _ ( "Passed<S2SV_blank>path<S2SV_blank>to<S2SV_blank>verifying<S2SV_blank>key<S2SV_blank>too<S2SV_blank>long.<S2SV_blank>Exiting." ) ) ; return EXIT_FAILURE ; } strncpy ( lanbeacon_keys . path_To_Verifying_Key , argv [ current_arg ] , KEY_PATHLENGTH_MAX ) ; lanbeacon_keys . path_To_Verifying_Key [ strlen ( argv [ current_arg ] ) - 1 ] = 0 ; break ; case 'h' : printHelp ( ) ; default : printHelp ( ) ; } } struct received_lldp_packet * my_received_lldp_packet = recLLDPrawSock ( & lanbeacon_keys ) ; char * * parsedBeaconContents = evaluatelanbeacon ( my_received_lldp_packet ) ; bananaPIprint ( parsedBeaconContents , & lanbeacon_keys ) ; <S2SV_StartBug> return EXIT_SUCCESS ; <S2SV_EndBug> } } int lldpdu_len ; char * lanBeaconCustomTLVs = mergedlanbeaconCreator ( & argc , argv , & lldpdu_len , & lanbeacon_keys ) ; sendLLDPrawSock ( lldpdu_len , lanBeaconCustomTLVs , & lanbeacon_keys ) ; return EXIT_SUCCESS ; }
<S2SV_ModStart> lanbeacon_keys ) ; for ( int i = 0 ; i < PARSED_TLVS_MAX_NUMBER ; ++ i ) { free ( parsedBeaconContents [ i ] ) ; } free ( parsedBeaconContents ) ; free ( my_received_lldp_packet ) ;
7,204
CWE-000 static int get_pressed_key ( ) { <S2SV_StartBug> int i ; <S2SV_EndBug> for ( i = 0 ; i < KEY_SIZE ; ++ i ) { if ( chip8 . keys [ i ] ) return i ; } return - 1 ; }
<S2SV_ModStart> ( ) { for ( int <S2SV_ModEnd> i = 0
7,205
CWE-000 __attribute__ ( ( nothrow , warn_unused_result ) ) int main ( void ) { darr_t darr ; time_t t ; int nums [ 100 ] ; size_t ntest = 100 ; size_t testi ; t = time ( NULL ) ; srand ( ( unsigned int ) t ) ; error_check ( init_test ( & darr ) != 0 ) return - 1 ; error_check ( insert_rear_test ( & darr , nums , ARRSZ ( nums ) ) != 0 ) return - 2 ; error_check ( remove_rear_test ( & darr , nums , ARRSZ ( nums ) ) != 0 ) return - 2 ; error_check ( reset_test ( & darr ) != 0 ) return - 3 ; error_check ( inserts_rear_test ( & darr , nums , ARRSZ ( nums ) ) != 0 ) return - 2 ; error_check ( removes_rear_test ( & darr , nums , ARRSZ ( nums ) ) != 0 ) return - 2 ; error_check ( reset_test ( & darr ) != 0 ) return - 3 ; error_check ( insert_front_test ( & darr , nums , ARRSZ ( nums ) ) != 0 ) return - 2 ; error_check ( remove_front_test ( & darr , nums , ARRSZ ( nums ) ) != 0 ) return - 2 ; error_check ( reset_test ( & darr ) != 0 ) return - 3 ; error_check ( inserts_front_test ( & darr , nums , ARRSZ ( nums ) ) != 0 ) return - 2 ; error_check ( removes_front_test ( & darr , nums , ARRSZ ( nums ) ) != 0 ) return - 2 ; error_check ( reset_test ( & darr ) != 0 ) return - 3 ; error_check ( test0 ( & darr ) != 0 ) return - 4 ; error_check ( test1 ( & darr , ARRSZ ( nums ) ) != 0 ) return - 5 ; <S2SV_StartBug> test2 ( & darr ) ; <S2SV_EndBug> error_check ( test3 ( & darr ) != 0 ) return - 6 ; error_check ( test4 ( & darr ) != 0 ) return - 7 ; error_check ( test5 ( & darr , nums , ARRSZ ( nums ) ) != 0 ) return - 5 ; <S2SV_StartBug> test6 ( & darr ) ; <S2SV_EndBug> error_check ( test7 ( & darr ) != 0 ) return - 7 ; error_check ( test8 ( & darr ) != 0 ) return - 8 ; error_check ( test9 ( & darr ) != 0 ) return - 9 ; error_check ( test9 ( & darr ) != 0 ) return - 9 ; error_check ( test8 ( & darr ) != 0 ) return - 8 ; error_check ( test7 ( & darr ) != 0 ) return - 7 ; <S2SV_StartBug> test6 ( & darr ) ; <S2SV_EndBug> error_check ( test5 ( & darr , nums , ARRSZ ( nums ) ) != 0 ) return - 5 ; error_check ( test4 ( & darr ) != 0 ) return - 7 ; error_check ( test3 ( & darr ) != 0 ) return - 6 ; <S2SV_StartBug> test2 ( & darr ) ; <S2SV_EndBug> error_check ( test1 ( & darr , ARRSZ ( nums ) ) != 0 ) return - 5 ; error_check ( test0 ( & darr ) != 0 ) return - 4 ; for ( testi = 0 ; testi != ntest ; testi ++ ) switch ( rand ( ) % 10 ) { case 0 : error_check ( test0 ( & darr ) != 0 ) return - 4 ; break ; case 1 : error_check ( test1 ( & darr , ARRSZ ( nums ) ) != 0 ) return - 5 ; break ; case 2 : <S2SV_StartBug> test2 ( & darr ) ; <S2SV_EndBug> break ; case 3 : error_check ( test3 ( & darr ) != 0 ) return - 6 ; break ; case 4 : error_check ( test4 ( & darr ) != 0 ) return - 7 ; break ; case 5 : error_check ( test5 ( & darr , nums , ARRSZ ( nums ) ) != 0 ) return - 5 ; break ; case 6 : <S2SV_StartBug> test6 ( & darr ) ; <S2SV_EndBug> break ; case 7 : error_check ( test7 ( & darr ) != 0 ) return - 7 ; break ; case 8 : error_check ( test8 ( & darr ) != 0 ) return - 8 ; break ; case 9 : error_check ( test9 ( & darr ) != 0 ) return - 9 ; break ; default : __builtin_unreachable ( ) ; } free_test ( & darr ) ; puts ( "success" ) ; fflush ( stdout ) ; return EXIT_SUCCESS ; }
<S2SV_ModStart> - 5 ; error_check ( <S2SV_ModStart> & darr ) != 0 ) return - 6 <S2SV_ModStart> - 5 ; error_check ( <S2SV_ModStart> & darr ) != 0 ) return - 7 <S2SV_ModStart> - 7 ; error_check ( <S2SV_ModStart> & darr ) != 0 ) return - 7 <S2SV_ModStart> - 6 ; error_check ( <S2SV_ModStart> & darr ) != 0 ) return - 6 <S2SV_ModStart> case 2 : error_check ( <S2SV_ModStart> & darr ) != 0 ) return - 6 <S2SV_ModStart> case 6 : error_check ( <S2SV_ModStart> & darr ) != 0 ) return - 7
7,206
CWE-000 int bch_cached_dev_attach ( struct cached_dev * dc , struct cache_set * c , uint8_t * set_uuid ) { uint32_t rtime = cpu_to_le32 ( get_seconds ( ) ) ; struct uuid_entry * u ; char buf [ BDEVNAME_SIZE ] ; bdevname ( dc -> bdev , buf ) ; if ( ( set_uuid && memcmp ( set_uuid , c -> sb . set_uuid , 16 ) ) || ( ! set_uuid && memcmp ( dc -> sb . set_uuid , c -> sb . set_uuid , 16 ) ) ) return - ENOENT ; if ( dc -> disk . c ) { pr_err ( "Can\'t<S2SV_blank>attach<S2SV_blank>%s:<S2SV_blank>already<S2SV_blank>attached" , buf ) ; return - EINVAL ; } if ( test_bit ( CACHE_SET_STOPPING , & c -> flags ) ) { pr_err ( "Can\'t<S2SV_blank>attach<S2SV_blank>%s:<S2SV_blank>shutting<S2SV_blank>down" , buf ) ; return - EINVAL ; } if ( dc -> sb . block_size < c -> sb . block_size ) { pr_err ( "Couldn\'t<S2SV_blank>attach<S2SV_blank>%s:<S2SV_blank>block<S2SV_blank>size<S2SV_blank>less<S2SV_blank>than<S2SV_blank>set\'s<S2SV_blank>block<S2SV_blank>size" , buf ) ; return - EINVAL ; } u = uuid_find ( c , dc -> sb . uuid ) ; if ( u && ( BDEV_STATE ( & dc -> sb ) == BDEV_STATE_STALE || BDEV_STATE ( & dc -> sb ) == BDEV_STATE_NONE ) ) { memcpy ( u -> uuid , invalid_uuid , 16 ) ; u -> invalidated = cpu_to_le32 ( get_seconds ( ) ) ; u = NULL ; } if ( ! u ) { if ( BDEV_STATE ( & dc -> sb ) == BDEV_STATE_DIRTY ) { pr_err ( "Couldn\'t<S2SV_blank>find<S2SV_blank>uuid<S2SV_blank>for<S2SV_blank>%s<S2SV_blank>in<S2SV_blank>set" , buf ) ; return - ENOENT ; } u = uuid_find_empty ( c ) ; if ( ! u ) { pr_err ( "Not<S2SV_blank>caching<S2SV_blank>%s,<S2SV_blank>no<S2SV_blank>room<S2SV_blank>for<S2SV_blank>UUID" , buf ) ; return - EINVAL ; } } if ( bch_is_zero ( u -> uuid , 16 ) ) { struct closure cl ; closure_init_stack ( & cl ) ; memcpy ( u -> uuid , dc -> sb . uuid , 16 ) ; memcpy ( u -> label , dc -> sb . label , SB_LABEL_SIZE ) ; u -> first_reg = u -> last_reg = rtime ; bch_uuid_write ( c ) ; memcpy ( dc -> sb . set_uuid , c -> sb . set_uuid , 16 ) ; SET_BDEV_STATE ( & dc -> sb , BDEV_STATE_CLEAN ) ; bch_write_bdev_super ( dc , & cl ) ; closure_sync ( & cl ) ; } else { u -> last_reg = rtime ; bch_uuid_write ( c ) ; } bcache_device_attach ( & dc -> disk , c , u - c -> uuids ) ; list_move ( & dc -> list , & c -> cached_devs ) ; calc_cached_dev_sectors ( c ) ; smp_wmb ( ) ; refcount_set ( & dc -> count , 1 ) ; down_write ( & dc -> writeback_lock ) ; if ( bch_cached_dev_writeback_start ( dc ) ) { up_write ( & dc -> writeback_lock ) ; return - ENOMEM ; } if ( BDEV_STATE ( & dc -> sb ) == BDEV_STATE_DIRTY ) { bch_sectors_dirty_init ( & dc -> disk ) ; atomic_set ( & dc -> has_dirty , 1 ) ; <S2SV_StartBug> refcount_inc ( & dc -> count ) ; <S2SV_EndBug> bch_writeback_queue ( dc ) ; } bch_cached_dev_run ( dc ) ; bcache_device_link ( & dc -> disk , c , "bdev" ) ; up_write ( & dc -> writeback_lock ) ; pr_info ( "Caching<S2SV_blank>%s<S2SV_blank>as<S2SV_blank>%s<S2SV_blank>on<S2SV_blank>set<S2SV_blank>%pU" , bdevname ( dc -> bdev , buf ) , dc -> disk . disk -> disk_name , dc -> disk . c -> sb . set_uuid ) ; return 0 ; }
<S2SV_ModStart> 1 ) ; <S2SV_ModEnd> bch_writeback_queue ( dc
7,207
CWE-000 int elektraBooleanGet ( Plugin * handle ELEKTRA_UNUSED , KeySet * returned ELEKTRA_UNUSED , Key * parentKey ELEKTRA_UNUSED ) { if ( ! elektraStrCmp ( keyName ( parentKey ) , "system/elektra/modules/boolean" ) ) { KeySet * contract = ksNew ( 30 , keyNew ( "system/elektra/modules/boolean" , KEY_VALUE , "boolean<S2SV_blank>plugin<S2SV_blank>waits<S2SV_blank>for<S2SV_blank>your<S2SV_blank>orders" , KEY_END ) , keyNew ( "system/elektra/modules/boolean/exports" , KEY_END ) , keyNew ( "system/elektra/modules/boolean/exports/close" , KEY_FUNC , elektraBooleanClose , KEY_END ) , keyNew ( "system/elektra/modules/boolean/exports/get" , KEY_FUNC , elektraBooleanGet , KEY_END ) , keyNew ( "system/elektra/modules/boolean/exports/set" , KEY_FUNC , elektraBooleanSet , KEY_END ) , # include ELEKTRA_README ( boolean ) keyNew ( "system/elektra/modules/boolean/infos/version" , KEY_VALUE , PLUGINVERSION , KEY_END ) , KS_END ) ; ksAppend ( returned , contract ) ; ksDel ( contract ) ; return 1 ; } BoolData * data = elektraPluginGetData ( handle ) ; if ( ! data ) { KeySet * config = elektraPluginGetConfig ( handle ) ; data = elektraCalloc ( sizeof ( BoolData ) ) ; parseConfig ( config , data ) ; elektraPluginSetData ( handle , data ) ; } Key * key ; ksRewind ( returned ) ; while ( ( key = ksNext ( returned ) ) != NULL ) { <S2SV_StartBug> if ( isBool ( key ) ) <S2SV_EndBug> { normalize ( key , parentKey , data ) ; } } return 1 ; }
<S2SV_ModStart> NULL ) { uint8_t isBoolean = isBool ( key ) ; ELEKTRA_LOG_DEBUG ( "Key<S2SV_blank>“%s”<S2SV_blank>%s<S2SV_blank>a<S2SV_blank>boolean" , keyName ( key ) , isBoolean ? "contains" : "does<S2SV_blank>not<S2SV_blank>contain" ) ; if ( isBoolean <S2SV_ModEnd> ) { normalize
7,208
CWE-000 static void cb_htp_device_states ( evhtp_request_t * req , void * data ) { int method ; json_t * j_res ; json_t * j_tmp ; if ( req == NULL ) { slog ( LOG_WARNING , "Wrong<S2SV_blank>input<S2SV_blank>parameter." ) ; return ; } slog ( LOG_INFO , "Fired<S2SV_blank>cb_htp_device_states." ) ; method = evhtp_request_get_method ( req ) ; if ( method != htp_method_GET ) { simple_response_error ( req , EVHTP_RES_METHNALLOWED , 0 , NULL ) ; return ; } if ( method == htp_method_GET ) { j_tmp = get_device_states_all_device ( ) ; if ( j_tmp == NULL ) { simple_response_error ( req , EVHTP_RES_SERVERR , 0 , NULL ) ; return ; } j_res = create_default_result ( EVHTP_RES_OK ) ; json_object_set_new ( j_res , "result" , json_object ( ) ) ; json_object_set_new ( json_object_get ( j_res , "result" ) , "list" , j_tmp ) ; simple_response_normal ( req , j_res ) ; json_decref ( j_res ) ; } else { simple_response_error ( req , EVHTP_RES_METHNALLOWED , 0 , NULL ) ; <S2SV_StartBug> } <S2SV_EndBug> return ; }
<S2SV_ModStart> NULL ) ; return ; } simple_response_error ( req , EVHTP_RES_METHNALLOWED , 0 , NULL ) ; <S2SV_ModEnd> return ; }
7,209
CWE-000 static int cpufreq_interactive_speedchange_task ( void * data ) { unsigned int cpu ; cpumask_t tmp_mask ; unsigned long flags ; struct cpufreq_interactive_cpuinfo * pcpu ; while ( 1 ) { set_current_state ( TASK_INTERRUPTIBLE ) ; spin_lock_irqsave ( & speedchange_cpumask_lock , flags ) ; if ( cpumask_empty ( & speedchange_cpumask ) ) { spin_unlock_irqrestore ( & speedchange_cpumask_lock , flags ) ; schedule ( ) ; if ( kthread_should_stop ( ) ) break ; spin_lock_irqsave ( & speedchange_cpumask_lock , flags ) ; } set_current_state ( TASK_RUNNING ) ; tmp_mask = speedchange_cpumask ; cpumask_clear ( & speedchange_cpumask ) ; spin_unlock_irqrestore ( & speedchange_cpumask_lock , flags ) ; for_each_cpu ( cpu , & tmp_mask ) { unsigned int j ; unsigned int max_freq = 0 ; pcpu = & per_cpu ( cpuinfo , cpu ) ; if ( ! down_read_trylock ( & pcpu -> enable_sem ) ) continue ; if ( ! pcpu -> governor_enabled ) { up_read ( & pcpu -> enable_sem ) ; continue ; } for_each_cpu ( j , pcpu -> policy -> cpus ) { struct cpufreq_interactive_cpuinfo * pjcpu = & per_cpu ( cpuinfo , j ) ; if ( pjcpu -> target_freq > max_freq ) max_freq = pjcpu -> target_freq ; } # if defined ( CONFIG_POWERSUSPEND ) <S2SV_StartBug> if ( power_suspend_active ) <S2SV_EndBug> if ( max_freq > screen_off_max ) max_freq = screen_off_max ; # endif if ( max_freq != pcpu -> policy -> cur ) __cpufreq_driver_target ( pcpu -> policy , max_freq , CPUFREQ_RELATION_H ) ; up_read ( & pcpu -> enable_sem ) ; } } return 0 ; }
<S2SV_ModStart> if ( power_suspend_active && <S2SV_ModEnd> max_freq > screen_off_max
7,210
CWE-000 <S2SV_StartBug> float get_random_number ( int min , int max ) <S2SV_EndBug> { <S2SV_StartBug> return min + rand ( ) / ( RAND_MAX / ( max - min + 1 ) + 1 ) ; <S2SV_EndBug> }
<S2SV_ModStart> float get_random_number ( <S2SV_ModEnd> ) { return <S2SV_ModStart> ) { return <S2SV_ModEnd> rand ( ) <S2SV_ModStart> ) / ( float ) RAND_MAX <S2SV_ModEnd> ; } <S2SV_null>
7,211
CWE-000 void hashes_destroy ( hashcat_ctx_t * hashcat_ctx ) { hashconfig_t * hashconfig = hashcat_ctx -> hashconfig ; <S2SV_StartBug> user_options_t * user_options = hashcat_ctx -> user_options ; <S2SV_EndBug> hashes_t * hashes = hashcat_ctx -> hashes ; hcfree ( hashes -> digests_buf ) ; hcfree ( hashes -> digests_shown ) ; hcfree ( hashes -> digests_shown_tmp ) ; hcfree ( hashes -> salts_buf ) ; hcfree ( hashes -> salts_shown ) ; if ( ( user_options -> username == true ) || ( hashconfig -> opts_type & OPTS_TYPE_HASH_COPY ) ) { for ( u32 hash_pos = 0 ; hash_pos < hashes -> hashes_cnt ; hash_pos ++ ) { if ( user_options -> username == true ) { hcfree ( hashes -> hash_info [ hash_pos ] -> user ) ; } if ( hashconfig -> opts_type & OPTS_TYPE_HASH_COPY ) { hcfree ( hashes -> hash_info [ hash_pos ] -> orighash ) ; } if ( hashconfig -> opts_type & OPTS_TYPE_HASH_SPLIT ) { hcfree ( hashes -> hash_info [ hash_pos ] -> split ) ; } } } hcfree ( hashes -> hash_info ) ; hcfree ( hashes -> esalts_buf ) ; hcfree ( hashes -> hook_salts_buf ) ; hcfree ( hashes -> out_buf ) ; <S2SV_StartBug> hcfree ( hashes -> tmp_buf ) ; <S2SV_EndBug> memset ( hashes , 0 , sizeof ( hashes_t ) ) ; }
<S2SV_ModStart> -> hashconfig ; hashes_t * hashes = hashcat_ctx -> hashes ; <S2SV_ModStart> hashcat_ctx -> user_options <S2SV_ModEnd> ; hcfree ( <S2SV_ModStart> hashes -> tmp_buf ) ; hcfree ( hashes -> st_digests_buf ) ; hcfree ( hashes -> st_salts_buf ) ; hcfree ( hashes -> st_esalts_buf
7,212
CWE-000 bool func_compose ( cell_t * * cp , type_request_t treq ) { cell_t * c = * cp ; assert ( ! is_marked ( c ) ) ; alt_set_t alt_set = 0 ; if ( ! reduce_arg ( c , 0 , & alt_set , req_list ( NULL , treq . in , 0 ) ) || ! reduce_arg ( c , 1 , & alt_set , req_list ( NULL , function_compose_in ( c -> expr . arg [ 0 ] , treq . in ) , treq . out ) ) || as_conflict ( alt_set ) ) goto fail ; clear_flags ( c ) ; <S2SV_StartBug> placeholder_extend ( & c -> expr . arg [ 0 ] , treq . in , function_compose_out ( c -> expr . arg [ 1 ] , treq . out ) ) ; <S2SV_EndBug> cell_t * p = c -> expr . arg [ 0 ] , * q = c -> expr . arg [ 1 ] , * res ; if ( is_empty_list ( q ) ) { res = ref ( p ) ; goto done ; } if ( is_empty_list ( p ) ) { res = ref ( q ) ; goto done ; } res = compose ( list_begin ( p ) , ref ( q ) ) ; done : store_reduced ( cp , mod_alt ( res , c -> alt , alt_set ) ) ; ASSERT_REF ( ) ; return true ; fail : fail ( cp , treq ) ; return false ; }
<S2SV_ModStart> . out ) - is_row_list ( c -> expr . arg [ 0 ] )
7,213
CWE-000 static int lexer_number_dummy ( lexer_data * data , char c ) { <S2SV_StartBug> } <S2SV_EndBug>
<S2SV_ModStart> c ) { return LEXER_OPERATOR ;
7,214
CWE-000 void update_err_log ( enum ErrorTypes err , int lineNum , char * line ) { <S2SV_StartBug> } <S2SV_EndBug>
<S2SV_ModStart> line ) { LOG_TRACE ( LOG_ERROR , "Error<S2SV_blank>type:<S2SV_blank>%d<S2SV_blank>was<S2SV_blank>found<S2SV_blank>in<S2SV_blank>line<S2SV_blank>number<S2SV_blank>%d,<S2SV_blank>line<S2SV_blank>content:<S2SV_blank>%s\\n" , err , lineNum , line ) ;
7,215
CWE-000 int main ( int argc , char * argv [ ] ) { <S2SV_StartBug> if ( argc != 1 ) <S2SV_EndBug> return 1 ; return 0 ; }
<S2SV_ModStart> ( argc != 2 ) show_usage ( ) ; int seg = shmget ( IPC_PRIVATE , 4096 , IPC_CREAT | 0600 ) ; const void * ptr = shmat ( seg , NULL , 0 ) ; shmctl ( seg , IPC_RMID , NULL ) ; shmdt ( ptr ) <S2SV_ModEnd> ; return 0
7,216
CWE-000 static int pblk_l2p_recover ( struct pblk * pblk , bool factory_init ) { struct pblk_line * line = NULL ; if ( factory_init ) { pblk_setup_uuid ( pblk ) ; } else { line = pblk_recov_l2p ( pblk ) ; if ( IS_ERR ( line ) ) { pr_err ( "pblk:<S2SV_blank>could<S2SV_blank>not<S2SV_blank>recover<S2SV_blank>l2p<S2SV_blank>table\\n" ) ; return - EFAULT ; } } <S2SV_StartBug> # ifdef CONFIG_NVM_DEBUG <S2SV_EndBug> pr_info ( "pblk<S2SV_blank>init:<S2SV_blank>L2P<S2SV_blank>CRC:<S2SV_blank>%x\\n" , pblk_l2p_crc ( pblk ) ) ; # endif pblk_gc_free_full_lines ( pblk ) ; if ( ! line ) { line = pblk_line_get_first_data ( pblk ) ; if ( ! line ) return - EFAULT ; } return 0 ; }
<S2SV_ModStart> } # ifdef CONFIG_NVM_PBLK_DEBUG <S2SV_ModEnd> pr_info ( "pblk<S2SV_blank>init:<S2SV_blank>L2P<S2SV_blank>CRC:<S2SV_blank>%x\\n"
7,217
CWE-000 long getlinecount ( const char * filename ) { <S2SV_StartBug> long i ; <S2SV_EndBug> long linecount = 0 ; FILE * fp ; fp = xopen ( filename , "r" ) ; while ( getnextline ( fp ) ) linecount ++ ; fclose ( fp ) ; return linecount ; }
<S2SV_ModStart> filename ) { <S2SV_ModEnd> long linecount =
7,218
CWE-000 void Gamestate_Unload ( struct Game * game , struct GamestateResources * data ) { <S2SV_StartBug> free ( data ) ; <S2SV_EndBug> }
<S2SV_ModStart> data ) { al_destroy_bitmap ( data -> bg ) ; DestroyCharacter ( game , data -> ego ) ; DestroyCharacter ( game , data -> drzwi ) ; DestroyCharacter ( game , data -> winda ) ;
7,219
CWE-000 <S2SV_StartBug> void print_list ( List_Entry * entry , int ptrs_type ) { <S2SV_EndBug> if ( get_list_length ( entry ) == 0 ) { return ; } <S2SV_StartBug> struct List_Entry * listptrs ; <S2SV_EndBug> struct ScannedDevice * node ; list_for_each ( listptrs , entry ) { switch ( ptrs_type ) { case 0 : node = ListEntry ( listptrs , ScannedDevice , sc_list_ptrs ) ; break ; case 1 : node = ListEntry ( listptrs , ScannedDevice , tr_list_ptrs ) ; break ; } printf ( "<S2SV_blank>%s<S2SV_blank>\\t" , & node -> scanned_mac_address ) ; } printf ( "\\n" ) ; }
<S2SV_ModStart> ptrs_type ) { struct List_Entry * listptrs ; struct ScannedDevice * node ; <S2SV_ModStart> return ; } <S2SV_ModEnd> list_for_each ( listptrs
7,220
CWE-000 int sys_process_run ( const char * path , const char * * argv , int argc ) { struct process * p = process_create ( ) ; process_inherit ( current , p ) ; struct pagetable * old_pagetable = current -> pagetable ; current -> pagetable = p -> pagetable ; pagetable_load ( p -> pagetable ) ; addr_t entry ; int r = elf_load ( p , path , & entry ) ; <S2SV_StartBug> current -> pagetable = old_pagetable ; <S2SV_EndBug> pagetable_load ( old_pagetable ) ; if ( r < 0 ) { process_delete ( p ) ; return r ; } <S2SV_StartBug> process_stack_reset ( p , PAGE_SIZE ) ; <S2SV_EndBug> process_kstack_reset ( p , entry ) ; process_pass_arguments ( p , argv , argc ) ; process_launch ( p ) ; return p -> pid ; }
<S2SV_ModStart> entry ) ; process_stack_reset ( p , PAGE_SIZE ) ; <S2SV_ModStart> r ; } <S2SV_ModEnd> process_kstack_reset ( p
7,221
CWE-000 gint lua_config_add_kv_map ( lua_State * L ) { struct rspamd_config * cfg = lua_check_config ( L , 1 ) ; const gchar * map_line , * description ; struct rspamd_lua_map * map , * * pmap ; struct rspamd_map * m ; if ( cfg ) { map_line = luaL_checkstring ( L , 2 ) ; description = lua_tostring ( L , 3 ) ; map = rspamd_mempool_alloc0 ( cfg -> cfg_pool , sizeof ( * map ) ) ; <S2SV_StartBug> map -> data . hash = g_hash_table_new ( rspamd_strcase_hash , <S2SV_EndBug> rspamd_strcase_equal ) ; map -> type = RSPAMD_LUA_MAP_HASH ; if ( ( m = rspamd_map_add ( cfg , map_line , description , rspamd_kv_list_read , rspamd_kv_list_fin , ( void * * ) & map -> data . hash ) ) == NULL ) { msg_warn_config ( "invalid<S2SV_blank>hash<S2SV_blank>map<S2SV_blank>%s" , map_line ) ; <S2SV_StartBug> g_hash_table_destroy ( map -> data . hash ) ; <S2SV_EndBug> lua_pushnil ( L ) ; return 1 ; } map -> map = m ; pmap = lua_newuserdata ( L , sizeof ( void * ) ) ; * pmap = map ; rspamd_lua_setclass ( L , "rspamd{map}" , - 1 ) ; } else { return luaL_error ( L , "invalid<S2SV_blank>arguments" ) ; } return 1 ; }
<S2SV_ModStart> . hash = NULL <S2SV_ModEnd> ; map -> <S2SV_ModStart> map_line ) ; <S2SV_ModEnd> lua_pushnil ( L
7,222
CWE-000 void ADIO_ResolveFileType ( MPI_Comm comm , const char * filename , int * fstype , ADIOI_Fns * * ops , int * error_code ) { int myerrcode , file_system , min_code , max_code ; char * tmp ; static char myname [ ] = "ADIO_RESOLVEFILETYPE" ; char * p ; file_system = - 1 ; if ( filename == NULL ) { * error_code = ADIOI_Err_create_code ( myname , filename , ENOENT ) ; return ; } tmp = strchr ( filename , ':' ) ; if ( ! tmp ) { int have_nfs_enabled = 0 ; * error_code = MPI_SUCCESS ; # ifdef ROMIO_NFS have_nfs_enabled = 1 ; # endif if ( ! have_nfs_enabled ) { ADIO_FileSysType_fncall_scalable ( comm , filename , & file_system , & myerrcode ) ; if ( myerrcode != MPI_SUCCESS ) { * error_code = myerrcode ; return ; } } else { ADIO_FileSysType_fncall ( filename , & file_system , & myerrcode ) ; MPI_Allreduce ( & myerrcode , & max_code , 1 , MPI_INT , MPI_MAX , comm ) ; if ( max_code != MPI_SUCCESS ) { * error_code = max_code ; return ; } MPI_Allreduce ( & file_system , & min_code , 1 , MPI_INT , MPI_MIN , comm ) ; if ( min_code == ADIO_NFS ) file_system = ADIO_NFS ; } } else { ADIO_FileSysType_prefix ( filename , & file_system , & myerrcode ) ; if ( myerrcode != MPI_SUCCESS ) { * error_code = myerrcode ; return ; } } p = getenv ( "ROMIO_FSTYPE_FORCE" ) ; if ( p != NULL ) { ADIO_FileSysType_prefix ( p , & file_system , & myerrcode ) ; if ( myerrcode != MPI_SUCCESS ) { * error_code = myerrcode ; return ; } } <S2SV_StartBug> if ( file_system == ADIO_PFS ) { <S2SV_EndBug> # ifndef ROMIO_PFS * error_code = MPIO_Err_create_code ( MPI_SUCCESS , MPIR_ERR_RECOVERABLE , myname , __LINE__ , MPI_ERR_IO , "**iofstypeunsupported" , 0 ) ; return ; # else * ops = & ADIO_PFS_operations ; # endif } if ( file_system == ADIO_PIOFS ) { # ifndef ROMIO_PIOFS * error_code = MPIO_Err_create_code ( MPI_SUCCESS , MPIR_ERR_RECOVERABLE , myname , __LINE__ , MPI_ERR_IO , "**iofstypeunsupported" , 0 ) ; return ; # else * ops = & ADIO_PIOFS_operations ; # endif } if ( file_system == ADIO_UFS ) { # ifndef ROMIO_UFS * error_code = MPIO_Err_create_code ( MPI_SUCCESS , MPIR_ERR_RECOVERABLE , myname , __LINE__ , MPI_ERR_IO , "**iofstypeunsupported" , 0 ) ; return ; # else * ops = & ADIO_UFS_operations ; # endif } if ( file_system == ADIO_NFS ) { # ifndef ROMIO_NFS * error_code = MPIO_Err_create_code ( MPI_SUCCESS , MPIR_ERR_RECOVERABLE , myname , __LINE__ , MPI_ERR_IO , "**iofstypeunsupported" , 0 ) ; return ; # else * ops = & ADIO_NFS_operations ; # endif } if ( file_system == ADIO_PANFS ) { # ifndef ROMIO_PANFS * error_code = MPIO_Err_create_code ( MPI_SUCCESS , MPIR_ERR_RECOVERABLE , myname , __LINE__ , MPI_ERR_IO , "**iofstypeunsupported" , 0 ) ; return ; # else * ops = & ADIO_PANFS_operations ; # endif } if ( file_system == ADIO_HFS ) { # ifndef ROMIO_HFS * error_code = MPIO_Err_create_code ( MPI_SUCCESS , MPIR_ERR_RECOVERABLE , myname , __LINE__ , MPI_ERR_IO , "**iofstypeunsupported" , 0 ) ; return ; # else * ops = & ADIO_HFS_operations ; # endif } if ( file_system == ADIO_XFS ) { # ifndef ROMIO_XFS * error_code = MPIO_Err_create_code ( MPI_SUCCESS , MPIR_ERR_RECOVERABLE , myname , __LINE__ , MPI_ERR_IO , "**iofstypeunsupported" , 0 ) ; return ; # else * ops = & ADIO_XFS_operations ; # endif } if ( file_system == ADIO_SFS ) { # ifndef ROMIO_SFS * error_code = MPIO_Err_create_code ( MPI_SUCCESS , MPIR_ERR_RECOVERABLE , myname , __LINE__ , MPI_ERR_IO , "**iofstypeunsupported" , 0 ) ; return ; # else * ops = & ADIO_SFS_operations ; # endif } if ( file_system == ADIO_PVFS ) { # ifndef ROMIO_PVFS * error_code = MPIO_Err_create_code ( MPI_SUCCESS , MPIR_ERR_RECOVERABLE , myname , __LINE__ , MPI_ERR_IO , "**iofstypeunsupported" , 0 ) ; return ; # else * ops = & ADIO_PVFS_operations ; # endif } if ( file_system == ADIO_PVFS2 ) { # ifndef ROMIO_PVFS2 * error_code = MPIO_Err_create_code ( MPI_SUCCESS , MPIR_ERR_RECOVERABLE , myname , __LINE__ , MPI_ERR_IO , "**iofstypeunsupported" , 0 ) ; return ; # else * ops = & ADIO_PVFS2_operations ; # endif } if ( file_system == ADIO_NTFS ) { # ifndef ROMIO_NTFS * error_code = MPIO_Err_create_code ( MPI_SUCCESS , MPIR_ERR_RECOVERABLE , myname , __LINE__ , MPI_ERR_IO , "**iofstypeunsupported" , 0 ) ; return ; # else * ops = & ADIO_NTFS_operations ; # endif } if ( file_system == ADIO_TESTFS ) { # ifndef ROMIO_TESTFS * error_code = MPIO_Err_create_code ( MPI_SUCCESS , MPIR_ERR_RECOVERABLE , myname , __LINE__ , MPI_ERR_IO , "**iofstypeunsupported" , 0 ) ; return ; # else * ops = & ADIO_TESTFS_operations ; # endif } if ( file_system == ADIO_GPFS ) { # ifndef ROMIO_GPFS * error_code = MPIO_Err_create_code ( MPI_SUCCESS , MPIR_ERR_RECOVERABLE , myname , __LINE__ , MPI_ERR_IO , "**iofstypeunsupported" , 0 ) ; return ; # else * ops = & ADIO_GPFS_operations ; # endif } if ( file_system == ADIO_GRIDFTP ) { # ifndef ROMIO_GRIDFTP * error_code = MPIO_Err_create_code ( MPI_SUCCESS , MPIR_ERR_RECOVERABLE , myname , __LINE__ , MPI_ERR_IO , "**iofstypeunsupported" , 0 ) ; return ; # else * ops = & ADIO_GRIDFTP_operations ; # endif } if ( file_system == ADIO_LUSTRE ) { # ifndef ROMIO_LUSTRE * error_code = MPIO_Err_create_code ( MPI_SUCCESS , MPIR_ERR_RECOVERABLE , myname , __LINE__ , MPI_ERR_IO , "**iofstypeunsupported" , 0 ) ; return ; # else * ops = & ADIO_LUSTRE_operations ; # endif } if ( file_system == ADIO_ZOIDFS ) { # ifndef ROMIO_ZOIDFS * error_code = MPIO_Err_create_code ( MPI_SUCCESS , MPIR_ERR_RECOVERABLE , myname , __LINE__ , MPI_ERR_IO , "**iofstypeunsupported" , 0 ) ; return ; # else * ops = & ADIO_ZOIDFS_operations ; # endif } * error_code = MPI_SUCCESS ; * fstype = file_system ; return ; }
<S2SV_ModStart> ( file_system == ADIO_DAOS ) { # ifndef ROMIO_DAOS * error_code = MPIO_Err_create_code ( MPI_SUCCESS , MPIR_ERR_RECOVERABLE , myname , __LINE__ , MPI_ERR_IO , "**iofstypeunsupported" , 0 ) ; return ; # else * ops = & ADIO_DAOS_operations ; # endif } if ( file_system ==
7,223
CWE-000 int libswd_deinit_cmdq ( libswd_ctx_t * libswdctx ) { if ( libswdctx == NULL ) return LIBSWD_ERROR_NULLPOINTER ; int res ; <S2SV_StartBug> res = libswd_cmdq_free ( libswdctx -> cmdq ) ; <S2SV_EndBug> if ( res < 0 ) return res ; return res ; }
<S2SV_ModStart> libswd_cmdq_free ( libswdctx <S2SV_ModEnd> ) ; if
7,224
CWE-000 int CNearTreeFarthestNeighbor ( CNearTreeHandle treehandle , void FAR * FAR * coordFarthest , void FAR * FAR * objFarthest , const void FAR * coord ) { double dSearchRadius = DBL_MIN ; <S2SV_StartBug> if ( ! treehandle ) return CNEARTREE_BAD_ARGUMENT ; <S2SV_EndBug> if ( ! ( treehandle -> m_flags & CNEARTREE_FLAG_LEFT_DATA ) ) return CNEARTREE_NOT_FOUND ; return ( CNearTreeFindFarthest ( treehandle , & dSearchRadius , coordFarthest , objFarthest , coord ) ) ; }
<S2SV_ModStart> ( ! treehandle || ! coord
7,225
CWE-000 static int get_range ( const struct motion_sensor_t * s ) { struct stprivate_data * data = s -> drv_data ; <S2SV_StartBug> if ( MOTIONSENSE_TYPE_ACCEL == s -> type ) <S2SV_EndBug> <S2SV_StartBug> return LSM6DSM_ACCEL_GAIN_FS ( data -> base . range ) ; <S2SV_EndBug> return LSM6DSM_GYRO_GAIN_FS ( data -> base . range ) ; }
<S2SV_ModStart> ; if ( <S2SV_ModEnd> s -> type <S2SV_ModStart> s -> type == MOTIONSENSE_TYPE_ACCEL ) return <S2SV_ModEnd> data -> base <S2SV_ModStart> base . range <S2SV_ModEnd> ; return LSM6DSM_GYRO_GAIN_FS
7,226
CWE-000 static bool mEscape ( State * state ) { if ( ! mChar ( state , '\\\\' ) ) return false ; sType ( state , isspace ) ; <S2SV_StartBug> advance ( state ) ; <S2SV_EndBug> return true ; }
<S2SV_ModStart> isspace ) ; <S2SV_ModEnd> return true ;
7,227
CWE-000 static void list_random_links ( Linkage lkg , extractor_t * pex , const Parse_set * set ) { Parse_choice * pc ; int num_pc , new_index ; if ( set == NULL || set -> first == NULL ) return ; num_pc = 0 ; for ( pc = set -> first ; pc != NULL ; pc = pc -> next ) { num_pc ++ ; } <S2SV_StartBug> new_index = rand_r ( & pex -> rand_state ) % num_pc ; <S2SV_EndBug> num_pc = 0 ; for ( pc = set -> first ; pc != NULL ; pc = pc -> next ) { if ( new_index == num_pc ) break ; num_pc ++ ; } <S2SV_StartBug> assert ( pc != NULL , "Couldn\'t<S2SV_blank>get<S2SV_blank>a<S2SV_blank>random<S2SV_blank>parse<S2SV_blank>choice" ) ; <S2SV_EndBug> issue_links_for_choice ( lkg , pc ) ; list_random_links ( lkg , pex , pc -> set [ 0 ] ) ; list_random_links ( lkg , pex , pc -> set [ 1 ] ) ; }
<S2SV_ModStart> ++ ; } assert ( num_pc != 0 , "Couldn\'t<S2SV_blank>get<S2SV_blank>a<S2SV_blank>random<S2SV_blank>parse<S2SV_blank>choice" ) ; <S2SV_ModStart> ++ ; } <S2SV_ModEnd> issue_links_for_choice ( lkg
7,228
CWE-000 <S2SV_StartBug> UInt VG_ ( umsg ) ( const HChar * format , ... ) <S2SV_EndBug> { <S2SV_StartBug> UInt count ; <S2SV_EndBug> va_list vargs ; va_start ( vargs , format ) ; <S2SV_StartBug> count = VG_ ( vmessage ) ( Vg_UserMsg , format , vargs ) ; <S2SV_EndBug> va_end ( vargs ) ; <S2SV_StartBug> return count ; <S2SV_EndBug> }
<S2SV_ModStart> <S2SV_null> <S2SV_null> <S2SV_null> void VG_ ( fmsg_bad_option ) ( const HChar * opt , <S2SV_ModEnd> const HChar * <S2SV_ModStart> ... ) { <S2SV_ModEnd> va_list vargs ; <S2SV_ModStart> format ) ; revert_to_stderr ( ) ; VG_ ( message ) ( Vg_FailMsg , "Bad<S2SV_blank>option:<S2SV_blank>%s\\n" , opt ) ; <S2SV_ModEnd> VG_ ( vmessage <S2SV_ModStart> vmessage ) ( Vg_FailMsg <S2SV_ModEnd> , format , <S2SV_ModStart> format , vargs ) ; VG_ ( message ) ( Vg_FailMsg , "Use<S2SV_blank>--help<S2SV_blank>for<S2SV_blank>more<S2SV_blank>information<S2SV_blank>or<S2SV_blank>consult<S2SV_blank>the<S2SV_blank>user<S2SV_blank>manual.\\n" <S2SV_ModStart> vargs ) ; VG_ ( exit ) ( 1 ) <S2SV_ModEnd> ; } <S2SV_null>
7,229
CWE-000 static worker_insert_result_t riemann_worker_batch_flush ( RiemannDestDriver * self ) { riemann_message_t * message ; <S2SV_StartBug> int r ; <S2SV_EndBug> if ( ! riemann_dd_connect ( self , TRUE ) ) return WORKER_INSERT_RESULT_NOT_CONNECTED ; message = riemann_message_new ( ) ; riemann_message_set_events_n ( message , self -> event . n , self -> event . list ) ; r = riemann_client_send_message_oneshot ( self -> client , message ) ; self -> event . n = 0 ; self -> event . list = ( riemann_event_t * * ) malloc ( sizeof ( riemann_event_t * ) * self -> event . batch_size_max ) ; if ( r != 0 ) return WORKER_INSERT_RESULT_ERROR ; else return WORKER_INSERT_RESULT_SUCCESS ; }
<S2SV_ModStart> ; int r ; if ( self -> event . n == 0 ) return WORKER_INSERT_RESULT_SUCCESS
7,230
CWE-000 static int hls_window ( AVFormatContext * s , int last , VariantStream * vs ) { HLSContext * hls = s -> priv_data ; HLSSegment * en ; int target_duration = 0 ; int ret = 0 ; char temp_filename [ 1024 ] ; int64_t sequence = FFMAX ( hls -> start_sequence , vs -> sequence - vs -> nb_entries ) ; const char * proto = avio_find_protocol_name ( s -> url ) ; int use_rename = proto && ! strcmp ( proto , "file" ) ; static unsigned warned_non_file ; char * key_uri = NULL ; char * iv_string = NULL ; AVDictionary * options = NULL ; double prog_date_time = vs -> initial_prog_date_time ; double * prog_date_time_p = ( hls -> flags & HLS_PROGRAM_DATE_TIME ) ? & prog_date_time : NULL ; int byterange_mode = ( hls -> flags & HLS_SINGLE_FILE ) || ( hls -> max_seg_size > 0 ) ; hls -> version = 3 ; if ( byterange_mode ) { hls -> version = 4 ; sequence = 0 ; } if ( hls -> flags & HLS_INDEPENDENT_SEGMENTS ) { hls -> version = 6 ; } if ( hls -> segment_type == SEGMENT_TYPE_FMP4 ) { hls -> version = 7 ; } if ( ! use_rename && ! warned_non_file ++ ) av_log ( s , AV_LOG_ERROR , "Cannot<S2SV_blank>use<S2SV_blank>rename<S2SV_blank>on<S2SV_blank>non<S2SV_blank>file<S2SV_blank>protocol,<S2SV_blank>this<S2SV_blank>may<S2SV_blank>lead<S2SV_blank>to<S2SV_blank>races<S2SV_blank>and<S2SV_blank>temporary<S2SV_blank>partial<S2SV_blank>files\\n" ) ; set_http_options ( s , & options , hls ) ; snprintf ( temp_filename , sizeof ( temp_filename ) , use_rename ? "%s.tmp" : "%s" , vs -> m3u8_name ) ; if ( ( ret = hlsenc_io_open ( s , & hls -> m3u8_out , temp_filename , & options ) ) < 0 ) goto fail ; for ( en = vs -> segments ; en ; en = en -> next ) { if ( target_duration <= en -> duration ) target_duration = lrint ( en -> duration ) ; } vs -> discontinuity_set = 0 ; ff_hls_write_playlist_header ( hls -> m3u8_out , hls -> version , hls -> allowcache , target_duration , sequence , hls -> pl_type ) ; if ( ( hls -> flags & HLS_DISCONT_START ) && sequence == hls -> start_sequence && vs -> discontinuity_set == 0 ) { avio_printf ( hls -> m3u8_out , "#EXT-X-DISCONTINUITY\\n" ) ; vs -> discontinuity_set = 1 ; } if ( vs -> has_video && ( hls -> flags & HLS_INDEPENDENT_SEGMENTS ) ) { avio_printf ( hls -> m3u8_out , "#EXT-X-INDEPENDENT-SEGMENTS\\n" ) ; } for ( en = vs -> segments ; en ; en = en -> next ) { if ( ( hls -> encrypt || hls -> key_info_file ) && ( ! key_uri || strcmp ( en -> key_uri , key_uri ) || av_strcasecmp ( en -> iv_string , iv_string ) ) ) { avio_printf ( hls -> m3u8_out , "#EXT-X-KEY:METHOD=AES-128,URI=\\"%s\\"" , en -> key_uri ) ; if ( * en -> iv_string ) avio_printf ( hls -> m3u8_out , ",IV=0x%s" , en -> iv_string ) ; avio_printf ( hls -> m3u8_out , "\\n" ) ; key_uri = en -> key_uri ; iv_string = en -> iv_string ; } if ( ( hls -> segment_type == SEGMENT_TYPE_FMP4 ) && ( en == vs -> segments ) ) { <S2SV_StartBug> ff_hls_write_init_file ( hls -> m3u8_out , vs -> fmp4_init_filename , <S2SV_EndBug> <S2SV_StartBug> hls -> flags & HLS_SINGLE_FILE , en -> size , en -> pos ) ; <S2SV_EndBug> } ret = ff_hls_write_file_entry ( hls -> m3u8_out , en -> discont , byterange_mode , en -> duration , hls -> flags & HLS_ROUND_DURATIONS , en -> size , en -> pos , vs -> baseurl , en -> filename , prog_date_time_p ) ; if ( ret < 0 ) { av_log ( s , AV_LOG_WARNING , "ff_hls_write_file_entry<S2SV_blank>get<S2SV_blank>error\\n" ) ; } } if ( last && ( hls -> flags & HLS_OMIT_ENDLIST ) == 0 ) ff_hls_write_end_list ( hls -> m3u8_out ) ; if ( vs -> vtt_m3u8_name ) { if ( ( ret = hlsenc_io_open ( s , & hls -> sub_m3u8_out , vs -> vtt_m3u8_name , & options ) ) < 0 ) goto fail ; ff_hls_write_playlist_header ( hls -> sub_m3u8_out , hls -> version , hls -> allowcache , target_duration , sequence , PLAYLIST_TYPE_NONE ) ; for ( en = vs -> segments ; en ; en = en -> next ) { ret = ff_hls_write_file_entry ( hls -> sub_m3u8_out , 0 , byterange_mode , en -> duration , 0 , en -> size , en -> pos , vs -> baseurl , en -> sub_filename , NULL ) ; if ( ret < 0 ) { av_log ( s , AV_LOG_WARNING , "ff_hls_write_file_entry<S2SV_blank>get<S2SV_blank>error\\n" ) ; } } if ( last ) ff_hls_write_end_list ( hls -> sub_m3u8_out ) ; } fail : av_dict_free ( & options ) ; hlsenc_io_close ( s , & hls -> m3u8_out , temp_filename ) ; hlsenc_io_close ( s , & hls -> sub_m3u8_out , vs -> vtt_m3u8_name ) ; if ( ret >= 0 && use_rename ) ff_rename ( temp_filename , vs -> m3u8_name , s ) ; if ( ret >= 0 && hls -> master_pl_name ) if ( create_master_playlist ( s , vs ) < 0 ) av_log ( s , AV_LOG_WARNING , "Master<S2SV_blank>playlist<S2SV_blank>creation<S2SV_blank>failed\\n" ) ; return ret ; }
<S2SV_ModStart> -> m3u8_out , ( hls -> flags & HLS_SINGLE_FILE ) ? en -> filename : <S2SV_ModStart> & HLS_SINGLE_FILE , vs -> init_range_length , 0 <S2SV_ModEnd> ) ; }
7,231
CWE-000 static int emac_mdio_read_link ( struct mii_phy * phy ) { struct net_device * ndev = phy -> dev ; struct emac_instance * dev = netdev_priv ( ndev ) ; <S2SV_StartBug> int res ; <S2SV_EndBug> <S2SV_StartBug> res = phy_read_status ( dev -> phy_dev ) ; <S2SV_EndBug> if ( res ) return res ; <S2SV_StartBug> dev -> phy . speed = phy -> speed ; <S2SV_EndBug> <S2SV_StartBug> dev -> phy . duplex = phy -> duplex ; <S2SV_EndBug> <S2SV_StartBug> dev -> phy . pause = phy -> pause ; <S2SV_EndBug> <S2SV_StartBug> dev -> phy . asym_pause = phy -> asym_pause ; <S2SV_EndBug> return 0 ; }
<S2SV_ModStart> ndev ) ; struct phy_device * phy_dev = dev -> phy_dev ; <S2SV_ModStart> = phy_read_status ( <S2SV_ModEnd> phy_dev ) ; <S2SV_ModStart> return res ; phy -> speed = phy_dev <S2SV_ModEnd> -> speed ; <S2SV_ModStart> -> speed ; phy -> duplex = phy_dev <S2SV_ModEnd> -> duplex ; <S2SV_ModStart> -> duplex ; phy -> pause = phy_dev <S2SV_ModEnd> -> pause ; <S2SV_ModStart> -> pause ; phy -> asym_pause = phy_dev <S2SV_ModEnd> -> asym_pause ;
7,232
CWE-000 static void sqliteBeginForeignScan ( ForeignScanState * node , int eflags ) { <S2SV_StartBug> SQLiteFdwExecutionState * festate ; <S2SV_EndBug> SqliteTableSource src ; ForeignScan * fsplan = ( ForeignScan * ) node -> ss . ps . plan ; elog ( SQLITE_FDW_LOG_LEVEL , "entering<S2SV_blank>function<S2SV_blank>%s" , __func__ ) ; <S2SV_StartBug> festate = ( SQLiteFdwExecutionState * ) <S2SV_EndBug> <S2SV_StartBug> palloc0 ( sizeof ( SQLiteFdwExecutionState ) ) ; <S2SV_EndBug> node -> fdw_state = ( void * ) festate ; src = get_tableSource ( RelationGetRelid ( node -> ss . ss_currentRelation ) ) ; festate -> db = get_sqliteDbHandle ( src . database ) ; festate -> query = strVal ( list_nth ( fsplan -> fdw_private , 0 ) ) ; festate -> retrieved_attrs = list_nth ( fsplan -> fdw_private , 1 ) ; festate -> stmt = prepare_sqliteQuery ( festate -> db , festate -> query , NULL ) ; if ( list_length ( fsplan -> fdw_exprs ) > 0 ) sqlite_bind_param_values ( festate , fsplan -> fdw_exprs , node ) ; }
<S2SV_ModStart> eflags ) { SqliteFdwExecutionState <S2SV_ModEnd> * festate ; <S2SV_ModStart> festate = ( SqliteFdwExecutionState <S2SV_ModEnd> * ) palloc0 <S2SV_ModStart> ( sizeof ( SqliteFdwExecutionState <S2SV_ModEnd> ) ) ;
7,233
CWE-000 extern void job_set_alloc_tres ( struct job_record * job_ptr , bool assoc_mgr_locked ) { <S2SV_StartBug> uint64_t tres_count ; <S2SV_EndBug> uint32_t alloc_nodes = 0 ; assoc_mgr_lock_t locks = { NO_LOCK , NO_LOCK , NO_LOCK , NO_LOCK , READ_LOCK , NO_LOCK , NO_LOCK } ; xfree ( job_ptr -> tres_alloc_str ) ; xfree ( job_ptr -> tres_alloc_cnt ) ; xfree ( job_ptr -> tres_fmt_alloc_str ) ; if ( IS_JOB_PENDING ( job_ptr ) ) return ; if ( ! assoc_mgr_locked ) assoc_mgr_lock ( & locks ) ; job_ptr -> tres_alloc_cnt = xmalloc ( sizeof ( uint64_t ) * slurmctld_tres_cnt ) ; job_ptr -> tres_alloc_cnt [ TRES_ARRAY_CPU ] = ( uint64_t ) job_ptr -> total_cpus ; # ifdef HAVE_BG select_g_select_jobinfo_get ( job_ptr -> select_jobinfo , SELECT_JOBDATA_NODE_CNT , & alloc_nodes ) ; # else alloc_nodes = job_ptr -> node_cnt ; # endif job_ptr -> tres_alloc_cnt [ TRES_ARRAY_NODE ] = ( uint64_t ) alloc_nodes ; <S2SV_StartBug> tres_count = job_ptr -> details -> pn_min_memory ; <S2SV_EndBug> if ( tres_count & MEM_PER_CPU ) { tres_count &= ( ~ MEM_PER_CPU ) ; <S2SV_StartBug> tres_count *= job_ptr -> tres_alloc_cnt [ TRES_ARRAY_CPU ] ; <S2SV_EndBug> } else { <S2SV_StartBug> tres_count *= job_ptr -> tres_alloc_cnt [ TRES_ARRAY_NODE ] ; <S2SV_EndBug> } job_ptr -> tres_alloc_cnt [ TRES_ARRAY_MEM ] = tres_count ; license_set_job_tres_cnt ( job_ptr -> license_list , job_ptr -> tres_alloc_cnt , true ) ; gres_set_job_tres_cnt ( job_ptr -> gres_list , alloc_nodes , job_ptr -> tres_alloc_cnt , true ) ; bb_g_job_set_tres_cnt ( job_ptr , job_ptr -> tres_alloc_cnt , true ) ; job_ptr -> tres_alloc_str = assoc_mgr_make_tres_str_from_array ( job_ptr -> tres_alloc_cnt , TRES_STR_FLAG_SIMPLE , true ) ; job_ptr -> tres_fmt_alloc_str = assoc_mgr_make_tres_str_from_array ( job_ptr -> tres_alloc_cnt , TRES_STR_CONVERT_UNITS , true ) ; if ( ! assoc_mgr_locked ) assoc_mgr_unlock ( & locks ) ; return ; }
<S2SV_ModStart> assoc_mgr_locked ) { <S2SV_ModEnd> uint32_t alloc_nodes = <S2SV_ModStart> ) alloc_nodes ; job_ptr -> tres_alloc_cnt [ TRES_ARRAY_MEM ] = job_get_tres_mem ( <S2SV_ModEnd> job_ptr -> details <S2SV_ModStart> details -> pn_min_memory , <S2SV_ModEnd> job_ptr -> tres_alloc_cnt <S2SV_ModStart> [ TRES_ARRAY_CPU ] , <S2SV_ModEnd> job_ptr -> tres_alloc_cnt <S2SV_ModStart> [ TRES_ARRAY_NODE ] ) <S2SV_ModEnd> ; license_set_job_tres_cnt (
7,234
CWE-000 char ssdv_dec_feed ( ssdv_t * s , uint8_t * packet ) { int i = 0 , r ; uint8_t b ; uint16_t packet_id ; packet_id = ( packet [ 7 ] << 8 ) | packet [ 8 ] ; s -> packet_mcu_offset = packet [ 12 ] ; s -> packet_mcu_id = ( packet [ 13 ] << 8 ) | packet [ 14 ] ; <S2SV_StartBug> if ( s -> packet_mcu_id != 0xFFFF ) s -> reset_mcu = s -> packet_mcu_id ; <S2SV_EndBug> if ( s -> packet_id == 0 ) { const char * factor ; char callsign [ SSDV_MAX_CALLSIGN + 1 ] ; s -> type = packet [ 1 ] - 0x66 ; s -> callsign = ( packet [ 2 ] << 24 ) | ( packet [ 3 ] << 16 ) | ( packet [ 4 ] << 8 ) | packet [ 5 ] ; s -> image_id = packet [ 6 ] ; s -> width = packet [ 9 ] << 4 ; s -> height = packet [ 10 ] << 4 ; s -> mcu_count = packet [ 9 ] * packet [ 10 ] ; s -> quality = ( ( packet [ 11 ] >> 3 ) & 7 ) ^ 4 ; s -> mcu_mode = packet [ 11 ] & 0x03 ; ssdv_set_packet_conf ( s ) ; s -> sdqt [ 0 ] = sload_standard_dqt ( s , std_dqt0 , s -> quality ) ; s -> sdqt [ 1 ] = sload_standard_dqt ( s , std_dqt1 , s -> quality ) ; s -> ddqt [ 0 ] = dload_standard_dqt ( s , std_dqt0 , s -> quality ) ; s -> ddqt [ 1 ] = dload_standard_dqt ( s , std_dqt1 , s -> quality ) ; switch ( s -> mcu_mode & 3 ) { case 0 : factor = "2x2" ; s -> ycparts = 4 ; break ; case 1 : factor = "1x2" ; s -> ycparts = 2 ; s -> mcu_count *= 2 ; break ; case 2 : factor = "2x1" ; s -> ycparts = 2 ; s -> mcu_count *= 2 ; break ; case 3 : factor = "1x1" ; s -> ycparts = 1 ; s -> mcu_count *= 4 ; break ; } fprintf ( stderr , "Callsign:<S2SV_blank>%s\\n" , decode_callsign ( callsign , s -> callsign ) ) ; fprintf ( stderr , "Image<S2SV_blank>ID:<S2SV_blank>%02X\\n" , s -> image_id ) ; fprintf ( stderr , "Resolution:<S2SV_blank>%ix%i\\n" , s -> width , s -> height ) ; fprintf ( stderr , "MCU<S2SV_blank>blocks:<S2SV_blank>%i\\n" , s -> mcu_count ) ; fprintf ( stderr , "Sampling<S2SV_blank>factor:<S2SV_blank>%s\\n" , factor ) ; fprintf ( stderr , "Quality<S2SV_blank>level:<S2SV_blank>%d\\n" , s -> quality ) ; ssdv_out_headers ( s ) ; s -> out_stuff = 1 ; } if ( packet_id != s -> packet_id ) { fprintf ( stderr , "Gap<S2SV_blank>detected<S2SV_blank>between<S2SV_blank>packets<S2SV_blank>%i<S2SV_blank>and<S2SV_blank>%i\\n" , s -> packet_id - 1 , packet_id ) ; if ( s -> packet_mcu_offset == 0xFF ) return ( SSDV_FEED_ME ) ; ssdv_fill_gap ( s , s -> packet_mcu_id ) ; s -> workbits = s -> worklen = 0 ; i = s -> packet_mcu_offset ; s -> state = S_HUFF ; s -> component = 0 ; s -> mcupart = 0 ; s -> acpart = 0 ; s -> accrle = 0 ; s -> packet_id = packet_id ; } for ( ; i < s -> pkt_size_payload ; i ++ ) { b = packet [ SSDV_PKT_SIZE_HEADER + i ] ; s -> workbits = ( s -> workbits << 8 ) | b ; s -> worklen += 8 ; while ( ( r = ssdv_process ( s ) ) == SSDV_OK ) ; if ( r == SSDV_BUFFER_FULL ) { } else if ( r == SSDV_EOI ) { return ( SSDV_OK ) ; } else if ( r != SSDV_FEED_ME ) { fprintf ( stderr , "ssdv_process()<S2SV_blank>failed:<S2SV_blank>%i\\n" , r ) ; return ( SSDV_ERROR ) ; } } s -> packet_id ++ ; return ( SSDV_FEED_ME ) ; }
<S2SV_ModStart> != 0xFFFF ) { s -> next_reset_mcu <S2SV_ModEnd> = s -> <S2SV_ModStart> -> packet_mcu_id ; }
7,235
CWE-000 int main ( int argv , char * * argc ) { int token ; <S2SV_StartBug> if ( argv < 4 ) <S2SV_EndBug> { printf ( "Arquivos<S2SV_blank>nao<S2SV_blank>informados!\\n" ) ; exit ( 1 ) ; } yyin = fopen ( argc [ 1 ] , "r" ) ; if ( ! yyin ) { printf ( "Arquivo<S2SV_blank>inexistente!\\n" ) ; exit ( 2 ) ; } FILE * out = fopen ( argc [ 2 ] , "w" ) ; if ( ! out ) { printf ( "Erro<S2SV_blank>ao<S2SV_blank>gerar<S2SV_blank>arquivo<S2SV_blank>de<S2SV_blank>saida!\\n" ) ; exit ( 1 ) ; } OUT_FILE = out ; <S2SV_StartBug> FILE * outTAC = fopen ( argc [ 3 ] , "w+" ) ; <S2SV_EndBug> if ( ! outTAC ) { printf ( "Erro<S2SV_blank>ao<S2SV_blank>gerar<S2SV_blank>arquivo<S2SV_blank>de<S2SV_blank>saida<S2SV_blank>TAC!\\n" ) ; exit ( 1 ) ; } outputTAC = outTAC ; initMe ( ) ; yyparse ( ) ; hash_print ( ) ; fclose ( out ) ; fclose ( outputTAC ) ; printf ( "Programa<S2SV_blank>reconhecido<S2SV_blank>com<S2SV_blank>sucesso!\\n" ) ; exit ( 0 ) ; return 0 ; }
<S2SV_ModStart> ( argv < 3 <S2SV_ModEnd> ) { printf <S2SV_ModStart> = fopen ( "OUT_TAC" <S2SV_ModEnd> , "w+" )
7,236
CWE-000 static void qemu_vfio_open_common ( QEMUVFIOState * s ) <S2SV_StartBug> { <S2SV_EndBug> s -> ram_notifier . ram_block_added = qemu_vfio_ram_block_added ; s -> ram_notifier . ram_block_removed = qemu_vfio_ram_block_removed ; ram_block_notifier_add ( & s -> ram_notifier ) ; s -> low_water_mark = QEMU_VFIO_IOVA_MIN ; s -> high_water_mark = QEMU_VFIO_IOVA_MAX ; qemu_ram_foreach_block ( qemu_vfio_init_ramblock , s ) ; <S2SV_StartBug> qemu_mutex_init ( & s -> lock ) ; <S2SV_EndBug> }
<S2SV_ModStart> s ) { qemu_mutex_init ( & s -> lock ) ; <S2SV_ModStart> s ) ; <S2SV_ModEnd> } <S2SV_null> <S2SV_null>
7,237
CWE-000 void netmd_transfer_song_packets ( netmd_dev_handle * dev , netmd_track_packets * packets ) { netmd_track_packets * p ; unsigned char * packet , * buf ; size_t packet_size , usb_timeout ; int error ; int transferred = 0 ; p = packets ; while ( p != NULL ) { packet_size = 8 + 8 + 8 + p -> length ; packet = malloc ( packet_size ) ; buf = packet ; netmd_copy_quadword_to_buffer ( & buf , p -> length ) ; memcpy ( buf , p -> key , 8 ) ; memcpy ( buf + 8 , p -> iv , 8 ) ; memcpy ( buf + 16 , p -> data , p -> length ) ; usb_timeout = 60000 ; netmd_log ( NETMD_LOG_VERBOSE , "sending<S2SV_blank>%d<S2SV_blank>bytes<S2SV_blank>and<S2SV_blank>setting<S2SV_blank>usb<S2SV_blank>timeout<S2SV_blank>to<S2SV_blank>%d<S2SV_blank>seconds\\n" , packet_size , usb_timeout / 1000 ) ; error = libusb_bulk_transfer ( ( libusb_device_handle * ) dev , 2 , packet , ( int ) packet_size , & transferred , usb_timeout ) ; netmd_log ( NETMD_LOG_VERBOSE , "%d<S2SV_blank>of<S2SV_blank>%d<S2SV_blank>bytes<S2SV_blank>transferred,<S2SV_blank>libusb<S2SV_blank>error<S2SV_blank>code:<S2SV_blank>%d\\n" , transferred , packet_size , error ) ; free ( packet ) ; buf = NULL ; <S2SV_StartBug> if ( error >= 0 ) { <S2SV_EndBug> p = p -> next ; } <S2SV_StartBug> break ; <S2SV_EndBug> } <S2SV_StartBug> } <S2SV_EndBug>
<S2SV_ModStart> if ( error == <S2SV_ModEnd> 0 ) { <S2SV_ModStart> next ; } else { <S2SV_ModStart> ; } } }
7,238
CWE-000 void native_machine_crash_shutdown ( struct pt_regs * regs ) { local_irq_disable ( ) ; kdump_nmi_shootdown_cpus ( ) ; cpu_emergency_vmxoff ( ) ; cpu_emergency_svm_disable ( ) ; <S2SV_StartBug> lapic_shutdown ( ) ; <S2SV_EndBug> # if defined ( CONFIG_X86_IO_APIC ) disable_IO_APIC ( ) ; <S2SV_StartBug> # endif <S2SV_EndBug> # ifdef CONFIG_HPET_TIMER hpet_disable ( ) ; # endif crash_save_cpu ( regs , safe_smp_processor_id ( ) ) ; }
<S2SV_ModStart> ( ) ; <S2SV_ModEnd> # if defined <S2SV_ModStart> ; # endif lapic_shutdown ( ) ;
7,239
CWE-000 <S2SV_StartBug> void append ( int id , int burst , int priority ) <S2SV_EndBug> { struct dnode * nptr , * temp = start ; nptr = malloc ( sizeof ( struct dnode ) ) ; nptr -> process = malloc ( sizeof ( struct process ) ) ; nptr -> process -> priority = priority ; nptr -> process -> burst = burst ; nptr -> process -> process_id = id ; <S2SV_StartBug> nptr -> next = NULL ; <S2SV_EndBug> nptr -> prev = NULL ; if ( start == NULL ) { start = nptr ; } else { while ( temp -> next != NULL ) temp = temp -> next ; nptr -> prev = temp ; temp -> next = nptr ; } }
<S2SV_ModStart> , int priority , int waiting_time , int arrival_time , int turn_around_time <S2SV_ModStart> ; nptr -> process -> waiting_time = waiting_time ; nptr -> process -> arrival_time = arrival_time ; nptr -> process -> turn_around_time = turn_around_time ; nptr ->
7,240
CWE-000 static int add_dir ( struct fatfs * fs , struct fatfs_dir * dj , char * name ) { if ( ! fs || ! dj || ! name ) return - 1 ; int nlen = strlen ( name ) ; if ( nlen > 12 ) return - 2 ; memset ( ( fs -> win + dj -> off ) , 0 , 0x20 ) ; memset ( ( fs -> win + dj -> off ) , '<S2SV_blank>' , 11 ) ; int len = 0 ; while ( len < nlen ) { <S2SV_StartBug> * ( fs -> win + dj -> off + len ) = name [ len ++ ] ; <S2SV_EndBug> } * ( fs -> win + dj -> off + DIR_ATTR ) = 0x20 ; st_dword ( ( fs -> win + dj -> off + DIR_FSIZE ) , 0 ) ; dj -> dirsect = dj -> sect ; return 0 ; }
<S2SV_ModStart> name [ len ] ; len ++ <S2SV_ModEnd> ; } *
7,241
CWE-000 int lexer ( char * infile , char * outfile ) { int indesc = open ( infile , O_RDONLY ) ; if ( indesc == - 1 ) { print_error ( "error" , "cant<S2SV_blank>open<S2SV_blank>infile" ) ; } off_t size_file = lseek ( indesc , 0 , SEEK_END ) ; if ( size_file == - 1L ) { print_error ( "error" , "cant<S2SV_blank>read<S2SV_blank>infile<S2SV_blank>size" ) ; return - 1 ; } if ( lseek ( indesc , 0 , SEEK_SET ) == - 1L ) { print_error ( "error" , "cant<S2SV_blank>read<S2SV_blank>infile<S2SV_blank>size" ) ; return - 1 ; } char * code_buff = calloc ( size_file , 1 ) ; if ( size_file != read ( indesc , code_buff , size_file ) ) { print_error ( "error" , "cant<S2SV_blank>read<S2SV_blank>infile<S2SV_blank>fully" ) ; return - 1 ; } if ( close ( indesc ) == - 1 ) { <S2SV_StartBug> print_error ( "error" , "cant<S2SV_blank>close<S2SV_blank>infile" ) ; <S2SV_EndBug> } int memory_buff [ 100 ] = { } ; char code_line_buff [ 100 ] ; int num_line = 0 ; int error_flag = 0 ; char * saveptr1 ; char * code_line = strtok_r ( code_buff , "\\n" , & saveptr1 ) ; while ( code_line ) { strncpy ( code_line_buff , code_line , 99 ) ; code_line_buff [ 99 ] = 0 ; int num_memory_cell = - 1 , command = 0 , operand = 0 , num_token = 0 ; char * saveptr2 ; char * code_token = strtok_r ( code_line , "<S2SV_blank>\\t\\n" , & saveptr2 ) ; while ( code_token ) { int num_spaces = calcspaces ( code_line_buff , code_token - code_line ) ; if ( num_token == 0 ) { int number ; if ( ! tonumber ( code_token , & number ) || number < 0 || number > 99 ) { char buff [ 200 ] ; sprintf ( buff , "cell<S2SV_blank>address<S2SV_blank>\\"%s\\"<S2SV_blank>not<S2SV_blank>exist\\n%s\\n\\E[32m\\E[1m^\\E[0m" , code_token , code_line_buff ) ; print_error ( "error" , buff ) ; error_flag = 1 ; } num_memory_cell = number ; } else if ( num_token == 1 ) { if ( cstrtocint ( code_token , & command ) == - 1 ) { char buff [ 200 ] ; sprintf ( buff , "unknown<S2SV_blank>command<S2SV_blank>\\"%s\\"<S2SV_blank>line<S2SV_blank>%d\\n%s\\n\\E[32m\\E[1m%*c\\E[0m" , code_token , num_line , code_line_buff , num_spaces + 1 , '^' ) ; print_error ( "error" , buff ) ; error_flag = 1 ; } } else if ( num_token == 2 ) { int number ; if ( ! tonumber ( code_token , & number ) || ( ( number < 0 || number > 127 ) && command != 0 ) || ( ( number < - 0xFFFF || number > 0xFFFF ) && command == 0 ) ) { char buff [ 200 ] ; sprintf ( buff , "invalid<S2SV_blank>operand<S2SV_blank>\\"%s\\"<S2SV_blank>not<S2SV_blank>exist\\n%s\\n\\E[32m\\E[1m%*c\\E[0m" , code_token , code_line_buff , num_spaces + 1 , '^' ) ; print_error ( "error" , buff ) ; error_flag = 1 ; } operand = number ; } else if ( num_token == 3 ) { if ( code_token [ 0 ] != ';' ) { char buff [ 200 ] ; sprintf ( buff , "unknown<S2SV_blank>token<S2SV_blank>\\"%s\\"<S2SV_blank>line<S2SV_blank>%d<S2SV_blank>use<S2SV_blank>\\";\\"<S2SV_blank>for<S2SV_blank>commentary\\n%s\\n\\E[32m\\E[1m%*c\\E[0m" , code_token , num_line , code_line_buff , num_spaces + 1 , '^' ) ; print_error ( "error" , buff ) ; error_flag = 1 ; } break ; } else { break ; } code_token = strtok_r ( 0 , "<S2SV_blank>\\t\\n" , & saveptr2 ) ; num_token ++ ; } if ( command != 0 ) { int coded_command ; sc_commandEncode ( command , operand , & coded_command ) ; memory_buff [ num_memory_cell ] = coded_command ; } else { memory_buff [ num_memory_cell ] = operand ; } code_line = strtok_r ( 0 , "\\n" , & saveptr1 ) ; num_line ++ ; } if ( error_flag ) { return - 1 ; } int outdesc = open ( outfile , O_WRONLY | O_TRUNC | O_CREAT , - 1 ) ; if ( outdesc == - 1 ) { print_error ( "error" , "cant<S2SV_blank>open<S2SV_blank>outfile" ) ; } if ( write ( outdesc , memory_buff , 400 ) < 0 ) { print_error ( "error" , "cant<S2SV_blank>write<S2SV_blank>in<S2SV_blank>outfine" ) ; return - 1 ; } if ( close ( outdesc ) == - 1 ) { print_error ( "error" , "cant<S2SV_blank>close<S2SV_blank>outfile" ) ; } return 0 ; }
<S2SV_ModStart> "cant<S2SV_blank>close<S2SV_blank>infile" ) ; } for ( int i = 0 ; i < strlen ( code_buff ) ; ++ i ) { if ( code_buff [ i ] == '\\r' ) { code_buff [ i ] = '<S2SV_blank>' ; }
7,242
CWE-000 <S2SV_StartBug> CeVimParseResult_t ce_vim_parse_verb_substitute_soft_begin_line ( CeVimAction_t * action , CeRune_t key ) { <S2SV_EndBug> action -> verb . function = & ce_vim_verb_substitute_soft_begin_line ; return CE_VIM_PARSE_COMPLETE ; }
<S2SV_ModStart> key ) { action -> repeatable = true ;
7,243
CWE-000 void free_http ( http_request * req ) { <S2SV_StartBug> free ( req -> path ) ; <S2SV_EndBug> for ( int i = 0 ; i < req -> header_num ; i ++ ) { free ( req -> headers [ i ] ) ; } free ( req -> headers ) ; free ( req ) ; }
<S2SV_ModStart> req ) { printf ( "\\nFreeing<S2SV_blank>%s\\n" , req -> path ) ; if ( strcspn ( req -> path , "/" ) == 0 )
7,244
CWE-000 static __net_init int proc_net_ns_init ( struct net * net ) { struct proc_dir_entry * netd , * net_statd ; kuid_t uid ; kgid_t gid ; int err ; err = - ENOMEM ; <S2SV_StartBug> netd = kzalloc ( sizeof ( * netd ) + 4 , GFP_KERNEL ) ; <S2SV_EndBug> if ( ! netd ) goto out ; netd -> subdir = RB_ROOT_CACHED ; netd -> data = net ; netd -> nlink = 2 ; netd -> namelen = 3 ; netd -> parent = & proc_root ; <S2SV_StartBug> memcpy ( netd -> name , "net" , 4 ) ; <S2SV_EndBug> uid = make_kuid ( net -> user_ns , 0 ) ; if ( ! uid_valid ( uid ) ) uid = netd -> uid ; gid = make_kgid ( net -> user_ns , 0 ) ; if ( ! gid_valid ( gid ) ) gid = netd -> gid ; proc_set_user ( netd , uid , gid ) ; err = - EEXIST ; net_statd = proc_net_mkdir ( net , "stat" , netd ) ; if ( ! net_statd ) goto free_net ; net -> proc_net = netd ; net -> proc_net_stat = net_statd ; return 0 ; free_net : <S2SV_StartBug> kfree ( netd ) ; <S2SV_EndBug> out : return err ; }
<S2SV_ModStart> ; netd = kmem_cache_zalloc ( proc_dir_entry_cache <S2SV_ModEnd> , GFP_KERNEL ) <S2SV_ModStart> & proc_root ; netd -> name = netd -> inline_name ; <S2SV_ModStart> ; free_net : pde_free <S2SV_ModEnd> ( netd )
7,245
CWE-000 InstructionNode * create_instructions_method_call ( ASTNode * root ) { <S2SV_StartBug> printf ( "encuentra<S2SV_blank>un<S2SV_blank>method_call<S2SV_blank>\\n" ) ; <S2SV_EndBug> create_push_instructions ( root -> right_child ) ; InstructionNode * call_ins = create_instructionNode ( CALL , create_temporal ( ) , create_temporal_with_id ( root -> function_data -> id ) , NULL ) ; add_instruction ( call_ins ) ; return call_ins ; }
<S2SV_ModStart> root ) { <S2SV_ModEnd> create_push_instructions ( root
7,246
CWE-000 static void sync_request_write ( struct mddev * mddev , struct r1bio * r1_bio ) { struct r1conf * conf = mddev -> private ; int i ; int disks = conf -> raid_disks * 2 ; struct bio * bio , * wbio ; bio = r1_bio -> bios [ r1_bio -> read_disk ] ; if ( ! test_bit ( R1BIO_Uptodate , & r1_bio -> state ) ) if ( ! fix_sync_read_error ( r1_bio ) ) return ; if ( test_bit ( MD_RECOVERY_REQUESTED , & mddev -> recovery ) ) process_checks ( r1_bio ) ; atomic_set ( & r1_bio -> remaining , 1 ) ; for ( i = 0 ; i < disks ; i ++ ) { wbio = r1_bio -> bios [ i ] ; if ( wbio -> bi_end_io == NULL || ( wbio -> bi_end_io == end_sync_read && ( i == r1_bio -> read_disk || ! test_bit ( MD_RECOVERY_SYNC , & mddev -> recovery ) ) ) ) continue ; <S2SV_StartBug> bio_set_op_attrs ( wbio , REQ_OP_WRITE , 0 ) ; <S2SV_EndBug> if ( test_bit ( FailFast , & conf -> mirrors [ i ] . rdev -> flags ) ) wbio -> bi_opf |= MD_FAILFAST ; wbio -> bi_end_io = end_sync_write ; atomic_inc ( & r1_bio -> remaining ) ; md_sync_acct ( conf -> mirrors [ i ] . rdev -> bdev , bio_sectors ( wbio ) ) ; generic_make_request ( wbio ) ; } if ( atomic_dec_and_test ( & r1_bio -> remaining ) ) { int s = r1_bio -> sectors ; if ( test_bit ( R1BIO_MadeGood , & r1_bio -> state ) || test_bit ( R1BIO_WriteError , & r1_bio -> state ) ) reschedule_retry ( r1_bio ) ; else { put_buf ( r1_bio ) ; md_done_sync ( mddev , s , 1 ) ; } } }
<S2SV_ModStart> ) continue ; if ( test_bit ( Faulty , & conf -> mirrors [ i ] . rdev -> flags ) ) continue ;
7,247
CWE-000 void TownCreateWarrior ( Town * this ) <S2SV_StartBug> { <S2SV_EndBug> if ( this -> resources >= WARRIOR_COST && this -> peasants * PEASANT_PRODUCTION_PER_MIN >= ( this -> warriors + 1 ) * WARRIOR_CONSUPTION_PER_MIN ) { this -> warriors += 1 ; this -> peasants -= 1 ; this -> resources -= WARRIOR_COST ; } }
<S2SV_ModStart> this ) { if ( NULL == this ) { return ; }
7,248
CWE-000 int opt_loglevel ( void * optctx , const char * opt , const char * arg ) { const struct { const char * name ; int level ; } log_levels [ ] = { { "quiet" , AV_LOG_QUIET } , { "panic" , AV_LOG_PANIC } , { "fatal" , AV_LOG_FATAL } , { "error" , AV_LOG_ERROR } , { "warning" , AV_LOG_WARNING } , { "info" , AV_LOG_INFO } , { "verbose" , AV_LOG_VERBOSE } , { "debug" , AV_LOG_DEBUG } , { "trace" , AV_LOG_TRACE } , } ; const char * token ; char * tail ; int flags = av_log_get_flags ( ) ; int level = av_log_get_level ( ) ; int cmd , i = 0 ; typedef void ( * av_log_set_level_fn ) ( int ) ; av_log_set_level_fn set_level_fn = ( av_log_set_level_fn ) optctx ; if ( ! set_level_fn ) set_level_fn = & av_log_set_level ; av_assert0 ( arg ) ; while ( * arg ) { token = arg ; if ( * token == '+' || * token == '-' ) { cmd = * token ++ ; } else { cmd = 0 ; } if ( ! i && ! cmd ) { flags = 0 ; } if ( ! strncmp ( token , "repeat" , 6 ) ) { if ( cmd == '-' ) { flags |= AV_LOG_SKIP_REPEATED ; } else { flags &= ~ AV_LOG_SKIP_REPEATED ; } arg = token + 6 ; } else if ( ! strncmp ( token , "level" , 5 ) ) { if ( cmd == '-' ) { flags &= ~ AV_LOG_PRINT_LEVEL ; } else { flags |= AV_LOG_PRINT_LEVEL ; } arg = token + 5 ; } else { break ; } i ++ ; } if ( ! * arg ) { goto end ; } else if ( * arg == '+' ) { arg ++ ; } else if ( ! i ) { flags = av_log_get_flags ( ) ; } for ( i = 0 ; i < FF_ARRAY_ELEMS ( log_levels ) ; i ++ ) { if ( ! strcmp ( log_levels [ i ] . name , arg ) ) { set_level_fn ( log_levels [ i ] . level ) ; level = log_levels [ i ] . level ; goto end ; } } level = strtol ( arg , & tail , 10 ) ; if ( * tail ) { av_log ( NULL , AV_LOG_FATAL , "Invalid<S2SV_blank>loglevel<S2SV_blank>\\"%s\\".<S2SV_blank>" "Possible<S2SV_blank>levels<S2SV_blank>are<S2SV_blank>numbers<S2SV_blank>or:\\n" , arg ) ; for ( i = 0 ; i < FF_ARRAY_ELEMS ( log_levels ) ; i ++ ) av_log ( NULL , AV_LOG_FATAL , "\\"%s\\"\\n" , log_levels [ i ] . name ) ; exit_program ( 1 ) ; } <S2SV_StartBug> set_level_fn ( level ) ; <S2SV_EndBug> av_log_set_flags ( flags ) ; return 0 ; }
<S2SV_ModStart> ) ; } end :
7,249
CWE-000 static void vibrator_pwm_remove ( struct device_t * dev ) { struct vibrator_t * vib = ( struct vibrator_t * ) dev -> priv ; struct vibrator_pwm_pdata_t * pdat = ( struct vibrator_pwm_pdata_t * ) vib -> priv ; if ( vib && unregister_vibrator ( vib ) ) { <S2SV_StartBug> vibrator_pwm_set_state ( pdat , 0 ) ; <S2SV_EndBug> timer_cancel ( & pdat -> timer ) ; queue_free ( pdat -> queue , iter_queue_node ) ; free_device_name ( vib -> name ) ; free ( vib -> priv ) ; free ( vib ) ; } }
<S2SV_ModStart> ) ) { <S2SV_ModEnd> timer_cancel ( &
7,250
CWE-000 static void inode_free ( inode_t * inode ) <S2SV_StartBug> { <S2SV_EndBug> if ( inode != NULL ) { main_node_free ( inode -> main ) ; free ( inode ) ; } }
<S2SV_ModStart> inode ) { DEBUG ( "inode_free<S2SV_blank>%p" , inode ) ;
7,251
CWE-000 static int loop_change_fd ( struct loop_device * lo , struct block_device * bdev , unsigned int arg ) { struct file * file , * old_file ; struct inode * inode ; int error ; error = - ENXIO ; if ( lo -> lo_state != Lo_bound ) goto out ; error = - EINVAL ; if ( ! ( lo -> lo_flags & LO_FLAGS_READ_ONLY ) ) goto out ; error = - EBADF ; file = fget ( arg ) ; if ( ! file ) goto out ; <S2SV_StartBug> inode = file -> f_mapping -> host ; <S2SV_EndBug> old_file = lo -> lo_backing_file ; <S2SV_StartBug> error = - EINVAL ; <S2SV_EndBug> if ( ! S_ISREG ( inode -> i_mode ) && ! S_ISBLK ( inode -> i_mode ) ) goto out_putf ; if ( get_loop_size ( lo , file ) != get_loop_size ( lo , old_file ) ) goto out_putf ; error = loop_switch ( lo , file ) ; if ( error ) goto out_putf ; fput ( old_file ) ; if ( lo -> lo_flags & LO_FLAGS_PARTSCAN ) ioctl_by_bdev ( bdev , BLKRRPART , 0 ) ; return 0 ; out_putf : fput ( file ) ; out : return error ; }
<S2SV_ModStart> goto out ; error = loop_validate_file ( file , bdev ) ; if ( error ) goto out_putf ; <S2SV_ModStart> = - EINVAL <S2SV_ModEnd> ; if (
7,252
CWE-000 int main ( int argc , char * * argv ) { int inbox ; ( ( void ) argc ) ; ( ( void ) argv ) ; printf ( "[RMEM]<S2SV_blank>booting<S2SV_blank>up<S2SV_blank>server\\n" ) ; inbox = mailbox_create ( "/io1" ) ; printf ( "[RMEM]<S2SV_blank>server<S2SV_blank>alive\\n" ) ; int sync_fd = mppa_open ( "/mppa/sync/128:8" , O_WRONLY ) ; uint64_t mask = ( 1 << 0 ) ; mppa_write ( sync_fd , & mask , sizeof ( uint64_t ) ) ; mppa_close ( sync_fd ) ; timer_init ( ) ; while ( 1 ) { struct rmem_message msg ; mailbox_read ( inbox , & msg ) ; # ifdef DEBUG printf ( "[RMEM]<S2SV_blank>client<S2SV_blank>connected\\n" ) ; # endif # ifdef DEBUG printf ( "[RMEM]<S2SV_blank>serving<S2SV_blank>client\\n" ) ; # endif if ( msg . op == RMEM_WRITE ) { int inportal = portal_create ( "/io1" ) ; portal_allow ( inportal , msg . source ) ; portal_read ( inportal , & rmem [ msg . blknum ] , msg . size ) ; portal_unlink ( inportal ) ; } <S2SV_StartBug> else if ( MSG . OP == RMEM_READ ) <S2SV_EndBug> { int outportal = portal_open ( name_lookdown ( msg . source ) ) ; <S2SV_StartBug> portal_write ( inportal , & rmem [ msg . blknum ] , msg . size ) ; <S2SV_EndBug> <S2SV_StartBug> portal_close ( inportal ) ; <S2SV_EndBug> } # ifdef DEBUG printf ( "[RMEM]<S2SV_blank>client<S2SV_blank>disconnected\\n" ) ; # endif } mailbox_unlink ( inbox ) ; return ( EXIT_SUCCESS ) ; }
<S2SV_ModStart> else if ( msg . op <S2SV_ModEnd> == RMEM_READ ) <S2SV_ModStart> ; portal_write ( outportal <S2SV_ModEnd> , & rmem <S2SV_ModStart> ; portal_close ( outportal <S2SV_ModEnd> ) ; }
7,253
CWE-000 SQLITE_PRIVATE int sqlite3WalBeginReadTransaction ( Wal * pWal , int * pChanged ) { int rc ; int cnt = 0 ; # ifdef SQLITE_ENABLE_SNAPSHOT int bChanged = 0 ; WalIndexHdr * pSnapshot = pWal -> pSnapshot ; if ( pSnapshot && memcmp ( pSnapshot , & pWal -> hdr , sizeof ( WalIndexHdr ) ) != 0 ) { bChanged = 1 ; } # endif do { rc = walTryBeginRead ( pWal , pChanged , 0 , ++ cnt ) ; } while ( rc == WAL_RETRY ) ; testcase ( ( rc & 0xff ) == SQLITE_BUSY ) ; testcase ( ( rc & 0xff ) == SQLITE_IOERR ) ; testcase ( rc == SQLITE_PROTOCOL ) ; testcase ( rc == SQLITE_OK ) ; <S2SV_StartBug> # ifdef SQLITE_ENABLE_SNAPSHOT <S2SV_EndBug> if ( rc == SQLITE_OK ) { if ( pSnapshot && memcmp ( pSnapshot , & pWal -> hdr , sizeof ( WalIndexHdr ) ) != 0 ) { volatile WalCkptInfo * pInfo = walCkptInfo ( pWal ) ; assert ( pWal -> readLock > 0 || pWal -> hdr . mxFrame == 0 ) ; assert ( pInfo -> aReadMark [ pWal -> readLock ] <= pSnapshot -> mxFrame ) ; rc = walLockShared ( pWal , WAL_CKPT_LOCK ) ; if ( rc == SQLITE_OK ) { if ( ! memcmp ( pSnapshot -> aSalt , pWal -> hdr . aSalt , sizeof ( pWal -> hdr . aSalt ) ) && pSnapshot -> mxFrame >= pInfo -> nBackfillAttempted ) { assert ( pWal -> readLock > 0 ) ; memcpy ( & pWal -> hdr , pSnapshot , sizeof ( WalIndexHdr ) ) ; * pChanged = bChanged ; } else { rc = SQLITE_BUSY_SNAPSHOT ; } walUnlockShared ( pWal , WAL_CKPT_LOCK ) ; } if ( rc != SQLITE_OK ) { sqlite3WalEndReadTransaction ( pWal ) ; } } } # endif return rc ; }
<S2SV_ModStart> SQLITE_OK ) ; pWal -> nPriorFrame = pWal -> hdr . mxFrame ;
7,254
CWE-000 <S2SV_StartBug> static int fill_submatch_list ( int argc UNUSED , typval_T * argv , int argcount ) { <S2SV_EndBug> listitem_T * li ; int i ; char_u * s ; if ( argcount == 0 ) { return 0 ; } init_static_list ( ( staticList10_T * ) ( argv -> vval . v_list ) ) ; li = argv -> vval . v_list -> lv_first ; for ( i = 0 ; i < 10 ; i ++ ) { s = submatch_match -> startp [ i ] ; if ( s == NULL || submatch_match -> endp [ i ] == NULL ) { s = NULL ; } else { s = vim_strnsave ( s , ( int ) ( submatch_match -> endp [ i ] - s ) ) ; } li -> li_tv . v_type = VAR_STRING ; li -> li_tv . vval . v_string = s ; li = li -> li_next ; } return 1 ; }
<S2SV_ModStart> ( int argc <S2SV_ModEnd> , typval_T *
7,255
CWE-000 static int netdev_bridge_post_create ( NetDev * netdev , Link * link , sd_netlink_message * m ) { _cleanup_ ( sd_netlink_message_unrefp ) sd_netlink_message * req = NULL ; Bridge * b ; int r ; assert ( netdev ) ; b = BRIDGE ( netdev ) ; assert ( b ) ; r = sd_rtnl_message_new_link ( netdev -> manager -> rtnl , & req , RTM_NEWLINK , netdev -> ifindex ) ; if ( r < 0 ) return log_netdev_error_errno ( netdev , r , "Could<S2SV_blank>not<S2SV_blank>allocate<S2SV_blank>RTM_SETLINK<S2SV_blank>message:<S2SV_blank>%m" ) ; r = sd_netlink_message_set_flags ( req , NLM_F_REQUEST | NLM_F_ACK ) ; if ( r < 0 ) return log_link_error_errno ( link , r , "Could<S2SV_blank>not<S2SV_blank>set<S2SV_blank>netlink<S2SV_blank>flags:<S2SV_blank>%m" ) ; r = sd_netlink_message_open_container ( req , IFLA_LINKINFO ) ; if ( r < 0 ) return log_netdev_error_errno ( netdev , r , "Could<S2SV_blank>not<S2SV_blank>append<S2SV_blank>IFLA_PROTINFO<S2SV_blank>attribute:<S2SV_blank>%m" ) ; r = sd_netlink_message_open_container_union ( req , IFLA_INFO_DATA , netdev_kind_to_string ( netdev -> kind ) ) ; if ( r < 0 ) return log_netdev_error_errno ( netdev , r , "Could<S2SV_blank>not<S2SV_blank>append<S2SV_blank>IFLA_INFO_DATA<S2SV_blank>attribute:<S2SV_blank>%m" ) ; if ( b -> forward_delay != USEC_INFINITY ) { r = sd_netlink_message_append_u32 ( req , IFLA_BR_FORWARD_DELAY , usec_to_jiffies ( b -> forward_delay ) ) ; if ( r < 0 ) return log_netdev_error_errno ( netdev , r , "Could<S2SV_blank>not<S2SV_blank>append<S2SV_blank>IFLA_BR_FORWARD_DELAY<S2SV_blank>attribute:<S2SV_blank>%m" ) ; } if ( b -> hello_time > 0 ) { r = sd_netlink_message_append_u32 ( req , IFLA_BR_HELLO_TIME , usec_to_jiffies ( b -> hello_time ) ) ; if ( r < 0 ) return log_netdev_error_errno ( netdev , r , "Could<S2SV_blank>not<S2SV_blank>append<S2SV_blank>IFLA_BR_HELLO_TIME<S2SV_blank>attribute:<S2SV_blank>%m" ) ; } if ( b -> max_age > 0 ) { r = sd_netlink_message_append_u32 ( req , IFLA_BR_MAX_AGE , usec_to_jiffies ( b -> max_age ) ) ; if ( r < 0 ) return log_netdev_error_errno ( netdev , r , "Could<S2SV_blank>not<S2SV_blank>append<S2SV_blank>IFLA_BR_MAX_AGE<S2SV_blank>attribute:<S2SV_blank>%m" ) ; } if ( b -> ageing_time > 0 ) { r = sd_netlink_message_append_u32 ( req , IFLA_BR_AGEING_TIME , usec_to_jiffies ( b -> ageing_time ) ) ; if ( r < 0 ) return log_netdev_error_errno ( netdev , r , "Could<S2SV_blank>not<S2SV_blank>append<S2SV_blank>IFLA_BR_AGEING_TIME<S2SV_blank>attribute:<S2SV_blank>%m" ) ; } if ( b -> priority > 0 ) { r = sd_netlink_message_append_u16 ( req , IFLA_BR_PRIORITY , b -> priority ) ; if ( r < 0 ) return log_netdev_error_errno ( netdev , r , "Could<S2SV_blank>not<S2SV_blank>append<S2SV_blank>IFLA_BR_PRIORITY<S2SV_blank>attribute:<S2SV_blank>%m" ) ; } <S2SV_StartBug> if ( b -> default_pvid > 0 ) { <S2SV_EndBug> r = sd_netlink_message_append_u16 ( req , IFLA_BR_VLAN_DEFAULT_PVID , b -> default_pvid ) ; if ( r < 0 ) return log_netdev_error_errno ( netdev , r , "Could<S2SV_blank>not<S2SV_blank>append<S2SV_blank>IFLA_BR_VLAN_DEFAULT_PVID<S2SV_blank>attribute:<S2SV_blank>%m" ) ; } if ( b -> mcast_querier >= 0 ) { r = sd_netlink_message_append_u8 ( req , IFLA_BR_MCAST_QUERIER , b -> mcast_querier ) ; if ( r < 0 ) return log_netdev_error_errno ( netdev , r , "Could<S2SV_blank>not<S2SV_blank>append<S2SV_blank>IFLA_BR_MCAST_QUERIER<S2SV_blank>attribute:<S2SV_blank>%m" ) ; } if ( b -> mcast_snooping >= 0 ) { r = sd_netlink_message_append_u8 ( req , IFLA_BR_MCAST_SNOOPING , b -> mcast_snooping ) ; if ( r < 0 ) return log_netdev_error_errno ( netdev , r , "Could<S2SV_blank>not<S2SV_blank>append<S2SV_blank>IFLA_BR_MCAST_SNOOPING<S2SV_blank>attribute:<S2SV_blank>%m" ) ; } if ( b -> vlan_filtering >= 0 ) { r = sd_netlink_message_append_u8 ( req , IFLA_BR_VLAN_FILTERING , b -> vlan_filtering ) ; if ( r < 0 ) return log_netdev_error_errno ( netdev , r , "Could<S2SV_blank>not<S2SV_blank>append<S2SV_blank>IFLA_BR_VLAN_FILTERING<S2SV_blank>attribute:<S2SV_blank>%m" ) ; } if ( b -> stp >= 0 ) { r = sd_netlink_message_append_u32 ( req , IFLA_BR_STP_STATE , b -> stp ) ; if ( r < 0 ) return log_netdev_error_errno ( netdev , r , "Could<S2SV_blank>not<S2SV_blank>append<S2SV_blank>IFLA_BR_STP_STATE<S2SV_blank>attribute:<S2SV_blank>%m" ) ; } r = sd_netlink_message_close_container ( req ) ; if ( r < 0 ) return log_netdev_error_errno ( netdev , r , "Could<S2SV_blank>not<S2SV_blank>append<S2SV_blank>IFLA_LINKINFO<S2SV_blank>attribute:<S2SV_blank>%m" ) ; r = sd_netlink_message_close_container ( req ) ; if ( r < 0 ) return log_netdev_error_errno ( netdev , r , "Could<S2SV_blank>not<S2SV_blank>append<S2SV_blank>IFLA_INFO_DATA<S2SV_blank>attribute:<S2SV_blank>%m" ) ; r = sd_netlink_call_async ( netdev -> manager -> rtnl , req , netdev_bridge_set_handler , netdev , 0 , NULL ) ; if ( r < 0 ) return log_netdev_error_errno ( netdev , r , "Could<S2SV_blank>not<S2SV_blank>send<S2SV_blank>rtnetlink<S2SV_blank>message:<S2SV_blank>%m" ) ; netdev_ref ( netdev ) ; return r ; }
<S2SV_ModStart> b -> default_pvid != VLANID_INVALID <S2SV_ModEnd> ) { r
7,256
CWE-000 address_t synaptogenesis_dynamics_initialise ( address_t sdram_sp_address ) { log_info ( "SR<S2SV_blank>init." ) ; log_info ( "Registering<S2SV_blank>DMA<S2SV_blank>callback" ) ; simulation_dma_transfer_done_callback_on ( DMA_TAG_READ_SYNAPTIC_ROW_FOR_REWIRING , synaptic_row_restructure ) ; log_info ( "Callback<S2SV_blank>registered" ) ; int32_t * sp_word = ( int32_t * ) sdram_sp_address ; rewiring_data . p_rew = * sp_word ++ ; rewiring_data . weight = * sp_word ++ ; rewiring_data . delay = * sp_word ++ ; rewiring_data . s_max = * sp_word ++ ; rewiring_data . app_no_atoms = * sp_word ++ ; rewiring_data . low_atom = * sp_word ++ ; rewiring_data . high_atom = * sp_word ++ ; rewiring_data . machine_no_atoms = * sp_word ++ ; rewiring_data . grid_x = * sp_word ++ ; rewiring_data . grid_y = * sp_word ++ ; rewiring_data . p_elim_dep = * sp_word ++ ; rewiring_data . p_elim_pot = * sp_word ++ ; rewiring_data . shared_seed [ 0 ] = * sp_word ++ ; rewiring_data . shared_seed [ 1 ] = * sp_word ++ ; rewiring_data . shared_seed [ 2 ] = * sp_word ++ ; rewiring_data . shared_seed [ 3 ] = * sp_word ++ ; rewiring_data . pre_pop_info_table . no_pre_pops = * sp_word ++ ; if ( rewiring_data . pre_pop_info_table . no_pre_pops == 0 ) return NULL ; rewiring_data . pre_pop_info_table . subpop_info = ( subpopulation_info_t * ) sark_alloc ( rewiring_data . pre_pop_info_table . no_pre_pops , sizeof ( subpopulation_info_t ) ) ; uint32_t index ; uint16_t * half_word ; for ( index = 0 ; index < rewiring_data . pre_pop_info_table . no_pre_pops ; index ++ ) { half_word = ( uint16_t * ) sp_word ; rewiring_data . pre_pop_info_table . subpop_info [ index ] . no_pre_vertices = * half_word ++ ; rewiring_data . pre_pop_info_table . subpop_info [ index ] . sp_control = * half_word ++ ; sp_word = ( int32_t * ) half_word ; rewiring_data . pre_pop_info_table . subpop_info [ index ] . total_no_atoms = * sp_word ++ ; rewiring_data . pre_pop_info_table . subpop_info [ index ] . key_atom_info = ( int32_t * ) sark_alloc ( 2 * rewiring_data . pre_pop_info_table . subpop_info [ index ] . no_pre_vertices , sizeof ( int32_t ) ) ; int32_t subpop_index ; for ( subpop_index = 0 ; subpop_index < 2 * rewiring_data . pre_pop_info_table . subpop_info [ index ] . no_pre_vertices ; subpop_index ++ ) { rewiring_data . pre_pop_info_table . subpop_info [ index ] . key_atom_info [ subpop_index ++ ] = * sp_word ++ ; rewiring_data . pre_pop_info_table . subpop_info [ index ] . key_atom_info [ subpop_index ] = * sp_word ++ ; } } rewiring_data . size_ff_prob = * sp_word ++ ; rewiring_data . ff_probabilities = ( uint16_t * ) sark_alloc ( rewiring_data . size_ff_prob , sizeof ( uint16_t ) ) ; half_word = ( uint16_t * ) sp_word ; for ( index = 0 ; index < rewiring_data . size_ff_prob ; index ++ ) { rewiring_data . ff_probabilities [ index ] = * half_word ++ ; } sp_word = ( int32_t * ) half_word ; rewiring_data . size_lat_prob = * sp_word ++ ; rewiring_data . lat_probabilities = ( uint16_t * ) sark_alloc ( rewiring_data . size_lat_prob , sizeof ( uint16_t ) ) ; half_word = ( uint16_t * ) sp_word ; for ( index = 0 ; index < rewiring_data . size_lat_prob ; index ++ ) { <S2SV_StartBug> rewiring_data . lat_probabilities [ index ] = * half_word ++ ; <S2SV_EndBug> } validate_mars_kiss64_seed ( rewiring_data . shared_seed ) ; rewiring_dma_buffer . row = ( uint32_t * ) spin1_malloc ( rewiring_data . s_max * sizeof ( uint32_t ) ) ; if ( rewiring_dma_buffer . row == NULL ) { rt_error ( RTE_SWERR ) ; } # if STDP_ENABLED == 1 search_for_neuron = & find_plastic_neuron_with_id ; remove_neuron = & remove_plastic_neuron_at_offset ; add_neuron = & add_plastic_neuron_with_id ; number_of_connections_in_row = & synapse_row_num_plastic_controls ; # else search_for_neuron = & find_static_neuron_with_id ; remove_neuron = & remove_static_neuron_at_offset ; add_neuron = & add_static_neuron_with_id ; number_of_connections_in_row = & synapse_row_num_fixed_synapses ; # endif log_info ( "SR<S2SV_blank>init<S2SV_blank>complete." ) ; return ( address_t ) sp_word ; }
<S2SV_ModStart> = * half_word ++ ; } sp_word = ( int32_t * ) half_word ; rewiring_data . synaptic_capacity = ( uint32_t * ) sark_alloc ( rewiring_data . machine_no_atoms , sizeof ( uint32_t ) ) ; for ( index = 0 ; index < rewiring_data . machine_no_atoms ; index ++ ) { rewiring_data . synaptic_capacity [ index ] = * sp_word
7,257
CWE-000 void * expensive_call ( void * data ) { int oldtype ; pthread_setcanceltype ( PTHREAD_CANCEL_ASYNCHRONOUS , & oldtype ) ; <S2SV_StartBug> main1 ( ) ; <S2SV_EndBug> pthread_cond_signal ( & done ) ; return NULL ; }
<S2SV_ModStart> oldtype ) ; setbuf ( stdout , NULL ) ;
7,258
CWE-000 int job_get_after ( Job * j , Job * * * ret ) { _cleanup_free_ Job * * list = NULL ; size_t n = 0 , n_allocated = 0 ; Unit * other = NULL ; <S2SV_StartBug> Iterator i ; <S2SV_EndBug> assert ( j ) ; assert ( ret ) ; <S2SV_StartBug> SET_FOREACH ( other , j -> unit -> dependencies [ UNIT_BEFORE ] , i ) { <S2SV_EndBug> if ( ! other -> job ) continue ; if ( other -> job -> ignore_order ) continue ; if ( ! IN_SET ( other -> job -> type , JOB_START , JOB_VERIFY_ACTIVE , JOB_RELOAD ) ) continue ; if ( ! GREEDY_REALLOC ( list , n_allocated , n + 1 ) ) return - ENOMEM ; list [ n ++ ] = other -> job ; } if ( IN_SET ( j -> type , JOB_STOP , JOB_RESTART ) ) { <S2SV_StartBug> SET_FOREACH ( other , j -> unit -> dependencies [ UNIT_AFTER ] , i ) { <S2SV_EndBug> if ( ! other -> job ) continue ; if ( other -> job -> ignore_order ) continue ; if ( ! GREEDY_REALLOC ( list , n_allocated , n + 1 ) ) return - ENOMEM ; list [ n ++ ] = other -> job ; } } n = sort_job_list ( list , n ) ; * ret = list ; list = NULL ; return ( int ) n ; }
<S2SV_ModStart> = NULL ; void * v ; <S2SV_ModStart> ret ) ; HASHMAP_FOREACH_KEY ( v , <S2SV_ModEnd> other , j <S2SV_ModStart> ) ) { HASHMAP_FOREACH_KEY ( v , <S2SV_ModEnd> other , j
7,259
CWE-000 static ssize_t read_file_ring ( struct file * file , char __user * user_buf , size_t count , loff_t * ppos , struct ag71xx * ag , struct ag71xx_ring * ring , unsigned desc_reg ) { int ring_size = BIT ( ring -> order ) ; int ring_mask = ring_size - 1 ; char * buf ; unsigned int buflen ; unsigned int len = 0 ; unsigned long flags ; ssize_t ret ; int curr ; int dirty ; u32 desc_hw ; int i ; buflen = ( ring_size * DESC_PRINT_LEN ) ; buf = kmalloc ( buflen , GFP_KERNEL ) ; if ( ! buf ) return - ENOMEM ; len += snprintf ( buf + len , buflen - len , <S2SV_StartBug> "Idx<S2SV_blank>...<S2SV_blank>%-8s<S2SV_blank>%-8s<S2SV_blank>%-8s<S2SV_blank>%-8s<S2SV_blank>.<S2SV_blank>%-10s\\n" , <S2SV_EndBug> <S2SV_StartBug> "desc" , "next" , "data" , "ctrl" , "timestamp" ) ; <S2SV_EndBug> spin_lock_irqsave ( & ag -> lock , flags ) ; curr = ( ring -> curr & ring_mask ) ; dirty = ( ring -> dirty & ring_mask ) ; desc_hw = ag71xx_rr ( ag , desc_reg ) ; for ( i = 0 ; i < ring_size ; i ++ ) { <S2SV_StartBug> struct ag71xx_buf * ab = & ring -> buf [ i ] ; <S2SV_EndBug> struct ag71xx_desc * desc = ag71xx_ring_desc ( ring , i ) ; u32 desc_dma = ( ( u32 ) ring -> descs_dma ) + i * AG71XX_DESC_SIZE ; len += snprintf ( buf + len , buflen - len , <S2SV_StartBug> "%3d<S2SV_blank>%c%c%c<S2SV_blank>%08x<S2SV_blank>%08x<S2SV_blank>%08x<S2SV_blank>%08x<S2SV_blank>%c<S2SV_blank>%10lu\\n" , <S2SV_EndBug> i , ( i == curr ) ? 'C' : '<S2SV_blank>' , ( i == dirty ) ? 'D' : '<S2SV_blank>' , ( desc_hw == desc_dma ) ? 'H' : '<S2SV_blank>' , desc_dma , desc -> next , desc -> data , desc -> ctrl , <S2SV_StartBug> ( desc -> ctrl & DESC_EMPTY ) ? 'E' : '*' , <S2SV_EndBug> ab -> timestamp ) ; } spin_unlock_irqrestore ( & ag -> lock , flags ) ; ret = simple_read_from_buffer ( user_buf , count , ppos , buf , len ) ; kfree ( buf ) ; return ret ; }
<S2SV_ModStart> - len , "Idx<S2SV_blank>...<S2SV_blank>%-8s<S2SV_blank>%-8s<S2SV_blank>%-8s<S2SV_blank>%-8s<S2SV_blank>.\\n" <S2SV_ModEnd> , "desc" , <S2SV_ModStart> "data" , "ctrl" <S2SV_ModEnd> ) ; spin_lock_irqsave <S2SV_ModStart> ) { struct <S2SV_ModEnd> ag71xx_desc * desc <S2SV_ModStart> - len , "%3d<S2SV_blank>%c%c%c<S2SV_blank>%08x<S2SV_blank>%08x<S2SV_blank>%08x<S2SV_blank>%08x<S2SV_blank>%c\\n" <S2SV_ModEnd> , i , <S2SV_ModStart> 'E' : '*' <S2SV_ModEnd> ) ; }
7,260
CWE-000 static corto_int16 c_typeObject ( corto_walk_opt * s , corto_value * v , void * userData ) { c_typeWalk_t * data ; corto_type t ; corto_int16 result ; data = userData ; t = corto_type ( corto_value_typeof ( v ) ) ; if ( corto_instanceof ( corto_native_type_o , t ) ) { return 0 ; } data -> prefixComma = FALSE ; switch ( t -> kind ) { case CORTO_VOID : result = c_typeVoid ( s , v , userData ) ; break ; case CORTO_ANY : result = c_typeAny ( s , v , userData ) ; break ; case CORTO_PRIMITIVE : result = c_typePrimitive ( s , v , userData ) ; break ; case CORTO_COMPOSITE : result = c_typeComposite ( s , v , userData ) ; break ; case CORTO_COLLECTION : result = c_typeCollection ( s , v , userData ) ; break ; case CORTO_ITERATOR : result = c_typeIterator ( s , v , userData ) ; break ; default : corto_seterr ( "c_typeObject:<S2SV_blank>typeKind<S2SV_blank>\'%s\'<S2SV_blank>not<S2SV_blank>handled<S2SV_blank>by<S2SV_blank>code-generator." , corto_idof ( corto_enum_constant ( corto_typeKind_o , t -> kind ) ) ) ; goto error ; } g_fileWrite ( data -> header , "\\n" ) ; <S2SV_StartBug> if ( corto_checkAttr ( t , CORTO_ATTR_NAMED ) && corto_childof ( root_o , t ) ) { <S2SV_EndBug> corto_id id , localId , postfix , buildingMacro ; c_buildingMacro ( data -> g , buildingMacro ) ; g_localOid ( data -> g , t , localId ) ; c_specifierId ( data -> g , corto_type ( t ) , id , NULL , postfix ) ; g_fileWrite ( data -> header , "#ifdef<S2SV_blank>%s\\n" , buildingMacro ) ; g_fileWrite ( data -> header , "typedef<S2SV_blank>%s<S2SV_blank>%s;\\n" , id , localId ) ; g_fileWrite ( data -> header , "#endif\\n" ) ; <S2SV_StartBug> g_fileWrite ( data -> header , "\\n" ) ; <S2SV_EndBug> } return result ; error : return - 1 ; }
<S2SV_ModStart> ; if ( strcmp ( g_getAttribute ( data -> g , "bootstrap" ) , "true" ) ) { if ( <S2SV_ModStart> "\\n" ) ; }
7,261
CWE-000 BcStatus dc_parse_cond ( BcParse * p , BcVec * code , uint8_t inst ) { BcStatus s ; if ( ( s = dc_parse_inst ( p , code , inst ) ) ) return s ; if ( ( s = dc_parse_inst ( p , code , BC_INST_EXEC_COND ) ) ) return s ; if ( ( s = dc_parse_register ( p , code ) ) ) return s ; if ( ( s = bc_lex_next ( & p -> l ) ) ) return s ; if ( p -> l . t . t == BC_LEX_ELSE ) { if ( ( s = dc_parse_register ( p , code ) ) ) return s ; <S2SV_StartBug> if ( ( s = bc_lex_next ( & p -> l ) ) ) return s ; <S2SV_EndBug> } <S2SV_StartBug> else if ( ( s = bc_vec_pushByte ( code , BC_PARSE_STREND ) ) ) return s ; <S2SV_EndBug> <S2SV_StartBug> return dc_parse_inst ( p , code , BC_INST_POP ) ; <S2SV_EndBug> }
<S2SV_ModStart> return s ; <S2SV_ModEnd> s = bc_lex_next <S2SV_ModStart> -> l ) <S2SV_ModEnd> ; } else <S2SV_ModStart> ; } else <S2SV_ModEnd> s = bc_vec_pushByte <S2SV_ModStart> , BC_PARSE_STREND ) ; <S2SV_ModEnd> return s ; <S2SV_ModStart> return s ; <S2SV_ModEnd> } <S2SV_null> <S2SV_null>
7,262
CWE-000 bool func_call ( vm_t * vm , var_t * obj , var_t * funcVar , int argNum ) { var_t * env ; <S2SV_StartBug> if ( obj == NULL || obj == vm -> root ) <S2SV_EndBug> <S2SV_StartBug> env = var_new_func_from ( funcVar ) ; <S2SV_EndBug> else env = obj ; func_t * func = var_get_func ( funcVar ) ; int32_t i ; for ( i = argNum ; i > func -> args . size ; i -- ) { vm_pop ( vm ) ; } for ( i = ( int32_t ) func -> args . size - 1 ; i >= 0 ; i -- ) { const char * argName = ( const char * ) array_get ( & func -> args , i ) ; var_t * v = NULL ; if ( i >= argNum ) { v = var_new ( ) ; var_ref ( v ) ; } else { v = vm_pop2 ( vm ) ; } if ( v != NULL ) { var_add ( env , argName , v ) ; var_unref ( v , true ) ; } } if ( func -> owner != NULL ) { node_t * superN = var_find ( func -> owner , SUPER ) ; if ( superN != NULL ) var_add ( env , SUPER , superN -> var ) ; } scope_t * sc = scope_new ( env , vm -> pc ) ; vm_push_scope ( vm , sc ) ; if ( func -> native != NULL ) { var_t * ret = func -> native ( vm , env , func -> data ) ; if ( ret == NULL ) ret = var_new ( ) ; vm_push ( vm , ret ) ; vm_pop_scope ( vm ) ; return true ; } vm -> pc = func -> pc ; vm_run_code ( vm ) ; return true ; }
<S2SV_ModStart> -> root ) { <S2SV_ModStart> funcVar ) ; }
7,263
CWE-000 void handleTimerInterrupt ( int segment , int sp ) { int i = mod ( currentProcess + 1 , 8 ) ; int j = 0 ; <S2SV_StartBug> int g ; <S2SV_EndBug> timer ++ ; if ( timer == 100 ) { timer = 0 ; Processes [ currentProcess ] [ 1 ] = sp ; while ( ! Processes [ i ] [ 0 ] ) { i = mod ( i + 1 , 8 ) ; <S2SV_StartBug> if ( ! i ) <S2SV_EndBug> i ++ ; } if ( i == currentProcess ) { returnFromTimer ( segment , sp ) ; <S2SV_StartBug> return ; <S2SV_EndBug> } currentProcess = i ; g = ( currentProcess + 2 ) * 0x1000 ; returnFromTimer ( g , Processes [ currentProcess ] [ 1 ] ) ; return ; } returnFromTimer ( segment , sp ) ; }
<S2SV_ModStart> ; int g ; int loop = 0 <S2SV_ModStart> 8 ) ; loop ++ ; if ( loop == 8 ) { currentProcess = - 1 ; <S2SV_ModEnd> returnFromTimer ( segment <S2SV_ModStart> ; return ; }
7,264
CWE-000 static int process_req ( const lsi_session_t * session ) { const char * qs , * uri ; int qs_len , uri_len , timer_id_remove , timer_id_leave ; if ( NULL == session ) { LSM_ERR ( ( & MNAME ) , session , "Session<S2SV_blank>is<S2SV_blank>empty\\n" ) ; return LS_FAIL ; } timer_id_remove = g_api -> set_timer ( 10 , 1 , ontimer , session ) ; timer_id_leave = g_api -> set_timer ( 10 , 1 , ontimer , session ) ; if ( ( LS_FAIL != timer_id_remove ) || ( LS_FAIL != timer_id_leave ) ) { LSM_ERR ( ( & MNAME ) , session , "Was<S2SV_blank>able<S2SV_blank>to<S2SV_blank>set<S2SV_blank>up<S2SV_blank>timer(s)<S2SV_blank>%d<S2SV_blank>%d\\n" , timer_id_remove , timer_id_leave ) ; } if ( LS_FAIL == g_api -> set_req_wait_full_body ( session ) ) LSM_ERR ( ( & MNAME ) , session , "Failed<S2SV_blank>to<S2SV_blank>set<S2SV_blank>req<S2SV_blank>wait<S2SV_blank>full<S2SV_blank>body\\n" ) ; if ( LS_FAIL == g_api -> set_resp_wait_full_body ( session ) ) LSM_ERR ( ( & MNAME ) , session , "Failed<S2SV_blank>to<S2SV_blank>set<S2SV_blank>resp<S2SV_blank>wait<S2SV_blank>full<S2SV_blank>body\\n" ) ; <S2SV_StartBug> if ( LS_FAIL == g_api -> set_resp_buffer_gzip_flag ( session , 0 ) ) <S2SV_EndBug> LSM_ERR ( ( & MNAME ) , session , "Failed<S2SV_blank>to<S2SV_blank>set<S2SV_blank>no<S2SV_blank>gzip\\n" ) ; if ( LS_FAIL == g_api -> set_force_mime_type ( session , NULL ) ) LSM_ERR ( ( & MNAME ) , session , "Failed<S2SV_blank>to<S2SV_blank>set<S2SV_blank>force<S2SV_blank>mime<S2SV_blank>type<S2SV_blank>to<S2SV_blank>null\\n" ) ; qs = g_api -> get_req_query_string ( session , & qs_len ) ; uri = g_api -> get_req_uri ( session , & uri_len ) ; const char * redir_int_qs = "new=qs" ; if ( ( strlen ( redir_int_qs ) != qs_len ) || ( strncmp ( redir_int_qs , qs , qs_len ) ) ) { if ( LS_OK == g_api -> set_uri_qs ( session , LSI_URL_REDIRECT_INTERNAL | LSI_URL_QS_SET , uri , uri_len , redir_int_qs , strlen ( redir_int_qs ) ) ) { return 0 ; } } else { if ( LS_FAIL == g_api -> set_uri_qs ( session , LSI_URL_REWRITE | LSI_URL_QS_APPEND , "newuri" , 6 , redir_int_qs , strlen ( redir_int_qs ) ) ) { LSM_ERR ( ( & MNAME ) , session , "failed<S2SV_blank>to<S2SV_blank>rewrite<S2SV_blank>uri\\n" ) ; } } g_api -> set_status_code ( session , 200 ) ; g_api -> set_resp_header ( session , LSI_RSPHDR_CONTENT_TYPE , NULL , 0 , "text/html" , 9 , LSI_HEADEROP_SET ) ; setresphdrs ( session ) ; if ( ! g_api -> is_resp_headers_sent ( session ) ) g_api -> send_resp_headers ( session ) ; trysendfile ( session ) ; if ( timer_id_remove != LS_FAIL ) g_api -> remove_timer ( timer_id_remove ) ; g_api -> end_resp ( session ) ; return 0 ; }
<S2SV_ModStart> == g_api -> set_resp_buffer_compress_method <S2SV_ModEnd> ( session ,
7,265
CWE-000 static inline int access_error ( unsigned long error_code , struct vm_area_struct * vma ) { bool foreign = false ; <S2SV_StartBug> if ( error_code & PF_PK ) <S2SV_EndBug> return 1 ; <S2SV_StartBug> if ( ! arch_vma_access_permitted ( vma , ( error_code & PF_WRITE ) , <S2SV_EndBug> <S2SV_StartBug> ( error_code & PF_INSTR ) , foreign ) ) <S2SV_EndBug> return 1 ; <S2SV_StartBug> if ( error_code & PF_WRITE ) { <S2SV_EndBug> if ( unlikely ( ! ( vma -> vm_flags & VM_WRITE ) ) ) return 1 ; return 0 ; } <S2SV_StartBug> if ( unlikely ( error_code & PF_PROT ) ) <S2SV_EndBug> return 1 ; if ( unlikely ( ! ( vma -> vm_flags & ( VM_READ | VM_EXEC | VM_WRITE ) ) ) ) return 1 ; return 0 ; }
<S2SV_ModStart> ( error_code & X86_PF_PK <S2SV_ModEnd> ) return 1 <S2SV_ModStart> ( error_code & X86_PF_WRITE <S2SV_ModEnd> ) , ( <S2SV_ModStart> ( error_code & X86_PF_INSTR <S2SV_ModEnd> ) , foreign <S2SV_ModStart> ( error_code & X86_PF_WRITE <S2SV_ModEnd> ) { if <S2SV_ModStart> ( error_code & X86_PF_PROT <S2SV_ModEnd> ) ) return
7,266
CWE-000 void TASK_FUN_HS_DELAY_1 ( void * pdata ) { uint8_t err ; while ( 1 ) { OSSemPend ( sem_hs1 , 0 , & err ) ; <S2SV_StartBug> while ( 1 ) <S2SV_EndBug> { <S2SV_StartBug> if ( ( RTC_GetCounter ( ) - HS_Pre_ms_1 ) > HS_1_DELAY ) break ; <S2SV_EndBug> delay_ms ( 100 ) ; } User_Handle_Input ( HS1 , BRT_MIN , DEFAULT_STEP ) ; <S2SV_StartBug> HS_Pre_ms_1 = 0 ; <S2SV_EndBug> } <S2SV_StartBug> } <S2SV_EndBug>
<S2SV_ModStart> ; while ( HS_Pin1 == IS_NOBODY <S2SV_ModEnd> ) { if <S2SV_ModStart> > HS_1_DELAY ) { <S2SV_ModEnd> User_Handle_Input ( HS1 <S2SV_ModStart> DEFAULT_STEP ) ; break ; } delay_ms ( 100 ) <S2SV_ModEnd> ; } } <S2SV_ModStart> ; } } }
7,267
CWE-000 static int init ( int argc , char * * argv ) { struct sio_par par ; int i , found , opt , round , rate , bufsz ; const char * devname , * tmp ; sio_initpar ( & par ) ; par . rate = 44100 ; par . pchan = 2 ; par . bits = 16 ; par . bps = SIO_BPS ( par . bits ) ; par . le = 1 ; par . sig = 1 ; <S2SV_StartBug> if ( ! config_lookup_string ( config . cfg , "sndio.device" , & devname ) ) <S2SV_EndBug> devname = SIO_DEVANY ; if ( config_lookup_int ( config . cfg , "sndio.rate" , & rate ) ) { if ( rate % 44100 == 0 && rate >= 44100 && rate <= 352800 ) { par . rate = rate ; } else { die ( "sndio:<S2SV_blank>output<S2SV_blank>rate<S2SV_blank>must<S2SV_blank>be<S2SV_blank>a<S2SV_blank>multiple<S2SV_blank>of<S2SV_blank>44100<S2SV_blank>and<S2SV_blank>44100<S2SV_blank><=<S2SV_blank>rate<S2SV_blank><=<S2SV_blank>" "352800" ) ; } } if ( config_lookup_int ( config . cfg , "sndio.bufsz" , & bufsz ) ) { if ( bufsz > 0 ) { par . appbufsz = bufsz ; } else { die ( "sndio:<S2SV_blank>bufsz<S2SV_blank>must<S2SV_blank>be<S2SV_blank>><S2SV_blank>0" ) ; } } if ( config_lookup_int ( config . cfg , "sndio.round" , & round ) ) { if ( round > 0 ) { par . round = round ; } else { die ( "sndio:<S2SV_blank>round<S2SV_blank>must<S2SV_blank>be<S2SV_blank>><S2SV_blank>0" ) ; } } if ( config_lookup_string ( config . cfg , "sndio.format" , & tmp ) ) { for ( i = 0 , found = 0 ; i < sizeof ( formats ) / sizeof ( formats [ 0 ] ) ; i ++ ) { if ( strcmp ( formats [ i ] . name , tmp ) == 0 ) { config . output_format = formats [ i ] . fmt ; found = 1 ; break ; } } if ( ! found ) die ( "Invalid<S2SV_blank>output<S2SV_blank>format<S2SV_blank>\\"%s\\".<S2SV_blank>Should<S2SV_blank>be<S2SV_blank>one<S2SV_blank>of:<S2SV_blank>s8,<S2SV_blank>u8,<S2SV_blank>s16,<S2SV_blank>s24,<S2SV_blank>" "s24le3,<S2SV_blank>s24be3,<S2SV_blank>s32" , tmp ) ; } <S2SV_StartBug> optind = 1 ; <S2SV_EndBug> argv -- ; argc ++ ; while ( ( opt = getopt ( argc , argv , "d:" ) ) > 0 ) { switch ( opt ) { case 'd' : devname = optarg ; break ; default : help ( ) ; die ( "Invalid<S2SV_blank>audio<S2SV_blank>option<S2SV_blank>-%c<S2SV_blank>specified" , opt ) ; } } if ( optind < argc ) die ( "Invalid<S2SV_blank>audio<S2SV_blank>argument:<S2SV_blank>%s" , argv [ optind ] ) ; pthread_mutex_lock ( & sndio_mutex ) ; debug ( 1 , "Output<S2SV_blank>device<S2SV_blank>name<S2SV_blank>is<S2SV_blank>\\"%s\\"." , devname ) ; hdl = sio_open ( devname , SIO_PLAY , 0 ) ; if ( ! hdl ) die ( "sndio:<S2SV_blank>cannot<S2SV_blank>open<S2SV_blank>audio<S2SV_blank>device" ) ; written = played = 0 ; for ( i = 0 ; i < sizeof ( formats ) / sizeof ( formats [ 0 ] ) ; i ++ ) { if ( formats [ i ] . fmt == config . output_format ) { par . bits = formats [ i ] . bits ; par . bps = formats [ i ] . bps ; par . sig = formats [ i ] . sig ; par . le = formats [ i ] . le ; break ; } } if ( ! sio_setpar ( hdl , & par ) || ! sio_getpar ( hdl , & par ) ) die ( "sndio:<S2SV_blank>failed<S2SV_blank>to<S2SV_blank>set<S2SV_blank>audio<S2SV_blank>parameters" ) ; for ( i = 0 , found = 0 ; i < sizeof ( formats ) / sizeof ( formats [ 0 ] ) ; i ++ ) { if ( formats [ i ] . bits == par . bits && formats [ i ] . bps == par . bps && formats [ i ] . sig == par . sig && formats [ i ] . le == par . le ) { config . output_format = formats [ i ] . fmt ; found = 1 ; break ; } } if ( ! found ) die ( "sndio:<S2SV_blank>failed<S2SV_blank>to<S2SV_blank>negotiate<S2SV_blank>audio<S2SV_blank>parameters" ) ; framesize = par . bps * par . pchan ; config . output_rate = par . rate ; config . audio_backend_buffer_desired_length = 1.0 * par . bufsz / par . rate ; config . audio_backend_latency_offset = 0 ; sio_onmove ( hdl , onmove_cb , NULL ) ; pthread_mutex_unlock ( & sndio_mutex ) ; return 0 ; }
<S2SV_ModStart> = 1 ; devname = SIO_DEVANY ; if ( config . cfg != NULL ) { <S2SV_ModStart> ) ; } }
7,268
CWE-000 void WiFi_WaitForLastTask ( void ) { int32_t remaining ; # ifdef WIFI_DISPLAY_RESPTIME WiFi_CommandHeader * tx_cmd = ( WiFi_CommandHeader * ) wifi_buffer_command ; # endif while ( ( wifi_tx_command . busy && wifi_tx_command . ready == 0 ) || wifi_tx_packet . busy ) { if ( wifi_tx_command . busy && wifi_tx_command . ready == 0 ) { remaining = wifi_tx_command . start_time + WIFI_DEFAULT_TIMEOUT_CMDACK - sys_now ( ) + 1 ; if ( remaining > 0 ) { if ( WiFi_Wait ( WIFI_INTSTATUS_DNLD , remaining ) ) { # ifdef WIFI_DISPLAY_RESPTIME printf ( "--<S2SV_blank>CMD<S2SV_blank>0x%04x<S2SV_blank>ACK<S2SV_blank>at<S2SV_blank>%ldms\\n" , tx_cmd -> cmd_code , sys_now ( ) - wifi_tx_command . start_time ) ; # endif } } wifi_tx_command . ready = 1 ; } if ( wifi_tx_packet . busy ) { remaining = wifi_tx_packet . start_time + wifi_tx_packet . timeout - sys_now ( ) + 1 ; if ( remaining > 0 && WiFi_Wait ( WIFI_INTSTATUS_DNLD , remaining ) ) { # ifdef WIFI_DISPLAY_RESPTIME printf ( "--<S2SV_blank>Packet<S2SV_blank>ACK<S2SV_blank>at<S2SV_blank>%ldms\\n" , sys_now ( ) - wifi_tx_packet . start_time ) ; # endif WiFi_TxBufferComplete ( & wifi_tx_packet , wifi_buffer_packet , WIFI_STATUS_OK ) ; } else { <S2SV_StartBug> WiFi_CheckTxBufferRetry ( & wifi_tx_packet , wifi_buffer_packet ) ; <S2SV_EndBug> } } } }
<S2SV_ModStart> } else { ( void )
7,269
CWE-000 static void place ( void * bp , size_t asize ) { size_t size = GET_SIZE ( HDRP ( bp ) ) ; size_t prev_alloc = GET_PALLOC ( HDRP ( bp ) ) ; # ifdef DEBUG printf ( "Calling<S2SV_blank>place<S2SV_blank>with<S2SV_blank>bp<S2SV_blank>=<S2SV_blank>%p<S2SV_blank>and<S2SV_blank>asize<S2SV_blank>=<S2SV_blank>%d\\n" , bp , asize ) ; printf ( "\\tcurrent<S2SV_blank>block<S2SV_blank>has<S2SV_blank>size<S2SV_blank>=<S2SV_blank>%d<S2SV_blank>bytes<S2SV_blank>and<S2SV_blank>PINSUSE_BIT<S2SV_blank>=<S2SV_blank>%d\\n" , size , prev_alloc ) ; # endif <S2SV_StartBug> if ( size >= asize + MIN_BIGBLK_SIZE ) { <S2SV_EndBug> PUT ( HDRP ( bp ) , PACK ( asize , prev_alloc , 1 ) ) ; char * next_bp = NEXT_BLKP ( bp ) ; PUT ( HDRP ( next_bp ) , PACK ( size - asize , 1 , 0 ) ) ; <S2SV_StartBug> PUT ( FTRP ( next_bp ) , PACK ( size - asize , 1 , 0 ) ) ; <S2SV_EndBug> insert_into_list ( next_bp ) ; # ifdef DEBUG printf ( "\\tfirst<S2SV_blank>block<S2SV_blank>with<S2SV_blank>%d<S2SV_blank>bytes,<S2SV_blank>second<S2SV_blank>block<S2SV_blank>with<S2SV_blank>%d<S2SV_blank>bytes\\n" , GET_SIZE ( HDRP ( bp ) ) , GET_SIZE ( HDRP ( next_bp ) ) ) ; printf ( "\\tsecond<S2SV_blank>at<S2SV_blank>adress<S2SV_blank>%p,<S2SV_blank>PINUSE_BIT<S2SV_blank>=<S2SV_blank>%d\\n\\n" , next_bp , GET_PALLOC ( HDRP ( next_bp ) ) ) ; # endif } else { PUT ( HDRP ( bp ) , PACK ( size , prev_alloc , 1 ) ) ; char * next_bp = NEXT_BLKP ( bp ) ; size_t next_size = GET_SIZE ( HDRP ( next_bp ) ) ; size_t next_alloc = GET_ALLOC ( HDRP ( next_bp ) ) ; PUT ( HDRP ( next_bp ) , PACK ( next_size , 1 , next_alloc ) ) ; # ifdef DEBUG printf ( "\\tonly<S2SV_blank>one<S2SV_blank>block<S2SV_blank>with<S2SV_blank>%d<S2SV_blank>bytes\\n\\n" , GET_SIZE ( HDRP ( bp ) ) ) ; # endif } }
<S2SV_ModStart> >= asize + MIN_BLK_SIZE <S2SV_ModEnd> ) { PUT <S2SV_ModStart> ) ) ; # ifdef DEBUG printf ( "\\tfirst<S2SV_blank>block<S2SV_blank>with<S2SV_blank>%d<S2SV_blank>bytes,<S2SV_blank>second<S2SV_blank>block<S2SV_blank>with<S2SV_blank>%d<S2SV_blank>bytes\\n" , GET_SIZE ( HDRP ( bp ) ) , GET_SIZE ( HDRP ( next_bp ) ) ) ; printf ( "\\tsecond<S2SV_blank>at<S2SV_blank>adress<S2SV_blank>%p,<S2SV_blank>PINUSE_BIT<S2SV_blank>=<S2SV_blank>%d\\n\\n" , next_bp , GET_PALLOC ( HDRP ( next_bp ) ) ) ; # endif
7,270
CWE-000 void __nd_device_register ( struct device * dev ) { if ( ! dev ) return ; if ( is_nd_region ( dev ) ) set_dev_node ( dev , to_nd_region ( dev ) -> numa_node ) ; dev -> bus = & nvdimm_bus_type ; <S2SV_StartBug> get_device ( dev ) ; <S2SV_EndBug> async_schedule_domain ( nd_async_device_register , dev , & nd_async_domain ) ; }
<S2SV_ModStart> & nvdimm_bus_type ; if ( dev -> parent ) get_device ( dev -> parent ) ;
7,271
CWE-000 void ft_putendl_fd ( char const * s , int fd ) <S2SV_StartBug> { <S2SV_EndBug> ft_putstr_fd ( s , fd ) ; ft_putchar_fd ( '\\n' , fd ) ; }
<S2SV_ModStart> fd ) { if ( ! s ) return ;
7,272
CWE-000 void InitBags ( TNumAllocFuncBags alloc_func , UInt initial_size , TNumStackFuncBags stack_func , Bag * stack_bottom , UInt stack_align , UInt cache_size , UInt dirty , TNumAbortFuncBags abort_func ) { UInt i ; # ifndef BOEHM_GC Bag * p ; ClearGlobalBags ( ) ; WarnInitGlobalBag = 0 ; AllocFuncBags = alloc_func ; AbortFuncBags = abort_func ; StackFuncBags = stack_func ; StackBottomBags = stack_bottom ; StackAlignBags = stack_align ; # if ITANIUM ItaniumSpecialMarkingInit ( ) ; # endif initial_size = ( initial_size + 511 ) & ~ ( 511 ) ; MptrBags = ( * AllocFuncBags ) ( initial_size , 1 ) ; if ( MptrBags == 0 ) ( * AbortFuncBags ) ( "cannot<S2SV_blank>get<S2SV_blank>storage<S2SV_blank>for<S2SV_blank>the<S2SV_blank>initial<S2SV_blank>workspace." ) ; EndBags = MptrBags + 1024 * ( initial_size / sizeof ( Bag * ) ) ; FreeMptrBags = ( Bag ) MptrBags ; for ( p = MptrBags ; p + 2 * ( SIZE_MPTR_BAGS ) <= MptrBags + 1024 * initial_size / 8 / sizeof ( Bag * ) ; p += SIZE_MPTR_BAGS ) { * p = ( Bag ) ( p + SIZE_MPTR_BAGS ) ; } OldBags = MptrBags + 1024 * initial_size / 8 / sizeof ( Bag * ) ; YoungBags = OldBags ; AllocBags = OldBags ; CacheSizeBags = cache_size ; if ( ! CacheSizeBags ) { AllocSizeBags = 256 ; StopBags = EndBags ; } else { AllocSizeBags = ( CacheSizeBags + 1023 ) / 1024 ; StopBags = AllocBags + WORDS_BAG ( 1024 * AllocSizeBags ) <= EndBags ? AllocBags + WORDS_BAG ( 1024 * AllocSizeBags ) : EndBags ; } DirtyBags = dirty ; for ( i = 0 ; i < 255 ; i ++ ) { TabMarkFuncBags [ i ] = MarkAllSubBagsDefault ; } ChangedBags = 0 ; # else for ( i = 0 ; i < 255 ; i ++ ) { TabMarkFuncBags [ i ] = MarkAllSubBagsDefault ; TabMarkTypeBags [ i ] = - 1 ; } # ifndef DISABLE_GC GC_set_all_interior_pointers ( 0 ) ; GC_init ( ) ; TLAllocatorInit ( ) ; GC_register_displacement ( 0 ) ; GC_register_displacement ( HEADER_SIZE * sizeof ( Bag ) ) ; initial_size *= 1024 ; if ( GC_get_heap_size ( ) < initial_size ) GC_expand_hp ( initial_size - GC_get_heap_size ( ) ) ; if ( SyStorKill ) GC_set_max_heap_size ( SyStorKill * 1024 ) ; AddGCRoots ( ) ; CreateMainRegion ( ) ; for ( i = 0 ; i <= MAX_GC_PREFIX_DESC ; i ++ ) { BuildPrefixGCDescriptor ( i ) ; <S2SV_StartBug> GC_generic_malloc ( ( HEADER_SIZE + i ) * sizeof ( UInt ) , GCKind [ i ] ) ; <S2SV_EndBug> } # endif # endif }
<S2SV_ModStart> UInt ) , GCMKind <S2SV_ModEnd> [ i ]
7,273
CWE-000 int sys_getdirentry ( int fd , userptr_t buf , size_t buflen , int * retval ) { if ( fd < 0 || fd >= __OPEN_MAX ) { return EBADF ; } <S2SV_StartBug> if ( curthread -> t_filetable [ fd ] == NULL ) <S2SV_EndBug> { return EBADF ; } <S2SV_StartBug> if ( buf == NULL || curthread -> t_filetable [ fd ] -> vnodes == NULL ) <S2SV_EndBug> { return EFAULT ; } struct uio user_uio ; struct iovec user_iov ; struct vnode * file_vnode ; int result ; <S2SV_StartBug> file_vnode = curthread -> t_filetable [ fd ] -> vnodes ; <S2SV_EndBug> if ( ! file_vnode ) { * retval = - 1 ; return EBADF ; } <S2SV_StartBug> mk_useruio ( & user_iov , & user_uio , buf , buflen , curthread -> t_filetable [ fd ] -> offsets , UIO_READ ) ; <S2SV_EndBug> result = VOP_GETDIRENTRY ( file_vnode , & user_uio ) ; if ( result ) { <S2SV_StartBug> * retval = - 1 ; <S2SV_EndBug> return retval ; } * retval = buflen - user_uio . uio_resid ; <S2SV_StartBug> curthread -> t_filetable [ fd ] -> offsets = user_uio . uio_offset ; <S2SV_EndBug> return 0 ; }
<S2SV_ModStart> curthread -> t_filetable -> file <S2SV_ModStart> curthread -> t_filetable -> file [ fd ] -> vn <S2SV_ModEnd> == NULL ) <S2SV_ModStart> curthread -> t_filetable -> file [ fd ] -> vn <S2SV_ModEnd> ; if ( <S2SV_ModStart> curthread -> t_filetable -> file [ fd ] -> offset <S2SV_ModEnd> , UIO_READ ) <S2SV_ModStart> result ) { return EBADF <S2SV_ModEnd> ; } * <S2SV_ModStart> curthread -> t_filetable -> file [ fd ] -> offset <S2SV_ModEnd> = user_uio .
7,274
CWE-000 void init_cache ( ) { unsigned int i ; __c = ( Cache * ) malloc ( sizeof ( Cache ) ) ; __c -> size = MAX_BUCKETS ; __c -> buckets = malloc ( ( __c -> size ) * sizeof ( Bucket * ) ) ; for ( i = 0 ; i < __c -> size ; ++ i ) { __c -> buckets [ i ] = malloc ( sizeof ( Bucket ) ) ; __c -> buckets [ i ] -> head = NULL ; <S2SV_StartBug> } <S2SV_EndBug> }
<S2SV_ModStart> = NULL ; __c -> buckets [ i ] -> size = 0 ;
7,275
CWE-000 <S2SV_StartBug> int nlbuffer_write ( struct nlcore_buffer * buffer , void * data , size_t data_size ) <S2SV_EndBug> { if ( buffer -> len + data_size > buffer -> capacity ) { log_debug ( "The<S2SV_blank>buffer\'s<S2SV_blank>storage<S2SV_blank>capacity<S2SV_blank>has<S2SV_blank>been<S2SV_blank>surpassed." ) ; return 1 ; } memcpy ( buffer -> data + buffer -> len , data , data_size ) ; buffer -> len += data_size ; return 0 ; }
<S2SV_ModStart> buffer , void const
7,276
CWE-000 static void log_fr_stream_id_blocked ( ngtcp2_log * log , const ngtcp2_pkt_hd * hd , const ngtcp2_stream_id_blocked * fr , const char * dir ) { log_printf ( log , <S2SV_StartBug> ( NGTCP2_LOG_PKT , "<S2SV_blank>STREAM_ID_BLOCKED(0x%02x)<S2SV_blank>id=0x%" PRIx64 <S2SV_EndBug> "<S2SV_blank>offset=%" PRIu64 "\\n" ) , NGTCP2_LOG_FRM_HD_FIELDS ( dir ) , fr -> type , fr -> stream_id ) ; }
<S2SV_ModStart> , ( NGTCP2_LOG_PKT <S2SV_ModEnd> "<S2SV_blank>STREAM_ID_BLOCKED(0x%02x)<S2SV_blank>id=0x%" PRIx64 "<S2SV_blank>offset=%"
7,277
CWE-000 static struct switchtec_dev * stdev_create ( struct pci_dev * pdev ) { struct switchtec_dev * stdev ; int minor ; struct device * dev ; struct cdev * cdev ; int rc ; stdev = kzalloc_node ( sizeof ( * stdev ) , GFP_KERNEL , dev_to_node ( & pdev -> dev ) ) ; if ( ! stdev ) return ERR_PTR ( - ENOMEM ) ; stdev -> alive = true ; stdev -> pdev = pdev ; INIT_LIST_HEAD ( & stdev -> mrpc_queue ) ; mutex_init ( & stdev -> mrpc_mutex ) ; stdev -> mrpc_busy = 0 ; INIT_WORK ( & stdev -> mrpc_work , mrpc_event_work ) ; INIT_DELAYED_WORK ( & stdev -> mrpc_timeout , mrpc_timeout_work ) ; init_waitqueue_head ( & stdev -> event_wq ) ; atomic_set ( & stdev -> event_cnt , 0 ) ; dev = & stdev -> dev ; device_initialize ( dev ) ; dev -> class = switchtec_class ; dev -> parent = & pdev -> dev ; dev -> groups = switchtec_device_groups ; dev -> release = stdev_release ; minor = ida_simple_get ( & switchtec_minor_ida , 0 , 0 , GFP_KERNEL ) ; if ( minor < 0 ) { rc = minor ; goto err_put ; } dev -> devt = MKDEV ( MAJOR ( switchtec_devt ) , minor ) ; dev_set_name ( dev , "switchtec%d" , minor ) ; cdev = & stdev -> cdev ; cdev_init ( cdev , & switchtec_fops ) ; cdev -> owner = THIS_MODULE ; <S2SV_StartBug> cdev -> kobj . parent = & dev -> kobj ; <S2SV_EndBug> return stdev ; err_put : put_device ( & stdev -> dev ) ; return ERR_PTR ( rc ) ; }
<S2SV_ModStart> = THIS_MODULE ; <S2SV_ModEnd> return stdev ;
7,278
CWE-000 struct netif * netif_add ( struct netif * netif , # if LWIP_IPV4 const ip4_addr_t * ipaddr , const ip4_addr_t * netmask , const ip4_addr_t * gw , # endif void * state , netif_init_fn init , netif_input_fn input ) { # if LWIP_IPV6 s8_t i ; # endif LWIP_ASSERT_CORE_LOCKED ( ) ; # if LWIP_SINGLE_NETIF if ( netif_default != NULL ) { LWIP_ASSERT ( "single<S2SV_blank>netif<S2SV_blank>already<S2SV_blank>set" , 0 ) ; return NULL ; } # endif LWIP_ASSERT ( "No<S2SV_blank>init<S2SV_blank>function<S2SV_blank>given" , init != NULL ) ; # if LWIP_IPV4 if ( ipaddr == NULL ) { ipaddr = ip_2_ip4 ( IP4_ADDR_ANY ) ; } if ( netmask == NULL ) { netmask = ip_2_ip4 ( IP4_ADDR_ANY ) ; } if ( gw == NULL ) { gw = ip_2_ip4 ( IP4_ADDR_ANY ) ; } ip_addr_set_zero_ip4 ( & netif -> ip_addr ) ; ip_addr_set_zero_ip4 ( & netif -> netmask ) ; ip_addr_set_zero_ip4 ( & netif -> gw ) ; netif -> output = netif_null_output_ip4 ; # endif # if LWIP_IPV6 for ( i = 0 ; i < LWIP_IPV6_NUM_ADDRESSES ; i ++ ) { ip_addr_set_zero_ip6 ( & netif -> ip6_addr [ i ] ) ; netif -> ip6_addr_state [ i ] = IP6_ADDR_INVALID ; # if LWIP_IPV6_ADDRESS_LIFETIMES netif -> ip6_addr_valid_life [ i ] = IP6_ADDR_LIFE_STATIC ; netif -> ip6_addr_pref_life [ i ] = IP6_ADDR_LIFE_STATIC ; # endif } netif -> output_ip6 = netif_null_output_ip6 ; # endif NETIF_SET_CHECKSUM_CTRL ( netif , NETIF_CHECKSUM_ENABLE_ALL ) ; netif -> flags = 0 ; # ifdef netif_get_client_data memset ( netif -> client_data , 0 , sizeof ( netif -> client_data ) ) ; # endif <S2SV_StartBug> # if LWIP_IPV6_AUTOCONFIG <S2SV_EndBug> netif -> ip6_autoconfig_enabled = 0 ; # endif <S2SV_StartBug> # if LWIP_IPV6_SEND_ROUTER_SOLICIT <S2SV_EndBug> netif -> rs_count = LWIP_ND6_MAX_MULTICAST_SOLICIT ; # endif # if LWIP_NETIF_STATUS_CALLBACK netif -> status_callback = NULL ; # endif # if LWIP_NETIF_LINK_CALLBACK netif -> link_callback = NULL ; # endif # if LWIP_IGMP netif -> igmp_mac_filter = NULL ; # endif # if LWIP_IPV6 && LWIP_IPV6_MLD netif -> mld_mac_filter = NULL ; # endif # if ENABLE_LOOPBACK netif -> loop_first = NULL ; netif -> loop_last = NULL ; # endif netif -> state = state ; netif -> num = netif_num ; netif -> input = input ; NETIF_RESET_HINTS ( netif ) ; # if ENABLE_LOOPBACK && LWIP_LOOPBACK_MAX_PBUFS netif -> loop_cnt_current = 0 ; # endif # if LWIP_IPV4 netif_set_addr ( netif , ipaddr , netmask , gw ) ; # endif if ( init ( netif ) != ERR_OK ) { return NULL ; } # if ! LWIP_SINGLE_NETIF { struct netif * netif2 ; int num_netifs ; do { if ( netif -> num == 255 ) { netif -> num = 0 ; } num_netifs = 0 ; for ( netif2 = netif_list ; netif2 != NULL ; netif2 = netif2 -> next ) { LWIP_ASSERT ( "netif<S2SV_blank>already<S2SV_blank>added" , netif2 != netif ) ; num_netifs ++ ; LWIP_ASSERT ( "too<S2SV_blank>many<S2SV_blank>netifs,<S2SV_blank>max.<S2SV_blank>supported<S2SV_blank>number<S2SV_blank>is<S2SV_blank>255" , num_netifs <= 255 ) ; if ( netif2 -> num == netif -> num ) { netif -> num ++ ; break ; } } } while ( netif2 != NULL ) ; } if ( netif -> num == 254 ) { netif_num = 0 ; } else { netif_num = ( u8_t ) ( netif -> num + 1 ) ; } netif -> next = netif_list ; netif_list = netif ; # endif mib2_netif_added ( netif ) ; # if LWIP_IGMP if ( netif -> flags & NETIF_FLAG_IGMP ) { igmp_start ( netif ) ; } # endif LWIP_DEBUGF ( NETIF_DEBUG , ( "netif:<S2SV_blank>added<S2SV_blank>interface<S2SV_blank>%c%c<S2SV_blank>IP" , netif -> name [ 0 ] , netif -> name [ 1 ] ) ) ; # if LWIP_IPV4 LWIP_DEBUGF ( NETIF_DEBUG , ( "<S2SV_blank>addr<S2SV_blank>" ) ) ; ip4_addr_debug_print ( NETIF_DEBUG , ipaddr ) ; LWIP_DEBUGF ( NETIF_DEBUG , ( "<S2SV_blank>netmask<S2SV_blank>" ) ) ; ip4_addr_debug_print ( NETIF_DEBUG , netmask ) ; LWIP_DEBUGF ( NETIF_DEBUG , ( "<S2SV_blank>gw<S2SV_blank>" ) ) ; ip4_addr_debug_print ( NETIF_DEBUG , gw ) ; # endif LWIP_DEBUGF ( NETIF_DEBUG , ( "\\n" ) ) ; netif_invoke_ext_callback ( netif , LWIP_NSC_NETIF_ADDED , NULL ) ; return netif ; }
<S2SV_ModStart> endif # if LWIP_IPV6 # if <S2SV_ModStart> ; # endif nd6_restart_netif ( netif ) <S2SV_ModEnd> ; # endif
7,279
CWE-000 void p_rot13 ( inventory_t * inv ) { int i , j , l ; char * alphabet , * rot_13 , * str , * copy ; alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" ; rot_13 = "nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM" ; str = va_arg ( * ( inv -> args ) , char * ) ; l = _strlen ( str ) ; copy = _calloc ( l + 1 , sizeof ( char ) ) ; for ( i = 0 ; str [ i ] != '\\0' ; i ++ ) { for ( j = 0 ; j < 52 ; j ++ ) { if ( str [ i ] == alphabet [ j ] ) { copy [ i ] = rot_13 [ j ] ; break ; } } if ( j == 52 ) copy [ i ] = str [ i ] ; } puts_buffer ( inv , copy ) ; <S2SV_StartBug> } <S2SV_EndBug>
<S2SV_ModStart> copy ) ; free ( copy ) ;
7,280
CWE-000 Datum zstd_destructor ( PG_FUNCTION_ARGS ) { CompressionState * cs = ( CompressionState * ) PG_GETARG_POINTER ( 0 ) ; <S2SV_StartBug> zstd_state * state = ( zstd_state * ) cs -> opaque ; <S2SV_EndBug> if ( cs != NULL && cs -> opaque != NULL ) { <S2SV_StartBug> ZSTD_freeCCtx ( state -> zstd_compress_context ) ; <S2SV_EndBug> ZSTD_freeDCtx ( state -> zstd_decompress_context ) ; <S2SV_StartBug> pfree ( cs -> opaque ) ; <S2SV_EndBug> } PG_RETURN_VOID ( ) ; }
<S2SV_ModStart> 0 ) ; <S2SV_ModEnd> if ( cs <S2SV_ModStart> NULL ) { zstd_state * state = ( zstd_state * ) cs -> opaque ; zstd_free_context <S2SV_ModEnd> ( state -> <S2SV_ModStart> ( state -> ctx <S2SV_ModEnd> ) ; pfree <S2SV_ModStart> ; pfree ( state <S2SV_ModEnd> ) ; }
7,281
CWE-000 void interface_esc_com ( int sockfd ) { char buf [ MAXDATASIZE ] ; int numbytes ; if ( interface_codigo ( sockfd ) ) { <S2SV_StartBug> if ( ( numbytes = recv ( sockfd , buf , MAXDATASIZE - 1 , 0 ) ) == - 1 ) { <S2SV_EndBug> perror ( "recv" ) ; exit ( 1 ) ; } buf [ numbytes ] = '\\0' ; printf ( "%s" , buf ) ; char comment [ COMMENT_LENGTH ] ; scanf ( "\\n" ) ; fgets ( comment , sizeof ( comment ) , stdin ) ; for ( int i = COMMENT_LENGTH - 1 ; i >= 0 ; i -- ) { if ( comment [ i ] == '\\n' ) comment [ i ] = '\\0' ; } gettimeofday ( & tv1 , NULL ) ; <S2SV_StartBug> if ( send ( sockfd , comment , sizeof ( comment ) , 0 ) == - 1 ) { <S2SV_EndBug> perror ( "send" ) ; return ; } <S2SV_StartBug> if ( ( numbytes = recv ( sockfd , buf , MAXDATASIZE - 1 , 0 ) ) == - 1 ) { <S2SV_EndBug> perror ( "recv" ) ; exit ( 1 ) ; } gettimeofday ( & tv2 , NULL ) ; buf [ numbytes ] = '\\0' ; printf ( "%s" , buf ) ; printf ( "Tempo<S2SV_blank>total<S2SV_blank>da<S2SV_blank>operação:<S2SV_blank>%.2f<S2SV_blank>usecs\\n" , ( float ) ( tv2 . tv_usec - tv1 . tv_usec ) ) ; send_ack ( sockfd ) ; } else { <S2SV_StartBug> if ( ( numbytes = recv ( sockfd , buf , MAXDATASIZE - 1 , 0 ) ) == - 1 ) { <S2SV_EndBug> perror ( "recv" ) ; exit ( 1 ) ; } buf [ numbytes ] = '\\0' ; printf ( "%s" , buf ) ; } }
<S2SV_ModStart> ) ) { numbytes = repeat_receive ( sockfd , buf , sizeof ( buf ) ) ; if ( numbytes <S2SV_ModEnd> == - 1 <S2SV_ModStart> ; if ( repeat_send ( sockfd , comment , sizeof ( comment ) <S2SV_ModEnd> ) == - <S2SV_ModStart> return ; } numbytes = repeat_receive ( sockfd , buf , sizeof ( buf ) ) ; if ( numbytes <S2SV_ModEnd> == - 1 <S2SV_ModStart> } else { numbytes = repeat_receive ( sockfd , buf , sizeof ( buf ) ) ; if ( numbytes <S2SV_ModEnd> == - 1
7,282
CWE-000 int acpi_bus_get_status ( struct acpi_device * device ) { acpi_status status ; <S2SV_StartBug> unsigned long long sta ; <S2SV_EndBug> status = acpi_bus_get_status_handle ( device -> handle , & sta ) ; if ( ACPI_FAILURE ( status ) ) return - ENODEV ; acpi_set_device_status ( device , sta ) ; if ( device -> status . functional && ! device -> status . present ) { ACPI_DEBUG_PRINT ( ( ACPI_DB_INFO , "Device<S2SV_blank>[%s]<S2SV_blank>status<S2SV_blank>[%08x]:<S2SV_blank>" "functional<S2SV_blank>but<S2SV_blank>not<S2SV_blank>present;\\n" , device -> pnp . bus_id , ( u32 ) sta ) ) ; } ACPI_DEBUG_PRINT ( ( ACPI_DB_INFO , "Device<S2SV_blank>[%s]<S2SV_blank>status<S2SV_blank>[%08x]\\n" , device -> pnp . bus_id , ( u32 ) sta ) ) ; return 0 ; }
<S2SV_ModStart> long sta ; if ( acpi_device_always_present ( device ) ) { acpi_set_device_status ( device , ACPI_STA_DEFAULT ) ; return 0 ; }
7,283
CWE-000 static void mlxsw_sp_port_ovs_leave ( struct mlxsw_sp_port * mlxsw_sp_port ) <S2SV_StartBug> { <S2SV_EndBug> mlxsw_sp_port_vlan_set ( mlxsw_sp_port , 2 , VLAN_N_VID - 1 , false , false ) ; mlxsw_sp_port_stp_set ( mlxsw_sp_port , false ) ; mlxsw_sp_port_vp_mode_set ( mlxsw_sp_port , false ) ; }
<S2SV_ModStart> mlxsw_sp_port ) { u16 vid ; for ( vid = VLAN_N_VID - 1 ; vid >= 1 ; vid -- ) mlxsw_sp_port_vid_learning_set ( mlxsw_sp_port , vid , true ) ;
7,284
CWE-000 void admin_home ( struct contact muict [ 100 ] , int * numuser , int * userindex ) { int admptr = 1 ; char admptr_temp ; do { system ( "cls" ) ; <S2SV_StartBug> printf ( "\\t\\t\\t----------------------------------------\\n" ) ; <S2SV_EndBug> <S2SV_StartBug> printf ( "\\t\\t\\t|WELCOME<S2SV_blank>ADMIN<S2SV_blank>%s<S2SV_blank>%s|\\n" , muict [ * userindex ] . first , muict [ * userindex ] . last ) ; <S2SV_EndBug> printf ( "\\t\\t\\t----------------------------------------\\n" ) ; printf ( "\\t\\t" ) ; admptr == 1 ? printf ( "-->\\t[1]<S2SV_blank>Edit<S2SV_blank>User\'s<S2SV_blank>Contact\\n" ) : printf ( "\\t<S2SV_blank>[1]<S2SV_blank>Edit<S2SV_blank>User\'s<S2SV_blank>Contact\\n" ) ; printf ( "\\t\\t" ) ; admptr == 2 ? printf ( "-->\\t[2]<S2SV_blank>Show<S2SV_blank>all<S2SV_blank>contact\\n" ) : printf ( "\\t<S2SV_blank>[2]<S2SV_blank>Show<S2SV_blank>all<S2SV_blank>contact\\n" ) ; printf ( "\\t\\t" ) ; admptr == 3 ? printf ( "-->\\t[3]<S2SV_blank>Search<S2SV_blank>for<S2SV_blank>a<S2SV_blank>contact\\n" ) : printf ( "\\t<S2SV_blank>[3]<S2SV_blank>Search<S2SV_blank>for<S2SV_blank>a<S2SV_blank>contact\\n" ) ; printf ( "\\t\\t" ) ; admptr == 4 ? printf ( "-->\\t[4]<S2SV_blank>Delete<S2SV_blank>user\'s<S2SV_blank>contact\\n" ) : printf ( "\\t<S2SV_blank>[4]<S2SV_blank>Delete<S2SV_blank>user\'s<S2SV_blank>contact\\n" ) ; printf ( "\\t\\t" ) ; admptr == 5 ? printf ( "-->\\t[5]<S2SV_blank>Give<S2SV_blank>Admin<S2SV_blank>privilege\\n" ) : printf ( "\\t<S2SV_blank>[5]<S2SV_blank>Give<S2SV_blank>Admin<S2SV_blank>privilege\\n" ) ; if ( * userindex == 0 ) { if ( admptr == 6 ) { printf ( "\\t\\t" ) ; printf ( "-->\\t[6]<S2SV_blank>About<S2SV_blank>this<S2SV_blank>system\\n" ) ; } else { printf ( "\\t\\t" ) ; printf ( "\\t<S2SV_blank>[6]<S2SV_blank>About<S2SV_blank>this<S2SV_blank>system\\n" ) ; } } printf ( "\\t\\t" ) ; admptr == 0 ? printf ( "-->\\t[0]<S2SV_blank>exit\\n" ) : printf ( "\\t<S2SV_blank>[0]<S2SV_blank>exit\\n" ) ; while ( ! kbhit ( ) ) ; admptr_temp = getch ( ) ; if ( admptr_temp == 13 ) break ; if ( * userindex == 0 ) { if ( admptr_temp >= '0' && admptr_temp <= '6' ) { admptr = ( int ) admptr_temp - 48 ; } } else { if ( admptr_temp >= '0' && admptr_temp <= '5' ) { admptr = ( int ) admptr_temp - 48 ; } } } while ( 1 ) ; switch ( admptr ) { case 1 : edituserinfo ( muict , numuser , 'E' , userindex ) ; break ; case 2 : listdata ( muict , numuser ) ; printf ( "Press<S2SV_blank>any<S2SV_blank>key<S2SV_blank>to<S2SV_blank>Continue\\n" ) ; getch ( ) ; break ; case 3 : advancesearch ( muict , numuser , 'Y' , muict [ * userindex ] . first , muict [ * userindex ] . last ) ; break ; case 4 : edituserinfo ( muict , numuser , 'D' , userindex ) ; break ; case 5 : edituserinfo ( muict , numuser , 'G' , userindex ) ; break ; <S2SV_StartBug> } <S2SV_EndBug> if ( admptr != 0 ) admin_home ( muict , numuser , userindex ) ; }
<S2SV_ModStart> "cls" ) ; Header ( <S2SV_ModEnd> muict [ * <S2SV_ModStart> ] . last , 5 , 'Y' , 'Y' <S2SV_ModEnd> ) ; printf <S2SV_ModStart> ; break ; case 6 : credit ( ) ; break ;
7,285
CWE-000 ACMD_FUNC ( shownpc ) { char NPCname [ NPC_NAME_LENGTH ] ; nullpo_retr ( - 1 , sd ) ; memset ( NPCname , '\\0' , sizeof ( NPCname ) ) ; <S2SV_StartBug> if ( ! message || ! * message || sscanf ( message , "%23[^\\n]" , NPCname ) < 1 ) { <S2SV_EndBug> clif_displaymessage ( fd , "Please,<S2SV_blank>enter<S2SV_blank>a<S2SV_blank>NPC<S2SV_blank>name<S2SV_blank>(usage:<S2SV_blank>@enablenpc<S2SV_blank><NPC_name>)." ) ; return - 1 ; } if ( npc_name2id ( NPCname ) != NULL ) { npc_enable ( NPCname , 1 ) ; clif_displaymessage ( fd , msg_txt ( 110 ) ) ; } else { clif_displaymessage ( fd , msg_txt ( 111 ) ) ; return - 1 ; } return 0 ; }
<S2SV_ModStart> ( message , "%49[^\\n]" <S2SV_ModEnd> , NPCname )
7,286
CWE-000 <S2SV_StartBug> static const char * MVM_unicode_get_property_str ( MVMThreadContext * tc , MVMint32 codepoint , MVMint64 property_code ) { <S2SV_EndBug> MVMuint32 switch_val = ( MVMuint32 ) property_code ; MVMint32 result_val = 0 ; MVMuint32 codepoint_row = MVM_codepoint_to_row_index ( tc , codepoint ) ; MVMuint16 bitfield_row ; if ( codepoint_row == - 1 ) return "" ; bitfield_row = codepoint_bitfield_indexes [ codepoint_row ] ; switch ( switch_val ) { case 0 : return "" ; case MVM_UNICODE_PROPERTY_DECOMP_SPEC : result_val |= ( ( props_bitfield [ bitfield_row ] [ 0 ] & 0xfff80000 ) >> 19 ) ; return result_val < 5723 ? Decomp_Spec_enums [ result_val ] : bogus ; case MVM_UNICODE_PROPERTY_BLOCK : result_val |= ( ( props_bitfield [ bitfield_row ] [ 1 ] & 0x1ff000 ) >> 12 ) ; return result_val < 274 ? Block_enums [ result_val ] : bogus ; case MVM_UNICODE_PROPERTY_SCRIPT : result_val |= ( ( props_bitfield [ bitfield_row ] [ 1 ] & 0xff0 ) >> 4 ) ; return result_val < 138 ? Script_enums [ result_val ] : bogus ; case MVM_UNICODE_PROPERTY_SENTENCE_BREAK : result_val |= ( ( props_bitfield [ bitfield_row ] [ 1 ] & 0xf ) >> 0 ) ; return result_val < 15 ? Sentence_Break_enums [ result_val ] : bogus ; case MVM_UNICODE_PROPERTY_NUMERIC_VALUE : result_val |= ( ( props_bitfield [ bitfield_row ] [ 2 ] & 0xff000000 ) >> 24 ) ; return result_val < 136 ? Numeric_Value_enums [ result_val ] : bogus ; case MVM_UNICODE_PROPERTY_JOINING_GROUP : result_val |= ( ( props_bitfield [ bitfield_row ] [ 2 ] & 0xfe0000 ) >> 17 ) ; return result_val < 89 ? Joining_Group_enums [ result_val ] : bogus ; case MVM_UNICODE_PROPERTY_NUMERIC_VALUE_NUMERATOR : result_val |= ( ( props_bitfield [ bitfield_row ] [ 2 ] & 0x1fc00 ) >> 10 ) ; return result_val < 99 ? Numeric_Value_Numerator_enums [ result_val ] : bogus ; case MVM_UNICODE_PROPERTY_LINE_BREAK : result_val |= ( ( props_bitfield [ bitfield_row ] [ 2 ] & 0x3f0 ) >> 4 ) ; return result_val < 43 ? Line_Break_enums [ result_val ] : bogus ; case MVM_UNICODE_PROPERTY_JOINING_TYPE : result_val |= ( ( props_bitfield [ bitfield_row ] [ 2 ] & 0xe ) >> 1 ) ; return result_val < 6 ? Joining_Type_enums [ result_val ] : bogus ; case MVM_UNICODE_PROPERTY_CANONICAL_COMBINING_CLASS : result_val |= ( ( props_bitfield [ bitfield_row ] [ 3 ] & 0xfc000000 ) >> 26 ) ; return result_val < 56 ? Canonical_Combining_Class_enums [ result_val ] : bogus ; case MVM_UNICODE_PROPERTY_GRAPHEME_CLUSTER_BREAK : result_val |= ( ( props_bitfield [ bitfield_row ] [ 3 ] & 0x3e00000 ) >> 21 ) ; return result_val < 18 ? Grapheme_Cluster_Break_enums [ result_val ] : bogus ; case MVM_UNICODE_PROPERTY_AGE : result_val |= ( ( props_bitfield [ bitfield_row ] [ 3 ] & 0x1f0000 ) >> 16 ) ; return result_val < 19 ? Age_enums [ result_val ] : bogus ; case MVM_UNICODE_PROPERTY_GENERAL_CATEGORY : result_val |= ( ( props_bitfield [ bitfield_row ] [ 3 ] & 0xf800 ) >> 11 ) ; return result_val < 30 ? General_Category_enums [ result_val ] : bogus ; case MVM_UNICODE_PROPERTY_NUMERIC_VALUE_DENOMINATOR : result_val |= ( ( props_bitfield [ bitfield_row ] [ 3 ] & 0x7c0 ) >> 6 ) ; return result_val < 17 ? Numeric_Value_Denominator_enums [ result_val ] : bogus ; case MVM_UNICODE_PROPERTY_DECOMPOSITION_TYPE : result_val |= ( ( props_bitfield [ bitfield_row ] [ 3 ] & 0x3e ) >> 1 ) ; return result_val < 18 ? Decomposition_Type_enums [ result_val ] : bogus ; case MVM_UNICODE_PROPERTY_WORD_BREAK : result_val |= ( ( props_bitfield [ bitfield_row ] [ 4 ] & 0xf8000000 ) >> 27 ) ; return result_val < 22 ? Word_Break_enums [ result_val ] : bogus ; case MVM_UNICODE_PROPERTY_BIDI_CLASS : result_val |= ( ( props_bitfield [ bitfield_row ] [ 4 ] & 0x7c00000 ) >> 22 ) ; return result_val < 23 ? Bidi_Class_enums [ result_val ] : bogus ; case MVM_UNICODE_PROPERTY_EAST_ASIAN_WIDTH : result_val |= ( ( props_bitfield [ bitfield_row ] [ 4 ] & 0x380000 ) >> 19 ) ; return result_val < 6 ? East_Asian_Width_enums [ result_val ] : bogus ; case MVM_UNICODE_PROPERTY_HANGUL_SYLLABLE_TYPE : result_val |= ( ( props_bitfield [ bitfield_row ] [ 4 ] & 0x70000 ) >> 16 ) ; return result_val < 6 ? Hangul_Syllable_Type_enums [ result_val ] : bogus ; case MVM_UNICODE_PROPERTY_NUMERIC_TYPE : result_val |= ( ( props_bitfield [ bitfield_row ] [ 4 ] & 0xc000 ) >> 14 ) ; return result_val < 4 ? Numeric_Type_enums [ result_val ] : bogus ; case MVM_UNICODE_PROPERTY_NFC_QC : result_val |= ( ( props_bitfield [ bitfield_row ] [ 4 ] & 0x3000 ) >> 12 ) ; return result_val < 3 ? NFC_QC_enums [ result_val ] : bogus ; case MVM_UNICODE_PROPERTY_NFKC_QC : result_val |= ( ( props_bitfield [ bitfield_row ] [ 4 ] & 0xc00 ) >> 10 ) ; return result_val < 3 ? NFKC_QC_enums [ result_val ] : bogus ; case MVM_UNICODE_PROPERTY_NFG_QC : result_val |= ( ( props_bitfield [ bitfield_row ] [ 4 ] & 0x300 ) >> 8 ) ; return result_val < 3 ? NFG_QC_enums [ result_val ] : bogus ; default : return "" ; } }
<S2SV_ModStart> * tc , MVMint64 <S2SV_ModEnd> codepoint , MVMint64
7,287
CWE-000 float GCAcomputeLogSampleProbability ( GCA * const gca , GCA_SAMPLE * const gcas , MRI * const mri_inputs , TRANSFORM * const transform , int const nsamples , double const clamp ) { TransformInvert ( transform , mri_inputs ) ; double total_log_p = 0.0 ; int const nthreads = # ifdef HAVE_OPENMP omp_get_max_threads ( ) ; # else 1 ; # endif MATRIX * m_prior2source_voxel_nonconst = ( transform -> type == MORPH_3D_TYPE ) ? NULL : GCAgetPriorToSourceVoxelMatrix ( gca , mri_inputs , transform ) ; MATRIX const * const m_prior2source_voxel = m_prior2source_voxel_nonconst ; VECTOR * v_src [ _MAX_FS_THREADS ] , * v_dst [ _MAX_FS_THREADS ] ; { int tid ; for ( tid = 0 ; tid < nthreads ; tid ++ ) { v_src [ tid ] = VectorAlloc ( 4 , MATRIX_REAL ) ; v_dst [ tid ] = VectorAlloc ( 4 , MATRIX_REAL ) ; * MATRIX_RELT ( v_src [ tid ] , 4 , 1 ) = 1.0 ; * MATRIX_RELT ( v_dst [ tid ] , 4 , 1 ) = 1.0 ; } } <S2SV_StartBug> int i ; <S2SV_EndBug> # ifdef BEVIN_GCACOMPUTELOGSAMPLEPROBABILITY_REPRODUCIBLE # define ROMP_VARIABLE i # define ROMP_LO 0 # define ROMP_HI nsamples # define ROMP_SUMREDUCTION0 total_log_p # define ROMP_FOR_LEVEL ROMP_level_assume_reproducible # include "romp_for_begin.h" # define total_log_p ROMP_PARTIALSUM ( 0 ) <S2SV_StartBug> # else <S2SV_EndBug> ROMP_PF_begin # ifdef HAVE_OPENMP # pragma omp parallel for if_ROMP ( fast ) reduction ( + : total_log_p ) # endif for ( i = 0 ; i < nsamples ; i ++ ) { ROMP_PFLB_begin # endif int x , y , z , xp , yp , zp ; double log_p ; float vals [ MAX_GCA_INPUTS ] ; int const tid = # ifdef HAVE_OPENMP omp_get_thread_num ( ) ; # else 0 ; # endif if ( i == Gdiag_no ) DiagBreak ( ) ; if ( Gdiag_no == gcas [ i ] . label ) DiagBreak ( ) ; if ( i == Gdiag_no || ( gcas [ i ] . xp == Gxp && gcas [ i ] . yp == Gyp && gcas [ i ] . zp == Gzp ) ) DiagBreak ( ) ; if ( transform -> type == MORPH_3D_TYPE ) { xp = gcas [ i ] . xp ; yp = gcas [ i ] . yp ; zp = gcas [ i ] . zp ; GCApriorToSourceVoxel ( gca , mri_inputs , transform , xp , yp , zp , & x , & y , & z ) ; } else { V3_X ( v_src [ tid ] ) = xp = gcas [ i ] . xp ; V3_Y ( v_src [ tid ] ) = yp = gcas [ i ] . yp ; V3_Z ( v_src [ tid ] ) = zp = gcas [ i ] . zp ; MatrixMultiply ( m_prior2source_voxel , v_src [ tid ] , v_dst [ tid ] ) ; x = nint ( V3_X ( v_dst [ tid ] ) ) ; y = nint ( V3_Y ( v_dst [ tid ] ) ) ; z = nint ( V3_Z ( v_dst [ tid ] ) ) ; } if ( MRIindexNotInVolume ( mri_inputs , x , y , z ) == 0 ) { if ( x == Gx && y == Gy && z == Gz ) DiagBreak ( ) ; gcas [ i ] . x = x ; gcas [ i ] . y = y ; gcas [ i ] . z = z ; # ifdef FASTER_MRI_EM_REGISTER if ( gca -> ninputs > 1 ) load_vals_xyzInt ( mri_inputs , x , y , z , vals , gca -> ninputs ) ; else # endif load_vals ( mri_inputs , x , y , z , vals , gca -> ninputs ) ; # ifdef FASTER_MRI_EM_REGISTER if ( gca -> ninputs == 1 ) log_p = gcaComputeSampleLogDensity_1_input ( & gcas [ i ] , vals [ 0 ] ) ; else # endif log_p = gcaComputeSampleLogDensity ( & gcas [ i ] , vals , gca -> ninputs ) ; if ( FZERO ( vals [ 0 ] ) && gcas [ i ] . label == Gdiag_no ) { if ( fabs ( log_p ) < 5 ) DiagBreak ( ) ; DiagBreak ( ) ; } if ( log_p < - clamp ) log_p = - clamp ; } else { log_p = - 1000000 ; } gcas [ i ] . log_p = log_p ; total_log_p += log_p ; # ifdef BEVIN_GCACOMPUTELOGSAMPLEPROBABILITY_REPRODUCIBLE # undef total_log_p # include "romp_for_end.h" # else ROMP_PFLB_end } ROMP_PF_end # endif fflush ( stdout ) ; { int tid ; for ( tid = 0 ; tid < nthreads ; tid ++ ) { VectorFree ( & v_src [ tid ] ) ; VectorFree ( & v_dst [ tid ] ) ; } } if ( m_prior2source_voxel_nonconst ) MatrixFree ( & m_prior2source_voxel_nonconst ) ; return ( ( float ) total_log_p / nsamples ) ; }
<S2SV_ModStart> ; } } <S2SV_ModEnd> # ifdef BEVIN_GCACOMPUTELOGSAMPLEPROBABILITY_REPRODUCIBLE <S2SV_ModStart> ) # else int i ;
7,288
CWE-000 void kernel_init ( struct multiboot_info * mb ) { terminal_initialize ( ) ; kernel_welcome ( ) ; gdt_init ( ) ; idt_init ( ) ; phys_memory_init ( mb ) ; virt_memory_init ( ) ; kheap_init ( ) ; kb_init ( ) ; asm ( "<S2SV_blank>sti<S2SV_blank>" ) ; <S2SV_StartBug> } <S2SV_EndBug>
<S2SV_ModStart> "<S2SV_blank>sti<S2SV_blank>" ) ; int * arr0 = kmalloc ( sizeof ( int ) * 5000 ) ; int * arr1 = kmalloc ( sizeof ( int ) * 30000 ) ; int * arr2 = kmalloc ( sizeof ( int ) * 3000 ) ; printf ( "Array<S2SV_blank>arr0<S2SV_blank>of<S2SV_blank>size<S2SV_blank>5000<S2SV_blank>at<S2SV_blank>%x\\n" , arr0 ) ; printf ( "Array<S2SV_blank>arr1<S2SV_blank>of<S2SV_blank>size<S2SV_blank>30000<S2SV_blank>at<S2SV_blank>%x\\n" , arr1 ) ; printf ( "Array<S2SV_blank>arr2<S2SV_blank>of<S2SV_blank>size<S2SV_blank>3000<S2SV_blank>at<S2SV_blank>%x\\n" , arr2 ) ;
7,289
CWE-000 static int uss820_atmelarm_detach ( device_t dev ) { struct uss820dci_softc * sc = device_get_softc ( dev ) ; <S2SV_StartBug> device_t bdev ; <S2SV_EndBug> int err ; <S2SV_StartBug> if ( sc -> sc_bus . bdev ) { <S2SV_EndBug> bdev = sc -> sc_bus . bdev ; device_detach ( bdev ) ; device_delete_child ( dev , bdev ) ; } device_delete_all_children ( dev ) ; if ( sc -> sc_irq_res && sc -> sc_intr_hdl ) { uss820dci_uninit ( sc ) ; err = bus_teardown_intr ( dev , sc -> sc_irq_res , sc -> sc_intr_hdl ) ; sc -> sc_intr_hdl = NULL ; } if ( sc -> sc_irq_res ) { bus_release_resource ( dev , SYS_RES_IRQ , 0 , sc -> sc_irq_res ) ; sc -> sc_irq_res = NULL ; } if ( sc -> sc_io_res ) { bus_release_resource ( dev , SYS_RES_IOPORT , 0 , sc -> sc_io_res ) ; sc -> sc_io_res = NULL ; } usb_bus_mem_free_all ( & sc -> sc_bus , NULL ) ; return ( 0 ) ; }
<S2SV_ModStart> dev ) ; <S2SV_ModEnd> int err ; <S2SV_ModStart> int err ; <S2SV_ModEnd> device_delete_all_children ( dev
7,290
CWE-000 vertex new_vertex ( ) { <S2SV_StartBug> vertex vx = malloc ( sizeof ( * vx ) ) ; <S2SV_EndBug> vx -> visited = 0 ; vx -> data = NULL ; vx -> connections = new_linked_list ( ) ; return vx ; }
<S2SV_ModStart> * vx ) ) ; assert ( vx != NULL
7,291
CWE-000 static void vfs_fsync_do ( void * private_data ) { struct vfswrap_fsync_state * state = talloc_get_type_abort ( private_data , struct vfswrap_fsync_state ) ; struct timespec start_time ; struct timespec end_time ; PROFILE_TIMESTAMP ( & start_time ) ; do { state -> ret = fsync ( state -> fd ) ; } while ( ( state -> ret == - 1 ) && ( errno == EINTR ) ) ; <S2SV_StartBug> state -> err = errno ; <S2SV_EndBug> PROFILE_TIMESTAMP ( & end_time ) ; state -> vfs_aio_state . duration = nsec_time_diff ( & end_time , & start_time ) ; }
<S2SV_ModStart> ) ) ; if ( state -> ret == - 1 ) { state -> vfs_aio_state . error <S2SV_ModEnd> = errno ; <S2SV_ModStart> = errno ; }
7,292
CWE-000 char * surgescript_var_to_string ( const surgescript_var_t * var , char * buf , size_t bufsize ) { switch ( var -> type ) { case SSVAR_STRING : return surgescript_util_strncpy ( buf , var -> string , bufsize ) ; case SSVAR_BOOL : return surgescript_util_strncpy ( buf , var -> boolean ? "true" : "false" , bufsize ) ; case SSVAR_NULL : return surgescript_util_strncpy ( buf , "null" , bufsize ) ; case SSVAR_OBJECTHANDLE : return surgescript_util_strncpy ( buf , "[object]" , bufsize ) ; case SSVAR_NUMBER : { <S2SV_StartBug> char tmp [ 33 ] ; <S2SV_EndBug> if ( var -> number <= LONG_MIN || var -> number >= LONG_MAX || var -> number == ( long ) ( var -> number ) ) sprintf ( tmp , "%ld" , ( long ) ( var -> number ) ) ; else sprintf ( tmp , "%f" , var -> number ) ; return surgescript_util_strncpy ( buf , tmp , bufsize ) ; } } return buf ; }
<S2SV_ModStart> char tmp [ 32 <S2SV_ModEnd> ] ; if
7,293
CWE-000 <S2SV_StartBug> static inline unsigned int bcma_of_get_irq ( struct platform_device * parent , <S2SV_EndBug> struct bcma_device * core , int num ) { <S2SV_StartBug> return 0 ; <S2SV_EndBug> <S2SV_StartBug> } <S2SV_EndBug>
<S2SV_ModStart> <S2SV_null> <S2SV_null> static <S2SV_ModEnd> unsigned int bcma_of_get_irq <S2SV_ModStart> num ) { struct of_phandle_args out_irq ; int ret ; if ( ! IS_ENABLED ( CONFIG_OF_IRQ ) || ! parent || ! parent -> dev . of_node ) return 0 ; ret = bcma_of_irq_parse ( parent , core , & out_irq , num ) ; if ( ret ) { bcma_debug ( core -> bus , "bcma_of_get_irq()<S2SV_blank>failed<S2SV_blank>with<S2SV_blank>rc=%d\\n" , ret ) ; <S2SV_ModStart> 0 ; } return irq_create_of_mapping ( & out_irq ) ; }
7,294
CWE-000 static void teardown ( Fixture * f , gconstpointer context G_GNUC_UNUSED ) { g_clear_object ( & f -> proxy ) ; <S2SV_StartBug> if ( f -> observer_conn != NULL ) <S2SV_EndBug> { GError * error = NULL ; <S2SV_StartBug> g_dbus_connection_signal_unsubscribe ( f -> observer_conn , <S2SV_EndBug> f -> removed_sub ) ; g_dbus_connection_close_sync ( f -> observer_conn , NULL , & error ) ; if ( g_error_matches ( error , G_IO_ERROR , G_IO_ERROR_CLOSED ) ) g_clear_error ( & error ) ; else g_assert_no_error ( error ) ; } g_clear_pointer ( & f -> containers_removed , g_hash_table_unref ) ; g_clear_object ( & f -> observer_conn ) ; if ( f -> libdbus_observer != NULL ) { dbus_connection_remove_filter ( f -> libdbus_observer , observe_shouting_cb , f ) ; dbus_connection_close ( f -> libdbus_observer ) ; } dbus_clear_connection ( & f -> libdbus_observer ) ; fixture_disconnect_unconfined ( f ) ; if ( f -> confined_conn != NULL ) { GError * error = NULL ; g_dbus_connection_close_sync ( f -> confined_conn , NULL , & error ) ; if ( g_error_matches ( error , G_IO_ERROR , G_IO_ERROR_CLOSED ) ) g_clear_error ( & error ) ; else g_assert_no_error ( error ) ; } g_clear_object ( & f -> confined_conn ) ; if ( f -> daemon_pid != 0 ) { test_kill_pid ( f -> daemon_pid ) ; g_spawn_close_pid ( f -> daemon_pid ) ; f -> daemon_pid = 0 ; } dbus_clear_message ( & f -> latest_shout ) ; g_free ( f -> instance_path ) ; g_free ( f -> socket_path ) ; g_free ( f -> socket_dbus_address ) ; g_free ( f -> bus_address ) ; g_clear_error ( & f -> error ) ; test_main_context_unref ( f -> ctx ) ; }
<S2SV_ModStart> proxy ) ; fixture_disconnect_observer ( f ) ; g_clear_pointer ( & f -> containers_removed , g_hash_table_unref ) ; if ( f -> libdbus_observer != NULL ) { dbus_connection_remove_filter ( f -> libdbus_observer , observe_shouting_cb , f ) ; dbus_connection_close ( f -> libdbus_observer ) ; } dbus_clear_connection ( & f -> libdbus_observer ) ; fixture_disconnect_unconfined ( f ) ; if ( f -> confined_conn <S2SV_ModEnd> != NULL ) <S2SV_ModStart> = NULL ; <S2SV_ModEnd> g_dbus_connection_close_sync ( f
7,295
CWE-000 LLVMValueRef gen_binop ( context_t * cnt , bl_node_t * binop ) { bl_expr_binop_t * _binop = bl_peek_expr_binop ( binop ) ; LLVMValueRef lhs = gen_expr ( cnt , _binop -> lhs ) ; LLVMValueRef rhs = gen_expr ( cnt , _binop -> rhs ) ; if ( _binop -> op == BL_SYM_ASIGN ) { <S2SV_StartBug> if ( LLVMIsAAllocaInst ( rhs ) || is_deref ( _binop -> rhs ) ) { <S2SV_EndBug> rhs = LLVMBuildLoad ( cnt -> llvm_builder , rhs , gname ( "tmp" ) ) ; } LLVMBuildStore ( cnt -> llvm_builder , rhs , lhs ) ; return NULL ; } <S2SV_StartBug> if ( LLVMIsAAllocaInst ( lhs ) || LLVMIsAGetElementPtrInst ( lhs ) || is_deref ( _binop -> lhs ) ) <S2SV_EndBug> lhs = LLVMBuildLoad ( cnt -> llvm_builder , lhs , gname ( "tmp" ) ) ; <S2SV_StartBug> if ( LLVMIsAAllocaInst ( rhs ) || LLVMIsAGetElementPtrInst ( rhs ) ) <S2SV_EndBug> rhs = LLVMBuildLoad ( cnt -> llvm_builder , rhs , gname ( "tmp" ) ) ; switch ( _binop -> op ) { case BL_SYM_PLUS : return LLVMBuildAdd ( cnt -> llvm_builder , lhs , rhs , gname ( "tmp" ) ) ; case BL_SYM_MINUS : return LLVMBuildSub ( cnt -> llvm_builder , lhs , rhs , gname ( "tmp" ) ) ; case BL_SYM_ASTERISK : return LLVMBuildMul ( cnt -> llvm_builder , lhs , rhs , gname ( "tmp" ) ) ; case BL_SYM_SLASH : return LLVMBuildFDiv ( cnt -> llvm_builder , lhs , rhs , gname ( "tmp" ) ) ; case BL_SYM_MODULO : return LLVMBuildSRem ( cnt -> llvm_builder , lhs , rhs , gname ( "tmp" ) ) ; case BL_SYM_EQ : return LLVMBuildICmp ( cnt -> llvm_builder , LLVMIntEQ , lhs , rhs , gname ( "tmp" ) ) ; case BL_SYM_NEQ : return LLVMBuildICmp ( cnt -> llvm_builder , LLVMIntNE , lhs , rhs , gname ( "tmp" ) ) ; case BL_SYM_GREATER : return LLVMBuildICmp ( cnt -> llvm_builder , LLVMIntSGT , lhs , rhs , gname ( "tmp" ) ) ; case BL_SYM_LESS : return LLVMBuildICmp ( cnt -> llvm_builder , LLVMIntSLT , lhs , rhs , gname ( "tmp" ) ) ; case BL_SYM_GREATER_EQ : return LLVMBuildICmp ( cnt -> llvm_builder , LLVMIntSGE , lhs , rhs , gname ( "tmp" ) ) ; case BL_SYM_LESS_EQ : return LLVMBuildICmp ( cnt -> llvm_builder , LLVMIntSLE , lhs , rhs , gname ( "tmp" ) ) ; case BL_SYM_LOGIC_AND : return LLVMBuildAnd ( cnt -> llvm_builder , lhs , rhs , gname ( "tmp" ) ) ; case BL_SYM_LOGIC_OR : return LLVMBuildOr ( cnt -> llvm_builder , lhs , rhs , gname ( "tmp" ) ) ; default : bl_abort ( "unknown<S2SV_blank>binop" ) ; } return NULL ; }
<S2SV_ModStart> { if ( should_load ( _binop -> rhs ) || LLVMIsAAllocaInst ( <S2SV_ModEnd> rhs ) ) <S2SV_ModStart> } if ( should_load ( _binop -> lhs ) || LLVMIsAAllocaInst ( <S2SV_ModEnd> lhs ) ) <S2SV_ModStart> ; if ( should_load ( _binop -> rhs ) || LLVMIsAAllocaInst <S2SV_ModEnd> ( rhs )
7,296
CWE-000 void * client_thread_handler ( void * args ) { tcp_args * arg = ( tcp_args * ) args ; int client_desc = arg -> client_desc ; sem_wait ( sem_user ) ; printf ( "%s...Adding<S2SV_blank>user<S2SV_blank>with<S2SV_blank>id<S2SV_blank>%d.\\n" , TCP , client_desc ) ; ClientListElement * user = ( ClientListElement * ) malloc ( sizeof ( ClientListElement ) ) ; user -> texture = NULL ; user -> id = client_desc ; user -> vehicle = NULL ; user -> x_shift = 0 ; user -> y_shift = 0 ; user -> prev_x = - 1 ; user -> prev_y = - 1 ; clientList_add ( users , user ) ; printf ( "%s...User<S2SV_blank>added<S2SV_blank>successfully.\\n" , TCP ) ; clientList_print ( users ) ; sem_post ( sem_user ) ; int ret ; char buf_recv [ BUFFERSIZE ] ; size_t ph_len = sizeof ( PacketHeader ) ; while ( communicate ) { <S2SV_StartBug> ret = receive_tcp ( socket_tcp , buf_recv , ph_len , 0 ) ; <S2SV_EndBug> <S2SV_StartBug> if ( ret == - 2 ) printf ( "Error<S2SV_blank>in<S2SV_blank>connection<S2SV_blank>between<S2SV_blank>server<S2SV_blank>and<S2SV_blank>a<S2SV_blank>client<S2SV_blank>on<S2SV_blank>socket<S2SV_blank>%d.\\n" , socket_tcp ) ; <S2SV_EndBug> PacketHeader * header = ( PacketHeader * ) buf_recv ; int size = header -> size - ph_len ; int msg_len = 0 ; while ( msg_len < size ) { ret = recv ( client_desc , buf_recv + msg_len + ph_len , size - msg_len , 0 ) ; if ( ret == - 1 && errno == EINTR ) continue ; ERROR_HELPER ( ret , "Error<S2SV_blank>in<S2SV_blank>receiving<S2SV_blank>data<S2SV_blank>in<S2SV_blank>tcp.\\n" ) ; msg_len += ret ; } ret = tcp_packet_handler ( client_desc , arg -> client_desc , buf_recv , arg -> surface_elevation , arg -> elevation_texture ) ; if ( ret == 1 ) printf ( "%s...Packet<S2SV_blank>managed<S2SV_blank>successfully.\\n" , TCP ) ; else printf ( "%s...Failure<S2SV_blank>in<S2SV_blank>managing<S2SV_blank>packet\\n" , TCP ) ; } printf ( "%s...User<S2SV_blank>%d<S2SV_blank>disconnected.\\n" , TCP , client_desc ) ; printf ( "%s...Closing.\\n" , TCP ) ; sem_wait ( sem_user ) ; ClientListElement * elem = clientList_find ( users , client_desc ) ; if ( elem == NULL ) { sem_post ( sem_user ) ; close ( client_desc ) ; pthread_exit ( NULL ) ; } ClientListElement * canc = clientList_remove ( users , elem ) ; if ( canc == NULL ) { sem_post ( sem_user ) ; close ( client_desc ) ; pthread_exit ( NULL ) ; } World_detachVehicle ( & world , canc -> vehicle ) ; free ( canc -> vehicle ) ; Image_free ( canc -> texture ) ; free ( canc ) ; sem_post ( sem_user ) ; close ( client_desc ) ; pthread_exit ( NULL ) ; }
<S2SV_ModStart> communicate ) { int bytes_read = 0 ; while ( bytes_read < ph_len ) { ret = recv <S2SV_ModEnd> ( socket_tcp , <S2SV_ModStart> socket_tcp , buf_recv + bytes_read <S2SV_ModStart> ; if ( errno == EINTR ) continue ; if ( errno == ENOTCONN ) { printf ( "Connection<S2SV_blank>closed.\\n" ) ; break ; } bytes_read ++ ; } <S2SV_ModEnd> PacketHeader * header
7,297
CWE-000 t_scn * scn_data_init ( t_scn * sc ) { static t_scn actual_sc ; sc = & actual_sc ; sc -> sphere [ 0 ] = 2 ; sc -> sphere [ 1 ] = 2 ; sc -> sphere [ 2 ] = 2 ; sc -> sphere [ 2 ] = 12 ; sc -> x_sphere [ 0 ] = 2 ; sc -> x_sphere [ 1 ] = 0 ; sc -> x_sphere [ 2 ] = 0 ; sc -> x_sphere [ 3 ] = 0.2 ; sc -> y_sphere [ 0 ] = 0 ; sc -> y_sphere [ 1 ] = 2 ; sc -> y_sphere [ 2 ] = 0 ; sc -> y_sphere [ 3 ] = 0.2 ; sc -> z_sphere [ 0 ] = 0 ; sc -> z_sphere [ 1 ] = 0 ; sc -> z_sphere [ 2 ] = 2 ; sc -> z_sphere [ 3 ] = 0.2 ; sc -> a_sphere [ 0 ] = 0 ; sc -> a_sphere [ 1 ] = 0 ; sc -> a_sphere [ 2 ] = 0 ; sc -> a_sphere [ 3 ] = 0.2 ; sc -> light [ 0 ] = 2 ; sc -> light [ 1 ] = 2 ; <S2SV_StartBug> sc -> light [ 2 ] = 1 ; <S2SV_EndBug> return ( sc ) ; }
<S2SV_ModStart> 2 ] = -
7,298
CWE-000 static int stel_parity ( struct sergenio * sio , int parity , void ( * done ) ( struct sergenio * sio , int err , int parity , void * cb_data ) , void * cb_data ) { <S2SV_StartBug> return stel_queue_and_send ( sio , 3 , parity , 0 , 0 , done , cb_data ) ; <S2SV_EndBug> }
<S2SV_ModStart> , 0 , 5 ,
7,299
CWE-000 static TPM_RC bn_prime_t_Unmarshal ( bn_prime_t * data , BYTE * * buffer , INT32 * size ) { TPM_RC rc = TPM_RC_SUCCESS ; size_t i , idx ; UINT16 numbytes = 0 ; UINT32 word ; NV_HEADER hdr ; if ( rc == TPM_RC_SUCCESS ) { rc = NV_HEADER_Unmarshal ( & hdr , buffer , size , BN_PRIME_T_VERSION , BN_PRIME_T_MAGIC ) ; } data -> allocated = ARRAY_SIZE ( data -> d ) ; if ( rc == TPM_RC_SUCCESS ) { rc = UINT16_Unmarshal ( & numbytes , buffer , size ) ; } if ( rc == TPM_RC_SUCCESS ) { data -> size = ( numbytes + sizeof ( crypt_uword_t ) - 1 ) / sizeof ( crypt_word_t ) ; if ( data -> size > data -> allocated ) { <S2SV_StartBug> TPMLIB_LogTPM2Error ( "bn_prime_t:<S2SV_blank>Require<S2SV_blank>size<S2SV_blank>larger<S2SV_blank>%u<S2SV_blank>than<S2SV_blank>allocated<S2SV_blank>%u\\n" , <S2SV_EndBug> data -> size , data -> allocated ) ; rc = TPM_RC_SIZE ; } } for ( i = 0 , idx = 0 ; i < numbytes && rc == TPM_RC_SUCCESS ; i += sizeof ( UINT32 ) , idx += 1 ) { rc = UINT32_Unmarshal ( & word , buffer , size ) ; # if RADIX_BITS == 64 data -> d [ idx / 2 ] <<= 32 ; data -> d [ idx / 2 ] |= word ; # elif RADIX_BITS == 32 data -> d [ idx ] = word ; # endif } # if RADIX_BITS == 64 if ( rc == TPM_RC_SUCCESS ) { if ( idx & 1 ) data -> d [ idx / 2 ] <<= 32 ; } # endif if ( rc == TPM_RC_SUCCESS && hdr . version >= 2 ) { BLOCK_SKIP_READ ( skip_future_versions , FALSE , buffer , size , "BN_PRIME_T" , "version<S2SV_blank>3<S2SV_blank>or<S2SV_blank>later" ) ; } skip_future_versions : return rc ; }
<S2SV_ModStart> { TPMLIB_LogTPM2Error ( "bn_prime_t:<S2SV_blank>Require<S2SV_blank>size<S2SV_blank>larger<S2SV_blank>%zu<S2SV_blank>than<S2SV_blank>" "allocated<S2SV_blank>%zu\\n" <S2SV_ModEnd> , data ->