Unnamed: 0
int64
0
535k
source
stringlengths
50
89.8k
target
stringlengths
23
37.7k
7,500
CWE-000 <S2SV_StartBug> int is_built ( char * * cmd , char * str ) <S2SV_EndBug> { if ( ft_strequ ( * cmd , "exit" ) || ft_strequ ( * cmd , "bye" ) ) return ( - 1 ) ; else if ( ft_strequ ( * cmd , "echo" ) ) <S2SV_StartBug> return ( ft_echo ( cmd + 1 , str + 5 ) ) ; <S2SV_EndBug> else if ( ft_strequ ( * cmd , "cd" ) ) return ( ft_cd ( cmd + 1 ) ) ; else if ( ft_strequ ( * cmd , ft_getenv ( "HOME" ) ) ) { safe_chdir ( ft_getenv ( "HOME" ) ) ; return ( 1 ) ; } else if ( ft_strequ ( * cmd , "cowsay" ) ) return ( ft_cowsay ( cmd + 1 ) ) ; else if ( ft_strequ ( * cmd , "env" ) ) return ( ft_env ( ) ) ; else if ( ft_strequ ( * cmd , "setenv" ) ) return ( ft_pre_setenv ( cmd + 1 ) ) ; else if ( ft_strequ ( * cmd , "unsetenv" ) ) return ( ft_pre_unsetenv ( cmd + 1 ) ) ; else if ( ft_strequ ( * cmd , "clear" ) ) return ( ft_clear ( ) ) ; else if ( ft_strequ ( * cmd , "help" ) ) return ( ft_helper ( ) ) ; return ( 0 ) ; }
<S2SV_ModStart> * * cmd <S2SV_ModEnd> ) { if <S2SV_ModStart> cmd + 1 <S2SV_ModEnd> ) ) ;
7,501
CWE-000 <S2SV_StartBug> int ft_strncmp ( const char * s1 , const char * s2 , size_t n ) { <S2SV_EndBug> size_t len = MIN ( n , MIN ( ft_strlen ( s1 ) , ft_strlen ( s2 ) ) ) ; return ft_memcmp ( ( const void * ) s1 , ( const void * ) s2 , len ) ; }
<S2SV_ModStart> n ) { if ( s1 == s2 ) return 0 ;
7,502
CWE-000 <S2SV_StartBug> MVMint64 MVM_io_setsockopt ( MVMThreadContext * tc , MVMObject * oshandle , MVMint32 option , MVMint64 value ) { <S2SV_EndBug> MVMOSHandle * handle = verify_is_handle ( tc , oshandle , "setsockopt" ) ; if ( handle -> body . ops -> options ) { MVMint64 result ; MVMROOT ( tc , handle , { uv_mutex_t * mutex = acquire_mutex ( tc , handle ) ; <S2SV_StartBug> result = handle -> body . ops -> options -> set_sock_opt ( tc , handle , ( int ) option , value ) ; <S2SV_EndBug> release_mutex ( tc , mutex ) ; } ) ; <S2SV_StartBug> return result ; <S2SV_EndBug> } else { MVM_exception_throw_adhoc ( tc , "Cannot<S2SV_blank>set<S2SV_blank>socket<S2SV_blank>options<S2SV_blank>on<S2SV_blank>this<S2SV_blank>kind<S2SV_blank>of<S2SV_blank>handle" ) ; } }
<S2SV_ModStart> <S2SV_null> <S2SV_null> <S2SV_null> void <S2SV_ModEnd> MVM_io_setsockopt ( MVMThreadContext <S2SV_ModStart> handle ) ; <S2SV_ModEnd> handle -> body <S2SV_ModStart> , handle , <S2SV_ModEnd> option , value <S2SV_ModStart> } ) ; <S2SV_ModEnd> } else {
7,503
CWE-000 static void emit_one_texture ( struct v3d_context * v3d , struct v3d_texture_stateobj * stage_tex , int i ) { struct v3d_job * job = v3d -> job ; struct pipe_sampler_state * psampler = stage_tex -> samplers [ i ] ; struct v3d_sampler_state * sampler = v3d_sampler_state ( psampler ) ; struct pipe_sampler_view * psview = stage_tex -> textures [ i ] ; struct v3d_sampler_view * sview = v3d_sampler_view ( psview ) ; struct pipe_resource * prsc = psview -> texture ; struct v3d_resource * rsc = v3d_resource ( prsc ) ; const struct v3d_device_info * devinfo = & v3d -> screen -> devinfo ; stage_tex -> texture_state [ i ] . offset = v3d_cl_ensure_space ( & job -> indirect , cl_packet_length ( TEXTURE_SHADER_STATE ) , 32 ) ; v3d_bo_set_reference ( & stage_tex -> texture_state [ i ] . bo , job -> indirect . bo ) ; uint32_t return_size = v3d_get_tex_return_size ( devinfo , psview -> format , psampler -> compare_mode ) ; struct V3D33_TEXTURE_SHADER_STATE unpacked = { . border_color_red = swizzled_border_color ( devinfo , psampler , sview , 0 ) , . border_color_green = swizzled_border_color ( devinfo , psampler , sview , 1 ) , . border_color_blue = swizzled_border_color ( devinfo , psampler , sview , 2 ) , . border_color_alpha = swizzled_border_color ( devinfo , psampler , sview , 3 ) , . min_level_of_detail = MIN2 ( psview -> u . tex . first_level + MAX2 ( psampler -> min_lod , 0 ) , psview -> u . tex . last_level ) , . max_level_of_detail = MIN2 ( psview -> u . tex . first_level + psampler -> max_lod , psview -> u . tex . last_level ) , . texture_base_pointer = cl_address ( rsc -> bo , rsc -> slices [ 0 ] . offset ) , . output_32_bit = return_size == 32 , } ; if ( return_size == 32 ) { unpacked . swizzle_r = translate_swizzle ( PIPE_SWIZZLE_X ) ; unpacked . swizzle_g = translate_swizzle ( PIPE_SWIZZLE_Y ) ; unpacked . swizzle_b = translate_swizzle ( PIPE_SWIZZLE_Z ) ; unpacked . swizzle_a = translate_swizzle ( PIPE_SWIZZLE_W ) ; } else { unpacked . swizzle_r = translate_swizzle ( sview -> swizzle [ 0 ] ) ; unpacked . swizzle_g = translate_swizzle ( sview -> swizzle [ 1 ] ) ; unpacked . swizzle_b = translate_swizzle ( sview -> swizzle [ 2 ] ) ; unpacked . swizzle_a = translate_swizzle ( sview -> swizzle [ 3 ] ) ; } int min_img_filter = psampler -> min_img_filter ; int min_mip_filter = psampler -> min_mip_filter ; int mag_img_filter = psampler -> mag_img_filter ; if ( return_size == 32 ) { min_mip_filter = PIPE_TEX_MIPFILTER_NEAREST ; <S2SV_StartBug> mag_img_filter = PIPE_TEX_FILTER_NEAREST ; <S2SV_EndBug> mag_img_filter = PIPE_TEX_FILTER_NEAREST ; } bool min_nearest = min_img_filter == PIPE_TEX_FILTER_NEAREST ; switch ( min_mip_filter ) { case PIPE_TEX_MIPFILTER_NONE : unpacked . filter += min_nearest ? 2 : 0 ; break ; case PIPE_TEX_MIPFILTER_NEAREST : unpacked . filter += min_nearest ? 4 : 8 ; break ; case PIPE_TEX_MIPFILTER_LINEAR : unpacked . filter += min_nearest ? 4 : 8 ; unpacked . filter += 2 ; break ; } if ( mag_img_filter == PIPE_TEX_FILTER_NEAREST ) unpacked . filter ++ ; if ( psampler -> max_anisotropy > 8 ) unpacked . filter = V3D_TMU_FILTER_ANISOTROPIC_16_1 ; else if ( psampler -> max_anisotropy > 4 ) unpacked . filter = V3D_TMU_FILTER_ANISOTROPIC_8_1 ; else if ( psampler -> max_anisotropy > 2 ) unpacked . filter = V3D_TMU_FILTER_ANISOTROPIC_4_1 ; else if ( psampler -> max_anisotropy ) unpacked . filter = V3D_TMU_FILTER_ANISOTROPIC_2_1 ; uint8_t packed [ cl_packet_length ( TEXTURE_SHADER_STATE ) ] ; cl_packet_pack ( TEXTURE_SHADER_STATE ) ( & job -> indirect , packed , & unpacked ) ; for ( int i = 0 ; i < ARRAY_SIZE ( packed ) ; i ++ ) packed [ i ] |= sview -> texture_shader_state [ i ] | sampler -> texture_shader_state [ i ] ; v3d_cl_ensure_space ( & job -> indirect , ARRAY_SIZE ( packed ) , 32 ) ; cl_emit_prepacked ( & job -> indirect , & packed ) ; }
<S2SV_ModStart> = PIPE_TEX_MIPFILTER_NEAREST ; min_img_filter <S2SV_ModEnd> = PIPE_TEX_FILTER_NEAREST ;
7,504
CWE-000 gboolean <S2SV_StartBug> fu_dell_supported ( GError * * error ) <S2SV_EndBug> { guint8 dell_supported = 0 ; struct smbios_struct * de_table ; <S2SV_StartBug> g_autofree gchar * dmidecode_path = NULL ; <S2SV_EndBug> g_autofree gchar * dmidecode_version = NULL ; g_autofree gchar * oem_string = NULL ; gboolean ret ; dmidecode_path = g_find_program_in_path ( "dmidecode" ) ; if ( dmidecode_path != NULL ) { ret = g_spawn_command_line_sync ( "dmidecode<S2SV_blank>--v" , & dmidecode_version , NULL , NULL , error ) ; if ( ! ret ) goto smbios_method ; g_strchomp ( dmidecode_version ) ; ret = g_strcmp0 ( dmidecode_version , DMIDECODE_VERSION ) >= 0 ; if ( ! ret ) goto smbios_method ; ret = g_spawn_command_line_sync ( "dmidecode<S2SV_blank>--oem-string<S2SV_blank>1" , & oem_string , NULL , NULL , error ) ; if ( ! ret ) goto smbios_method ; g_strchomp ( oem_string ) ; if ( g_strcmp0 ( oem_string , DELL_SYSTEM ) == 0 ) { g_debug ( "Verified<S2SV_blank>running<S2SV_blank>on<S2SV_blank>supported<S2SV_blank>%s<S2SV_blank>via<S2SV_blank>dmidecode<S2SV_blank>%s" , oem_string , dmidecode_version ) ; return TRUE ; } } smbios_method : de_table = smbios_get_next_struct_by_handle ( 0 , 0xDE00 ) ; if ( ! de_table ) return FALSE ; smbios_struct_get_data ( de_table , & ( dell_supported ) , 0x00 , sizeof ( guint8 ) ) ; if ( dell_supported != 0xDE ) return FALSE ; <S2SV_StartBug> g_debug ( "Verified<S2SV_blank>via<S2SV_blank>SMBIOS<S2SV_blank>tables:<S2SV_blank>%02x" , dell_supported ) ; <S2SV_EndBug> return TRUE ; }
<S2SV_ModStart> gboolean fu_dell_supported ( void <S2SV_ModEnd> ) { guint8 <S2SV_ModStart> * de_table ; <S2SV_ModEnd> de_table = smbios_get_next_struct_by_handle <S2SV_ModStart> return FALSE ; <S2SV_ModEnd> return TRUE ;
7,505
CWE-000 struct mCc_assembly_line * mCc_assembly_condition ( struct mCc_tac_list * tac , struct mCc_assembly_line * current ) { jump_cond = tac -> binary_op_type ; if ( tac -> next -> type == MCC_TAC_ELEMENT_TYPE_CONDITIONAL_JUMP ) { if ( is_float ( tac -> rhs ) ) { NEW_DOUBLE_LINE set_float_register ( "temp_float_zero_constant" ) ; retval -> instruction = new_string ( "\\tfucomip\\t%s,<S2SV_blank>%s\\n\\tfstp\\t%s\\n\\tjp\\t%s" , get_register ( tac -> rhs ) , get_register ( tac -> lhs ) , "%st" , get_label ( tac -> next -> jump -> identifier1 ) ) ; current -> next = retval ; retval -> next = NULL ; temp -> prev = NULL ; while ( current -> next != NULL ) current = current -> next ; move_line_to_end ( current , tac -> prev , tac -> rhs ) ; while ( current -> next != NULL ) current = current -> next ; move_line_to_end ( current , tac -> prev , tac -> lhs ) ; while ( current -> next != NULL ) current = current -> next ; current -> next = temp ; temp -> instruction = new_string ( "\\tfucomip\\t%s,<S2SV_blank>%s\\n\\tfstp\\t%s" , get_register ( tac -> rhs ) , get_register ( tac -> lhs ) , "%st" ) ; retval -> type = MCC_ASSEMBLY_CMP ; temp -> type = MCC_ASSEMBLY_CMP ; return NULL ; } else { NEW_SINGLE_LINE retval -> type = MCC_ASSEMBLY_CMP ; retval -> instruction = new_string ( "\\tcmpl\\t%s,<S2SV_blank>%s" , get_register ( tac -> rhs ) , get_register ( tac -> lhs ) ) ; <S2SV_StartBug> return retval ; <S2SV_EndBug> } } else { printf ( "nested" ) ; return NULL ; } }
<S2SV_ModStart> ) ) ; free_register ( tac -> lhs ) ; free_register ( tac -> rhs ) ;
7,506
CWE-000 static pid_t sub_command ( int fd_in , int fd_out , char * argv_store [ MAX_ARGC ] , int is_first , pid_t pgid_idx ) { if ( ( strcmp ( argv_store [ 0 ] , "export" ) == 0 ) || ( strcmp ( argv_store [ 0 ] , "unset" ) == 0 ) ) { do_environVar ( argv_store [ 0 ] , argv_store [ 1 ] ) ; return MAGIC_BUILDIN ; } pid_t pid ; if ( ( pid = fork ( ) ) == 0 ) { if ( is_first ) { if ( setpgid ( 0 , 0 ) ) { perror ( "setpgid<S2SV_blank>failed" ) ; } pgid_map [ pgid_idx ] = getpgid ( 0 ) ; } else { if ( setpgid ( 0 , pgid_map [ pgid_idx ] ) ) { perror ( "setpgid<S2SV_blank>failed" ) ; } } if ( fd_in != STDIN_FILENO ) { dup2 ( fd_in , STDIN_FILENO ) ; close ( fd_in ) ; } if ( fd_out != STDOUT_FILENO ) { dup2 ( fd_out , STDOUT_FILENO ) ; close ( fd_out ) ; } if ( sigprocmask ( SIG_UNBLOCK , & SignalSet , NULL ) == - 1 ) { perror ( "Failed<S2SV_blank>to<S2SV_blank>change<S2SV_blank>signal<S2SV_blank>mask." ) ; } if ( execvp ( argv_store [ 0 ] , argv_store ) == - 1 ) { fprintf ( stderr , "exec():%s<S2SV_blank><S2SV_blank>failed,errno=%d\\n" , argv_store [ 0 ] , errno ) ; _exit ( EXIT_FAILURE ) ; } } else if ( pid > 0 && is_first ) { pgid_map [ pgid_idx ] = pid ; } <S2SV_StartBug> return pid ; <S2SV_EndBug> }
<S2SV_ModStart> pid ; } globfree ( & glob_result ) ;
7,507
CWE-000 Grammar * createGrammar ( ) { <S2SV_StartBug> Grammar * g = Grammar_new ( ) ; <S2SV_EndBug> Grammar_setVerbose ( g ) ; SYMBOL ( WS , TOKEN ( "\\\\s+" ) ) ; SYMBOL ( NUMBER , TOKEN ( "\\\\d+(\\\\.\\\\d+)?" ) ) ; SYMBOL ( VARIABLE , TOKEN ( "\\\\w+" ) ) ; SYMBOL ( OPERATOR , TOKEN ( "[\\\\+\\\\-\\\\*/]" ) ) ; SYMBOL ( Value , GROUP ( _S ( NUMBER ) , _S ( VARIABLE ) ) ) ; SYMBOL ( Suffix , RULE ( _AS ( _S ( OPERATOR ) , "operator" ) , _AS ( _S ( Value ) , "value" ) ) ) ; SYMBOL ( Expression , RULE ( _S ( Value ) , MANY_OPTIONAL ( _S ( Suffix ) ) ) ) ; AXIOM ( Expression ) ; SKIP ( WS ) ; return g ; }
<S2SV_ModStart> = Grammar_new ( <S2SV_ModEnd> ) ; SYMBOL
7,508
CWE-000 static int _set_object ( struct UtilTimeoutChain * chain , void * obj , struct timespec * time ) { int callStat = 0 ; struct ObjItem objValue ; struct TimeItem timeValue ; RbKey_t timeKey = _rbkey_from_timespec ( time ) ; RbKey_t objKey = _rbKey_from_objptr ( obj ) ; <S2SV_StartBug> _TM_DB ( "Add<S2SV_blank>time<S2SV_blank>%04ld.%09ld,<S2SV_blank>object<S2SV_blank>%s<S2SV_blank>%d" , ( long ) ( time -> tv_sec ) , ( long ) ( time -> tv_nsec ) , ( ( struct AMCEpollEvent * ) obj ) -> description , ( ( struct AMCEpollEvent * ) obj ) -> fd ) ; <S2SV_EndBug> callStat = utilRbTree_GetData ( & ( chain -> obj_time_chain ) , objKey , & timeValue ) ; if ( - RB_ERR_NO_FOUND == callStat ) { return _add_new_object ( chain , obj , time ) ; } callStat = utilRbTree_GetData ( & ( chain -> time_obj_chain ) , timeValue . time , & objValue ) ; if ( 0 == callStat ) { if ( obj == objValue . obj ) { if ( objValue . next ) { struct ObjItem * next = objValue . next ; objValue . next = next -> next ; objValue . obj = next -> obj ; free ( next ) ; utilRbTree_SetData ( & ( chain -> time_obj_chain ) , timeKey , & objValue , NULL ) ; } else { struct ObjItem * prev = & objValue ; struct ObjItem * next = objValue . next ; while ( next && ( next -> obj != obj ) ) { prev = next ; next = next -> next ; } if ( next ) { prev -> next = next -> next ; free ( next ) ; next = NULL ; if ( prev == & objValue ) { utilRbTree_SetData ( & ( chain -> time_obj_chain ) , timeKey , & objValue , NULL ) ; } } } } } timeValue . time = _rbkey_from_timespec ( time ) ; utilRbTree_SetData ( & ( chain -> obj_time_chain ) , objKey , & timeValue , NULL ) ; return 0 ; }
<S2SV_ModStart> ; _TM_DB ( "Add<S2SV_blank>time<S2SV_blank>%04ld.%09ld,<S2SV_blank>object<S2SV_blank>%s" <S2SV_ModEnd> , ( long <S2SV_ModStart> ) -> description <S2SV_ModEnd> ) ; callStat
7,509
CWE-000 uint32_t load_rom ( uint8_t * filename , uint32_t base_addr , uint8_t flags ) { UINT bytes_read ; DWORD filesize ; UINT count = 0 ; UINT is_menu = filename == ( uint8_t * ) "/sd2snes/menu.bin" ; tick_t ticksstart , ticks_total = 0 ; ticksstart = getticks ( ) ; printf ( "%s\\n" , filename ) ; file_open ( filename , FA_READ ) ; if ( file_res ) { uart_putc ( '?' ) ; uart_putc ( 0x30 + file_res ) ; return 0 ; } filesize = file_handle . fsize ; smc_id ( & romprops , flags ) ; file_close ( ) ; <S2SV_StartBug> if ( ! romprops . fpga_conf && msu1_check ( filename ) ) romprops . fpga_conf = FPGA_MSU ; <S2SV_EndBug> if ( is_menu ) { printf ( "Setting<S2SV_blank>menu<S2SV_blank>features..." ) ; fpga_set_features ( romprops . fpga_features | FEAT_CMD_UNLOCK ) ; printf ( "OK.\\n" ) ; } if ( flags & LOADROM_WAIT_SNES ) { printf ( "Setting<S2SV_blank>cmd=0x55..." ) ; snes_set_snes_cmd ( 0x55 ) ; printf ( "OK.\\n" ) ; } if ( flags & LOADROM_WAIT_SNES ) { printf ( "Checking<S2SV_blank>if<S2SV_blank>ok<S2SV_blank>to<S2SV_blank>reconfigure..." ) ; while ( snes_get_mcu_cmd ( ) != SNES_CMD_FPGA_RECONF ) ; printf ( "OK.\\n" ) ; } if ( romprops . fpga_conf || ( flags & LOADROM_WITH_FPGA ) ) { const uint8_t * fpga_conf = romprops . fpga_conf ? romprops . fpga_conf : FPGA_BASE ; printf ( "reconfigure<S2SV_blank>FPGA<S2SV_blank>with<S2SV_blank>%s...\\n" , fpga_conf ) ; fpga_pgm ( ( uint8_t * ) fpga_conf ) ; fpga_set_features ( romprops . fpga_features | FEAT_CMD_UNLOCK ) ; } if ( flags & LOADROM_WAIT_SNES ) snes_set_snes_cmd ( 0x77 ) ; set_mcu_addr ( base_addr + romprops . load_address ) ; file_open ( filename , FA_READ ) ; ff_sd_offload = 1 ; sd_offload_tgt = 0 ; f_lseek ( & file_handle , romprops . offset ) ; for ( ; ; ) { ff_sd_offload = 1 ; sd_offload_tgt = 0 ; bytes_read = file_read ( ) ; if ( file_res || ! bytes_read ) break ; if ( ! ( count ++ % 512 ) ) { uart_putc ( '.' ) ; } } file_close ( ) ; printf ( "rom<S2SV_blank>header<S2SV_blank>map:<S2SV_blank>%02x;<S2SV_blank>mapper<S2SV_blank>id:<S2SV_blank>%d\\n" , romprops . header . map , romprops . mapper_id ) ; ticks_total = getticks ( ) - ticksstart ; printf ( "%u<S2SV_blank>ticks<S2SV_blank>total\\n" , ticks_total ) ; if ( romprops . mapper_id == 3 ) { printf ( "BSX<S2SV_blank>Flash<S2SV_blank>cart<S2SV_blank>image\\n" ) ; printf ( "attempting<S2SV_blank>to<S2SV_blank>load<S2SV_blank>BSX<S2SV_blank>BIOS<S2SV_blank>/sd2snes/bsxbios.bin...\\n" ) ; load_sram_offload ( ( uint8_t * ) "/sd2snes/bsxbios.bin" , 0x800000 , LOADRAM_AUTOSKIP_HEADER ) ; printf ( "attempting<S2SV_blank>to<S2SV_blank>load<S2SV_blank>BS<S2SV_blank>data<S2SV_blank>file<S2SV_blank>/sd2snes/bsxpage.bin...\\n" ) ; load_sram_offload ( ( uint8_t * ) "/sd2snes/bsxpage.bin" , 0x900000 , 0 ) ; printf ( "Type:<S2SV_blank>%02x\\n" , romprops . header . destcode ) ; set_bsx_regs ( 0xf6 , 0x09 ) ; uint16_t rombase ; if ( romprops . header . ramsize & 1 ) { rombase = romprops . load_address + 0xff00 ; } else { rombase = romprops . load_address + 0x7f00 ; } sram_writebyte ( 0x33 , rombase + 0xda ) ; sram_writebyte ( 0x00 , rombase + 0xd4 ) ; sram_writebyte ( 0x00 , rombase + 0xd5 ) ; if ( CFG . bsx_use_usertime ) { set_fpga_time ( srtctime2bcdtime ( CFG . bsx_time ) ) ; } else { set_fpga_time ( get_bcdtime ( ) ) ; } } if ( romprops . has_dspx ) { printf ( "DSPx<S2SV_blank>game.<S2SV_blank>Loading<S2SV_blank>firmware<S2SV_blank>image<S2SV_blank>%s...\\n" , romprops . dsp_fw ) ; load_dspx ( romprops . dsp_fw , romprops . fpga_features ) ; if ( file_res && romprops . dsp_fw == DSPFW_1 ) { load_dspx ( DSPFW_1B , romprops . fpga_features ) ; } if ( file_res ) { snes_menu_errmsg ( MENU_ERR_SUPPLFILE , ( void * ) romprops . dsp_fw ) ; } } uint32_t rammask ; uint32_t rommask ; while ( filesize > ( romprops . romsize_bytes + romprops . offset ) ) { romprops . romsize_bytes <<= 1 ; } if ( romprops . header . ramsize == 0 ) { rammask = 0 ; } else { rammask = romprops . ramsize_bytes - 1 ; } rommask = romprops . romsize_bytes - 1 ; printf ( "ramsize=%x<S2SV_blank>rammask=%lx\\nromsize=%x<S2SV_blank>rommask=%lx\\n" , romprops . header . ramsize , rammask , romprops . header . romsize , rommask ) ; set_saveram_mask ( rammask ) ; set_rom_mask ( rommask ) ; readled ( 0 ) ; if ( flags & LOADROM_WITH_SRAM ) { if ( romprops . ramsize_bytes ) { sram_memset ( SRAM_SAVE_ADDR , romprops . ramsize_bytes , 0xFF ) ; migrate_and_load_srm ( filename , SRAM_SAVE_ADDR ) ; if ( file_res == FR_NO_FILE ) file_res = 0 ; saveram_crc_old = calc_sram_crc ( SRAM_SAVE_ADDR , romprops . ramsize_bytes , 0 ) ; } else { printf ( "No<S2SV_blank>SRAM\\n" ) ; } } printf ( "check<S2SV_blank>MSU..." ) ; if ( msu1_check ( filename ) ) { romprops . fpga_features |= FEAT_MSU1 ; romprops . has_msu1 = 1 ; } else { romprops . has_msu1 = 0 ; } printf ( "done\\n" ) ; if ( CFG . enable_irq_hook ) { romprops . fpga_features |= FEAT_USB1 ; romprops . fpga_features |= FEAT_DMA1 ; } if ( cfg_is_r213f_override_enabled ( ) && ! is_menu && ! ST . is_u16 ) { romprops . fpga_features |= FEAT_213F ; } fpga_set_213f ( romprops . region ) ; fpga_set_dspfeat ( romprops . fpga_dspfeat ) ; dac_pause ( ) ; dac_reset ( 0 ) ; if ( get_cic_state ( ) == CIC_PAIR ) { if ( filename != ( uint8_t * ) "/sd2snes/menu.bin" ) { if ( CFG . vidmode_game == VIDMODE_AUTO ) { cic_videomode ( romprops . region ) ; } else { cic_videomode ( CFG . vidmode_game ) ; } cic_d4 ( romprops . region ) ; } } if ( flags & LOADROM_WAIT_SNES ) { while ( snes_get_mcu_cmd ( ) != SNES_CMD_RESET ) cli_entrycheck ( ) ; } set_mapper ( romprops . mapper_id ) ; if ( flags & ( LOADROM_WITH_RESET | LOADROM_WAIT_SNES ) ) { assert_reset ( ) ; init ( filename ) ; deassert_reset ( ) ; } return ( uint32_t ) filesize ; }
<S2SV_ModStart> . fpga_conf && ( <S2SV_ModStart> ( filename ) || romprops . mapper_id == 3 || romprops . has_dspx ) <S2SV_ModStart> . fpga_conf = FPGA_ORIG <S2SV_ModEnd> ; if (
7,510
CWE-000 void * waiting_worker ( void * arg_ ) { struct waiting_worker_args * arg = ( struct waiting_worker_args * ) arg_ ; __int128_t val = 1 ; val = val << arg -> bit ; pthread_mutex_lock ( & ( arg -> m -> lock ) ) ; * ( arg -> count ) += 1 ; if ( * ( arg -> count ) == NUM_THREADS ) { <S2SV_StartBug> printf ( "Waking<S2SV_blank>everyone<S2SV_blank>up.\\n" ) ; <S2SV_EndBug> pthread_cond_broadcast ( & ( arg -> m -> condition ) ) ; } else while ( * ( arg -> count ) < NUM_THREADS ) { <S2SV_StartBug> printf ( "Waiting,<S2SV_blank>only<S2SV_blank>%d<S2SV_blank>are<S2SV_blank>activated.\\n" , * ( arg -> count ) ) ; <S2SV_EndBug> pthread_cond_wait ( & ( arg -> m -> condition ) , & ( arg -> m -> lock ) ) ; } pthread_mutex_unlock ( & ( arg -> m -> lock ) ) ; for ( int i = 0 ; i < ITERATIONS ; i ++ ) { <S2SV_StartBug> shared = val ; <S2SV_EndBug> <S2SV_StartBug> } <S2SV_EndBug> printf ( "Thread-%d<S2SV_blank>completed\\n" , arg -> bit ) ; }
<S2SV_ModStart> NUM_THREADS ) { sleep ( 1 <S2SV_ModEnd> ) ; pthread_cond_broadcast <S2SV_ModStart> NUM_THREADS ) { <S2SV_ModEnd> pthread_cond_wait ( & <S2SV_ModStart> ++ ) { shared_128_int <S2SV_ModEnd> = val ; <S2SV_ModStart> = val ; * ( arg -> started ) = true ; } } <S2SV_ModEnd> <S2SV_null> <S2SV_null> <S2SV_null>
7,511
CWE-000 SR_PRIV int std_session_send_df_end ( const struct sr_dev_inst * sdi ) { <S2SV_StartBug> const char * prefix = sdi -> driver -> name ; <S2SV_EndBug> int ret ; struct sr_datafeed_packet packet ; if ( ! sdi ) return SR_ERR_ARG ; sr_dbg ( "%s:<S2SV_blank>Sending<S2SV_blank>SR_DF_END<S2SV_blank>packet." , prefix ) ; packet . type = SR_DF_END ; packet . payload = NULL ; if ( ( ret = sr_session_send ( sdi , & packet ) ) < 0 ) { sr_err ( "%s:<S2SV_blank>Failed<S2SV_blank>to<S2SV_blank>send<S2SV_blank>SR_DF_END<S2SV_blank>packet:<S2SV_blank>%d." , prefix , ret ) ; return ret ; } return SR_OK ; }
<S2SV_ModStart> * prefix = ( sdi -> driver ) ? <S2SV_ModStart> driver -> name : "unknown"
7,512
CWE-000 int main ( ) { int array [ 10 ] = { 5 , 2 , 7 , 3 , 1 , 7 , 2 , 9 , 3 , 0 } ; <S2SV_StartBug> int * parray [ 10 ] ; <S2SV_EndBug> for ( int i = 0 ; i < 10 ; ++ i ) { parray [ i ] = array + i ; } <S2SV_StartBug> quick_sort ( ( void * * ) parray , 10 , cmpInt ) ; <S2SV_EndBug> for ( int j = 0 ; j < 10 ; ++ j ) { <S2SV_StartBug> printf ( "%d,<S2SV_blank>" , * parray [ j ] ) ; <S2SV_EndBug> } <S2SV_StartBug> return 0 ; <S2SV_EndBug> }
<S2SV_ModStart> 0 } ; void <S2SV_ModEnd> * parray [ <S2SV_ModStart> } quick_sort ( <S2SV_ModEnd> parray , 10 <S2SV_ModStart> 10 , cmpInt ) ; printf ( "\\n" <S2SV_ModStart> "%d,<S2SV_blank>" , * ( int * ) <S2SV_ModStart> ) ; } printf ( "\\n" ) ;
7,513
CWE-000 static Binding * get_binding ( i3_event_state_mask_t state_filtered , bool is_release , uint16_t input_code , input_type_t input_type ) { <S2SV_StartBug> Binding * bind ; <S2SV_EndBug> if ( ! is_release ) { TAILQ_FOREACH ( bind , bindings , bindings ) { if ( bind -> input_type != input_type ) continue ; if ( bind -> release == B_UPON_KEYRELEASE_IGNORE_MODS ) bind -> release = B_UPON_KEYRELEASE ; } } const uint32_t xkb_group_state = ( state_filtered & 0xFFFF0000 ) ; const uint32_t modifiers_state = ( state_filtered & 0x0000FFFF ) ; TAILQ_FOREACH ( bind , bindings , bindings ) { if ( bind -> input_type != input_type ) { continue ; } const uint32_t xkb_group_mask = ( bind -> event_state_mask & 0xFFFF0000 ) ; const bool groups_match = ( ( xkb_group_state & xkb_group_mask ) == xkb_group_mask ) ; if ( ! groups_match ) { DLOG ( "skipping<S2SV_blank>binding<S2SV_blank>%p<S2SV_blank>because<S2SV_blank>XKB<S2SV_blank>groups<S2SV_blank>do<S2SV_blank>not<S2SV_blank>match\\n" , bind ) ; continue ; } bool found_keycode = false ; if ( input_type == B_KEYBOARD && bind -> symbol != NULL ) { xcb_keycode_t input_keycode = ( xcb_keycode_t ) input_code ; struct Binding_Keycode * binding_keycode ; TAILQ_FOREACH ( binding_keycode , & ( bind -> keycodes_head ) , keycodes ) { const uint32_t modifiers_mask = ( binding_keycode -> modifiers & 0x0000FFFF ) ; const bool mods_match = ( modifiers_mask == modifiers_state ) ; DLOG ( "binding_keycode->modifiers<S2SV_blank>=<S2SV_blank>%d,<S2SV_blank>modifiers_mask<S2SV_blank>=<S2SV_blank>%d,<S2SV_blank>modifiers_state<S2SV_blank>=<S2SV_blank>%d,<S2SV_blank>mods_match<S2SV_blank>=<S2SV_blank>%s\\n" , binding_keycode -> modifiers , modifiers_mask , modifiers_state , ( mods_match ? "yes" : "no" ) ) ; if ( binding_keycode -> keycode == input_keycode && ( mods_match || ( bind -> release == B_UPON_KEYRELEASE_IGNORE_MODS && is_release ) ) ) { found_keycode = true ; break ; } } } else { if ( bind -> keycode != input_code ) { continue ; } struct Binding_Keycode * binding_keycode ; TAILQ_FOREACH ( binding_keycode , & ( bind -> keycodes_head ) , keycodes ) { const uint32_t modifiers_mask = ( binding_keycode -> modifiers & 0x0000FFFF ) ; const bool mods_match = ( modifiers_mask == modifiers_state ) ; DLOG ( "binding_keycode->modifiers<S2SV_blank>=<S2SV_blank>%d,<S2SV_blank>modifiers_mask<S2SV_blank>=<S2SV_blank>%d,<S2SV_blank>modifiers_state<S2SV_blank>=<S2SV_blank>%d,<S2SV_blank>mods_match<S2SV_blank>=<S2SV_blank>%s\\n" , binding_keycode -> modifiers , modifiers_mask , modifiers_state , ( mods_match ? "yes" : "no" ) ) ; if ( mods_match || ( bind -> release == B_UPON_KEYRELEASE_IGNORE_MODS && is_release ) ) { found_keycode = true ; break ; } } } if ( ! found_keycode ) { continue ; } if ( bind -> release == B_UPON_KEYRELEASE && ! is_release ) { bind -> release = B_UPON_KEYRELEASE_IGNORE_MODS ; DLOG ( "marked<S2SV_blank>bind<S2SV_blank>%p<S2SV_blank>as<S2SV_blank>B_UPON_KEYRELEASE_IGNORE_MODS\\n" , bind ) ; <S2SV_StartBug> bind = TAILQ_END ( bindings ) ; <S2SV_EndBug> break ; } <S2SV_StartBug> if ( ( bind -> release == B_UPON_KEYPRESS && is_release ) || <S2SV_EndBug> ( bind -> release >= B_UPON_KEYRELEASE && ! is_release ) ) { continue ; } break ; } return ( bind == TAILQ_END ( bindings ) ? NULL : bind ) ; }
<S2SV_ModStart> Binding * bind ; Binding * result = NULL <S2SV_ModStart> bind ) ; if ( result ) { break ; } continue <S2SV_ModEnd> ; } if <S2SV_ModStart> && is_release ) ) { continue ; } if ( is_release ) { return bind ; } else if ( ! result ) { result = bind ; } } return result <S2SV_ModEnd> ; } <S2SV_null>
7,514
CWE-000 static void hw_stop ( struct entropy_nrf5_dev_data * dev_data ) { unsigned int key ; __ASSERT_NO_MSG ( dev_data ) ; key = irq_lock ( ) ; <S2SV_StartBug> __ASSERT_NO_MSG ( ( dev_data -> hw_users - 1 ) != ~ 0u ) ; <S2SV_EndBug> if ( -- dev_data -> hw_users == 0 ) nrf_rng_task_trigger ( NRF_RNG_TASK_STOP ) ; irq_unlock ( key ) ; }
<S2SV_ModStart> ( ) ; if <S2SV_ModEnd> ( dev_data -> <S2SV_ModStart> dev_data -> hw_users != 0 ) <S2SV_ModEnd> if ( --
7,515
CWE-000 static void yyaddDeferredAction ( yyGLRStack * yystackp , size_t yyk , yyGLRState * yystate , yyGLRState * yyrhs , yyRuleNum yyrule ) { yySemanticOption * yynewOption = <S2SV_StartBug> & yynewGLRStackItem ( yystackp , yyfalse ) -> yyoption ; <S2SV_EndBug> yynewOption -> yystate = yyrhs ; yynewOption -> yyrule = yyrule ; if ( yystackp -> yytops . yylookaheadNeeds [ yyk ] ) { yynewOption -> yyrawchar = yychar ; yynewOption -> yyval = yylval ; ] b4_locations_if ( [ yynewOption -> yyloc = yylloc ; ] ) [ } else yynewOption -> yyrawchar = YYEMPTY ; yynewOption -> yynext = yystate -> yysemantics . yyfirstVal ; yystate -> yysemantics . yyfirstVal = yynewOption ; YY_RESERVE_GLRSTACK ( yystackp ) ; } static yybool yyinitStateSet ( yyGLRStateSet * yyset ) { yyset -> yysize = 1 ; yyset -> yycapacity = 16 ; yyset -> yystates = ( yyGLRState * * ) YYMALLOC ( 16 * sizeof yyset -> yystates [ 0 ] ) ; if ( ! yyset -> yystates ) return yyfalse ; yyset -> yystates [ 0 ] = YY_NULL ; yyset -> yylookaheadNeeds = ( yybool * ) YYMALLOC ( 16 * sizeof yyset -> yylookaheadNeeds [ 0 ] ) ; if ( ! yyset -> yylookaheadNeeds ) { YYFREE ( yyset -> yystates ) ; return yyfalse ; } return yytrue ; } static void yyfreeStateSet ( yyGLRStateSet * yyset ) { YYFREE ( yyset -> yystates ) ; YYFREE ( yyset -> yylookaheadNeeds ) ; } static yybool yyinitGLRStack ( yyGLRStack * yystackp , size_t yysize ) { yystackp -> yyerrState = 0 ; yynerrs = 0 ; yystackp -> yyspaceLeft = yysize ; yystackp -> yyitems = ( yyGLRStackItem * ) YYMALLOC ( yysize * sizeof yystackp -> yynextFree [ 0 ] ) ; if ( ! yystackp -> yyitems ) return yyfalse ; yystackp -> yynextFree = yystackp -> yyitems ; yystackp -> yysplitPoint = YY_NULL ; yystackp -> yylastDeleted = YY_NULL ; return yyinitStateSet ( & yystackp -> yytops ) ; } # if YYSTACKEXPANDABLE # define YYRELOC ( YYFROMITEMS , YYTOITEMS , YYX , YYTYPE ) & ( ( YYTOITEMS ) - ( ( YYFROMITEMS ) - ( yyGLRStackItem * ) ( YYX ) ) ) -> YYTYPE static void yyexpandGLRStack ( yyGLRStack * yystackp ) { yyGLRStackItem * yynewItems ; yyGLRStackItem * yyp0 , * yyp1 ; size_t yynewSize ; size_t yyn ; size_t yysize = yystackp -> yynextFree - yystackp -> yyitems ; if ( YYMAXDEPTH - YYHEADROOM < yysize ) yyMemoryExhausted ( yystackp ) ; yynewSize = 2 * yysize ; if ( YYMAXDEPTH < yynewSize ) yynewSize = YYMAXDEPTH ; yynewItems = ( yyGLRStackItem * ) YYMALLOC ( yynewSize * sizeof yynewItems [ 0 ] ) ; if ( ! yynewItems ) yyMemoryExhausted ( yystackp ) ; for ( yyp0 = yystackp -> yyitems , yyp1 = yynewItems , yyn = yysize ; 0 < yyn ; yyn -= 1 , yyp0 += 1 , yyp1 += 1 ) { * yyp1 = * yyp0 ; if ( * ( yybool * ) yyp0 ) { yyGLRState * yys0 = & yyp0 -> yystate ; yyGLRState * yys1 = & yyp1 -> yystate ; if ( yys0 -> yypred != YY_NULL ) yys1 -> yypred = YYRELOC ( yyp0 , yyp1 , yys0 -> yypred , yystate ) ; if ( ! yys0 -> yyresolved && yys0 -> yysemantics . yyfirstVal != YY_NULL ) yys1 -> yysemantics . yyfirstVal = YYRELOC ( yyp0 , yyp1 , yys0 -> yysemantics . yyfirstVal , yyoption ) ; } else { yySemanticOption * yyv0 = & yyp0 -> yyoption ; yySemanticOption * yyv1 = & yyp1 -> yyoption ; if ( yyv0 -> yystate != YY_NULL ) yyv1 -> yystate = YYRELOC ( yyp0 , yyp1 , yyv0 -> yystate , yystate ) ; if ( yyv0 -> yynext != YY_NULL ) yyv1 -> yynext = YYRELOC ( yyp0 , yyp1 , yyv0 -> yynext , yyoption ) ; } } if ( yystackp -> yysplitPoint != YY_NULL ) yystackp -> yysplitPoint = YYRELOC ( yystackp -> yyitems , yynewItems , yystackp -> yysplitPoint , yystate ) ; for ( yyn = 0 ; yyn < yystackp -> yytops . yysize ; yyn += 1 ) if ( yystackp -> yytops . yystates [ yyn ] != YY_NULL ) yystackp -> yytops . yystates [ yyn ] = YYRELOC ( yystackp -> yyitems , yynewItems , yystackp -> yytops . yystates [ yyn ] , yystate ) ; YYFREE ( yystackp -> yyitems ) ; yystackp -> yyitems = yynewItems ; yystackp -> yynextFree = yynewItems + yysize ; yystackp -> yyspaceLeft = yynewSize - yysize ; }
<S2SV_ModStart> ) -> yyoption ; YYASSERT ( ! yynewOption -> yyisState )
7,516
CWE-000 bool dlg_win_init_ansi ( void ) { <S2SV_StartBug> # ifdef DLG_OS_WIN <S2SV_EndBug> static volatile LONG status = 0 ; LONG res = InterlockedCompareExchange ( & status , 1 , 0 ) ; if ( res == 0 ) { InterlockedExchange ( & status , 3 + init_ansi_console ( ) ) ; } while ( status == 1 ) ; return ( status == 4 ) ; # else return true ; # endif }
<S2SV_ModStart> ) { # if defined ( DLG_OS_WIN ) && defined ( DLG_WIN_CONSOLE ) <S2SV_ModEnd> static volatile LONG
7,517
CWE-000 int dmu_object_next ( objset_t * os , uint64_t * objectp , boolean_t hole , uint64_t txg ) { uint64_t offset ; uint64_t start_obj ; struct dsl_dataset * ds = os -> os_dsl_dataset ; int error ; if ( * objectp == 0 ) { start_obj = 1 ; } else if ( ds && ds -> ds_feature_inuse [ SPA_FEATURE_LARGE_DNODE ] ) { uint64_t i = * objectp + 1 ; <S2SV_StartBug> uint64_t last_obj = P2ROUNDUP ( * objectp , DNODES_PER_BLOCK ) ; <S2SV_EndBug> dmu_object_info_t doi ; <S2SV_StartBug> while ( i < last_obj ) { <S2SV_EndBug> error = dmu_object_info ( os , i , & doi ) ; if ( error == ENOENT ) { if ( hole ) { * objectp = i ; return ( 0 ) ; } else { i ++ ; } } else if ( error == EEXIST ) { i ++ ; } else if ( error == 0 ) { if ( hole ) { i += doi . doi_dnodesize >> DNODE_SHIFT ; } else { * objectp = i ; return ( 0 ) ; } } else { return ( error ) ; } } start_obj = i ; } else { start_obj = * objectp + 1 ; } offset = start_obj << DNODE_SHIFT ; error = dnode_next_offset ( DMU_META_DNODE ( os ) , ( hole ? DNODE_FIND_HOLE : 0 ) , & offset , 0 , DNODES_PER_BLOCK , txg ) ; * objectp = offset >> DNODE_SHIFT ; return ( error ) ; }
<S2SV_ModStart> uint64_t last_obj = * objectp | ( DNODES_PER_BLOCK - 1 <S2SV_ModEnd> ) ; dmu_object_info_t <S2SV_ModStart> while ( i <= <S2SV_ModEnd> last_obj ) {
7,518
CWE-000 void table_liste_liberer ( Cellule_t * liste ) { Cellule_t * tmp ; while ( liste ) { tmp = liste ; liste = liste -> next ; <S2SV_StartBug> free ( tmp ) ; <S2SV_EndBug> } }
<S2SV_ModStart> free ( tmp -> key ) ; free ( tmp -> content ) ; free ( tmp
7,519
CWE-000 static ssize_t nfs_idmap_get_key ( const char * name , size_t namelen , const char * type , void * data , size_t data_size , struct idmap * idmap ) { const struct cred * saved_cred ; struct key * rkey ; const struct user_key_payload * payload ; ssize_t ret ; saved_cred = override_creds ( id_resolver_cache ) ; rkey = nfs_idmap_request_key ( name , namelen , type , idmap ) ; revert_creds ( saved_cred ) ; if ( IS_ERR ( rkey ) ) { ret = PTR_ERR ( rkey ) ; goto out ; } rcu_read_lock ( ) ; rkey -> perm |= KEY_USR_VIEW ; ret = key_validate ( rkey ) ; if ( ret < 0 ) goto out_up ; <S2SV_StartBug> payload = user_key_payload ( rkey ) ; <S2SV_EndBug> if ( IS_ERR_OR_NULL ( payload ) ) { ret = PTR_ERR ( payload ) ; goto out_up ; } ret = payload -> datalen ; if ( ret > 0 && ret <= data_size ) memcpy ( data , payload -> data , ret ) ; else ret = - EINVAL ; out_up : rcu_read_unlock ( ) ; key_put ( rkey ) ; out : return ret ; }
<S2SV_ModStart> ; payload = user_key_payload_rcu <S2SV_ModEnd> ( rkey )
7,520
CWE-000 static void json_object_extarr_delete ( struct json_object * jso ) { assert ( jso && json_object_is_type ( jso , json_type_extarr ) ) ; array_list_free ( jso -> o . c_extarr . dims ) ; <S2SV_StartBug> json_object_generic_delete ( jso ) ; <S2SV_EndBug> }
<S2SV_ModStart> dims ) ; if ( ! ( jso -> o . c_extarr . flags & JSON_C_EXTARR_DONT_FREE ) ) free ( ( void * ) jso -> o . c_extarr . data ) ;
7,521
CWE-000 void fs_rtp_session_new_recv_pad ( FsRtpSession * session , GstPad * new_pad , guint32 ssrc , guint pt ) { FsRtpSubStream * substream = NULL ; FsRtpStream * stream = NULL ; GError * error = NULL ; gint no_rtcp_timeout ; if ( fs_rtp_session_has_disposed_enter ( session , NULL ) ) return ; FS_RTP_SESSION_LOCK ( session ) ; no_rtcp_timeout = session -> priv -> no_rtcp_timeout ; FS_RTP_SESSION_UNLOCK ( session ) ; substream = fs_rtp_sub_stream_new ( session -> priv -> conference , session , new_pad , ssrc , pt , no_rtcp_timeout , & error ) ; if ( substream == NULL ) { g_prefix_error ( & error , "Could<S2SV_blank>not<S2SV_blank>create<S2SV_blank>a<S2SV_blank>substream<S2SV_blank>for<S2SV_blank>the<S2SV_blank>new<S2SV_blank>pad:<S2SV_blank>" ) ; fs_session_emit_error ( FS_SESSION ( session ) , error ? error -> code : FS_ERROR_CONSTRUCTION , error ? error -> message : "No<S2SV_blank>error<S2SV_blank>details<S2SV_blank>returned" ) ; g_clear_error ( & error ) ; fs_rtp_session_has_disposed_exit ( session ) ; return ; } g_signal_connect_object ( substream , "get-codec-bin" , G_CALLBACK ( _substream_get_codec_bin ) , session , 0 ) ; g_signal_connect_object ( substream , "unlinked" , G_CALLBACK ( _substream_unlinked ) , session , 0 ) ; g_signal_connect_object ( substream , "codec-changed" , G_CALLBACK ( _substream_codec_changed ) , session , 0 ) ; FS_RTP_SESSION_LOCK ( session ) ; stream = fs_rtp_session_get_stream_by_ssrc_locked ( session , ssrc ) ; if ( stream ) GST_DEBUG ( "Already<S2SV_blank>have<S2SV_blank>a<S2SV_blank>stream<S2SV_blank>with<S2SV_blank>SSRC<S2SV_blank>%x,<S2SV_blank>using<S2SV_blank>it" , ssrc ) ; if ( ! stream ) { if ( no_rtcp_timeout == 0 && g_list_length ( session -> priv -> streams ) == 1 ) { stream = g_object_ref ( g_list_first ( session -> priv -> streams ) -> data ) ; GST_DEBUG ( "No<S2SV_blank>RTCP<S2SV_blank>timeout<S2SV_blank>and<S2SV_blank>only<S2SV_blank>one<S2SV_blank>stream,<S2SV_blank>giving<S2SV_blank>it<S2SV_blank>substream" "<S2SV_blank>for<S2SV_blank>SSRC<S2SV_blank>%x<S2SV_blank>in<S2SV_blank>session<S2SV_blank>%u" , ssrc , session -> id ) ; } else { session -> priv -> free_substreams = g_list_prepend ( session -> priv -> free_substreams , substream ) ; g_signal_connect_object ( substream , "error" , G_CALLBACK ( _substream_error ) , session , 0 ) ; if ( no_rtcp_timeout > 0 ) { g_signal_connect_object ( substream , "no-rtcp-timedout" , G_CALLBACK ( _substream_no_rtcp_timedout_cb ) , session , 0 ) ; GST_DEBUG ( "No<S2SV_blank>stream<S2SV_blank>for<S2SV_blank>SSRC<S2SV_blank>%x,<S2SV_blank>waiting<S2SV_blank>for<S2SV_blank>%d<S2SV_blank>ms<S2SV_blank>before<S2SV_blank>associating" "in<S2SV_blank>session<S2SV_blank>%u" , ssrc , no_rtcp_timeout , session -> id ) ; } else if ( no_rtcp_timeout < 0 ) { GST_DEBUG ( "No<S2SV_blank>RTCP<S2SV_blank>timeout<S2SV_blank>is<S2SV_blank><<S2SV_blank>0,<S2SV_blank>we<S2SV_blank>will<S2SV_blank>wait<S2SV_blank>forever<S2SV_blank>for<S2SV_blank>an" "<S2SV_blank>RTCP<S2SV_blank>SDES<S2SV_blank>to<S2SV_blank>arrive<S2SV_blank>for<S2SV_blank>SSRC<S2SV_blank>%x<S2SV_blank>in<S2SV_blank>session<S2SV_blank>%u" , ssrc , session -> id ) ; } else { GST_WARNING ( "No<S2SV_blank>RTCP<S2SV_blank>timeout<S2SV_blank>is<S2SV_blank>0,<S2SV_blank>but<S2SV_blank>there<S2SV_blank>is<S2SV_blank>more<S2SV_blank>than<S2SV_blank>one<S2SV_blank>stream," "<S2SV_blank>we<S2SV_blank>will<S2SV_blank>wait<S2SV_blank>forever<S2SV_blank>for<S2SV_blank>an<S2SV_blank>RTCP<S2SV_blank>SDES<S2SV_blank>to<S2SV_blank>arrive<S2SV_blank>for<S2SV_blank>SSRC<S2SV_blank>%u<S2SV_blank>in" "<S2SV_blank>session<S2SV_blank>%u" , ssrc , session -> id ) ; } } } if ( stream ) { <S2SV_StartBug> if ( ! fs_rtp_stream_add_substream_unlock ( stream , substream , & error ) ) <S2SV_EndBug> { g_prefix_error ( & error , "Could<S2SV_blank>not<S2SV_blank>add<S2SV_blank>the<S2SV_blank>output<S2SV_blank>ghostpad<S2SV_blank>to<S2SV_blank>the<S2SV_blank>new<S2SV_blank>substream:<S2SV_blank>" ) ; fs_session_emit_error ( FS_SESSION ( session ) , error -> code , error -> message ) ; } g_clear_error ( & error ) ; } else { fs_rtp_sub_stream_verify_codec_locked ( substream ) ; FS_RTP_SESSION_UNLOCK ( session ) ; } if ( stream ) g_object_unref ( stream ) ; fs_rtp_session_has_disposed_exit ( session ) ; }
<S2SV_ModStart> , substream , session ,
7,522
CWE-000 void vcons_attach ( struct device * parent , struct device * self , void * aux ) { struct vcons_softc * sc = ( struct vcons_softc * ) self ; <S2SV_StartBug> struct vbus_attach_args * va = aux ; <S2SV_EndBug> uint64_t sysino ; int vcons_is_input , vcons_is_output ; int node , maj ; sc -> sc_si = softintr_establish ( IPL_TTY , vcons_softintr , sc ) ; if ( sc -> sc_si == NULL ) panic ( ":<S2SV_blank>can\'t<S2SV_blank>establish<S2SV_blank>soft<S2SV_blank>interrupt" ) ; <S2SV_StartBug> if ( vbus_intr_map ( va -> va_node , va -> va_intr [ 0 ] , & sysino ) ) <S2SV_EndBug> printf ( ":<S2SV_blank>can\'t<S2SV_blank>map<S2SV_blank>interrupt\\n" ) ; <S2SV_StartBug> printf ( ":<S2SV_blank>ivec<S2SV_blank>0x%llx" , sysino ) ; <S2SV_EndBug> <S2SV_StartBug> sc -> sc_ih = bus_intr_establish ( va -> va_bustag , sysino , IPL_TTY , <S2SV_EndBug> BUS_INTR_ESTABLISH_MPSAFE , vcons_intr , sc , sc -> sc_dv . dv_xname ) ; if ( sc -> sc_ih == NULL ) { printf ( ",<S2SV_blank>can\'t<S2SV_blank>establish<S2SV_blank>interrupt\\n" ) ; return ; } node = OF_instance_to_package ( OF_stdin ( ) ) ; vcons_is_input = ( va -> va_node == node ) ; node = OF_instance_to_package ( OF_stdout ( ) ) ; vcons_is_output = ( va -> va_node == node ) ; if ( vcons_is_input || vcons_is_output ) { if ( vcons_is_input ) { cn_tab -> cn_pollc = nullcnpollc ; cn_tab -> cn_getc = vcons_cngetc ; for ( maj = 0 ; maj < nchrdev ; maj ++ ) if ( cdevsw [ maj ] . d_open == vconsopen ) break ; cn_tab -> cn_dev = makedev ( maj , self -> dv_unit ) ; } if ( vcons_is_output ) cn_tab -> cn_putc = vcons_cnputc ; printf ( ",<S2SV_blank>console" ) ; } printf ( "\\n" ) ; }
<S2SV_ModStart> va = aux <S2SV_ModEnd> ; int vcons_is_input <S2SV_ModStart> ] , & sc -> sc_sysino <S2SV_ModEnd> ) ) printf <S2SV_ModStart> ( ":<S2SV_blank>ivec<S2SV_blank>0x%llx" , sc -> sc_sysino ) ; sc -> sc_bustag = va -> va_bustag <S2SV_ModEnd> ; sc -> <S2SV_ModStart> = bus_intr_establish ( sc -> sc_bustag , sc -> sc_sysino <S2SV_ModEnd> , IPL_TTY ,
7,523
CWE-000 void load_handle_select ( ) <S2SV_StartBug> { <S2SV_EndBug> game . current_screen = HANDLE_SELECT ; clear_sprites ( ) ; DrawMap2 ( 3 , 4 , map_green_tank ) ; DrawMap2 ( 20 , 4 , map_blue_tank ) ; Print ( 9 , 1 , ( char * ) strHandlesTitle ) ; Print ( 6 , 5 , ( char * ) strPlayer1 ) ; Print ( 23 , 5 , ( char * ) strPlayer2 ) ; for ( int i = 0 ; i < 27 ; i += 1 ) { PrintChar ( ( i % 3 ) + 3 , 8 + ( i / 3 ) , handles . data [ i ] ) ; PrintChar ( 20 + ( i % 3 ) , 8 + ( i / 3 ) , handles . data [ i ] ) ; } # if JAMMA Print ( 6 , 22 , ( char * ) strSelectHandle ) ; Print ( 6 , 24 , ( char * ) strChangeHandle ) ; # else Print ( 5 , 21 , ( char * ) strSelectHandle ) ; Print ( 5 , 22 , ( char * ) strConfirmHandle ) ; Print ( 5 , 23 , ( char * ) strCancelHandle ) ; Print ( 5 , 24 , ( char * ) strChangeHandle ) ; # endif }
<S2SV_ModStart> ( ) { player1 . netMessage . ps . select_state = SELECTING ; player2 . netMessage . ps . select_state = SELECTING ; player1 . netMessage . ps . handle_id = 0 ; player2 . netMessage . ps . handle_id = 0 ; player1 . netMessage . ps . char_index = 0 ; player2 . netMessage . ps . char_index = 0 ;
7,524
CWE-000 int main ( int argc , char * * argv ) { uint in_wnum , in_rnum , in_max , in_time ; int error_code , i , end_size ; pthread_t * writers , * readers , garbage_collector ; if ( 5 != argc ) { printf ( "Incorrect<S2SV_blank>usage.\\nUse<S2SV_blank>%s<S2SV_blank><WNUM><S2SV_blank><RNUM><S2SV_blank><MAX><S2SV_blank><TIME>\\n" , argv [ 0 ] ) ; return - 1 ; } srand ( ( uint ) time ( NULL ) ) ; in_wnum = ( uint ) strtol ( argv [ 1 ] , NULL , BASE ) ; in_rnum = ( uint ) strtol ( argv [ 2 ] , NULL , BASE ) ; in_max = ( uint ) strtol ( argv [ 3 ] , NULL , BASE ) ; in_time = ( uint ) strtol ( argv [ 4 ] , NULL , BASE ) ; MAX = in_max ; if ( NULL == ( global_intlist = ( intlist * ) malloc ( sizeof ( intlist ) ) ) ) { printf ( "Error<S2SV_blank>in<S2SV_blank>malloc():<S2SV_blank>%s\\n" , strerror ( errno ) ) ; return - 1 ; } intlist_init ( global_intlist ) ; if ( NULL == ( too_many_elements_cond = ( pthread_cond_t * ) malloc ( sizeof ( pthread_cond_t ) ) ) ) { printf ( "Error<S2SV_blank>in<S2SV_blank>malloc():<S2SV_blank>%s\\n" , strerror ( errno ) ) ; return - 1 ; } error_code = pthread_cond_init ( too_many_elements_cond , NULL ) ; if ( error_code ) { printf ( "Error<S2SV_blank>in<S2SV_blank>pthread_cond_init():<S2SV_blank>%s\\n" , strerror ( error_code ) ) ; return - 1 ; } printf ( "Creating<S2SV_blank>GC\\n" ) ; error_code = pthread_create ( & garbage_collector , NULL , garbage_collector_function , NULL ) ; if ( error_code ) { printf ( "Error<S2SV_blank>in<S2SV_blank>pthread_create():<S2SV_blank>%s\\n" , strerror ( error_code ) ) ; return - 1 ; } printf ( "Creating<S2SV_blank>writers\\n" ) ; if ( NULL == ( writers = ( pthread_t * ) malloc ( sizeof ( pthread_t ) * in_wnum ) ) ) { printf ( "Error<S2SV_blank>in<S2SV_blank>malloc():<S2SV_blank>%s\\n" , strerror ( errno ) ) ; return - 1 ; } for ( i = 0 ; i < in_wnum ; ++ i ) { error_code = pthread_create ( & writers [ i ] , NULL , writer_function , NULL ) ; if ( error_code ) { printf ( "Error<S2SV_blank>in<S2SV_blank>pthread_create():<S2SV_blank>%s\\n" , strerror ( error_code ) ) ; <S2SV_StartBug> } <S2SV_EndBug> } printf ( "Creating<S2SV_blank>readers\\n" ) ; if ( NULL == ( readers = ( pthread_t * ) malloc ( sizeof ( pthread_t ) * in_rnum ) ) ) { printf ( "Error<S2SV_blank>in<S2SV_blank>malloc():<S2SV_blank>%s\\n" , strerror ( errno ) ) ; return - 1 ; } for ( i = 0 ; i < in_rnum ; ++ i ) { error_code = pthread_create ( & readers [ i ] , NULL , reader_function , NULL ) ; if ( error_code ) { printf ( "Error<S2SV_blank>in<S2SV_blank>pthread_create():<S2SV_blank>%s\\n" , strerror ( error_code ) ) ; <S2SV_StartBug> } <S2SV_EndBug> } printf ( "Sleeping............\\n" ) ; sleep ( in_time ) ; printf ( "Time<S2SV_blank>to<S2SV_blank>stop!!\\n" ) ; continue_running = 0 ; for ( i = 0 ; i < in_rnum ; ++ i ) { error_code = pthread_join ( readers [ i ] , NULL ) ; if ( error_code ) { printf ( "Error<S2SV_blank>in<S2SV_blank>pthread_join:<S2SV_blank>%s\\n" , strerror ( error_code ) ) ; return - 1 ; } } for ( i = 0 ; i < in_wnum ; ++ i ) { error_code = pthread_join ( writers [ i ] , NULL ) ; if ( error_code ) { printf ( "Error<S2SV_blank>in<S2SV_blank>pthread_join:<S2SV_blank>%s\\n" , strerror ( error_code ) ) ; return - 1 ; } } pthread_cond_signal ( too_many_elements_cond ) ; error_code = pthread_join ( garbage_collector , NULL ) ; if ( error_code ) { printf ( "Error<S2SV_blank>in<S2SV_blank>pthread_join:<S2SV_blank>%s\\n" , strerror ( error_code ) ) ; return - 1 ; } end_size = intlist_size ( global_intlist ) ; printf ( "size<S2SV_blank>is:<S2SV_blank>%d\\n" , end_size ) ; <S2SV_StartBug> for ( i = 0 ; i < end_size ; ++ i ) <S2SV_EndBug> { printf ( "%d<S2SV_blank>" , intlist_pop_tail ( global_intlist ) ) ; } printf ( "\\n" ) ; free ( readers ) ; free ( writers ) ; intlist_destroy ( global_intlist ) ; free ( global_intlist ) ; pthread_cond_destroy ( too_many_elements_cond ) ; free ( too_many_elements_cond ) ; return 0 ; }
<S2SV_ModStart> ) ) ; return - 1 ; <S2SV_ModStart> ) ) ; return - 1 ; <S2SV_ModStart> end_size ) ; free ( readers ) ; free ( writers ) ; intlist_destroy ( global_intlist ) ; free ( global_intlist ) ; pthread_cond_destroy ( too_many_elements_cond ) ; free ( too_many_elements_cond ) ; return 0 ; <S2SV_ModEnd> } <S2SV_null> <S2SV_null>
7,525
CWE-000 static void ndpi_tg_destroy ( const struct xt_tgdtor_param * par ) { <S2SV_StartBug> nf_ct_l3proto_module_put ( par -> family ) ; <S2SV_EndBug> }
<S2SV_ModStart> par ) { # if LINUX_VERSION_CODE >= KERNEL_VERSION ( 4 , 11 , 0 ) nf_ct_netns_put ( par -> net , par -> family ) ; # endif
7,526
CWE-000 static int h264_slice_header_init ( H264Context * h ) { const SPS * sps = h -> ps . sps ; int i , ret ; ff_set_sar ( h -> avctx , sps -> sar ) ; av_pix_fmt_get_chroma_sub_sample ( h -> avctx -> pix_fmt , & h -> chroma_x_shift , & h -> chroma_y_shift ) ; if ( sps -> timing_info_present_flag ) { int64_t den = sps -> time_scale ; if ( h -> sei . unregistered . x264_build < 44U ) den *= 2 ; av_reduce ( & h -> avctx -> framerate . den , & h -> avctx -> framerate . num , sps -> num_units_in_tick * h -> avctx -> ticks_per_frame , den , 1 << 30 ) ; } ff_h264_free_tables ( h ) ; h -> first_field = 0 ; h -> prev_interlaced_frame = 1 ; <S2SV_StartBug> init_scan_tables ( h ) ; <S2SV_EndBug> ret = ff_h264_alloc_tables ( h ) ; if ( ret < 0 ) { av_log ( h -> avctx , AV_LOG_ERROR , "Could<S2SV_blank>not<S2SV_blank>allocate<S2SV_blank>memory\\n" ) ; goto fail ; } # if FF_API_CAP_VDPAU if ( h -> avctx -> codec && h -> avctx -> codec -> capabilities & AV_CODEC_CAP_HWACCEL_VDPAU && ( sps -> bit_depth_luma != 8 || sps -> chroma_format_idc > 1 ) ) { av_log ( h -> avctx , AV_LOG_ERROR , "VDPAU<S2SV_blank>decoding<S2SV_blank>does<S2SV_blank>not<S2SV_blank>support<S2SV_blank>video<S2SV_blank>colorspace.\\n" ) ; ret = AVERROR_INVALIDDATA ; goto fail ; } # endif if ( sps -> bit_depth_luma < 8 || sps -> bit_depth_luma > 14 || sps -> bit_depth_luma == 11 || sps -> bit_depth_luma == 13 ) { av_log ( h -> avctx , AV_LOG_ERROR , "Unsupported<S2SV_blank>bit<S2SV_blank>depth<S2SV_blank>%d\\n" , sps -> bit_depth_luma ) ; ret = AVERROR_INVALIDDATA ; goto fail ; } h -> cur_bit_depth_luma = h -> avctx -> bits_per_raw_sample = sps -> bit_depth_luma ; h -> cur_chroma_format_idc = sps -> chroma_format_idc ; h -> pixel_shift = sps -> bit_depth_luma > 8 ; h -> chroma_format_idc = sps -> chroma_format_idc ; h -> bit_depth_luma = sps -> bit_depth_luma ; ff_h264dsp_init ( & h -> h264dsp , sps -> bit_depth_luma , sps -> chroma_format_idc ) ; ff_h264chroma_init ( & h -> h264chroma , sps -> bit_depth_chroma ) ; ff_h264qpel_init ( & h -> h264qpel , sps -> bit_depth_luma ) ; ff_h264_pred_init ( & h -> hpc , h -> avctx -> codec_id , sps -> bit_depth_luma , sps -> chroma_format_idc ) ; ff_videodsp_init ( & h -> vdsp , sps -> bit_depth_luma ) ; if ( ! HAVE_THREADS || ! ( h -> avctx -> active_thread_type & FF_THREAD_SLICE ) ) { ret = ff_h264_slice_context_init ( h , & h -> slice_ctx [ 0 ] ) ; if ( ret < 0 ) { av_log ( h -> avctx , AV_LOG_ERROR , "context_init()<S2SV_blank>failed.\\n" ) ; goto fail ; } } else { for ( i = 0 ; i < h -> nb_slice_ctx ; i ++ ) { H264SliceContext * sl = & h -> slice_ctx [ i ] ; sl -> h264 = h ; sl -> intra4x4_pred_mode = h -> intra4x4_pred_mode + i * 8 * 2 * h -> mb_stride ; sl -> mvd_table [ 0 ] = h -> mvd_table [ 0 ] + i * 8 * 2 * h -> mb_stride ; sl -> mvd_table [ 1 ] = h -> mvd_table [ 1 ] + i * 8 * 2 * h -> mb_stride ; if ( ( ret = ff_h264_slice_context_init ( h , sl ) ) < 0 ) { av_log ( h -> avctx , AV_LOG_ERROR , "context_init()<S2SV_blank>failed.\\n" ) ; goto fail ; } } } h -> context_initialized = 1 ; return 0 ; fail : ff_h264_free_tables ( h ) ; h -> context_initialized = 0 ; return ret ; }
<S2SV_ModStart> = 1 ; h -> got_first_iframe = 0 ;
7,527
CWE-000 static int print_insn_shift ( bfd_vma memaddr , struct disassemble_info * info , uint8_t byte ) { size_t i ; uint8_t sb ; int status = read_memory ( memaddr , & sb , 1 , info ) ; if ( status < 0 ) return status ; enum SB_DIR dir = ( sb & 0x40 ) ? SB_LEFT : SB_RIGHT ; enum SB_TYPE type = ( sb & 0x80 ) ? SB_ARITHMETIC : SB_LOGICAL ; enum SB_MODE mode = - 1 ; for ( i = 0 ; i < sizeof ( sb_table ) / sizeof ( sb_table [ 0 ] ) ; ++ i ) { const struct sb * sbe = sb_table + i ; if ( ( sb & sbe -> mask ) == sbe -> value ) mode = sbe -> mode ; } char mnemonic [ 6 ] ; int x = 0 ; if ( mode == SB_ROT ) { mnemonic [ x ++ ] = 'r' ; mnemonic [ x ++ ] = 'o' ; } else { mnemonic [ x ++ ] = ( type == SB_LOGICAL ) ? 'l' : 'a' ; mnemonic [ x ++ ] = 's' ; } mnemonic [ x ++ ] = ( dir == SB_LEFT ) ? 'l' : 'r' ; switch ( mode ) { case SB_REG_OPR_EFF : case SB_ROT : case SB_REG_OPR_OPR : mnemonic [ x ++ ] = '.' ; mnemonic [ x ++ ] = shift_size_table [ sb & 0x03 ] ; break ; case SB_OPR_N : { uint8_t xb ; read_memory ( memaddr + 1 , & xb , 1 , info ) ; if ( ( xb & 0xF8 ) != 0xB8 ) { mnemonic [ x ++ ] = '.' ; mnemonic [ x ++ ] = shift_size_table [ sb & 0x03 ] ; } } break ; default : break ; } ; mnemonic [ x ++ ] = '\\0' ; ( * info -> fprintf_func ) ( info -> stream , "%s" , mnemonic ) ; switch ( mode ) { case SB_REG_REG_N_EFF : case SB_REG_REG_N : case SB_REG_OPR_EFF : case SB_REG_OPR_OPR : operand_separator ( info ) ; ( * info -> fprintf_func ) ( info -> stream , "%s" , registers [ byte & 0x7 ] . name ) ; break ; case SB_ROT : opr_decode ( memaddr + 1 , info ) ; break ; default : break ; } switch ( mode ) { case SB_REG_REG_N_EFF : case SB_REG_REG_N : operand_separator ( info ) ; ( * info -> fprintf_func ) ( info -> stream , "%s" , registers [ sb & 0x7 ] . name ) ; break ; case SB_REG_OPR_OPR : opr_decode ( memaddr + 1 , info ) ; break ; default : break ; } switch ( mode ) { case SB_REG_OPR_EFF : case SB_OPR_N : opr_decode ( memaddr + 1 , info ) ; break ; case SB_REG_REG_N : <S2SV_StartBug> if ( sb & 0x08 ) <S2SV_EndBug> { operand_separator ( info ) ; if ( byte & 0x10 ) { <S2SV_StartBug> uint8_t xb ; <S2SV_EndBug> read_memory ( memaddr + 1 , & xb , 1 , info ) ; int shift = ( ( sb & 0x08 ) >> 3 ) | ( ( xb & 0x0f ) << 1 ) ; ( * info -> fprintf_func ) ( info -> stream , "#%d" , shift ) ; } else { ( * info -> fprintf_func ) ( info -> stream , "%s:%d" , __FILE__ , __LINE__ ) ; } } else { opr_decode ( memaddr + 1 , info ) ; } <S2SV_StartBug> break ; <S2SV_EndBug> case SB_REG_OPR_OPR : { uint8_t xb ; int n = opr_n_bytes ( memaddr + 1 , info ) ; read_memory ( memaddr + 1 + n , & xb , 1 , info ) ; if ( ( xb & 0xF0 ) == 0x70 ) { int imm = xb & 0x0F ; imm <<= 1 ; imm |= ( sb & 0x08 ) >> 3 ; operand_separator ( info ) ; ( * info -> fprintf_func ) ( info -> stream , "#%d" , imm ) ; } else { opr_decode ( memaddr + 1 + n , info ) ; } } break ; default : break ; } switch ( mode ) { case SB_REG_REG_N_EFF : case SB_REG_OPR_EFF : case SB_OPR_N : operand_separator ( info ) ; ( * info -> fprintf_func ) ( info -> stream , "#%d" , ( sb & 0x08 ) ? 2 : 1 ) ; break ; default : break ; } return 0 ; }
<S2SV_ModStart> case SB_REG_REG_N : { uint8_t xb ; read_memory ( memaddr + 1 , & xb , 1 , info ) ; if ( ( xb & 0xF0 ) == 0x70 <S2SV_ModEnd> ) { operand_separator <S2SV_ModStart> 0x10 ) { <S2SV_ModEnd> int shift = <S2SV_ModStart> ) ; } }
7,528
CWE-000 double gcamLogLikelihoodEnergy ( const GCA_MORPH * gcam , MRI * mri ) { # if GCAM_LLENERGY_OUTPUT const unsigned int gcamLLEoutputFreq = 10 ; static unsigned int nCalls = 0 ; if ( ( nCalls % gcamLLEoutputFreq ) == 0 ) { char fname [ STRLEN ] ; snprintf ( fname , STRLEN - 1 , "gcamLLEinput%04u" , nCalls / gcamLLEoutputFreq ) ; fname [ STRLEN - 1 ] = '\\0' ; WriteGCAMoneInput ( gcam , fname ) ; snprintf ( fname , STRLEN - 1 , "mriLLEinput%04u.mgz" , nCalls / gcamLLEoutputFreq ) ; MRIwrite ( mri , fname ) ; } # endif # if DEBUG_LL_SSE int max_x , max_y , max_z ; max_x = max_y = max_z = 0 ; double max_increase = 0 , increase ; if ( last_sse == NULL ) { last_sse = ( float * * * ) calloc ( gcam -> width , sizeof ( float * ) ) ; for ( x = 0 ; x < gcam -> width ; x ++ ) { last_sse [ x ] = ( float * * ) calloc ( gcam -> height , sizeof ( float * ) ) ; for ( y = 0 ; y < gcam -> height ; y ++ ) { last_sse [ x ] [ y ] = ( float * ) calloc ( gcam -> depth , sizeof ( float ) ) ; } } } # endif double sse = 0.0 ; # ifdef GCAM_LLENERGY_GPU if ( gcam -> ninputs != 0 ) { printf ( "%s:<S2SV_blank>ninputs<S2SV_blank>=<S2SV_blank>%i\\n" , __FUNCTION__ , gcam -> ninputs ) ; } # if SHOW_EXEC_LOC printf ( "%s:<S2SV_blank>CUDA<S2SV_blank>call\\n" , __FUNCTION__ ) ; # endif sse = gcamLogLikelihoodEnergyGPU ( gcam , mri ) ; # else # if SHOW_EXEC_LOC printf ( "%s:<S2SV_blank>CPU<S2SV_blank>call\\n" , __FUNCTION__ ) ; # endif # ifdef BEVIN_GCAMLOGLIKELIHOODENERGY_REPRODUCIBLE # define ROMP_VARIABLE x # define ROMP_LO 0 # define ROMP_HI gcam -> width # define ROMP_SUMREDUCTION0 sse <S2SV_StartBug> # define ROMP_FOR_LEVEL ROMP_level_assume_reproducible <S2SV_EndBug> # include "romp_for_begin.h" # define sse ROMP_PARTIALSUM ( 0 ) # else int x ; ROMP_PF_begin # ifdef HAVE_OPENMP # pragma omp parallel for if_ROMP ( fast ) reduction ( + : sse ) firstprivate ( y , z , error ) shared ( gcam , mri ) schedule ( static , 1 ) # endif for ( x = 0 ; x < gcam -> width ; x ++ ) { ROMP_PFLB_begin # endif int y ; for ( y = 0 ; y < gcam -> height ; y ++ ) { struct different_neighbor_labels_context different_neighbor_labels_context ; init_different_neighbor_labels_context ( & different_neighbor_labels_context , gcam , x , y ) ; float vals [ MAX_GCA_INPUTS ] ; int z ; for ( z = 0 ; z < gcam -> depth ; z ++ ) { if ( x == Gx && y == Gy && z == Gz ) { DiagBreak ( ) ; } const GCA_MORPH_NODE * gcamn = & gcam -> nodes [ x ] [ y ] [ z ] ; if ( gcamn -> invalid == GCAM_POSITION_INVALID ) { continue ; } check_gcam ( gcam ) ; if ( gcamn -> status & ( GCAM_IGNORE_LIKELIHOOD | GCAM_NEVER_USE_LIKELIHOOD ) ) { continue ; } if ( IS_UNKNOWN ( gcamn -> label ) && ( different_neighbor_labels ( & different_neighbor_labels_context , gcamn -> label , gcam , x , y , z ) == 0 ) ) { continue ; } check_gcam ( gcam ) ; load_vals ( mri , gcamn -> x , gcamn -> y , gcamn -> z , vals , gcam -> ninputs ) ; check_gcam ( gcam ) ; double error ; if ( gcamn -> gc ) { error = GCAmahDist ( gcamn -> gc , vals , gcam -> ninputs ) + log ( covariance_determinant ( gcamn -> gc , gcam -> ninputs ) ) ; } else { int n ; for ( n = 0 , error = 0.0 ; n < gcam -> ninputs ; n ++ ) { error += ( vals [ n ] * vals [ n ] / MIN_VAR ) ; } } check_gcam ( gcam ) ; if ( x == Gx && y == Gy && z == Gz ) printf ( "E_like:<S2SV_blank>node(%d,%d,%d)<S2SV_blank>-><S2SV_blank>" "(%2.1f,%2.1f,%2.1f),<S2SV_blank>target=%2.1f+-%2.1f,<S2SV_blank>val=%2.1f\\n" , x , y , z , gcamn -> x , gcamn -> y , gcamn -> z , gcamn -> gc ? gcamn -> gc -> means [ 0 ] : 0.0 , gcamn -> gc ? sqrt ( covariance_determinant ( gcamn -> gc , gcam -> ninputs ) ) : 0.0 , vals [ 0 ] ) ; check_gcam ( gcam ) ; # if DEBUG_LL_SSE if ( last_sse [ x ] [ y ] [ z ] < ( .9 * error ) && ! FZERO ( last_sse [ x ] [ y ] [ z ] ) ) { DiagBreak ( ) ; increase = error - last_sse [ x ] [ y ] [ z ] ; if ( increase > max_increase ) { max_increase = increase ; max_x = x ; max_y = y ; max_z = z ; } } last_sse [ x ] [ y ] [ z ] = ( error ) ; # endif sse += ( error ) ; if ( ! finitep ( sse ) ) { DiagBreak ( ) ; } } } # ifdef BEVIN_GCAMLOGLIKELIHOODENERGY_REPRODUCIBLE # undef sse # include "romp_for_end.h" # else ROMP_PFLB_end } ROMP_PF_end # endif # endif # if DEBUG_LL_SSE if ( Gdiag & DIAG_SHOW ) printf ( "max<S2SV_blank>increase<S2SV_blank>%2.2f<S2SV_blank>at<S2SV_blank>(%d,<S2SV_blank>%d,<S2SV_blank>%d)\\n" , max_increase , max_x , max_y , max_z ) ; # endif # if GCAM_LLENERGY_OUTPUT nCalls ++ ; # endif return ( sse ) ; }
<S2SV_ModStart> define ROMP_FOR_LEVEL ROMP_level_assume_reproducible # ifdef ROMP_SUPPORT_ENABLED const int romp_for_line = __LINE__ ; # endif
7,529
CWE-000 static int src_params ( struct comp_dev * dev ) { struct sof_ipc_stream_params * params = & dev -> params ; struct sof_ipc_comp_src * src = COMP_GET_IPC ( dev , sof_ipc_comp_src ) ; struct sof_ipc_comp_config * config = COMP_GET_CONFIG ( dev ) ; struct comp_data * cd = comp_get_drvdata ( dev ) ; struct comp_buffer * sink ; struct comp_buffer * source ; size_t delay_lines_size ; uint32_t source_rate ; uint32_t sink_rate ; int32_t * buffer_start ; int n = 0 ; int err ; int frames_is_for_source ; int q ; <S2SV_StartBug> trace_src ( "par" ) ; <S2SV_EndBug> switch ( config -> frame_fmt ) { case SOF_IPC_FRAME_S24_4LE : cd -> polyphase_func = src_polyphase_stage_cir_s24 ; break ; case SOF_IPC_FRAME_S32_LE : cd -> polyphase_func = src_polyphase_stage_cir ; break ; default : trace_src_error ( "sr0" ) ; return - EINVAL ; } if ( src -> source_rate == 0 ) { source_rate = params -> rate ; sink_rate = src -> sink_rate ; params -> rate = sink_rate ; frames_is_for_source = 0 ; } else { source_rate = src -> source_rate ; sink_rate = params -> rate ; params -> rate = source_rate ; frames_is_for_source = 1 ; } err = src_buffer_lengths ( & cd -> param , source_rate , sink_rate , params -> channels , dev -> frames , frames_is_for_source ) ; if ( err < 0 ) { trace_src_error ( "sr1" ) ; trace_error_value ( source_rate ) ; trace_error_value ( sink_rate ) ; trace_error_value ( params -> channels ) ; trace_error_value ( dev -> frames ) ; return err ; } delay_lines_size = sizeof ( int32_t ) * cd -> param . total ; if ( delay_lines_size == 0 ) { trace_src_error ( "sr2" ) ; return - EINVAL ; } if ( ! cd -> delay_lines ) rfree ( cd -> delay_lines ) ; cd -> delay_lines = rballoc ( RZONE_RUNTIME , SOF_MEM_CAPS_RAM , delay_lines_size ) ; if ( ! cd -> delay_lines ) { trace_src_error ( "sr3" ) ; trace_error_value ( delay_lines_size ) ; return - EINVAL ; } memset ( cd -> delay_lines , 0 , delay_lines_size ) ; buffer_start = cd -> delay_lines + cd -> param . sbuf_length ; n = src_polyphase_init ( & cd -> src , & cd -> param , buffer_start ) ; cd -> sbuf_r_ptr = cd -> delay_lines ; cd -> sbuf_w_ptr = cd -> delay_lines ; cd -> sbuf_avail = 0 ; switch ( n ) { case 0 : cd -> src_func = src_copy_s32_default ; break ; case 1 : cd -> src_func = src_1s_s32_default ; break ; case 2 : cd -> src_func = src_2s_s32_default ; break ; default : trace_src ( "SFa" ) ; cd -> src_func = src_fallback ; return - EINVAL ; } dev -> frame_bytes = dev -> params . sample_container_bytes * dev -> params . channels ; q = src_ceil_divide ( cd -> param . blk_out , ( int ) dev -> frames ) + 1 ; <S2SV_StartBug> sink = list_first_item ( & dev -> bsink_list , struct comp_buffer , <S2SV_EndBug> source_list ) ; err = buffer_set_size ( sink , q * dev -> frames * dev -> frame_bytes ) ; if ( err < 0 ) { trace_src_error ( "eSz" ) ; trace_error_value ( sink -> alloc_size ) ; trace_error_value ( q * dev -> frames * dev -> frame_bytes ) ; return err ; } source = list_first_item ( & dev -> bsource_list , struct comp_buffer , sink_list ) ; if ( source -> size < cd -> param . blk_in * dev -> frame_bytes ) { trace_src_error ( "eSy" ) ; return - EINVAL ; } return 0 ; }
<S2SV_ModStart> int q ; int d ; <S2SV_ModStart> + 1 ; d = dev -> frames - cd -> param . blk_out ; cd -> prefill = ( d > 0 ) ? d * dev -> frame_bytes : 0 ;
7,530
CWE-000 char * M_GetSaveGameDir ( char * iwadname ) { char * savegamedir ; char * topdir ; <S2SV_StartBug> if ( ! strcmp ( configdir , "" ) ) <S2SV_EndBug> { savegamedir = M_StringDuplicate ( "" ) ; } else { topdir = M_StringJoin ( configdir , "savegames" , NULL ) ; M_MakeDirectory ( topdir ) ; savegamedir = M_StringJoin ( topdir , DIR_SEPARATOR_S , iwadname , DIR_SEPARATOR_S , NULL ) ; M_MakeDirectory ( savegamedir ) ; free ( topdir ) ; } return savegamedir ; }
<S2SV_ModStart> * topdir ; int p ; p = M_CheckParmWithArgs ( "-savedir" , 1 ) ; if ( p ) { savegamedir = myargv [ p + 1 ] ; if ( ! M_FileExists ( savegamedir ) ) { M_MakeDirectory ( savegamedir ) ; } savegamedir = M_StringJoin ( savegamedir , DIR_SEPARATOR_S , NULL ) ; printf ( "Save<S2SV_blank>directory<S2SV_blank>changed<S2SV_blank>to<S2SV_blank>%s.\\n" , savegamedir ) ; } # ifdef _WIN32 else if ( M_ParmExists ( "-cdrom" ) ) { savegamedir = configdir ; } # endif else
7,531
CWE-000 int ccreate ( void * ( * start ) ( void * ) , void * arg , int prio ) { if ( scheduler == NULL ) { printf ( "scheduler<S2SV_blank>nulo:<S2SV_blank>bora<S2SV_blank>inicializa<S2SV_blank>essa<S2SV_blank>merda\\n" ) ; csched_init ( ) ; } printf ( "\\n[<S2SV_blank>CCREATE<S2SV_blank>]\\n" ) ; TCB_t * newThread = malloc ( sizeof ( TCB_t ) ) ; newThread -> state = PROCST_CRIACAO ; newThread -> prio = PRIORITY ; newThread -> tid = scheduler -> count ; <S2SV_StartBug> getcontext ( & newThread -> context ) ; <S2SV_EndBug> newThread -> context . uc_link = & ( scheduler -> dispatcherContext ) ; newThread -> context . uc_stack . ss_sp = malloc ( SIGSTKSZ ) ; newThread -> context . uc_stack . ss_size = SIGSTKSZ ; makecontext ( & newThread -> context , ( void ( * ) ( void ) ) start , ARGC , arg ) ; PNODE2 newThreadNode = malloc ( sizeof ( PNODE2 ) ) ; newThreadNode -> node = newThread ; AppendFila2 ( scheduler -> able , newThreadNode ) ; scheduler -> count ++ ; return newThread -> tid ; }
<S2SV_ModStart> -> count ; newThread -> lastTime = 0 ;
7,532
CWE-000 static M_CODE lm_worker_perform ( worker_t * w ) { M_CODE r ; int x ; if ( w -> ue_h -> current -> bind == 0 ) { LM_WARNING ( w -> m , "lm_worker_perform<S2SV_blank>called<S2SV_blank>on<S2SV_blank>unbound<S2SV_blank>URL" ) ; w -> ue_h -> current -> bind = 1 ; } filetype_t * ft = w -> m -> filetypes [ w -> ue_h -> current -> bind - 1 ] ; uint8_t ft_binding = w -> ue_h -> current -> bind ; if ( lm_crawler_flag_isset ( w -> crawler , LM_CRFLAG_JAIL ) ) { url_t * url = w -> ue_h -> current ; url_t * jail_url = & w -> crawler -> jail_url ; if ( url -> file_o - url -> host_o - url -> host_l < jail_url -> file_o - jail_url -> host_o - jail_url -> host_l || strncasecmp ( jail_url -> str + jail_url -> host_o + jail_url -> host_l , url -> str + url -> host_o + url -> host_l , jail_url -> file_o - jail_url -> host_o - jail_url -> host_l ) != 0 ) { return M_OK ; } } if ( lm_filter_eval_url ( & w -> ue_h -> host_ent -> filter , w -> ue_h -> current ) != LM_FILTER_ALLOW ) return M_OK ; # ifdef DEBUG fprintf ( stderr , "*<S2SV_blank>worker:(%p)<S2SV_blank>URL:<S2SV_blank>%s\\n" , w , w -> ue_h -> current -> str ) ; # endif if ( ft -> switch_to . ptr ) lm_worker_set_crawler ( w , ft -> switch_to . ptr ) ; w -> io_h -> timer_wait = ( clock_t ) ( w -> crawler -> wait * ( float ) CLOCKS_PER_SEC ) ; w -> io_h -> timer_wait_mp = 0 ; lm_attrlist_prepare ( & w -> attributes , ( const char * * ) ft -> attributes , ft -> attr_count ) ; wfunction_t * wf = ( ft -> handler . wf ? ft -> handler . wf : ( w -> crawler -> default_handler . wf ? w -> crawler -> default_handler . wf : 0 ) ) ; if ( wf ) { # ifdef DEBUG fprintf ( stderr , "*<S2SV_blank>worker:(%p)<S2SV_blank>calling<S2SV_blank>handler<S2SV_blank>\'%s\'\\n" , w , wf -> name ) ; # endif switch ( wf -> type ) { case LM_WFUNCTION_TYPE_NATIVE : r = wf -> fn . native_handler ( w -> m , w , w -> io_h , & w -> io_h -> buf , & w -> io_h -> transfer , w -> ue_h -> current ) ; break ; default : return M_ERROR ; } } else r = lm_io_get ( w -> io_h , w -> ue_h -> current ) ; if ( r != M_OK ) { # ifdef DEBUG fprintf ( stderr , "*<S2SV_blank>worker:(%p)<S2SV_blank>handler<S2SV_blank>or<S2SV_blank>lm_io_get<S2SV_blank>failed:<S2SV_blank>%s<S2SV_blank>(%d)\\n" , w , lm_strerror ( r ) , r ) ; # endif return r ; } if ( w -> ue_h -> current -> bind != ft_binding ) { # ifdef DEBUG fprintf ( stderr , "*<S2SV_blank>worker:(%p)<S2SV_blank>filetype<S2SV_blank>binding<S2SV_blank>changed<S2SV_blank>from<S2SV_blank>%d<S2SV_blank>to<S2SV_blank>%d\\n" , w , ft_binding , w -> ue_h -> current -> bind ) ; # endif <S2SV_StartBug> ft = w -> m -> filetypes [ w -> ue_h -> current -> bind - 1 ] ; <S2SV_EndBug> ft_binding = w -> ue_h -> current -> bind ; } w -> m -> status_cb ( w -> m , w , w -> ue_h -> current , & w -> io_h -> transfer ) ; if ( w -> io_h -> transfer . status_code >= 300 && w -> io_h -> transfer . status_code < 400 ) { if ( w -> io_h -> transfer . headers . location ) { # ifdef DEBUG fprintf ( stderr , "*<S2SV_blank>worker:(%p)<S2SV_blank>%d<S2SV_blank>redirect<S2SV_blank>to<S2SV_blank>\'%s\'\\n" , w , w -> io_h -> transfer . status_code , w -> io_h -> transfer . headers . location ) ; # endif w -> redirects ++ ; if ( w -> redirects >= 20 ) { LM_WARNING ( w -> m , "breaking<S2SV_blank>out<S2SV_blank>of<S2SV_blank>possible<S2SV_blank>redirect<S2SV_blank>loop" ) ; w -> redirects = 0 ; return M_OK ; } url_t tmp ; lm_url_init ( & tmp ) ; if ( lm_url_set ( & tmp , w -> io_h -> transfer . headers . location , strlen ( w -> io_h -> transfer . headers . location ) ) == M_OK ) { if ( lm_url_hostcmp ( & tmp , w -> ue_h -> current ) == 0 ) { ue_revert ( w -> ue_h , tmp . str , tmp . sz ) ; } else { ue_move_to_secondary ( w -> ue_h , & tmp ) ; } } lm_url_uninit ( & tmp ) ; return M_OK ; } } w -> redirects = 0 ; int last = LM_WFUNCTION_TYPE_NATIVE ; for ( x = 0 ; x < ft -> parser_chain . num_parsers ; x ++ ) { wfunction_t * p = ft -> parser_chain . parsers [ x ] ; # ifdef DEBUG fprintf ( stderr , "*<S2SV_blank>worker:(%p)<S2SV_blank>parser<S2SV_blank>%d<S2SV_blank>of<S2SV_blank>%d:<S2SV_blank>\'%s\'\\n" , w , x + 1 , ft -> parser_chain . num_parsers , p -> name ) ; # endif switch ( p -> type ) { case LM_WFUNCTION_TYPE_NATIVE : p -> fn . native_parser ( w -> m , w , & w -> io_h -> buf , w -> ue_h , w -> ue_h -> current , & w -> attributes ) ; break ; default : return M_FAILED ; } last = p -> type ; } if ( w -> attributes . changed ) w -> m -> target_cb ( w -> m , w , w -> ue_h -> current , & w -> attributes , ft ) ; return M_OK ; }
<S2SV_ModStart> ; # endif if ( FT_FLAG_ISSET ( ft , FT_FLAG_IGNORE_DEPTH ) != FT_FLAG_ISSET ( <S2SV_ModEnd> w -> m <S2SV_ModStart> - 1 ] , FT_FLAG_IGNORE_DEPTH ) ) { LM_ERROR ( w -> m , "switching<S2SV_blank>between<S2SV_blank>filetypes<S2SV_blank>with<S2SV_blank>mismatch<S2SV_blank>ignore_depth<S2SV_blank>setting<S2SV_blank>not<S2SV_blank>allowed,<S2SV_blank>not<S2SV_blank>parsing" ) ; return M_ERROR ; } ft = w -> m -> filetypes [ w -> ue_h -> current -> bind - 1 ]
7,533
CWE-000 int main ( void ) { Param param ; SK sk ; PK pk ; mpz_t chiper1 ; mpz_t chiper2 ; mpz_t chiper3 ; mpz_t chiper4 ; mpz_t chiper5 ; mpz_t chiper6 ; mpz_inits ( chiper1 , chiper2 , chiper3 , chiper4 , chiper5 , chiper6 , NULL ) ; <S2SV_StartBug> param_init ( & param , 5 ) ; <S2SV_EndBug> keyGen ( & sk , & pk , & param ) ; encrypt ( chiper1 , & param , & pk , 1 ) ; encrypt ( chiper2 , & param , & pk , 0 ) ; encrypt ( chiper3 , & param , & pk , 1 ) ; encrypt ( chiper4 , & param , & pk , 1 ) ; encrypt ( chiper5 , & param , & pk , 0 ) ; encrypt ( chiper6 , & param , & pk , 1 ) ; decrypt ( & sk , chiper1 ) ; decrypt ( & sk , chiper2 ) ; decrypt ( & sk , chiper3 ) ; decrypt ( & sk , chiper4 ) ; decrypt ( & sk , chiper5 ) ; decrypt ( & sk , chiper6 ) ; keyClean ( & sk , & pk , & param ) ; return 0 ; }
<S2SV_ModStart> & param , 4 <S2SV_ModEnd> ) ; keyGen
7,534
CWE-000 static void alloc_processus ( t_arena * arena , uint16_t actor , size_t offset ) { t_process process ; process . pc = offset ; process . carry = FALSE ; process . alive = FALSE ; process . wait = 0 ; <S2SV_StartBug> ft_memcpy ( & process . reg [ 0 ] , & ( arena -> players [ actor ] . id ) , <S2SV_EndBug> sizeof ( unsigned int ) ) ; process . instruction = NULL ; ft_bzero ( & process . op , sizeof ( t_op ) ) ; ft_bzero ( process . param , sizeof ( process . param ) ) ; process . offset = 0 ; <S2SV_StartBug> ft_dlstappend ( & ( arena -> procs ) , <S2SV_EndBug> ft_dlstnew ( & process , sizeof ( t_process ) ) ) ; }
<S2SV_ModStart> = 0 ; <S2SV_ModEnd> process . reg <S2SV_ModStart> [ 0 ] = <S2SV_ModEnd> arena -> players <S2SV_ModStart> ] . id <S2SV_ModEnd> ; process . <S2SV_ModStart> ft_dlstappend ( & <S2SV_ModEnd> arena -> procs <S2SV_ModStart> arena -> procs <S2SV_ModEnd> , ft_dlstnew (
7,535
CWE-000 void add_while_label ( Symbol * cond , Analysis * stat ) { <S2SV_StartBug> set_control_label ( & label ) ; <S2SV_EndBug> <S2SV_StartBug> assembly_push_front ( cond -> assembly , append_char ( get_beg_label ( & label ) , ':' ) ) ; <S2SV_EndBug> <S2SV_StartBug> pop_and_je ( cond -> assembly , cond -> res_info , get_end_label ( & label ) ) ; <S2SV_EndBug> <S2SV_StartBug> emit_jump ( stat -> assembly , get_beg_label ( & label ) ) ; <S2SV_EndBug> <S2SV_StartBug> assembly_push_back ( stat -> assembly , append_char ( get_end_label ( & label ) , ':' ) ) ; <S2SV_EndBug> }
<S2SV_ModStart> { set_control_label ( <S2SV_ModEnd> ) ; assembly_push_front <S2SV_ModStart> ( get_beg_label ( <S2SV_ModEnd> ) , ':' <S2SV_ModStart> , get_end_label ( <S2SV_ModEnd> ) ) ; <S2SV_ModStart> , get_beg_label ( <S2SV_ModEnd> ) ) ; <S2SV_ModStart> ( get_end_label ( <S2SV_ModEnd> ) , ':'
7,536
CWE-000 int read_humidity ( phydat_t * res ) { res -> unit = UNIT_PERCENT ; res -> scale = 0 ; gpio_set ( GPIO_POWER ) ; xtimer_usleep ( ADC_SLEEP1 ) ; int measurement = adc_sample ( ADC_USED_LINE , RES ) ; gpio_clear ( GPIO_POWER ) ; if ( PFLANZEN_DEBUG ) { <S2SV_StartBug> printf ( "adc<S2SV_blank>sample<S2SV_blank>value:<S2SV_blank>%d" , measurement ) ; <S2SV_EndBug> } double value = ( double ) measurement ; double gain = ADC_MAX / ( ADC_MEASURED_MAX - ADC_MEASURED_OFFSET ) ; value = ( value - ADC_MEASURED_OFFSET ) * gain ; value = ( 100.0 / ADC_MAX ) * value ; res -> val [ 0 ] = value ; res -> val [ 1 ] = 0 ; res -> val [ 2 ] = 0 ; return 1 ; }
<S2SV_ModStart> { printf ( "adc<S2SV_blank>sample<S2SV_blank>value:<S2SV_blank>%d\\n" <S2SV_ModEnd> , measurement )
7,537
CWE-000 static void chip_revision_info ( struct drm_device * dev ) { struct via_device * dev_priv = dev -> dev_private ; struct pci_bus * bus = NULL ; u16 device_id , subsystem_vendor_id , subsystem_device_id ; u8 tmp ; int pci_bus ; u8 pci_device , pci_function ; int ret ; DRM_DEBUG_KMS ( "Entered<S2SV_blank>%s.\\n" , __func__ ) ; if ( ( dev -> pdev -> device == PCI_DEVICE_ID_VIA_VT1122 ) || ( dev -> pdev -> device == PCI_DEVICE_ID_VIA_VX875 ) || ( dev -> pdev -> device == PCI_DEVICE_ID_VIA_VX900_VGA ) ) { pci_bus = 0 ; pci_device = 1 ; pci_function = 0 ; } else { pci_bus = 1 ; pci_device = 0 ; pci_function = 0 ; } bus = pci_find_bus ( 0 , pci_bus ) ; if ( ! bus ) { goto pci_error ; } ret = pci_bus_read_config_word ( bus , PCI_DEVFN ( pci_device , pci_function ) , PCI_DEVICE_ID , & device_id ) ; if ( ret ) { goto pci_error ; } ret = pci_bus_read_config_word ( bus , PCI_DEVFN ( pci_device , pci_function ) , PCI_SUBSYSTEM_VENDOR_ID , & subsystem_vendor_id ) ; if ( ret ) { goto pci_error ; } ret = pci_bus_read_config_word ( bus , PCI_DEVFN ( pci_device , pci_function ) , PCI_SUBSYSTEM_ID , & subsystem_device_id ) ; if ( ret ) { goto pci_error ; } DRM_DEBUG_KMS ( "DRM<S2SV_blank>Device<S2SV_blank>ID:<S2SV_blank>" "0x%04x\\n" , dev -> pdev -> device ) ; DRM_DEBUG_KMS ( "Chrome<S2SV_blank>IGP<S2SV_blank>Device<S2SV_blank>ID:<S2SV_blank>" "0x%04x\\n" , device_id ) ; DRM_DEBUG_KMS ( "Chrome<S2SV_blank>IGP<S2SV_blank>Subsystem<S2SV_blank>Vendor<S2SV_blank>ID:<S2SV_blank>" "0x%04x\\n" , subsystem_vendor_id ) ; DRM_DEBUG_KMS ( "Chrome<S2SV_blank>IGP<S2SV_blank>Subsystem<S2SV_blank>Device<S2SV_blank>ID:<S2SV_blank>" "0x%04x\\n" , subsystem_device_id ) ; switch ( dev -> pdev -> device ) { case PCI_DEVICE_ID_VIA_CLE266 : tmp = vga_rcrt ( VGABASE , 0x4F ) ; vga_wcrt ( VGABASE , 0x4F , 0x55 ) ; if ( vga_rcrt ( VGABASE , 0x4F ) != 0x55 ) { dev_priv -> revision = CLE266_REVISION_AX ; } else { dev_priv -> revision = CLE266_REVISION_CX ; } vga_wcrt ( VGABASE , 0x4F , tmp ) ; break ; case PCI_DEVICE_ID_VIA_VT3157 : tmp = vga_rseq ( VGABASE , 0x43 ) ; if ( tmp & 0x02 ) { dev_priv -> revision = CX700_REVISION_700M2 ; } else if ( tmp & 0x40 ) { dev_priv -> revision = CX700_REVISION_700M ; } else { dev_priv -> revision = CX700_REVISION_700 ; } if ( ( subsystem_vendor_id == 0x1509 ) && ( subsystem_device_id == 0x2d30 ) ) { dev_priv -> is_via_nanobook = true ; } else { dev_priv -> is_via_nanobook = false ; } break ; case PCI_DEVICE_ID_VIA_VT1122 : if ( ( subsystem_vendor_id == 0x152d ) && ( subsystem_device_id == 0x0771 ) ) { dev_priv -> is_quanta_il1 = true ; } else { dev_priv -> is_quanta_il1 = false ; } <S2SV_StartBug> break ; <S2SV_EndBug> case PCI_DEVICE_ID_VIA_VX875 : case PCI_DEVICE_ID_VIA_VX900_VGA : dev_priv -> revision = vga_rseq ( VGABASE , 0x3B ) ; break ; default : break ; } goto exit ; pci_error : DRM_ERROR ( "PCI<S2SV_blank>bus<S2SV_blank>related<S2SV_blank>error." ) ; exit : DRM_DEBUG_KMS ( "Exiting<S2SV_blank>%s.\\n" , __func__ ) ; }
<S2SV_ModStart> false ; } if ( ( subsystem_vendor_id == 0x144d ) && ( subsystem_device_id == 0xc04e ) ) { dev_priv -> is_samsung_nc20 = true ; } else { dev_priv -> is_samsung_nc20 = false ; }
7,538
CWE-000 void edi_debugpanel_add ( Evas_Object * parent ) { Evas_Object * table , * entry , * bt_term , * bt_int , * bt_start , * bt_quit ; Evas_Object * separator ; Evas_Object * ico_start , * ico_quit , * ico_int , * ico_term ; Elm_Code_Widget * widget ; Elm_Code * code ; Ecore_Timer * timer ; code = elm_code_create ( ) ; widget = elm_code_widget_add ( parent , code ) ; elm_obj_code_widget_font_set ( widget , _edi_project_config -> font . name , _edi_project_config -> font . size ) ; elm_obj_code_widget_gravity_set ( widget , 0.0 , 1.0 ) ; efl_event_callback_add ( widget , & ELM_CODE_EVENT_LINE_LOAD_DONE , _edi_debugpanel_line_cb , NULL ) ; evas_object_size_hint_weight_set ( widget , EVAS_HINT_EXPAND , EVAS_HINT_EXPAND ) ; evas_object_size_hint_align_set ( widget , EVAS_HINT_FILL , EVAS_HINT_FILL ) ; evas_object_show ( widget ) ; table = elm_table_add ( parent ) ; evas_object_size_hint_weight_set ( table , EVAS_HINT_EXPAND , 0 ) ; evas_object_size_hint_align_set ( table , EVAS_HINT_FILL , 0 ) ; separator = elm_separator_add ( parent ) ; elm_separator_horizontal_set ( separator , EINA_FALSE ) ; evas_object_show ( separator ) ; _button_term = bt_term = elm_button_add ( parent ) ; ico_term = elm_icon_add ( parent ) ; elm_icon_standard_set ( ico_term , "media-playback-stop" ) ; elm_object_part_content_set ( bt_term , "icon" , ico_term ) ; elm_object_tooltip_text_set ( bt_term , "Send<S2SV_blank>SIGTERM" ) ; elm_object_disabled_set ( bt_term , EINA_TRUE ) ; evas_object_smart_callback_add ( bt_term , "clicked" , _edi_debugpanel_bt_sigterm_cb , NULL ) ; evas_object_show ( bt_term ) ; _button_int = bt_int = elm_button_add ( parent ) ; ico_int = elm_icon_add ( parent ) ; elm_icon_standard_set ( ico_int , "media-playback-pause" ) ; elm_object_part_content_set ( bt_int , "icon" , ico_int ) ; <S2SV_StartBug> elm_object_tooltip_text_set ( bt_int , "Send<S2SV_blank>SIGINT" ) ; <S2SV_EndBug> elm_object_disabled_set ( bt_int , EINA_TRUE ) ; evas_object_smart_callback_add ( bt_int , "clicked" , _edi_debugpanel_bt_sigint_cb , NULL ) ; evas_object_show ( bt_int ) ; _button_start = bt_start = elm_button_add ( parent ) ; ico_start = elm_icon_add ( parent ) ; elm_icon_standard_set ( ico_start , "media-playback-start" ) ; elm_object_tooltip_text_set ( bt_start , "Start<S2SV_blank>Debugging" ) ; elm_object_part_content_set ( bt_start , "icon" , ico_start ) ; evas_object_smart_callback_add ( bt_start , "clicked" , _edi_debugpanel_button_start_cb , NULL ) ; evas_object_show ( bt_start ) ; _button_quit = bt_quit = elm_button_add ( parent ) ; ico_quit = elm_icon_add ( parent ) ; elm_icon_standard_set ( ico_quit , "application-exit" ) ; elm_object_part_content_set ( bt_quit , "icon" , ico_quit ) ; elm_object_tooltip_text_set ( bt_quit , "Stop<S2SV_blank>Debugging" ) ; elm_object_disabled_set ( bt_quit , EINA_TRUE ) ; evas_object_smart_callback_add ( bt_quit , "clicked" , _edi_debugpanel_button_quit_cb , NULL ) ; evas_object_show ( bt_quit ) ; entry = elm_entry_add ( parent ) ; elm_entry_single_line_set ( entry , EINA_TRUE ) ; elm_entry_scrollable_set ( entry , EINA_TRUE ) ; elm_entry_editable_set ( entry , EINA_TRUE ) ; evas_object_size_hint_weight_set ( entry , EVAS_HINT_EXPAND , 0 ) ; evas_object_size_hint_align_set ( entry , EVAS_HINT_FILL , EVAS_HINT_FILL ) ; evas_object_event_callback_add ( entry , EVAS_CALLBACK_KEY_DOWN , _edi_debugpanel_keypress_cb , NULL ) ; evas_object_show ( entry ) ; elm_table_pack ( table , entry , 0 , 0 , 1 , 1 ) ; elm_table_pack ( table , bt_term , 1 , 0 , 1 , 1 ) ; elm_table_pack ( table , bt_int , 2 , 0 , 1 , 1 ) ; elm_table_pack ( table , separator , 3 , 0 , 1 , 1 ) ; elm_table_pack ( table , bt_start , 4 , 0 , 1 , 1 ) ; elm_table_pack ( table , bt_quit , 5 , 0 , 1 , 1 ) ; evas_object_show ( table ) ; _debug_output = code ; _info_widget = widget ; _entry_widget = entry ; timer = ecore_timer_add ( 1.0 , _edi_debug_active_check_cb , NULL ) ; ( void ) timer ; elm_box_pack_end ( parent , widget ) ; elm_box_pack_end ( parent , table ) ; ecore_event_handler_add ( EDI_EVENT_CONFIG_CHANGED , _edi_debugpanel_config_changed , NULL ) ; }
<S2SV_ModStart> ( bt_int , "Start/Stop<S2SV_blank>Process" <S2SV_ModEnd> ) ; elm_object_disabled_set
7,539
CWE-000 void vListDelNode ( vList * list , vListNode * node ) { if ( node -> pre ) { node -> pre -> next = node -> next ; } else { list -> head = node -> next ; } if ( node -> next ) { node -> next -> pre = node -> pre ; } else { list -> tail = node -> pre ; } if ( list -> free ) { ( * list -> free ) ( node -> val ) ; } <S2SV_StartBug> free ( node ) ; <S2SV_EndBug> }
<S2SV_ModStart> ) ; } list -> len -- ;
7,540
CWE-000 static int msm_bus_dbg_fill_fab_buffer ( const char * fabname , void * cdata , int nmasters , int nslaves , int ntslaves ) { int i ; char * buf = NULL ; struct msm_bus_fab_list * fablist = NULL ; struct timespec ts ; int found = 0 ; mutex_lock ( & msm_bus_dbg_fablist_lock ) ; list_for_each_entry ( fablist , & fabdata_list , list ) { if ( strcmp ( fablist -> name , fabname ) == 0 ) { found = 1 ; break ; } } <S2SV_StartBug> if ( ! found ) <S2SV_EndBug> <S2SV_StartBug> return - ENOENT ; <S2SV_EndBug> if ( fablist -> file == NULL ) { MSM_BUS_DBG ( "Fabric<S2SV_blank>dbg<S2SV_blank>entry<S2SV_blank>does<S2SV_blank>not<S2SV_blank>exist\\n" ) ; mutex_unlock ( & msm_bus_dbg_fablist_lock ) ; return - EFAULT ; } if ( fablist -> size < MAX_BUFF_SIZE - 256 ) i = fablist -> size ; else { i = 0 ; fablist -> size = 0 ; } buf = fablist -> buffer ; mutex_unlock ( & msm_bus_dbg_fablist_lock ) ; ts = ktime_to_timespec ( ktime_get ( ) ) ; i += scnprintf ( buf + i , MAX_BUFF_SIZE - i , "\\n%ld.%09lu\\n" , ts . tv_sec , ts . tv_nsec ) ; msm_bus_rpm_fill_cdata_buffer ( & i , buf , MAX_BUFF_SIZE , cdata , nmasters , nslaves , ntslaves ) ; i += scnprintf ( buf + i , MAX_BUFF_SIZE - i , "\\n" ) ; mutex_lock ( & msm_bus_dbg_fablist_lock ) ; fablist -> size = i ; mutex_unlock ( & msm_bus_dbg_fablist_lock ) ; return 0 ; }
<S2SV_ModStart> ! found ) { mutex_unlock ( & msm_bus_dbg_fablist_lock ) ; <S2SV_ModStart> - ENOENT ; }
7,541
CWE-000 static void gst_festival_init ( GstFestival * festival ) { festival -> sinkpad = gst_pad_new_from_static_template ( & sink_template_factory , "sink" ) ; gst_pad_set_chain_function ( festival -> sinkpad , gst_festival_chain ) ; gst_element_add_pad ( GST_ELEMENT ( festival ) , festival -> sinkpad ) ; festival -> srcpad = gst_pad_new_from_static_template ( & src_template_factory , "src" ) ; <S2SV_StartBug> gst_element_add_pad ( GST_ELEMENT ( festival ) , festival -> srcpad ) ; <S2SV_EndBug> festival -> info = festival_default_info ( ) ; }
<S2SV_ModStart> "src" ) ; gst_pad_set_query_function ( festival -> srcpad , gst_festival_src_query ) ;
7,542
CWE-000 void mag_set_req_data ( request_rec * req , struct mag_config * cfg , struct mag_conn * mc ) { apr_table_set ( mc -> env , "GSS_NAME" , mc -> gss_name ) ; apr_table_set ( mc -> env , "GSS_SESSION_EXPIRATION" , apr_psprintf ( req -> pool , "%ld" , ( long ) mc -> expiration ) ) ; req -> ap_auth_type = ( char * ) mag_str_auth_type ( mc -> auth_type ) ; req -> user = apr_pstrdup ( req -> pool , mc -> user_name ) ; if ( mc -> name_attributes ) { mag_set_name_attributes ( req , mc ) ; } # ifdef HAVE_CRED_STORE if ( cfg -> deleg_ccache_dir && mc -> delegated && mc -> ccname ) { <S2SV_StartBug> mag_set_KRB5CCNAME ( req , cfg , mc ) ; <S2SV_EndBug> } # endif ap_set_module_config ( req -> request_config , & auth_gssapi_module , mc -> env ) ; mag_export_req_env ( req , mc -> env ) ; }
<S2SV_ModStart> ccname ) { mag_set_ccname_envvar <S2SV_ModEnd> ( req ,
7,543
CWE-000 long int __strtol ( const char * nptr , char * * endptr , int base ) { int negative = 0 ; while ( is_space ( * nptr ) ) { nptr ++ ; } switch ( * nptr ) { case '-' : negative = 1 ; case '+' : nptr ++ ; } switch ( base ) { case 0 : if ( nptr [ 0 ] == '0' ) { if ( ( nptr [ 1 ] == 'x' || nptr [ 1 ] == 'X' ) ) { base = 16 ; nptr += 2 ; } else { base = 8 ; nptr += 1 ; } } else { base = 10 ; } <S2SV_StartBug> case 16 : <S2SV_EndBug> if ( nptr [ 0 ] == '0' && ( nptr [ 1 ] == 'x' || nptr [ 1 ] == 'X' ) ) { nptr += 2 ; <S2SV_StartBug> } <S2SV_EndBug> } unsigned long int max = INT32_MAX ; if ( negative ) max ++ ; unsigned long int lim1 = max / base ; unsigned long int lim2 = max % base ; unsigned long int value = 0 ; char outrange = 0 ; char * p = ( char * ) nptr ; char num ; while ( 1 ) { num = * p ; if ( num >= '0' && num <= '9' ) { num -= '0' ; } else if ( num >= 'a' && num <= 'z' ) { num = num - 'a' + 10 ; } else if ( num >= 'A' && num <= 'Z' ) { num = num - 'A' + 10 ; } else { break ; } if ( num >= base ) { break ; } p ++ ; if ( value < lim1 || ( value == lim1 && ( unsigned long int ) num <= lim2 ) ) { value = value * base + num ; } else { outrange = 1 ; } } if ( endptr ) * endptr = p ; if ( outrange ) { errno = ERANGE ; return negative ? INT32_MIN : INT32_MAX ; } return negative ? ( - value ) : value ; }
<S2SV_ModStart> 10 ; } break ; <S2SV_ModStart> 2 ; } break ;
7,544
CWE-000 static void __vr_interface_make_req ( vr_interface_req * req , struct vr_interface * intf , unsigned int core ) { uint8_t proto ; uint16_t port ; unsigned int cpu , i , j , k = 0 ; struct vr_interface_settings settings ; req -> vifr_core = core ; req -> vifr_type = intf -> vif_type ; req -> vifr_flags = intf -> vif_flags ; req -> vifr_vrf = intf -> vif_vrf ; req -> vifr_idx = intf -> vif_idx ; req -> vifr_rid = intf -> vif_rid ; req -> vifr_transport = intf -> vif_transport ; req -> vifr_os_idx = intf -> vif_os_idx ; req -> vifr_mtu = intf -> vif_mtu ; if ( req -> vifr_mac_size && req -> vifr_mac ) memcpy ( req -> vifr_mac , intf -> vif_mac , MINIMUM ( req -> vifr_mac_size , sizeof ( intf -> vif_mac ) ) ) ; req -> vifr_ip = intf -> vif_ip ; req -> vifr_mir_id = intf -> vif_mirror_id ; req -> vifr_ref_cnt = intf -> vif_users ; if ( req -> vifr_name ) { strncpy ( req -> vifr_name , intf -> vif_name , VR_INTERFACE_NAME_LEN - 1 ) ; } if ( intf -> vif_parent ) req -> vifr_parent_vif_idx = intf -> vif_parent -> vif_idx ; else req -> vifr_parent_vif_idx = - 1 ; if ( intf -> vif_type == VIF_TYPE_VIRTUAL_VLAN ) { req -> vifr_vlan_id = intf -> vif_vlan_id ; req -> vifr_ovlan_id = intf -> vif_ovlan_id ; } if ( intf -> vif_src_mac ) { memcpy ( req -> vifr_src_mac , intf -> vif_src_mac , VR_ETHER_ALEN ) ; req -> vifr_src_mac_size = VR_ETHER_ALEN ; req -> vifr_bridge_idx = vif_bridge_get_index ( intf -> vif_parent , intf ) ; } else { req -> vifr_src_mac_size = 0 ; } <S2SV_StartBug> if ( intf -> vif_in_mirror_md_len ) { <S2SV_EndBug> memcpy ( req -> vifr_in_mirror_md , intf -> vif_in_mirror_md , intf -> vif_in_mirror_md_len ) ; req -> vifr_in_mirror_md_size = intf -> vif_in_mirror_md_len ; <S2SV_StartBug> } <S2SV_EndBug> if ( intf -> vif_out_mirror_md_len ) { memcpy ( req -> vifr_out_mirror_md , intf -> vif_out_mirror_md , intf -> vif_out_mirror_md_len ) ; req -> vifr_out_mirror_md_size = intf -> vif_out_mirror_md_len ; } req -> vifr_ibytes = 0 ; req -> vifr_ipackets = 0 ; req -> vifr_ierrors = 0 ; req -> vifr_obytes = 0 ; req -> vifr_opackets = 0 ; req -> vifr_oerrors = 0 ; req -> vifr_queue_ipackets = 0 ; for ( i = 0 ; i < vr_num_cpus ; i ++ ) req -> vifr_queue_ierrors_to_lcore [ i ] = 0 ; req -> vifr_queue_ierrors = 0 ; req -> vifr_queue_opackets = 0 ; req -> vifr_queue_oerrors = 0 ; req -> vifr_port_ipackets = 0 ; req -> vifr_port_ierrors = 0 ; req -> vifr_port_isyscalls = 0 ; req -> vifr_port_inombufs = 0 ; req -> vifr_port_opackets = 0 ; req -> vifr_port_oerrors = 0 ; req -> vifr_port_osyscalls = 0 ; req -> vifr_dev_ibytes = 0 ; req -> vifr_dev_ipackets = 0 ; req -> vifr_dev_ierrors = 0 ; req -> vifr_dev_inombufs = 0 ; req -> vifr_dev_obytes = 0 ; req -> vifr_dev_opackets = 0 ; req -> vifr_dev_oerrors = 0 ; if ( hif_ops -> hif_stats_update ) { hif_ops -> hif_stats_update ( intf , core ) ; } if ( core == ( unsigned ) - 1 ) { for ( cpu = 0 ; cpu < vr_num_cpus ; cpu ++ ) { vr_interface_add_response ( req , vif_get_stats ( intf , cpu ) ) ; } } else if ( core < vr_num_cpus ) { vr_interface_add_response ( req , vif_get_stats ( intf , core ) ) ; } req -> vifr_speed = - 1 ; req -> vifr_duplex = - 1 ; if ( intf -> vif_type == VIF_TYPE_PHYSICAL ) { if ( ! hif_ops -> hif_get_settings ( intf , & settings ) ) { req -> vifr_speed = settings . vis_speed ; req -> vifr_duplex = settings . vis_duplex ; } } for ( i = 0 ; i < VIF_FAT_FLOW_MAXPROTO_INDEX ; i ++ ) { switch ( i ) { case VIF_FAT_FLOW_TCP_INDEX : proto = VR_IP_PROTO_TCP ; break ; case VIF_FAT_FLOW_UDP_INDEX : proto = VR_IP_PROTO_UDP ; break ; case VIF_FAT_FLOW_SCTP_INDEX : proto = VR_IP_PROTO_SCTP ; break ; default : proto = 0 ; break ; } if ( req -> vifr_fat_flow_protocol_port && req -> vifr_fat_flow_protocol_port_size ) { for ( j = 0 ; j < intf -> vif_fat_flow_config_size [ i ] ; j ++ ) { port = intf -> vif_fat_flow_config [ i ] [ j ] ; if ( vif_fat_flow_port_is_set ( intf , i , port ) ) { req -> vifr_fat_flow_protocol_port [ k ++ ] = ( proto << 16 ) | port ; } else { vr_printf ( "vif0/%u:<S2SV_blank>FatFlow<S2SV_blank>port<S2SV_blank>%u<S2SV_blank>in<S2SV_blank>configuration," "<S2SV_blank>but<S2SV_blank>not<S2SV_blank>in<S2SV_blank>operational<S2SV_blank>DB\\n" , intf -> vif_idx , port ) ; } } } } req -> vifr_qos_map_index = intf -> vif_qos_map_index ; req -> vifr_dpackets = vr_interface_get_drops ( intf ) ; return ; }
<S2SV_ModStart> 0 ; } req -> vifr_in_mirror_md_size = 0 ; <S2SV_ModStart> vif_in_mirror_md_len ; } req -> vifr_out_mirror_md_size = 0 ;
7,545
CWE-000 static void register_packages ( MonoDomain * domain , JNIEnv * env , jobjectArray assemblies ) { jsize i ; jsize assembliesLength = ( * env ) -> GetArrayLength ( env , assemblies ) ; for ( i = 0 ; i < assembliesLength ; ++ i ) { const char * filename ; char * basename ; MonoAssembly * a ; MonoImage * image ; MonoClass * c ; MonoMethod * m ; jstring assembly = ( * env ) -> GetObjectArrayElement ( env , assemblies , i ) ; filename = ( * env ) -> GetStringUTFChars ( env , assembly , NULL ) ; basename = monodroid_strdup_printf ( "%s" , filename ) ; ( * strrchr ( basename , '.' ) ) = '\\0' ; a = mono . mono_domain_assembly_open ( domain , basename ) ; if ( a == NULL ) { log_fatal ( LOG_ASSEMBLY , "Could<S2SV_blank>not<S2SV_blank>load<S2SV_blank>assembly<S2SV_blank>\'%s\'<S2SV_blank>during<S2SV_blank>startup<S2SV_blank>registration." , basename ) ; log_fatal ( LOG_ASSEMBLY , "This<S2SV_blank>might<S2SV_blank>be<S2SV_blank>due<S2SV_blank>to<S2SV_blank>an<S2SV_blank>invalid<S2SV_blank>debug<S2SV_blank>installation." ) ; log_fatal ( LOG_ASSEMBLY , "A<S2SV_blank>common<S2SV_blank>cause<S2SV_blank>is<S2SV_blank>to<S2SV_blank>\'adb<S2SV_blank>install\'<S2SV_blank>the<S2SV_blank>app<S2SV_blank>directly<S2SV_blank>instead<S2SV_blank>of<S2SV_blank>doing<S2SV_blank>from<S2SV_blank>the<S2SV_blank>IDE." ) ; exit ( FATAL_EXIT_MISSING_ASSEMBLY ) ; } free ( basename ) ; ( * env ) -> ReleaseStringUTFChars ( env , assembly , filename ) ; <S2SV_StartBug> image = mono . mono_assembly_get_image ( a ) ; <S2SV_EndBug> c = monodroid_get_class_from_image ( & mono , domain , image , "Java.Interop" , "__TypeRegistrations" ) ; if ( c == NULL ) continue ; m = mono . mono_class_get_method_from_name ( c , "RegisterPackages" , 0 ) ; if ( m == NULL ) continue ; monodroid_runtime_invoke ( & mono , domain , m , NULL , NULL , NULL ) ; } }
<S2SV_ModStart> filename ) ; ( * env ) -> DeleteLocalRef ( env , assembly ) ;
7,546
CWE-000 static size_t httplog ( char * response , size_t size , size_t nmemb , void * userptr ) { char * log ; size_t realsize , copysize ; log = ( char * ) userptr ; realsize = size * nmemb ; <S2SV_StartBug> copysize = realsize < LOG_MEM_LIMIT ? realsize : LOG_MEM_LIMIT ; <S2SV_EndBug> memcpy ( log , response , copysize ) ; log [ copysize ] = '\\0' ; return realsize ; }
<S2SV_ModStart> = realsize < ( LOG_MEM_LIMIT - 1 ) <S2SV_ModEnd> ? realsize : <S2SV_ModStart> ? realsize : ( LOG_MEM_LIMIT - 1 ) <S2SV_ModEnd> ; memcpy (
7,547
CWE-000 static ssize_t uv__fs_fdatasync ( uv_fs_t * req ) { # if defined ( __linux__ ) || defined ( __sun ) || defined ( __NetBSD__ ) return fdatasync ( req -> file ) ; # elif defined ( __APPLE__ ) <S2SV_StartBug> return fcntl ( req -> file , F_FULLFSYNC ) ; <S2SV_EndBug> # else return fsync ( req -> file ) ; # endif }
<S2SV_ModStart> __APPLE__ ) return uv__fs_fsync ( req <S2SV_ModEnd> ) ; #
7,548
CWE-000 <S2SV_StartBug> LC_Return_t LC_SendMessage ( void * sender , LC_ObjectRecord_t * object , uint16_t target , uint16_t index ) { <S2SV_EndBug> LC_NodeDescription_t * node = sender ; if ( node == 0 ) node = & own_nodes [ 0 ] ; if ( node -> State != LCNodeState_Online ) return LC_NodeOffline ; if ( object == 0 ) return LC_ObjectError ; char * dataAddr = object -> Address ; if ( dataAddr == 0 && object -> Size != 0 ) return LC_DataError ; if ( object -> Attributes . Pointer ) dataAddr = * ( char * * ) dataAddr ; if ( ( object -> Attributes . TCP ) || ( object -> Size > 8 ) || ( ( object -> Size < 0 ) && ( strnlen ( dataAddr , 8 ) == 8 ) ) ) { <S2SV_StartBug> objBuffered * txProceed = findObject ( objTXbuf_start , index , target , node -> ShortName . NodeID ) ; <S2SV_EndBug> if ( txProceed ) return LC_Collision ; <S2SV_StartBug> if ( target == node -> ShortName . NodeID ) <S2SV_EndBug> return LC_Collision ; headerPacked_t hdr = { 0 } ; hdr . MsgID = index ; hdr . Priority = ~ object -> Attributes . Priority ; hdr . Request = 0 ; hdr . Source = node -> ShortName . NodeID ; <S2SV_StartBug> hdr . Target = target ; <S2SV_EndBug> # ifndef LEVCAN_MEM_STATIC objBuffered * newTXobj = ( objBuffered * ) lcmalloc ( sizeof ( objBuffered ) ) ; # else if ( object -> Attributes . Cleanup == 1 ) return LC_MallocFail ; objBuffered * newTXobj = getFreeObject ( ) ; # endif if ( newTXobj == 0 ) return LC_MallocFail ; newTXobj -> Attempt = 0 ; newTXobj -> Header = hdr ; newTXobj -> Length = object -> Size ; newTXobj -> Pointer = dataAddr ; newTXobj -> Position = 0 ; newTXobj -> Time_since_comm = 0 ; newTXobj -> Next = 0 ; newTXobj -> Flags . TCP = object -> Attributes . TCP ; newTXobj -> Flags . TXcleanup = object -> Attributes . Cleanup ; lc_disable_irq ( ) ; if ( objTXbuf_start == 0 ) { newTXobj -> Previous = 0 ; objTXbuf_start = newTXobj ; objTXbuf_end = newTXobj ; } else { newTXobj -> Previous = ( intptr_t * ) objTXbuf_end ; objTXbuf_end -> Next = ( intptr_t * ) newTXobj ; objTXbuf_end = newTXobj ; } lc_enable_irq ( ) ; # ifdef LEVCAN_TRACE # endif objectTXproceed ( newTXobj , 0 ) ; } else { int32_t size = object -> Size ; if ( size < 0 ) size = strnlen ( dataAddr , 7 ) + 1 ; uint32_t data [ 2 ] ; memcpy ( data , dataAddr , size ) ; headerPacked_t hdr = { 0 } ; hdr . MsgID = index ; hdr . Priority = ~ object -> Attributes . Priority ; hdr . Request = 0 ; hdr . Parity = 0 ; hdr . RTS_CTS = 1 ; hdr . EoM = 1 ; hdr . Source = node -> ShortName . NodeID ; <S2SV_StartBug> hdr . Target = target ; <S2SV_EndBug> return sendDataToQueue ( hdr , data , size ) ; } return LC_Ok ; }
<S2SV_ModStart> LC_ObjectRecord_t * object <S2SV_ModEnd> , uint16_t index <S2SV_ModStart> , index , object -> NodeID <S2SV_ModEnd> , node -> <S2SV_ModStart> ; if ( object -> NodeID <S2SV_ModEnd> == node -> <S2SV_ModStart> . Target = object -> NodeID <S2SV_ModEnd> ; # ifndef <S2SV_ModStart> . Target = object -> NodeID <S2SV_ModEnd> ; return sendDataToQueue
7,549
CWE-000 void sixp_input ( const uint8_t * buf , uint16_t len , const linkaddr_t * src_addr ) { sixp_pkt_t pkt ; sixp_nbr_t * nbr ; uint8_t invalid_schedule_generation ; sixp_trans_t * trans ; const sixtop_sf_t * sf ; int16_t seqno ; int16_t gen ; int ret ; assert ( buf != NULL && src_addr != NULL ) ; if ( buf == NULL || src_addr == NULL ) { return ; } if ( sixp_pkt_parse ( buf , len , & pkt ) < 0 ) { <S2SV_StartBug> LOG_ERR ( "6P:<S2SV_blank>sixp_input()<S2SV_blank>fails<S2SV_blank>because<S2SV_blank>off<S2SV_blank>a<S2SV_blank>malformed<S2SV_blank>6P<S2SV_blank>packet\\n" ) ; <S2SV_EndBug> return ; } if ( pkt . type != SIXP_PKT_TYPE_REQUEST && pkt . type != SIXP_PKT_TYPE_RESPONSE && pkt . type != SIXP_PKT_TYPE_CONFIRMATION ) { LOG_ERR ( "6P:<S2SV_blank>sixp_input()<S2SV_blank>fails<S2SV_blank>because<S2SV_blank>of<S2SV_blank>unsupported<S2SV_blank>type<S2SV_blank>[type:%u]\\n" , pkt . type ) ; return ; } if ( ( sf = sixtop_find_sf ( pkt . sfid ) ) == NULL ) { LOG_ERR ( "6P:<S2SV_blank>sixp_input()<S2SV_blank>fails<S2SV_blank>because<S2SV_blank>SF<S2SV_blank>[sfid:%u]<S2SV_blank>is<S2SV_blank>unavailable\\n" , pkt . sfid ) ; if ( send_back_error ( SIXP_PKT_TYPE_RESPONSE , ( sixp_pkt_code_t ) ( uint8_t ) SIXP_PKT_RC_SFID , pkt . sfid , pkt . seqno , src_addr ) < 0 ) { LOG_ERR ( "6P:<S2SV_blank>sixp_input()<S2SV_blank>fails<S2SV_blank>to<S2SV_blank>return<S2SV_blank>an<S2SV_blank>error<S2SV_blank>response\\n" ) ; } ; return ; } nbr = sixp_nbr_find ( src_addr ) ; if ( pkt . code . value == SIXP_PKT_CMD_CLEAR ) { invalid_schedule_generation = 0 ; } else if ( nbr == NULL ) { if ( pkt . gen == 0 ) { invalid_schedule_generation = 0 ; } else { LOG_ERR ( "6P:<S2SV_blank>GEN<S2SV_blank>should<S2SV_blank>be<S2SV_blank>0<S2SV_blank>because<S2SV_blank>of<S2SV_blank>no<S2SV_blank>corresponding<S2SV_blank>nbr\\n" ) ; invalid_schedule_generation = 1 ; } } else { if ( ( gen = sixp_nbr_get_gen ( nbr ) ) < 0 ) { LOG_ERR ( "6P:<S2SV_blank>unexpected<S2SV_blank>error;<S2SV_blank>cannot<S2SV_blank>get<S2SV_blank>our<S2SV_blank>GEN\\n" ) ; return ; } LOG_INFO ( "6P:<S2SV_blank>received<S2SV_blank>GEN<S2SV_blank>%u,<S2SV_blank>our<S2SV_blank>GEN:<S2SV_blank>%u\\n" , pkt . gen , sixp_nbr_get_gen ( nbr ) ) ; if ( pkt . gen == gen ) { invalid_schedule_generation = 0 ; } else { invalid_schedule_generation = 1 ; } } if ( invalid_schedule_generation ) { LOG_ERR ( "6P:<S2SV_blank>sixp_input()<S2SV_blank>fails<S2SV_blank>because<S2SV_blank>of<S2SV_blank>schedule<S2SV_blank>generation<S2SV_blank>mismatch\\n" ) ; return ; } trans = sixp_trans_find ( src_addr ) ; if ( pkt . type == SIXP_PKT_TYPE_REQUEST ) { if ( trans != NULL ) { LOG_ERR ( "6P:<S2SV_blank>sixp_input()<S2SV_blank>fails<S2SV_blank>because<S2SV_blank>another<S2SV_blank>request<S2SV_blank>[peer_addr:" ) ; LOG_ERR_LLADDR ( ( const linkaddr_t * ) src_addr ) ; LOG_ERR_ ( "<S2SV_blank>seqno:%u]<S2SV_blank>is<S2SV_blank>in<S2SV_blank>process\\n" , sixp_trans_get_seqno ( trans ) ) ; if ( send_back_error ( SIXP_PKT_TYPE_RESPONSE , ( sixp_pkt_code_t ) ( uint8_t ) SIXP_PKT_RC_BUSY , pkt . sfid , pkt . seqno , src_addr ) < 0 ) { LOG_ERR ( "6P:<S2SV_blank>sixp_input()<S2SV_blank>fails<S2SV_blank>to<S2SV_blank>return<S2SV_blank>an<S2SV_blank>error<S2SV_blank>response" ) ; } return ; } else if ( ( trans = sixp_trans_alloc ( & pkt , src_addr ) ) == NULL ) { LOG_ERR ( "6P:<S2SV_blank>sixp_input()<S2SV_blank>fails<S2SV_blank>because<S2SV_blank>of<S2SV_blank>lack<S2SV_blank>of<S2SV_blank>memory\\n" ) ; if ( send_back_error ( SIXP_PKT_TYPE_RESPONSE , ( sixp_pkt_code_t ) ( uint8_t ) SIXP_PKT_RC_NORES , pkt . sfid , pkt . seqno , src_addr ) < 0 ) { LOG_ERR ( "6P:<S2SV_blank>sixp_input()<S2SV_blank>fails<S2SV_blank>to<S2SV_blank>return<S2SV_blank>an<S2SV_blank>error<S2SV_blank>response\\n" ) ; } return ; } } else if ( pkt . type == SIXP_PKT_TYPE_RESPONSE || pkt . type == SIXP_PKT_TYPE_CONFIRMATION ) { if ( trans == NULL ) { LOG_ERR ( "6P:<S2SV_blank>sixp_input()<S2SV_blank>fails<S2SV_blank>because<S2SV_blank>of<S2SV_blank>no<S2SV_blank>trans<S2SV_blank>[peer_addr:" ) ; LOG_ERR_LLADDR ( ( const linkaddr_t * ) src_addr ) ; LOG_ERR_ ( "]\\n" ) ; return ; } else if ( ( seqno = sixp_trans_get_seqno ( trans ) ) < 0 || seqno != pkt . seqno ) { LOG_ERR ( "6P:<S2SV_blank>sixp_input()<S2SV_blank>fails<S2SV_blank>because<S2SV_blank>of<S2SV_blank>invalid<S2SV_blank>seqno<S2SV_blank>[seqno:%u,<S2SV_blank>%u]\\n" , seqno , pkt . seqno ) ; return ; } } assert ( trans != NULL ) ; switch ( pkt . type ) { case SIXP_PKT_TYPE_REQUEST : ret = sixp_trans_transit_state ( trans , SIXP_TRANS_STATE_REQUEST_RECEIVED ) ; break ; case SIXP_PKT_TYPE_RESPONSE : ret = sixp_trans_transit_state ( trans , SIXP_TRANS_STATE_RESPONSE_RECEIVED ) ; break ; case SIXP_PKT_TYPE_CONFIRMATION : ret = sixp_trans_transit_state ( trans , SIXP_TRANS_STATE_CONFIRMATION_RECEIVED ) ; break ; default : LOG_ERR ( "6P:<S2SV_blank>sixp_input()<S2SV_blank>fails<S2SV_blank>because<S2SV_blank>of<S2SV_blank>unsupported<S2SV_blank>type<S2SV_blank>[type:%u]\\n" , pkt . type ) ; return ; } if ( ret < 0 ) { LOG_ERR ( "6P:<S2SV_blank>sixp_input()<S2SV_blank>fails<S2SV_blank>because<S2SV_blank>of<S2SV_blank>state<S2SV_blank>transition<S2SV_blank>failure\\n" ) ; LOG_ERR ( "6P:<S2SV_blank>something<S2SV_blank>wrong;<S2SV_blank>we\'re<S2SV_blank>terminating<S2SV_blank>the<S2SV_blank>trans<S2SV_blank>%p\\n" , trans ) ; ( void ) sixp_trans_transit_state ( trans , SIXP_TRANS_STATE_TERMINATING ) ; return ; } if ( sf -> input != NULL ) { sf -> input ( pkt . type , pkt . code , pkt . body , pkt . body_len , src_addr ) ; } return ; }
<S2SV_ModStart> { LOG_ERR ( "6P:<S2SV_blank>sixp_input()<S2SV_blank>fails<S2SV_blank>because<S2SV_blank>of<S2SV_blank>a<S2SV_blank>malformed<S2SV_blank>6P<S2SV_blank>packet\\n" <S2SV_ModEnd> ) ; return
7,550
CWE-000 ngx_int_t ngx_http_v2_get_indexed_header ( ngx_http_v2_connection_t * h2c , ngx_uint_t index , ngx_uint_t name_only ) { u_char * p ; size_t rest ; ngx_http_v2_header_t * entry ; if ( index == 0 ) { ngx_log_error ( NGX_LOG_INFO , h2c -> connection -> log , 0 , "client<S2SV_blank>sent<S2SV_blank>invalid<S2SV_blank>hpack<S2SV_blank>table<S2SV_blank>index<S2SV_blank>0" ) ; return NGX_ERROR ; } ngx_log_debug2 ( NGX_LOG_DEBUG_HTTP , h2c -> connection -> log , 0 , "http2<S2SV_blank>get<S2SV_blank>indexed<S2SV_blank>%s:<S2SV_blank>%ui" , <S2SV_StartBug> name_only ? "header" : "header<S2SV_blank>name" , index ) ; <S2SV_EndBug> index -- ; if ( index < NGX_HTTP_V2_STATIC_TABLE_ENTRIES ) { h2c -> state . header = ngx_http_v2_static_table [ index ] ; return NGX_OK ; } index -= NGX_HTTP_V2_STATIC_TABLE_ENTRIES ; if ( index < h2c -> hpack . added - h2c -> hpack . deleted ) { index = ( h2c -> hpack . added - index - 1 ) % h2c -> hpack . allocated ; entry = h2c -> hpack . entries [ index ] ; p = ngx_pnalloc ( h2c -> state . pool , entry -> name . len + 1 ) ; if ( p == NULL ) { return NGX_ERROR ; } h2c -> state . header . name . len = entry -> name . len ; h2c -> state . header . name . data = p ; rest = h2c -> hpack . storage + NGX_HTTP_V2_TABLE_SIZE - entry -> name . data ; if ( entry -> name . len > rest ) { p = ngx_cpymem ( p , entry -> name . data , rest ) ; p = ngx_cpymem ( p , h2c -> hpack . storage , entry -> name . len - rest ) ; } else { p = ngx_cpymem ( p , entry -> name . data , entry -> name . len ) ; } * p = '\\0' ; if ( name_only ) { return NGX_OK ; } p = ngx_pnalloc ( h2c -> state . pool , entry -> value . len + 1 ) ; if ( p == NULL ) { return NGX_ERROR ; } h2c -> state . header . value . len = entry -> value . len ; h2c -> state . header . value . data = p ; rest = h2c -> hpack . storage + NGX_HTTP_V2_TABLE_SIZE - entry -> value . data ; if ( entry -> value . len > rest ) { p = ngx_cpymem ( p , entry -> value . data , rest ) ; p = ngx_cpymem ( p , h2c -> hpack . storage , entry -> value . len - rest ) ; } else { p = ngx_cpymem ( p , entry -> value . data , entry -> value . len ) ; } * p = '\\0' ; return NGX_OK ; } ngx_log_error ( NGX_LOG_INFO , h2c -> connection -> log , 0 , "client<S2SV_blank>sent<S2SV_blank>out<S2SV_blank>of<S2SV_blank>bound<S2SV_blank>hpack<S2SV_blank>table<S2SV_blank>index:<S2SV_blank>%ui" , index ) ; return NGX_ERROR ; }
<S2SV_ModStart> , name_only ? "name" : "header" <S2SV_ModEnd> , index )
7,551
CWE-000 void cmd_loop ( ) { while ( 1 ) { while ( ub . command == NULL ) { } esp_command_req_t * command = ub . command ; ub . command = NULL ; uint32_t * data_words = ( uint32_t * ) command -> data_buf ; esp_command_response_t resp = { . resp = 1 , . op_ret = command -> op , . len_ret = 2 , . value = 0 , } ; switch ( command -> op ) { case ESP_READ_REG : if ( command -> data_len == 4 ) { resp . value = REG_READ ( data_words [ 0 ] ) ; } break ; case ESP_FLASH_VERIFY_MD5 : resp . len_ret = 16 + 2 ; break ; default : break ; } SLIP_send_frame_delimiter ( ) ; SLIP_send_frame_data_buf ( & resp , sizeof ( esp_command_response_t ) ) ; if ( command -> data_len > MAX_WRITE_BLOCK + 16 ) { SLIP_send_frame_data ( ESP_BAD_DATA_LEN ) ; SLIP_send_frame_data ( 0xEE ) ; SLIP_send_frame_delimiter ( ) ; continue ; } esp_command_error error = ESP_CMD_NOT_IMPLEMENTED ; int status = 0 ; switch ( command -> op ) { case ESP_ERASE_FLASH : error = verify_data_len ( command , 0 ) || SPIEraseChip ( ) ; break ; case ESP_ERASE_REGION : error = verify_data_len ( command , 8 ) || handle_flash_erase ( data_words [ 0 ] , data_words [ 1 ] ) ; break ; case ESP_SET_BAUD : error = verify_data_len ( command , 8 ) ; break ; case ESP_READ_FLASH : error = verify_data_len ( command , 16 ) ; break ; case ESP_FLASH_VERIFY_MD5 : error = verify_data_len ( command , 16 ) || handle_flash_get_md5sum ( data_words [ 0 ] , data_words [ 1 ] ) ; break ; case ESP_FLASH_BEGIN : if ( command -> data_len == 16 && data_words [ 2 ] != MAX_WRITE_BLOCK ) { error = ESP_BAD_BLOCKSIZE ; } else { error = verify_data_len ( command , 16 ) || handle_flash_begin ( data_words [ 0 ] , data_words [ 3 ] ) ; } break ; case ESP_FLASH_DEFLATED_BEGIN : if ( command -> data_len == 16 && data_words [ 2 ] != MAX_WRITE_BLOCK ) { error = ESP_BAD_BLOCKSIZE ; } else { error = verify_data_len ( command , 16 ) || handle_flash_deflated_begin ( data_words [ 0 ] , data_words [ 1 ] * data_words [ 2 ] , data_words [ 3 ] ) ; } break ; case ESP_FLASH_DATA : case ESP_FLASH_DEFLATED_DATA : if ( is_in_flash_mode ( ) ) { error = get_flash_error ( ) ; int payload_len = command -> data_len - 16 ; if ( data_words [ 0 ] != payload_len ) { error = ESP_BAD_DATA_LEN ; } uint8_t data_checksum = calculate_checksum ( command -> data_buf + 16 , payload_len ) ; if ( data_checksum != command -> checksum ) { error = ESP_BAD_DATA_CHECKSUM ; } } else { error = ESP_NOT_IN_FLASH_MODE ; } break ; case ESP_FLASH_END : case ESP_FLASH_DEFLATED_END : error = handle_flash_end ( ) ; break ; case ESP_SPI_SET_PARAMS : error = verify_data_len ( command , 24 ) || handle_spi_set_params ( data_words , & status ) ; break ; case ESP_SPI_ATTACH : error = verify_data_len ( command , 4 ) || handle_spi_attach ( data_words [ 0 ] ) ; break ; case ESP_WRITE_REG : error = verify_data_len ( command , 16 ) ; if ( error == ESP_OK ) { REG_WRITE ( data_words [ 0 ] , data_words [ 1 ] ) ; } break ; case ESP_READ_REG : error = verify_data_len ( command , 4 ) ; break ; case ESP_MEM_BEGIN : error = verify_data_len ( command , 16 ) || handle_mem_begin ( data_words [ 0 ] , data_words [ 3 ] ) ; break ; case ESP_MEM_DATA : error = handle_mem_data ( command -> data_buf + 16 , command -> data_len - 16 ) ; break ; case ESP_MEM_END : error = verify_data_len ( command , 8 ) || handle_mem_finish ( ) ; break ; case ESP_RUN_USER_CODE : return ; } SLIP_send_frame_data ( error ) ; SLIP_send_frame_data ( status ) ; SLIP_send_frame_delimiter ( ) ; if ( error == ESP_OK ) { switch ( command -> op ) { case ESP_SET_BAUD : ets_delay_us ( 10000 ) ; uart_div_modify ( 0 , get_new_uart_divider ( data_words [ 1 ] , data_words [ 0 ] ) ) ; ets_delay_us ( 1000 ) ; break ; case ESP_READ_FLASH : handle_flash_read ( data_words [ 0 ] , data_words [ 1 ] , data_words [ 2 ] , data_words [ 3 ] ) ; break ; case ESP_FLASH_DATA : handle_flash_data ( command -> data_buf + 16 , command -> data_len - 16 ) ; break ; case ESP_FLASH_DEFLATED_DATA : handle_flash_deflated_data ( command -> data_buf + 16 , command -> data_len - 16 ) ; break ; case ESP_FLASH_DEFLATED_END : case ESP_FLASH_END : if ( data_words [ 0 ] == 0 ) { # ifdef ESP32 uart_tx_flush ( 0 ) ; # endif ets_delay_us ( 10000 ) ; software_reset ( ) ; } break ; case ESP_MEM_END : if ( data_words [ 1 ] != 0 ) { void ( * entrypoint_fn ) ( void ) = ( void ( * ) ) data_words [ 1 ] ; <S2SV_StartBug> entrypoint_fn ( ) ; <S2SV_EndBug> } break ; } } } }
<S2SV_ModStart> 1 ] ; # ifdef ESP32 uart_tx_flush ( 0 ) ; # endif ets_delay_us ( 1000 ) ;
7,552
CWE-000 static void synaptics_ts_work_func ( struct work_struct * work ) { int ret ; uint8_t status = 0 ; uint8_t inte = 0 ; struct synaptics_ts_data * ts = ts_g ; if ( ts -> enable_remote ) { goto END ; } ret = synaptics_rmi4_i2c_write_byte ( ts -> client , 0xff , 0x00 ) ; ret = synaptics_rmi4_i2c_read_word ( ts -> client , F01_RMI_DATA_BASE ) ; if ( atomic_read ( & ts -> is_stop ) == 1 ) goto END ; if ( ret < 0 ) { TPDTM_DMESG ( "Synaptic:ret<S2SV_blank>=<S2SV_blank>%d\\n" , ret ) ; synaptics_hard_reset ( ts ) ; goto END ; } status = ret & 0xff ; inte = ( ret & 0x7f00 ) >> 8 ; if ( status ) { int_state ( ts ) ; goto END ; } if ( inte & 0x04 ) { <S2SV_StartBug> int_touch ( ) ; <S2SV_EndBug> <S2SV_StartBug> } <S2SV_EndBug> END : ret = set_changer_bit ( ts ) ; touch_enable ( ts ) ; return ; }
<S2SV_ModStart> 0x04 ) { uint8_t finger_num = <S2SV_ModStart> ( ) ; ts -> touch_active = finger_num ;
7,553
CWE-000 static void wma_set_vdev_resume_dtim ( tp_wma_handle wma , uint8_t vdev_id ) { struct wma_txrx_node * iface = & wma -> interfaces [ vdev_id ] ; if ( ( iface -> type == WMI_VDEV_TYPE_STA ) && ( iface -> restore_dtim_setting ) ) { QDF_STATUS ret ; uint32_t cfg_data_val = 0 ; struct sAniSirGlobal * mac = cds_get_context ( QDF_MODULE_ID_PE ) ; if ( ! mac ) { WMA_LOGE ( FL ( "Failed<S2SV_blank>to<S2SV_blank>get<S2SV_blank>mac<S2SV_blank>context" ) ) ; return ; } if ( ( wlan_cfg_get_int ( mac , WNI_CFG_LISTEN_INTERVAL , & cfg_data_val ) != eSIR_SUCCESS ) ) { QDF_TRACE ( QDF_MODULE_ID_WMA , QDF_TRACE_LEVEL_ERROR , "Failed<S2SV_blank>to<S2SV_blank>get<S2SV_blank>value<S2SV_blank>for<S2SV_blank>listen<S2SV_blank>interval" ) ; cfg_data_val = POWERSAVE_DEFAULT_LISTEN_INTERVAL ; } ret = wma_vdev_set_param ( wma -> wmi_handle , vdev_id , WMI_VDEV_PARAM_LISTEN_INTERVAL , cfg_data_val ) ; if ( QDF_IS_STATUS_ERROR ( ret ) ) { WMA_LOGE ( "Failed<S2SV_blank>to<S2SV_blank>Set<S2SV_blank>Listen<S2SV_blank>Interval<S2SV_blank>vdevId<S2SV_blank>%d" , vdev_id ) ; } <S2SV_StartBug> WMA_LOGD ( "Set<S2SV_blank>Listen<S2SV_blank>Interval<S2SV_blank>vdevId<S2SV_blank>%d<S2SV_blank>Listen<S2SV_blank>Intv<S2SV_blank>%d" , <S2SV_EndBug> vdev_id , cfg_data_val ) ; if ( wlan_cfg_get_int ( mac , WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT , & cfg_data_val ) != eSIR_SUCCESS ) { QDF_TRACE ( QDF_MODULE_ID_WMA , QDF_TRACE_LEVEL_ERROR , "Failed<S2SV_blank>to<S2SV_blank>get<S2SV_blank>WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT" ) ; cfg_data_val = POWERSAVE_DEFAULT_INACTIVITY_TIME ; } iface -> restore_dtim_setting = false ; } }
<S2SV_ModStart> } WMA_LOGD ( "%s:<S2SV_blank>Set<S2SV_blank>Listen<S2SV_blank>Interval<S2SV_blank>vdevId<S2SV_blank>%d<S2SV_blank>Listen<S2SV_blank>Intv<S2SV_blank>%d" , __func__ , <S2SV_ModEnd> vdev_id , cfg_data_val
7,554
CWE-000 void gettxinfo ( void ) { # ifdef HAVE_LIBHAMLIB freq_t rigfreq ; vfo_t vfo ; pbwidth_t bwidth ; int retval ; int retvalmode ; static double last_freq_time = 0.0 ; # else float rigfreq ; # endif static int oldbandinx ; <S2SV_StartBug> # ifdef HAVE_LIBXMLRPC <S2SV_EndBug> static int fldigi_carrier ; static int fldigi_shift_freq ; # endif if ( ! trx_control ) return ; # ifdef HAVE_LIBHAMLIB if ( rigptt == 0x0b ) { retval = rig_set_ptt ( my_rig , RIG_VFO_CURR , RIG_PTT_ON ) ; rigptt |= ( 1 << 2 ) ; rigptt &= ~ ( 1 << 3 ) ; } if ( rigptt == 0x17 ) { retval = rig_set_ptt ( my_rig , RIG_VFO_CURR , RIG_PTT_OFF ) ; rigptt &= ~ ( 1 << 4 ) ; rigptt &= ~ ( 1 << 2 ) ; } # endif double reqf = get_and_reset_outfreq ( ) ; if ( reqf == 0 ) { rigfreq = 0.0 ; # ifdef HAVE_LIBHAMLIB double now = get_current_seconds ( ) ; if ( now < last_freq_time + 0.2 ) { return ; } last_freq_time = now ; retval = rig_get_vfo ( my_rig , & vfo ) ; if ( retval == RIG_OK || retval == - RIG_ENIMPL || retval == - RIG_ENAVAIL ) { retval = rig_get_freq ( my_rig , RIG_VFO_CURR , & rigfreq ) ; if ( trxmode == DIGIMODE && ( digikeyer == GMFSK || digikeyer == FLDIGI ) && retval == RIG_OK ) { retvalmode = rig_get_mode ( my_rig , RIG_VFO_CURR , ( rmode_t * ) & rigmode , & bwidth ) ; if ( retvalmode != RIG_OK ) { rigmode = RIG_MODE_NONE ; } } } if ( trxmode == DIGIMODE && ( digikeyer == GMFSK || digikeyer == FLDIGI ) ) { fldigi_carrier = fldigi_get_carrier ( ) ; rigfreq += ( freq_t ) fldigi_carrier ; if ( rigmode == RIG_MODE_RTTY || rigmode == RIG_MODE_RTTYR ) { fldigi_shift_freq = fldigi_get_shift_freq ( ) ; if ( fldigi_shift_freq != 0 ) { retval = rig_set_freq ( my_rig , RIG_VFO_CURR , ( ( freq_t ) rigfreq + ( freq_t ) fldigi_shift_freq ) ) ; } } } if ( retval != RIG_OK || rigfreq < 0.1 ) { freq = 0.0 ; return ; } # endif if ( rigfreq >= 1800000.0 ) { freq = rigfreq / 1000.0 ; } bandinx = freq2band ( ( unsigned int ) ( freq * 1000.0 ) ) ; bandfrequency [ bandinx ] = freq ; if ( bandinx != oldbandinx ) { oldbandinx = bandinx ; handle_trx_bandswitch ( ( int ) freq ) ; } } else if ( reqf == SETCWMODE ) { # ifdef HAVE_LIBHAMLIB if ( cw_bandwidth == 0 ) { retval = rig_set_mode ( my_rig , RIG_VFO_CURR , RIG_MODE_CW , TLF_DEFAULT_PASSBAND ) ; } else { retval = rig_set_mode ( my_rig , RIG_VFO_CURR , RIG_MODE_CW , cw_bandwidth ) ; } if ( retval != 0 ) { mvprintw ( 24 , 0 , "Problem<S2SV_blank>with<S2SV_blank>rig<S2SV_blank>link!\\n" ) ; refreshp ( ) ; sleep ( 1 ) ; } # endif } else if ( reqf == SETSSBMODE ) { # ifdef HAVE_LIBHAMLIB if ( freq > 13999.9 ) retval = rig_set_mode ( my_rig , RIG_VFO_CURR , RIG_MODE_USB , TLF_DEFAULT_PASSBAND ) ; else retval = rig_set_mode ( my_rig , RIG_VFO_CURR , RIG_MODE_LSB , TLF_DEFAULT_PASSBAND ) ; if ( retval != RIG_OK ) { mvprintw ( 24 , 0 , "Problem<S2SV_blank>with<S2SV_blank>rig<S2SV_blank>link!\\n" ) ; refreshp ( ) ; sleep ( 1 ) ; } # endif } else if ( reqf == SETDIGIMODE ) { # ifdef HAVE_LIBHAMLIB rmode_t new_mode = digi_mode ; if ( new_mode == RIG_MODE_NONE ) { if ( digikeyer == FLDIGI ) new_mode = RIG_MODE_USB ; else new_mode = RIG_MODE_LSB ; } retval = rig_set_mode ( my_rig , RIG_VFO_CURR , new_mode , TLF_DEFAULT_PASSBAND ) ; if ( retval != RIG_OK ) { mvprintw ( 24 , 0 , "Problem<S2SV_blank>with<S2SV_blank>rig<S2SV_blank>link!\\n" ) ; refreshp ( ) ; sleep ( 1 ) ; } # endif } else if ( reqf == RESETRIT ) { # ifdef HAVE_LIBHAMLIB retval = rig_set_rit ( my_rig , RIG_VFO_CURR , 0 ) ; if ( retval != RIG_OK ) { mvprintw ( 24 , 0 , "Problem<S2SV_blank>with<S2SV_blank>rig<S2SV_blank>link!\\n" ) ; refreshp ( ) ; sleep ( 1 ) ; } # endif } else { # ifdef HAVE_LIBHAMLIB retval = rig_set_freq ( my_rig , RIG_VFO_CURR , ( freq_t ) reqf ) ; if ( retval != RIG_OK ) { mvprintw ( 24 , 0 , "Problem<S2SV_blank>with<S2SV_blank>rig<S2SV_blank>link:<S2SV_blank>set<S2SV_blank>frequency!\\n" ) ; refreshp ( ) ; sleep ( 1 ) ; } # endif } }
<S2SV_ModStart> ; # ifdef HAVE_LIBHAMLIB <S2SV_ModEnd> static int fldigi_carrier
7,555
CWE-000 void pathman_join_pathlist_hook ( PlannerInfo * root , RelOptInfo * joinrel , RelOptInfo * outerrel , RelOptInfo * innerrel , JoinType jointype , JoinPathExtraData * extra ) { JoinCostWorkspace workspace ; JoinType saved_jointype = jointype ; RangeTblEntry * inner_rte = root -> simple_rte_array [ innerrel -> relid ] ; const PartRelationInfo * inner_prel ; List * joinclauses , * otherclauses ; WalkerContext context ; double paramsel ; Node * part_expr ; ListCell * lc ; if ( set_join_pathlist_next ) set_join_pathlist_next ( root , joinrel , outerrel , innerrel , jointype , extra ) ; if ( ! IsPathmanReady ( ) || ! pg_pathman_enable_runtimeappend ) return ; <S2SV_StartBug> if ( inner_rte && inner_rte -> inh ) <S2SV_EndBug> return ; if ( jointype == JOIN_FULL || jointype == JOIN_RIGHT ) return ; if ( innerrel -> reloptkind != RELOPT_BASEREL || ! ( inner_prel = get_pathman_relation_info ( inner_rte -> relid ) ) ) return ; if ( PARENTHOOD_DISALLOWED == get_rel_parenthood_status ( root -> parse -> queryId , inner_rte ) ) return ; if ( jointype == JOIN_UNIQUE_OUTER || jointype == JOIN_UNIQUE_INNER ) jointype = JOIN_INNER ; if ( IS_OUTER_JOIN ( extra -> sjinfo -> jointype ) ) { extract_actual_join_clauses ( extra -> restrictlist , & joinclauses , & otherclauses ) ; } else { joinclauses = extract_actual_clauses ( extra -> restrictlist , false ) ; otherclauses = NIL ; } part_expr = PrelExpressionForRelid ( inner_prel , innerrel -> relid ) ; paramsel = 1.0 ; foreach ( lc , joinclauses ) { WrapperNode * wrap ; InitWalkerContext ( & context , part_expr , inner_prel , NULL ) ; wrap = walk_expr_tree ( ( Expr * ) lfirst ( lc ) , & context ) ; paramsel *= wrap -> paramsel ; } foreach ( lc , innerrel -> pathlist ) { AppendPath * cur_inner_path = ( AppendPath * ) lfirst ( lc ) ; Path * outer , * inner ; NestPath * nest_path ; ParamPathInfo * ppi ; Relids required_nestloop , required_inner ; List * filtered_joinclauses = NIL , * saved_ppi_list , * pathkeys ; ListCell * rinfo_lc ; if ( ! IsA ( cur_inner_path , AppendPath ) ) continue ; outer = outerrel -> cheapest_total_path ; if ( PATH_PARAM_BY_REL ( outer , innerrel ) ) continue ; if ( saved_jointype == JOIN_UNIQUE_OUTER ) { outer = ( Path * ) create_unique_path ( root , outerrel , outer , extra -> sjinfo ) ; Assert ( outer ) ; } if ( saved_jointype == JOIN_UNIQUE_INNER ) return ; required_inner = bms_union ( PATH_REQ_OUTER ( ( Path * ) cur_inner_path ) , outerrel -> relids ) ; saved_ppi_list = innerrel -> ppilist ; innerrel -> ppilist = NIL ; ppi = get_baserel_parampathinfo ( root , innerrel , required_inner ) ; innerrel -> ppilist = saved_ppi_list ; if ( ! ( ppi && get_partitioning_clauses ( ppi -> ppi_clauses , inner_prel , innerrel -> relid ) ) ) continue ; inner = create_runtimeappend_path ( root , cur_inner_path , ppi , paramsel ) ; if ( ! inner ) return ; required_nestloop = calc_nestloop_required_outer ( outer , inner ) ; if ( required_nestloop && ( ( ! bms_overlap ( required_nestloop , extra -> param_source_rels ) && ! allow_star_schema_join ( root , outer , inner ) ) || have_dangerous_phv ( root , outer -> parent -> relids , required_inner ) ) ) return ; initial_cost_nestloop_compat ( root , & workspace , jointype , outer , inner , extra ) ; pathkeys = build_join_pathkeys ( root , joinrel , jointype , outer -> pathkeys ) ; foreach ( rinfo_lc , extra -> restrictlist ) { RestrictInfo * rinfo = ( RestrictInfo * ) lfirst ( rinfo_lc ) ; Assert ( IsA ( rinfo , RestrictInfo ) ) ; if ( ! join_clause_is_movable_to ( rinfo , inner -> parent ) ) filtered_joinclauses = lappend ( filtered_joinclauses , rinfo ) ; } nest_path = create_nestloop_path_compat ( root , joinrel , jointype , & workspace , extra , outer , inner , filtered_joinclauses , pathkeys , calc_nestloop_required_outer ( outer , inner ) ) ; nest_path -> path . rows = get_parameterized_joinrel_size_compat ( root , joinrel , outer , inner , extra -> sjinfo , filtered_joinclauses ) ; add_path ( joinrel , ( Path * ) nest_path ) ; } }
<S2SV_ModStart> ; if ( innerrel -> reloptkind != RELOPT_BASEREL ) return ; if ( <S2SV_ModEnd> inner_rte -> inh
7,556
CWE-000 <S2SV_StartBug> int <S2SV_EndBug> em_allocate_legacy ( struct adapter * adapter ) { device_t dev = adapter -> dev ; struct tx_ring * txr = adapter -> tx_rings ; int error , rid = 0 ; E1000_WRITE_REG ( & adapter -> hw , E1000_IMC , 0xffffffff ) ; if ( adapter -> msix == 1 ) rid = 1 ; adapter -> res = bus_alloc_resource_any ( dev , SYS_RES_IRQ , & rid , RF_SHAREABLE | RF_ACTIVE ) ; if ( adapter -> res == NULL ) { device_printf ( dev , "Unable<S2SV_blank>to<S2SV_blank>allocate<S2SV_blank>bus<S2SV_blank>resource:<S2SV_blank>" "interrupt\\n" ) ; return ( ENXIO ) ; } TASK_INIT ( & adapter -> que_task , 0 , em_handle_que , adapter ) ; adapter -> tq = taskqueue_create_fast ( "em_taskq" , M_NOWAIT , taskqueue_thread_enqueue , & adapter -> tq ) ; taskqueue_start_threads ( & adapter -> tq , 1 , PI_NET , "%s<S2SV_blank>que" , device_get_nameunit ( adapter -> dev ) ) ; TASK_INIT ( & txr -> tx_task , 0 , em_handle_tx , txr ) ; txr -> tq = taskqueue_create_fast ( "em_txq" , M_NOWAIT , taskqueue_thread_enqueue , & txr -> tq ) ; taskqueue_start_threads ( & txr -> tq , 1 , PI_NET , "%s<S2SV_blank>txq" , device_get_nameunit ( adapter -> dev ) ) ; TASK_INIT ( & adapter -> link_task , 0 , em_handle_link , adapter ) ; if ( ( error = bus_setup_intr ( dev , adapter -> res , INTR_TYPE_NET , em_irq_fast , NULL , adapter , & adapter -> tag ) ) != 0 ) { device_printf ( dev , "Failed<S2SV_blank>to<S2SV_blank>register<S2SV_blank>fast<S2SV_blank>interrupt<S2SV_blank>" "handler:<S2SV_blank>%d\\n" , error ) ; taskqueue_free ( adapter -> tq ) ; adapter -> tq = NULL ; return ( error ) ; } return ( 0 ) ; }
<S2SV_ModStart> <S2SV_null> <S2SV_null> <S2SV_null> static
7,557
CWE-000 int main ( int argc , char * argv [ ] ) { program_name = argv [ 0 ] ; const char * const shortOptions = "hdrun" ; const struct option longOptions [ ] = { { "help" , 0 , NULL , 'h' } , { "daemon" , 0 , NULL , 'd' } , { "report" , 0 , NULL , 'r' } , { "update" , 0 , NULL , 'u' } , { "no-network" , 0 , NULL , 'n' } , } ; int nextOption ; bool daemonMode = false ; bool updateOnce = false ; do { nextOption = getopt_long ( argc , argv , shortOptions , longOptions , NULL ) ; switch ( nextOption ) { case 'h' : usage ( stdout , 0 ) ; case 'd' : daemonMode = true ; break ; case 'r' : daemonMode = false ; updateOnce = false ; break ; case 'u' : updateOnce = true ; break ; case 'n' : noNetwork = true ; break ; case '?' : usage ( stderr , 1 ) ; case ( - 1 ) : break ; default : printf ( "what?<S2SV_blank>exiting\\n" ) ; exit ( EXIT_FAILURE ) ; } } while ( nextOption != - 1 ) ; static Display * dpy ; if ( daemonMode || updateOnce ) { if ( ! ( dpy = XOpenDisplay ( NULL ) ) ) { fputs ( "Cannot<S2SV_blank>open<S2SV_blank>display.<S2SV_blank>are<S2SV_blank>you<S2SV_blank>_sure_<S2SV_blank>X11<S2SV_blank>is<S2SV_blank>running?\\n" , stderr ) ; return EXIT_FAILURE ; } if ( daemonMode ) { <S2SV_StartBug> for ( daemon ( 0 , 0 ) ; true ; sleep ( SLEEP_INTERVAL ) ) { <S2SV_EndBug> setStatus ( dpy ) ; } } else { setStatus ( dpy ) ; } } else { puts ( buildStatus ( ) ) ; } return 0 ; }
<S2SV_ModStart> ( 0 , 1 <S2SV_ModEnd> ) ; true
7,558
CWE-000 vcode_reg_t emit_abs ( vcode_reg_t lhs ) { int64_t lconst ; if ( vcode_reg_const ( lhs , & lconst ) ) <S2SV_StartBug> return emit_const ( vcode_reg_type ( lhs ) , - lconst ) ; <S2SV_EndBug> op_t * op = vcode_add_op ( VCODE_OP_ABS ) ; vcode_add_arg ( op , lhs ) ; op -> result = vcode_add_reg ( vcode_reg_type ( lhs ) ) ; return op -> result ; }
<S2SV_ModStart> lhs ) , llabs ( lconst ) <S2SV_ModEnd> ) ; op_t
7,559
CWE-000 void <S2SV_StartBug> defsubr ( struct Lisp_Subr * sname ) <S2SV_EndBug> { Lisp_Object sym , tem ; sym = intern_c_string ( sname -> symbol_name ) ; XSETPVECTYPE ( sname , PVEC_SUBR ) ; XSETSUBR ( tem , sname ) ; set_symbol_function ( sym , tem ) ; }
<S2SV_ModStart> void defsubr ( union Aligned_Lisp_Subr * aname ) { <S2SV_ModStart> Lisp_Subr * sname = & aname -> s ; <S2SV_ModEnd> Lisp_Object sym ,
7,560
CWE-000 my_bool audit_log_check_command_included ( const char * name , size_t length ) { <S2SV_StartBug> my_bool res ; <S2SV_EndBug> mysql_rwlock_rdlock ( & LOCK_command_list ) ; res = my_hash_search ( & include_commands , ( const uchar * ) name , length ) != NULL ; mysql_rwlock_unlock ( & LOCK_command_list ) ; return res ; }
<S2SV_ModStart> { my_bool res ; if ( length == 0 ) return false
7,561
CWE-000 int xhci_init ( struct xhci_softc * sc ) { uint32_t hcr ; int npage , error ; # ifdef XHCI_DEBUG uint16_t vers ; vers = XREAD2 ( sc , XHCI_HCIVERSION ) ; printf ( "%s:<S2SV_blank>xHCI<S2SV_blank>version<S2SV_blank>%x.%x\\n" , DEVNAME ( sc ) , vers >> 8 , vers & 0xff ) ; # endif sc -> sc_bus . usbrev = USBREV_3_0 ; sc -> sc_bus . methods = & xhci_bus_methods ; sc -> sc_bus . pipe_size = sizeof ( struct xhci_pipe ) ; sc -> sc_oper_off = XREAD1 ( sc , XHCI_CAPLENGTH ) ; sc -> sc_door_off = XREAD4 ( sc , XHCI_DBOFF ) ; sc -> sc_runt_off = XREAD4 ( sc , XHCI_RTSOFF ) ; # ifdef XHCI_DEBUG <S2SV_StartBug> printf ( "%s:<S2SV_blank>CAPLENGTH=0x%x\\n" , DEVNAME ( sc ) , sc -> sc_oper_off ) ; <S2SV_EndBug> <S2SV_StartBug> printf ( "%s:<S2SV_blank>DOORBELL=0x%x\\n" , DEVNAME ( sc ) , sc -> sc_door_off ) ; <S2SV_EndBug> <S2SV_StartBug> printf ( "%s:<S2SV_blank>RUNTIME=0x%x\\n" , DEVNAME ( sc ) , sc -> sc_runt_off ) ; <S2SV_EndBug> # endif error = xhci_reset ( sc ) ; if ( error ) return ( error ) ; if ( xhcixfer == NULL ) { xhcixfer = malloc ( sizeof ( struct pool ) , M_DEVBUF , M_NOWAIT ) ; if ( xhcixfer == NULL ) { printf ( "%s:<S2SV_blank>unable<S2SV_blank>to<S2SV_blank>allocate<S2SV_blank>pool<S2SV_blank>descriptor\\n" , DEVNAME ( sc ) ) ; return ( ENOMEM ) ; } pool_init ( xhcixfer , sizeof ( struct xhci_xfer ) , 0 , 0 , 0 , "xhcixfer" , NULL ) ; } hcr = XREAD4 ( sc , XHCI_HCCPARAMS ) ; sc -> sc_ctxsize = XHCI_HCC_CSZ ( hcr ) ? 64 : 32 ; DPRINTF ( ( "%s:<S2SV_blank>%d<S2SV_blank>bytes<S2SV_blank>context\\n" , DEVNAME ( sc ) , sc -> sc_ctxsize ) ) ; # ifdef XHCI_DEBUG hcr = XOREAD4 ( sc , XHCI_PAGESIZE ) ; printf ( "%s:<S2SV_blank>supported<S2SV_blank>page<S2SV_blank>size<S2SV_blank>0x%08x\\n" , DEVNAME ( sc ) , hcr ) ; # endif sc -> sc_pagesize = 4096 ; hcr = XREAD4 ( sc , XHCI_HCSPARAMS1 ) ; sc -> sc_noport = XHCI_HCS1_N_PORTS ( hcr ) ; sc -> sc_noslot = XHCI_HCS1_DEVSLOT_MAX ( hcr ) ; DPRINTF ( ( "%s:<S2SV_blank>%d<S2SV_blank>ports<S2SV_blank>and<S2SV_blank>%d<S2SV_blank>slots\\n" , DEVNAME ( sc ) , sc -> sc_noport , sc -> sc_noslot ) ) ; sc -> sc_dcbaa . size = ( sc -> sc_noslot + 1 ) * sizeof ( uint64_t ) ; error = usb_allocmem ( & sc -> sc_bus , sc -> sc_dcbaa . size , 64 , & sc -> sc_dcbaa . dma ) ; if ( error ) return ( ENOMEM ) ; sc -> sc_dcbaa . segs = KERNADDR ( & sc -> sc_dcbaa . dma , 0 ) ; memset ( sc -> sc_dcbaa . segs , 0 , sc -> sc_dcbaa . size ) ; usb_syncmem ( & sc -> sc_dcbaa . dma , 0 , sc -> sc_dcbaa . size , BUS_DMASYNC_PREWRITE ) ; error = xhci_ring_alloc ( sc , & sc -> sc_cmd_ring , XHCI_MAX_COMMANDS ) ; if ( error ) { printf ( "%s:<S2SV_blank>could<S2SV_blank>not<S2SV_blank>allocate<S2SV_blank>command<S2SV_blank>ring.\\n" , DEVNAME ( sc ) ) ; usb_freemem ( & sc -> sc_bus , & sc -> sc_dcbaa . dma ) ; return ( error ) ; } error = xhci_ring_alloc ( sc , & sc -> sc_evt_ring , XHCI_MAX_EVENTS ) ; if ( error ) { printf ( "%s:<S2SV_blank>could<S2SV_blank>not<S2SV_blank>allocate<S2SV_blank>event<S2SV_blank>ring.\\n" , DEVNAME ( sc ) ) ; xhci_ring_free ( sc , & sc -> sc_cmd_ring ) ; usb_freemem ( & sc -> sc_bus , & sc -> sc_dcbaa . dma ) ; return ( error ) ; } sc -> sc_erst . size = 1 * sizeof ( struct xhci_erseg ) ; error = usb_allocmem ( & sc -> sc_bus , sc -> sc_erst . size , 64 , & sc -> sc_erst . dma ) ; if ( error ) { printf ( "%s:<S2SV_blank>could<S2SV_blank>not<S2SV_blank>allocate<S2SV_blank>segment<S2SV_blank>table.\\n" , DEVNAME ( sc ) ) ; xhci_ring_free ( sc , & sc -> sc_evt_ring ) ; xhci_ring_free ( sc , & sc -> sc_cmd_ring ) ; usb_freemem ( & sc -> sc_bus , & sc -> sc_dcbaa . dma ) ; return ( ENOMEM ) ; } sc -> sc_erst . segs = KERNADDR ( & sc -> sc_erst . dma , 0 ) ; sc -> sc_erst . segs [ 0 ] . er_addr = htole64 ( DMAADDR ( & sc -> sc_evt_ring . dma , 0 ) ) ; sc -> sc_erst . segs [ 0 ] . er_size = htole32 ( XHCI_MAX_EVENTS ) ; sc -> sc_erst . segs [ 0 ] . er_rsvd = 0 ; usb_syncmem ( & sc -> sc_erst . dma , 0 , sc -> sc_erst . size , BUS_DMASYNC_PREWRITE ) ; hcr = XREAD4 ( sc , XHCI_HCSPARAMS2 ) ; npage = XHCI_HCS2_SPB_MAX ( hcr ) ; DPRINTF ( ( "%s:<S2SV_blank>%d<S2SV_blank>scratch<S2SV_blank>pages\\n" , DEVNAME ( sc ) , npage ) ) ; if ( npage > 0 && xhci_scratchpad_alloc ( sc , npage ) ) { printf ( "%s:<S2SV_blank>could<S2SV_blank>not<S2SV_blank>allocate<S2SV_blank>scratchpad.\\n" , DEVNAME ( sc ) ) ; usb_freemem ( & sc -> sc_bus , & sc -> sc_erst . dma ) ; xhci_ring_free ( sc , & sc -> sc_evt_ring ) ; xhci_ring_free ( sc , & sc -> sc_cmd_ring ) ; usb_freemem ( & sc -> sc_bus , & sc -> sc_dcbaa . dma ) ; return ( ENOMEM ) ; } xhci_config ( sc ) ; return ( 0 ) ; }
<S2SV_ModStart> XHCI_DEBUG printf ( "%s:<S2SV_blank>CAPLENGTH=%#lx\\n" <S2SV_ModEnd> , DEVNAME ( <S2SV_ModStart> ; printf ( "%s:<S2SV_blank>DOORBELL=%#lx\\n" <S2SV_ModEnd> , DEVNAME ( <S2SV_ModStart> ; printf ( "%s:<S2SV_blank>RUNTIME=%#lx\\n" <S2SV_ModEnd> , DEVNAME (
7,562
CWE-000 int ipa_nat_init_cmd ( struct ipa_ioc_v4_nat_init * init ) { struct ipa_desc desc = { 0 } ; struct ipa_ip_v4_nat_init * cmd ; u16 size = sizeof ( struct ipa_ip_v4_nat_init ) ; int result ; u32 offset = 0 ; IPADBG ( "\\n" ) ; <S2SV_StartBug> if ( init -> tbl_index < 0 || init -> table_entries <= 0 ) { <S2SV_EndBug> IPADBG ( "Table<S2SV_blank>index<S2SV_blank>or<S2SV_blank>entries<S2SV_blank>is<S2SV_blank>zero\\n" ) ; result = - EPERM ; goto bail ; } cmd = kmalloc ( size , GFP_KERNEL ) ; if ( ! cmd ) { IPAERR ( "Failed<S2SV_blank>to<S2SV_blank>alloc<S2SV_blank>immediate<S2SV_blank>command<S2SV_blank>object\\n" ) ; result = - ENOMEM ; goto bail ; } if ( ipa_ctx -> nat_mem . vaddr ) { IPADBG ( "using<S2SV_blank>system<S2SV_blank>memory<S2SV_blank>for<S2SV_blank>nat<S2SV_blank>table\\n" ) ; cmd -> ipv4_rules_addr_type = IPA_NAT_SYSTEM_MEMORY ; cmd -> ipv4_expansion_rules_addr_type = IPA_NAT_SYSTEM_MEMORY ; cmd -> index_table_addr_type = IPA_NAT_SYSTEM_MEMORY ; cmd -> index_table_expansion_addr_type = IPA_NAT_SYSTEM_MEMORY ; offset = UINT_MAX - ipa_ctx -> nat_mem . dma_handle ; if ( ( init -> ipv4_rules_offset > offset ) || ( init -> expn_rules_offset > offset ) || ( init -> index_offset > offset ) || ( init -> index_expn_offset > offset ) ) { IPAERR ( "Failed<S2SV_blank>due<S2SV_blank>to<S2SV_blank>integer<S2SV_blank>overflow\\n" ) ; IPAERR ( "nat.mem.dma_handle:<S2SV_blank>0x%pa\\n" , & ipa_ctx -> nat_mem . dma_handle ) ; IPAERR ( "ipv4_rules_offset:<S2SV_blank>0x%x\\n" , init -> ipv4_rules_offset ) ; IPAERR ( "expn_rules_offset:<S2SV_blank>0x%x\\n" , init -> expn_rules_offset ) ; IPAERR ( "index_offset:<S2SV_blank>0x%x\\n" , init -> index_offset ) ; IPAERR ( "index_expn_offset:<S2SV_blank>0x%x\\n" , init -> index_expn_offset ) ; result = - EPERM ; goto free_cmd ; } cmd -> ipv4_rules_addr = ipa_ctx -> nat_mem . dma_handle + init -> ipv4_rules_offset ; IPADBG ( "ipv4_rules_offset:0x%x\\n" , init -> ipv4_rules_offset ) ; cmd -> ipv4_expansion_rules_addr = ipa_ctx -> nat_mem . dma_handle + init -> expn_rules_offset ; IPADBG ( "expn_rules_offset:0x%x\\n" , init -> expn_rules_offset ) ; cmd -> index_table_addr = ipa_ctx -> nat_mem . dma_handle + init -> index_offset ; IPADBG ( "index_offset:0x%x\\n" , init -> index_offset ) ; cmd -> index_table_expansion_addr = ipa_ctx -> nat_mem . dma_handle + init -> index_expn_offset ; IPADBG ( "index_expn_offset:0x%x\\n" , init -> index_expn_offset ) ; } else { IPADBG ( "using<S2SV_blank>shared(local)<S2SV_blank>memory<S2SV_blank>for<S2SV_blank>nat<S2SV_blank>table\\n" ) ; cmd -> ipv4_rules_addr_type = IPA_NAT_SHARED_MEMORY ; cmd -> ipv4_expansion_rules_addr_type = IPA_NAT_SHARED_MEMORY ; cmd -> index_table_addr_type = IPA_NAT_SHARED_MEMORY ; cmd -> index_table_expansion_addr_type = IPA_NAT_SHARED_MEMORY ; cmd -> ipv4_rules_addr = init -> ipv4_rules_offset + IPA_RAM_NAT_OFST ; cmd -> ipv4_expansion_rules_addr = init -> expn_rules_offset + IPA_RAM_NAT_OFST ; cmd -> index_table_addr = init -> index_offset + IPA_RAM_NAT_OFST ; cmd -> index_table_expansion_addr = init -> index_expn_offset + IPA_RAM_NAT_OFST ; } cmd -> table_index = init -> tbl_index ; IPADBG ( "Table<S2SV_blank>index:0x%x\\n" , cmd -> table_index ) ; cmd -> size_base_tables = init -> table_entries ; IPADBG ( "Base<S2SV_blank>Table<S2SV_blank>size:0x%x\\n" , cmd -> size_base_tables ) ; cmd -> size_expansion_tables = init -> expn_table_entries ; IPADBG ( "Expansion<S2SV_blank>Table<S2SV_blank>size:0x%x\\n" , cmd -> size_expansion_tables ) ; cmd -> public_ip_addr = init -> ip_addr ; IPADBG ( "Public<S2SV_blank>ip<S2SV_blank>address:0x%x\\n" , cmd -> public_ip_addr ) ; desc . opcode = IPA_IP_V4_NAT_INIT ; desc . type = IPA_IMM_CMD_DESC ; desc . callback = NULL ; desc . user1 = NULL ; desc . user2 = 0 ; desc . pyld = ( void * ) cmd ; desc . len = size ; IPADBG ( "posting<S2SV_blank>v4<S2SV_blank>init<S2SV_blank>command\\n" ) ; if ( ipa_send_cmd ( 1 , & desc ) ) { IPAERR ( "Fail<S2SV_blank>to<S2SV_blank>send<S2SV_blank>immediate<S2SV_blank>command\\n" ) ; result = - EPERM ; goto free_cmd ; } ipa_ctx -> nat_mem . public_ip_addr = init -> ip_addr ; IPADBG ( "Table<S2SV_blank>ip<S2SV_blank>address:0x%x" , ipa_ctx -> nat_mem . public_ip_addr ) ; ipa_ctx -> nat_mem . ipv4_rules_addr = ( char * ) ipa_ctx -> nat_mem . nat_base_address + init -> ipv4_rules_offset ; IPADBG ( "ipv4_rules_addr:<S2SV_blank>0x%p\\n" , ipa_ctx -> nat_mem . ipv4_rules_addr ) ; ipa_ctx -> nat_mem . ipv4_expansion_rules_addr = ( char * ) ipa_ctx -> nat_mem . nat_base_address + init -> expn_rules_offset ; IPADBG ( "ipv4_expansion_rules_addr:<S2SV_blank>0x%p\\n" , ipa_ctx -> nat_mem . ipv4_expansion_rules_addr ) ; ipa_ctx -> nat_mem . index_table_addr = ( char * ) ipa_ctx -> nat_mem . nat_base_address + init -> index_offset ; IPADBG ( "index_table_addr:<S2SV_blank>0x%p\\n" , ipa_ctx -> nat_mem . index_table_addr ) ; ipa_ctx -> nat_mem . index_table_expansion_addr = ( char * ) ipa_ctx -> nat_mem . nat_base_address + init -> index_expn_offset ; IPADBG ( "index_table_expansion_addr:<S2SV_blank>0x%p\\n" , ipa_ctx -> nat_mem . index_table_expansion_addr ) ; IPADBG ( "size_base_tables:<S2SV_blank>%d\\n" , init -> table_entries ) ; ipa_ctx -> nat_mem . size_base_tables = init -> table_entries ; IPADBG ( "size_expansion_tables:<S2SV_blank>%d\\n" , init -> expn_table_entries ) ; ipa_ctx -> nat_mem . size_expansion_tables = init -> expn_table_entries ; IPADBG ( "return\\n" ) ; result = 0 ; free_cmd : kfree ( cmd ) ; bail : return result ; }
<S2SV_ModStart> ( init -> table_entries == 0 ) { IPADBG ( "Table<S2SV_blank>index<S2SV_blank>or<S2SV_blank>entries<S2SV_blank>is<S2SV_blank>zero\\n" ) ; result = - EPERM ; goto bail ; } if ( init -> ipv4_rules_offset >= ipa_ctx -> nat_mem . size || init -> index_offset >= ipa_ctx -> nat_mem . size || init -> expn_rules_offset >= ipa_ctx -> nat_mem . size || init -> index_expn_offset >= ipa_ctx -> nat_mem . size ) { IPAERR ( "Table<S2SV_blank>rules<S2SV_blank>offset<S2SV_blank>are<S2SV_blank>not<S2SV_blank>valid\\n" <S2SV_ModEnd> ) ; result
7,563
CWE-000 int __wrap_main ( int argc , char * * argv ) { MPI_Init ( & argc , & argv ) ; int rank ; int size ; MPI_Comm_size ( MPI_COMM_WORLD , & size ) ; MPI_Comm_rank ( MPI_COMM_WORLD , & rank ) ; int * send_buff ; int * recv_buff ; int lenperproc ; opts o ; parse_opts ( argc , argv , & o ) ; init_data ( & o , & send_buff , & lenperproc , & recv_buff ) ; int sendcount = lenperproc ; int recvcount = rank == o . root ? lenperproc * size : 0 ; char * sendbufstr , * recvbufstr ; make_int_array_str ( send_buff , sendcount , & sendbufstr , 20 ) ; make_int_array_str ( recv_buff , recvcount , & recvbufstr , 20 ) ; if ( rank == o . root ) { printf ( "Engaging<S2SV_blank>in<S2SV_blank>my_gather\\nroot:%d\\n" , o . root ) ; } printf ( "Rank<S2SV_blank>%d<S2SV_blank>calls<S2SV_blank>my_gather<S2SV_blank>with:\\nsend_buf:%s\\nsend_count:%d\\nrecv_buf:%s\\nrecv_count:%d\\nroot:%d\\n\\n" , rank , sendbufstr , sendcount , recvbufstr , recvcount , o . root ) ; <S2SV_StartBug> my_gather ( recv_buff , recvcount , send_buff , sendcount , o . root , MPI_COMM_WORLD ) ; <S2SV_EndBug> char * result_str ; if ( rank == o . root ) { make_int_array_str ( recv_buff , lenperproc * size , & result_str , 40 ) ; printf ( "Rank<S2SV_blank>%d<S2SV_blank>ends<S2SV_blank>up<S2SV_blank>with:\\nrecv_buff:<S2SV_blank>%s\\n\\n" , rank , result_str ) ; } char filename [ 1000 ] ; sprintf ( filename , "whatidid.rank.%d.txt" , rank ) ; FILE * fp = fopen ( filename , "w" ) ; fprintf ( fp , "total<S2SV_blank>sends:<S2SV_blank>%d\\n" , num_sends ) ; fprintf ( fp , "No.\\tTo\\tData\\n" ) ; for ( int i = 0 ; i < num_sends ; i ++ ) { make_int_array_str ( send_records [ i ] + 2 , send_records [ i ] [ 1 ] , & result_str , 40 ) ; fprintf ( fp , "%d\\t%d\\t%s\\n" , i , send_records [ i ] [ 0 ] , result_str ) ; } fprintf ( fp , "total<S2SV_blank>recvs:<S2SV_blank>%d\\n" , num_recvs ) ; for ( int i = 0 ; i < num_recvs ; i ++ ) { make_int_array_str ( recv_records [ i ] + 2 , recv_records [ i ] [ 1 ] , & result_str , lenperproc * size ) ; fprintf ( fp , "%d\\t%d\\t%s\\n" , i , recv_records [ i ] [ 0 ] , result_str ) ; } if ( rank == o . root ) { make_int_array_str ( recv_buff , lenperproc * size , & result_str , lenperproc * size ) ; fprintf ( fp , "Final<S2SV_blank>Data:<S2SV_blank>%s\\n" , result_str ) ; } fclose ( fp ) ; MPI_Finalize ( ) ; exit ( MPI_SUCCESS ) ; }
<S2SV_ModStart> ( recv_buff , lenperproc <S2SV_ModEnd> , send_buff ,
7,564
CWE-000 static void exit_udp_trace ( void ) { working = 0 ; <S2SV_StartBug> resetTcpSocket ( ) ; <S2SV_EndBug> sem_post ( & sema ) ; sem_destroy ( & sema ) ; }
<S2SV_ModStart> ; resetTcpSocket ( __FUNCTION__ , __LINE__
7,565
CWE-000 int main ( int argc , char * * argv ) { int cycles , frameskip ; sysconsole_open ( ) ; xemu_dump_version ( stdout , "The<S2SV_blank>Incomplete<S2SV_blank>Commodore-65/Mega-65<S2SV_blank>emulator<S2SV_blank>from<S2SV_blank>LGB" ) ; emucfg_define_str_option ( "8" , NULL , "Path<S2SV_blank>of<S2SV_blank>EXTERNAL<S2SV_blank>D81<S2SV_blank>disk<S2SV_blank>image<S2SV_blank>(not<S2SV_blank>on/the<S2SV_blank>SD-image)" ) ; emucfg_define_num_option ( "dmarev" , 0 , "Revision<S2SV_blank>of<S2SV_blank>the<S2SV_blank>DMAgic<S2SV_blank>chip<S2SV_blank><S2SV_blank>(0=F018A,<S2SV_blank>other=F018B)" ) ; emucfg_define_num_option ( "fastclock" , MEGA65_DEFAULT_FAST_CLOCK , "Clock<S2SV_blank>of<S2SV_blank>M65<S2SV_blank>fast<S2SV_blank>mode<S2SV_blank>(in<S2SV_blank>MHz)" ) ; emucfg_define_str_option ( "fpga" , NULL , "Comma<S2SV_blank>separated<S2SV_blank>list<S2SV_blank>of<S2SV_blank>FPGA-board<S2SV_blank>switches<S2SV_blank>turned<S2SV_blank>ON" ) ; emucfg_define_switch_option ( "fullscreen" , "Start<S2SV_blank>in<S2SV_blank>fullscreen<S2SV_blank>mode" ) ; emucfg_define_switch_option ( "hyperdebug" , "Crazy,<S2SV_blank>VERY<S2SV_blank>slow<S2SV_blank>and<S2SV_blank>\'spammy\'<S2SV_blank>hypervisor<S2SV_blank>debug<S2SV_blank>mode" ) ; emucfg_define_num_option ( "kicked" , 0x0 , "Answer<S2SV_blank>to<S2SV_blank>KickStart<S2SV_blank>upgrade<S2SV_blank>(128=ask<S2SV_blank>user<S2SV_blank>in<S2SV_blank>a<S2SV_blank>pop-up<S2SV_blank>window)" ) ; emucfg_define_str_option ( "kickup" , KICKSTART_NAME , "Override<S2SV_blank>path<S2SV_blank>of<S2SV_blank>external<S2SV_blank>KickStart<S2SV_blank>to<S2SV_blank>be<S2SV_blank>used" ) ; emucfg_define_str_option ( "kickuplist" , NULL , "Set<S2SV_blank>path<S2SV_blank>of<S2SV_blank>symbol<S2SV_blank>list<S2SV_blank>file<S2SV_blank>for<S2SV_blank>external<S2SV_blank>KickStart" ) ; emucfg_define_str_option ( "sdimg" , SDCARD_NAME , "Override<S2SV_blank>path<S2SV_blank>of<S2SV_blank>SD-image<S2SV_blank>to<S2SV_blank>be<S2SV_blank>used" ) ; # ifdef XEMU_SNAPSHOT_SUPPORT emucfg_define_str_option ( "snapload" , NULL , "Load<S2SV_blank>a<S2SV_blank>snapshot<S2SV_blank>from<S2SV_blank>the<S2SV_blank>given<S2SV_blank>file" ) ; emucfg_define_str_option ( "snapsave" , NULL , "Save<S2SV_blank>a<S2SV_blank>snapshot<S2SV_blank>into<S2SV_blank>the<S2SV_blank>given<S2SV_blank>file<S2SV_blank>before<S2SV_blank>Xemu<S2SV_blank>would<S2SV_blank>exit" ) ; # endif emucfg_define_switch_option ( "skipunhandledmem" , "Do<S2SV_blank>not<S2SV_blank>panic<S2SV_blank>on<S2SV_blank>unhandled<S2SV_blank>memory<S2SV_blank>access<S2SV_blank>(hides<S2SV_blank>problems!!)" ) ; if ( emucfg_parse_commandline ( argc , argv , NULL ) ) return 1 ; if ( xemu_byte_order_test ( ) ) FATAL ( "Byte<S2SV_blank>order<S2SV_blank>test<S2SV_blank>failed!!" ) ; window_title_info_addon = emulator_speed_title ; if ( emu_init_sdl ( TARGET_DESC APP_DESC_APPEND , APP_ORG , TARGET_NAME , 1 , SCREEN_WIDTH , SCREEN_HEIGHT , SCREEN_WIDTH , SCREEN_HEIGHT * 2 , SCREEN_WIDTH , SCREEN_HEIGHT * 2 , SCREEN_FORMAT , 0 , NULL , NULL , RENDER_SCALE_QUALITY , USE_LOCKED_TEXTURE , shutdown_callback ) ) return 1 ; osd_init_with_defaults ( ) ; mega65_init ( SID_CYCLES_PER_SEC , AUDIO_SAMPLE_FREQ ) ; skip_unhandled_mem = emucfg_get_bool ( "skipunhandledmem" ) ; printf ( "UNHANDLED<S2SV_blank>memory<S2SV_blank>policy:<S2SV_blank>%d" NL , skip_unhandled_mem ) ; cycles = 0 ; frameskip = 0 ; frame_counter = 0 ; vic3_blink_phase = 0 ; emu_timekeeping_start ( ) ; if ( audio ) SDL_PauseAudioDevice ( audio , 0 ) ; emu_set_full_screen ( emucfg_get_bool ( "fullscreen" ) ) ; for ( ; ; ) { while ( unlikely ( paused ) ) { if ( unlikely ( dma_status ) ) break ; if ( m65mon_callback ) { m65mon_callback ( ) ; m65mon_callback = NULL ; uartmon_finish_command ( ) ; } update_emulator ( ) ; if ( trace_step_trigger ) { trace_step_trigger = 0 ; break ; } window_title_custom_addon = paused ? ( char * ) emulator_paused_title : NULL ; if ( paused != paused_old ) { paused_old = paused ; if ( paused ) <S2SV_StartBug> fprintf ( stderr , "TRACE:<S2SV_blank>entering<S2SV_blank>into<S2SV_blank>trace<S2SV_blank>mode<S2SV_blank>@<S2SV_blank>$%04X" NL , cpu_pc ) ; <S2SV_EndBug> <S2SV_StartBug> else <S2SV_EndBug> <S2SV_StartBug> fprintf ( stderr , "TRACE:<S2SV_blank>leaving<S2SV_blank>trace<S2SV_blank>mode<S2SV_blank>@<S2SV_blank>$%04X" NL , cpu_pc ) ; <S2SV_EndBug> } } if ( unlikely ( in_hypervisor ) ) { hypervisor_debug ( ) ; } if ( unlikely ( breakpoint_pc == cpu_pc ) ) { <S2SV_StartBug> fprintf ( stderr , "Breakpoint<S2SV_blank>@<S2SV_blank>$%04X<S2SV_blank>hit,<S2SV_blank>Xemu<S2SV_blank>moves<S2SV_blank>to<S2SV_blank>trace<S2SV_blank>mode<S2SV_blank>after<S2SV_blank>the<S2SV_blank>execution<S2SV_blank>of<S2SV_blank>this<S2SV_blank>opcode." NL , cpu_pc ) ; <S2SV_EndBug> paused = 1 ; } cycles += unlikely ( dma_status ) ? dma_update_multi_steps ( cpu_cycles_per_scanline ) : cpu_step ( # ifdef CPU_STEP_MULTI_OPS <S2SV_StartBug> unlikely ( paused ) ? 0 : cpu_cycles_per_scanline <S2SV_EndBug> # endif ) ; if ( cycles >= cpu_cycles_per_scanline ) { scanline ++ ; cycles -= cpu_cycles_per_scanline ; cia_tick ( & cia1 , 64 ) ; cia_tick ( & cia2 , 64 ) ; if ( scanline == 312 ) { frameskip = ! frameskip ; scanline = 0 ; if ( ! frameskip ) update_emulator ( ) ; sid1 . sFrameCount ++ ; sid2 . sFrameCount ++ ; frame_counter ++ ; if ( frame_counter == 25 ) { frame_counter = 0 ; vic3_blink_phase = ! vic3_blink_phase ; } } vic3_check_raster_interrupt ( ) ; } } return 0 ; }
<S2SV_ModStart> ( paused ) { DEBUGPRINT ( <S2SV_ModEnd> "TRACE:<S2SV_blank>entering<S2SV_blank>into<S2SV_blank>trace<S2SV_blank>mode<S2SV_blank>@<S2SV_blank>$%04X" NL , <S2SV_ModStart> cpu_pc ) ; cpu_cycles_per_step = 0 ; } else { DEBUGPRINT ( <S2SV_ModEnd> "TRACE:<S2SV_blank>leaving<S2SV_blank>trace<S2SV_blank>mode<S2SV_blank>@<S2SV_blank>$%04X" NL , <S2SV_ModStart> cpu_pc ) ; if ( breakpoint_pc < 0 ) cpu_cycles_per_step = cpu_cycles_per_scanline ; else cpu_cycles_per_step = 0 ; } <S2SV_ModStart> ) ) { DEBUGPRINT ( "TRACE:<S2SV_blank>Breakpoint<S2SV_blank>@<S2SV_blank>$%04X<S2SV_blank>hit,<S2SV_blank>Xemu<S2SV_blank>moves<S2SV_blank>to<S2SV_blank>trace<S2SV_blank>mode<S2SV_blank>after<S2SV_blank>the<S2SV_blank>execution<S2SV_blank>of<S2SV_blank>this<S2SV_blank>opcode." <S2SV_ModEnd> NL , cpu_pc <S2SV_ModStart> # ifdef CPU_STEP_MULTI_OPS cpu_cycles_per_step <S2SV_ModEnd> # endif )
7,566
CWE-000 void getMove ( int move [ 2 ] , Player currentPlayer , bool result [ 8 ] [ 8 ] ) { printf ( "%s,<S2SV_blank>choose<S2SV_blank>your<S2SV_blank>move:<S2SV_blank>\\n" , currentPlayer . name ) ; int count = 0 ; for ( int i = 0 ; i < 8 ; i ++ ) { for ( int j = 0 ; j < 8 ; j ++ ) { if ( result [ i ] [ j ] == true ) { <S2SV_StartBug> printf ( "%d.<S2SV_blank>(%d,<S2SV_blank>%d)\\t" , ++ count , i + 1 , j + 1 ) ; <S2SV_EndBug> } } } printf ( "\\n><S2SV_blank>" ) ; int choice = - 1 ; while ( choice == - 1 ) { char input [ 20 ] ; while ( ! requestInput ( 20 , input ) ) { <S2SV_StartBug> printf ( "Invalid<S2SV_blank>input!\\n><S2SV_blank>" ) ; <S2SV_EndBug> } if ( input [ 1 ] == '\\0' ) { choice = input [ 0 ] - 48 ; <S2SV_StartBug> } else if ( input [ 2 ] = '\\0' ) { <S2SV_EndBug> choice = ( input [ 0 ] - 48 ) * 10 + input [ 1 ] - 48 ; } else { <S2SV_StartBug> printf ( "Invalid<S2SV_blank>input.\\n><S2SV_blank>" ) ; <S2SV_EndBug> continue ; } if ( ! ( choice > 0 && choice <= count ) ) { <S2SV_StartBug> printf ( "Invalid<S2SV_blank>input.\\n><S2SV_blank>" ) ; <S2SV_EndBug> choice = - 1 ; continue ; } } count = 0 ; for ( int i = 0 ; i < 8 ; i ++ ) { for ( int j = 0 ; j < 8 ; j ++ ) { if ( result [ i ] [ j ] == true ) { <S2SV_StartBug> if ( ++ count == choice ) { <S2SV_EndBug> move [ 0 ] = i ; move [ 1 ] = j ; return ; } } } } }
<S2SV_ModStart> true ) { count ++ ; <S2SV_ModStart> ( "%d.<S2SV_blank>(%d,<S2SV_blank>%d)\\t" , <S2SV_ModEnd> count , i <S2SV_ModStart> { printf ( "Invalid<S2SV_blank>input!1\\n><S2SV_blank>" <S2SV_ModEnd> ) ; } <S2SV_ModStart> [ 2 ] == <S2SV_ModEnd> '\\0' ) { <S2SV_ModStart> { printf ( "Invalid<S2SV_blank>input.2\\n><S2SV_blank>" <S2SV_ModEnd> ) ; continue <S2SV_ModStart> { printf ( "Invalid<S2SV_blank>input.3\\n><S2SV_blank>" <S2SV_ModEnd> ) ; choice <S2SV_ModStart> true ) { count ++ ; if ( <S2SV_ModEnd> count == choice
7,567
CWE-000 static void arc_read_done ( zio_t * zio ) { blkptr_t * bp = zio -> io_bp ; arc_buf_hdr_t * hdr = zio -> io_private ; kmutex_t * hash_lock = NULL ; arc_callback_t * callback_list ; arc_callback_t * acb ; boolean_t freeable = B_FALSE ; boolean_t no_zio_error = ( zio -> io_error == 0 ) ; if ( HDR_IN_HASH_TABLE ( hdr ) ) { ASSERT3U ( hdr -> b_birth , == , BP_PHYSICAL_BIRTH ( zio -> io_bp ) ) ; ASSERT3U ( hdr -> b_dva . dva_word [ 0 ] , == , BP_IDENTITY ( zio -> io_bp ) -> dva_word [ 0 ] ) ; ASSERT3U ( hdr -> b_dva . dva_word [ 1 ] , == , BP_IDENTITY ( zio -> io_bp ) -> dva_word [ 1 ] ) ; arc_buf_hdr_t * found = buf_hash_find ( hdr -> b_spa , zio -> io_bp , & hash_lock ) ; ASSERT ( ( found == hdr && DVA_EQUAL ( & hdr -> b_dva , BP_IDENTITY ( zio -> io_bp ) ) ) || ( found == hdr && HDR_L2_READING ( hdr ) ) ) ; ASSERT3P ( hash_lock , != , NULL ) ; } if ( BP_IS_PROTECTED ( bp ) ) { hdr -> b_crypt_hdr . b_ot = BP_GET_TYPE ( bp ) ; hdr -> b_crypt_hdr . b_dsobj = zio -> io_bookmark . zb_objset ; zio_crypt_decode_params_bp ( bp , hdr -> b_crypt_hdr . b_salt , hdr -> b_crypt_hdr . b_iv ) ; if ( BP_GET_TYPE ( bp ) == DMU_OT_INTENT_LOG ) { void * tmpbuf ; tmpbuf = abd_borrow_buf_copy ( zio -> io_abd , sizeof ( zil_chain_t ) ) ; zio_crypt_decode_mac_zil ( tmpbuf , hdr -> b_crypt_hdr . b_mac ) ; abd_return_buf ( zio -> io_abd , tmpbuf , sizeof ( zil_chain_t ) ) ; } else { zio_crypt_decode_mac_bp ( bp , hdr -> b_crypt_hdr . b_mac ) ; } } if ( no_zio_error ) { if ( BP_SHOULD_BYTESWAP ( zio -> io_bp ) ) { if ( BP_GET_LEVEL ( zio -> io_bp ) > 0 ) { hdr -> b_l1hdr . b_byteswap = DMU_BSWAP_UINT64 ; } else { hdr -> b_l1hdr . b_byteswap = DMU_OT_BYTESWAP ( BP_GET_TYPE ( zio -> io_bp ) ) ; } } else { hdr -> b_l1hdr . b_byteswap = DMU_BSWAP_NUMFUNCS ; } } arc_hdr_clear_flags ( hdr , ARC_FLAG_L2_EVICTED ) ; if ( l2arc_noprefetch && HDR_PREFETCH ( hdr ) ) arc_hdr_clear_flags ( hdr , ARC_FLAG_L2CACHE ) ; callback_list = hdr -> b_l1hdr . b_acb ; ASSERT3P ( callback_list , != , NULL ) ; if ( hash_lock && no_zio_error && hdr -> b_l1hdr . b_state == arc_anon ) { arc_access ( hdr , hash_lock ) ; } int callback_cnt = 0 ; for ( acb = callback_list ; acb != NULL ; acb = acb -> acb_next ) { if ( ! acb -> acb_done ) continue ; callback_cnt ++ ; <S2SV_StartBug> int error = arc_buf_alloc_impl ( hdr , zio -> io_spa , <S2SV_EndBug> acb -> acb_dsobj , acb -> acb_private , acb -> acb_encrypted , acb -> acb_compressed , acb -> acb_noauth , no_zio_error , <S2SV_StartBug> & acb -> acb_buf ) ; <S2SV_EndBug> ASSERT ( ( zio -> io_flags & ZIO_FLAG_SPECULATIVE ) || error != ENOENT ) ; if ( error == ECKSUM ) { ASSERT ( BP_IS_PROTECTED ( bp ) ) ; error = SET_ERROR ( EIO ) ; spa_log_error ( zio -> io_spa , & zio -> io_bookmark ) ; if ( ( zio -> io_flags & ZIO_FLAG_SPECULATIVE ) == 0 ) { zfs_ereport_post ( FM_EREPORT_ZFS_AUTHENTICATION , zio -> io_spa , NULL , & zio -> io_bookmark , zio , 0 , 0 ) ; } } if ( no_zio_error ) { zio -> io_error = error ; } } hdr -> b_l1hdr . b_acb = NULL ; arc_hdr_clear_flags ( hdr , ARC_FLAG_IO_IN_PROGRESS ) ; if ( callback_cnt == 0 ) ASSERT ( hdr -> b_l1hdr . b_pabd != NULL || HDR_HAS_RABD ( hdr ) ) ; ASSERT ( refcount_is_zero ( & hdr -> b_l1hdr . b_refcnt ) || callback_list != NULL ) ; if ( no_zio_error ) { arc_hdr_verify ( hdr , zio -> io_bp ) ; } else { arc_hdr_set_flags ( hdr , ARC_FLAG_IO_ERROR ) ; if ( hdr -> b_l1hdr . b_state != arc_anon ) arc_change_state ( arc_anon , hdr , hash_lock ) ; if ( HDR_IN_HASH_TABLE ( hdr ) ) buf_hash_remove ( hdr ) ; freeable = refcount_is_zero ( & hdr -> b_l1hdr . b_refcnt ) ; } cv_broadcast ( & hdr -> b_l1hdr . b_cv ) ; if ( hash_lock != NULL ) { mutex_exit ( hash_lock ) ; } else { ASSERT3P ( hdr -> b_l1hdr . b_state , == , arc_anon ) ; freeable = refcount_is_zero ( & hdr -> b_l1hdr . b_refcnt ) ; } while ( ( acb = callback_list ) != NULL ) { if ( acb -> acb_done ) { acb -> acb_done ( zio , zio -> io_error , acb -> acb_buf , acb -> acb_private ) ; } if ( acb -> acb_zio_dummy != NULL ) { acb -> acb_zio_dummy -> io_error = zio -> io_error ; zio_nowait ( acb -> acb_zio_dummy ) ; } callback_list = acb -> acb_next ; kmem_free ( acb , sizeof ( arc_callback_t ) ) ; } if ( freeable ) arc_hdr_destroy ( hdr ) ; }
<S2SV_ModStart> callback_cnt ++ ; if ( zio -> io_error != 0 ) continue ; <S2SV_ModStart> acb_buf ) ; if ( error != 0 ) { ( void ) remove_reference ( hdr , hash_lock , acb -> acb_private ) ; arc_buf_destroy_impl ( acb -> acb_buf ) ; acb -> acb_buf = NULL ; }
7,568
CWE-000 int aws_task_scheduler_schedule_future ( struct aws_task_scheduler * scheduler , struct aws_task * task , uint64_t time_to_run ) { <S2SV_StartBug> if ( aws_thread_current_thread_id ( ) != scheduler -> owning_thread ) { <S2SV_EndBug> return aws_raise_error ( AWS_ERROR_TASK_SCHEDULER_ILLEGAL_XTHREAD_ACCESS ) ; } struct task_container container ; container . task = * task ; container . timestamp = time_to_run ; if ( aws_priority_queue_push ( & scheduler -> queue , & container ) ) { return AWS_OP_ERR ; } return AWS_OP_SUCCESS ; }
<S2SV_ModStart> time_to_run ) { <S2SV_ModEnd> struct task_container container
7,569
CWE-000 long sgx_ioctl ( struct file * filep , unsigned int cmd , unsigned long arg ) { char data [ 256 ] ; sgx_ioc_t handler = NULL ; long ret ; switch ( cmd ) { <S2SV_StartBug> case SGX_IOC_ENCLAVE_CREATE : <S2SV_EndBug> handler = sgx_ioc_enclave_create ; break ; case SGX_IOC_ENCLAVE_ADD_PAGE : handler = sgx_ioc_enclave_add_page ; break ; case SGX_IOC_ENCLAVE_INIT : handler = sgx_ioc_enclave_init ; break ; case SGX_IOC_ENCLAVE_REMOVE_PAGES : handler = sgx_ioc_enclave_remove_pages ; break ; case SGX_IOC_ENCLAVE_MODIFY_PAGES : handler = sgx_ioc_enclave_modify_pages ; break ; default : return - ENOIOCTLCMD ; } if ( copy_from_user ( data , ( void __user * ) arg , _IOC_SIZE ( cmd ) ) ) return - EFAULT ; ret = handler ( filep , cmd , ( unsigned long ) ( ( void * ) data ) ) ; if ( ! ret && ( cmd & IOC_OUT ) ) { if ( copy_to_user ( ( void __user * ) arg , data , _IOC_SIZE ( cmd ) ) ) return - EFAULT ; } if ( IS_ENCLS_FAULT ( ret ) ) return - EFAULT ; return ret ; }
<S2SV_ModStart> ) { case SGX_IOC_ENCLU_REGISTER : handler = sgx_ioc_enclu_register ; break ; case
7,570
CWE-000 void setsysvar_str ( int index , const char * value ) { <S2SV_StartBug> int tid ; <S2SV_EndBug> int i ; <S2SV_StartBug> int l = strlen ( value ) + 1 ; <S2SV_EndBug> tid = ctask -> tid ; for ( i = 0 ; i < count_tasks ( ) ; i ++ ) { activate_task ( i ) ; if ( ctask -> has_sysvars ) { var_t * var_p = tvar [ index ] ; <S2SV_StartBug> if ( var_p -> type == V_STR ) { <S2SV_EndBug> free ( var_p -> v . p . ptr ) ; } var_p -> type = V_STR ; <S2SV_StartBug> var_p -> const_flag = 1 ; <S2SV_EndBug> var_p -> v . p . ptr = malloc ( l ) ; strcpy ( var_p -> v . p . ptr , value ) ; var_p -> v . p . length = l ; } } activate_task ( tid ) ; }
<S2SV_ModStart> ) { int <S2SV_ModEnd> i ; int <S2SV_ModStart> i ; int <S2SV_ModEnd> tid = ctask <S2SV_ModStart> index ] ; v_free ( var_p ) ; v_createstr ( var_p , value ) <S2SV_ModEnd> ; var_p -> <S2SV_ModStart> const_flag = 1 <S2SV_ModEnd> ; } }
7,571
CWE-000 void resetx86 ( ) { pclog ( "x86<S2SV_blank>reset\\n" ) ; resets ++ ; ins = 0 ; <S2SV_StartBug> use32 = 0 ; <S2SV_EndBug> cpu_cur_status = 0 ; stack32 = 0 ; cpu_state . pc = 0 ; msw = 0 ; if ( is486 ) cr0 = 1 << 30 ; else cr0 = 0 ; cpu_cache_int_enabled = 0 ; cpu_update_waitstates ( ) ; cr4 = 0 ; eflags = 0 ; cgate32 = 0 ; loadcs ( 0xFFFF ) ; rammask = AT ? 0xFFFFFFFF : 0xfffff ; idt . base = 0 ; flags = 2 ; makeznptable ( ) ; resetreadlookup ( ) ; makemod1table ( ) ; resetmcr ( ) ; FETCHCLEAR ( ) ; x87_reset ( ) ; cpu_set_edx ( ) ; EAX = 0 ; ESP = 0 ; mmu_perm = 4 ; memset ( inscounts , 0 , sizeof ( inscounts ) ) ; x86seg_reset ( ) ; codegen_reset ( ) ; x86_was_reset = 1 ; port_92_clear_reset ( ) ; }
<S2SV_ModStart> 0 ; use32 <S2SV_ModEnd> = 0 ;
7,572
CWE-000 XArchive * xa_init_archive_structure ( gint type ) { XEntry * entry = NULL ; XArchive * archive = NULL ; archive = g_new0 ( XArchive , 1 ) ; if ( archive == NULL ) return NULL ; entry = g_new0 ( XEntry , 1 ) ; entry -> filename = "" ; archive -> root_entry = entry ; archive -> ask = ask [ type ] ; <S2SV_StartBug> archive -> open = open [ type ] ; <S2SV_EndBug> archive -> delete = delete [ type ] ; archive -> add = add [ type ] ; archive -> extract = extract [ type ] ; archive -> test = test [ type ] ; archive -> type = type ; ( * archive -> ask ) ( archive ) ; return archive ; }
<S2SV_ModStart> ; archive -> list = list <S2SV_ModEnd> [ type ]
7,573
CWE-000 static ssize_t occ_write_common ( struct occ_client * client , const char __user * ubuf , const char * kbuf , size_t len ) { int rc ; unsigned int i ; u16 data_length , checksum = 0 ; struct occ_xfr * xfr = & client -> xfr ; if ( len > ( OCC_CMD_DATA_BYTES + 3 ) || len < 3 ) return - EINVAL ; spin_lock_irq ( & client -> lock ) ; if ( test_and_set_bit ( CLIENT_XFR_PENDING , & client -> flags ) ) { rc = - EBUSY ; goto done ; } memset ( xfr , 0 , sizeof ( * xfr ) ) ; xfr -> buf [ 0 ] = 1 ; if ( ubuf ) { if ( copy_from_user ( & xfr -> buf [ 1 ] , ubuf , len ) ) { kfree ( xfr ) ; rc = - EFAULT ; goto done ; } } else memcpy ( & xfr -> buf [ 1 ] , kbuf , len ) ; data_length = ( xfr -> buf [ 2 ] << 8 ) + xfr -> buf [ 3 ] ; if ( data_length > OCC_CMD_DATA_BYTES ) { kfree ( xfr ) ; rc = - EINVAL ; goto done ; } for ( i = 0 ; i < data_length + 4 ; ++ i ) checksum += xfr -> buf [ i ] ; xfr -> buf [ data_length + 4 ] = checksum >> 8 ; xfr -> buf [ data_length + 5 ] = checksum & 0xFF ; xfr -> cmd_data_length = data_length + 6 ; client -> read_offset = 0 ; occ_enqueue_xfr ( xfr ) ; rc = len ; done : <S2SV_StartBug> spin_unlock ( & client -> lock ) ; <S2SV_EndBug> return rc ; }
<S2SV_ModStart> ; done : spin_unlock_irq <S2SV_ModEnd> ( & client
7,574
CWE-000 static struct tlv_packet * core_negotiate_tlv_encryption ( struct tlv_handler_ctx * ctx ) { # ifndef __MINGW32__ size_t guid_len = 0 ; size_t pkey_len = 0 ; struct mettle * m = ctx -> arg ; struct tlv_dispatcher * td = mettle_get_tlv_dispatcher ( m ) ; char * guid = tlv_packet_get_raw ( ctx -> req , TLV_TYPE_SESSION_GUID , & guid_len ) ; unsigned char * pkey = tlv_packet_get_raw ( ctx -> req , TLV_TYPE_RSA_PUB_KEY , & pkey_len ) ; ; if ( pkey_len > 0 ) { struct tlv_encryption_ctx * enc_ctx = create_tlv_encryption_context ( ENC_AES256 ) ; if ( enc_ctx -> key != NULL ) { unsigned char buf [ MBEDTLS_MPI_MAX_SIZE ] = { '\\0' } ; int enc_len = 0 ; if ( ( enc_len = rsa_encrypt_pkcs ( pkey , pkey_len , enc_ctx , buf ) ) > 0 ) { struct tlv_packet * p = tlv_packet_response_result ( ctx , TLV_RESULT_SUCCESS ) ; <S2SV_StartBug> tlv_packet_add_u32 ( p , TLV_TYPE_SYM_KEY_TYPE , ENC_AES256 ) ; <S2SV_EndBug> <S2SV_StartBug> tlv_packet_add_raw ( p , TLV_TYPE_ENC_SYM_KEY , buf , enc_len ) ; <S2SV_EndBug> tlv_dispatcher_add_encryption ( td , enc_ctx ) ; return p ; } } } # endif return tlv_packet_response_result ( ctx , TLV_RESULT_FAILURE ) ; }
<S2SV_ModStart> TLV_RESULT_SUCCESS ) ; p = <S2SV_ModStart> ENC_AES256 ) ; p =
7,575
CWE-000 <S2SV_StartBug> int unset_invalid_bit ( union rfs_block * block ) { <S2SV_EndBug> <S2SV_StartBug> if ( is_set ( block -> inode . isvalid ) ) { <S2SV_EndBug> <S2SV_StartBug> block -> inode . isvalid = 0 ; <S2SV_EndBug> } return 1 ; }
<S2SV_ModStart> rfs_block * block , int index <S2SV_ModStart> block -> inode [ index ] <S2SV_ModStart> block -> inode [ index ]
7,576
CWE-000 PHP_METHOD ( Xfyun , __destruct ) { int ret = MSPLogout ( ) ; if ( MSP_SUCCESS != ret ) { throw_exception ( XFYUN_ERROR_LOGOUT , "MSPLogout<S2SV_blank>failed<S2SV_blank>[%d]" , ret ) ; <S2SV_StartBug> } <S2SV_EndBug> }
<S2SV_ModStart> ret ) ; RETURN_NULL ( ) ;
7,577
CWE-000 static inline void kill_all_lockers ( struct flock * mem_usage_check ) { int tries = 10 ; ZCSG ( force_restart_time ) = 0 ; while ( mem_usage_check -> l_pid > 0 ) { while ( tries -- ) { <S2SV_StartBug> zend_accel_error ( ACCEL_LOG_ERROR , "Killed<S2SV_blank>locker<S2SV_blank>%d" , mem_usage_check -> l_pid ) ; <S2SV_EndBug> if ( kill ( mem_usage_check -> l_pid , SIGKILL ) ) { break ; } usleep ( 20000 ) ; if ( kill ( mem_usage_check -> l_pid , 0 ) ) { break ; } usleep ( 10000 ) ; } if ( ! tries ) { <S2SV_StartBug> zend_accel_error ( ACCEL_LOG_ERROR , "Can\'t<S2SV_blank>kill<S2SV_blank>%d<S2SV_blank>after<S2SV_blank>20<S2SV_blank>tries!" , mem_usage_check -> l_pid ) ; <S2SV_EndBug> ZCSG ( force_restart_time ) = time ( NULL ) ; } mem_usage_check -> l_type = F_WRLCK ; mem_usage_check -> l_whence = SEEK_SET ; mem_usage_check -> l_start = 1 ; mem_usage_check -> l_len = 1 ; mem_usage_check -> l_pid = - 1 ; if ( fcntl ( lock_file , F_GETLK , mem_usage_check ) == - 1 ) { zend_accel_error ( ACCEL_LOG_DEBUG , "KLockers:<S2SV_blank><S2SV_blank>%s<S2SV_blank>(%d)" , strerror ( errno ) , errno ) ; break ; } if ( mem_usage_check -> l_type == F_UNLCK || mem_usage_check -> l_pid <= 0 ) { break ; } } }
<S2SV_ModStart> { zend_accel_error ( ACCEL_LOG_WARNING <S2SV_ModEnd> , "Killed<S2SV_blank>locker<S2SV_blank>%d" , <S2SV_ModStart> { zend_accel_error ( ACCEL_LOG_WARNING , "Can\'t<S2SV_blank>kill<S2SV_blank>%d<S2SV_blank>after<S2SV_blank>10<S2SV_blank>tries!" <S2SV_ModEnd> , mem_usage_check ->
7,578
CWE-000 static struct sk_buff * ipv6_gso_segment ( struct sk_buff * skb , netdev_features_t features ) { struct sk_buff * segs = ERR_PTR ( - EINVAL ) ; struct ipv6hdr * ipv6h ; const struct net_offload * ops ; int proto ; struct frag_hdr * fptr ; u8 * prevhdr ; int offset = 0 ; bool encap , udpfrag ; int nhoff ; if ( unlikely ( skb_shinfo ( skb ) -> gso_type & ~ ( SKB_GSO_TCPV4 | SKB_GSO_UDP | SKB_GSO_DODGY | SKB_GSO_TCP_ECN | SKB_GSO_GRE | SKB_GSO_GRE_CSUM | SKB_GSO_IPIP | SKB_GSO_SIT | SKB_GSO_UDP_TUNNEL | SKB_GSO_UDP_TUNNEL_CSUM | SKB_GSO_TUNNEL_REMCSUM | SKB_GSO_TCPV6 | 0 ) ) ) goto out ; skb_reset_network_header ( skb ) ; nhoff = skb_network_header ( skb ) - skb_mac_header ( skb ) ; if ( unlikely ( ! pskb_may_pull ( skb , sizeof ( * ipv6h ) ) ) ) goto out ; encap = SKB_GSO_CB ( skb ) -> encap_level > 0 ; if ( encap ) features &= skb -> dev -> hw_enc_features ; SKB_GSO_CB ( skb ) -> encap_level += sizeof ( * ipv6h ) ; ipv6h = ipv6_hdr ( skb ) ; __skb_pull ( skb , sizeof ( * ipv6h ) ) ; segs = ERR_PTR ( - EPROTONOSUPPORT ) ; proto = ipv6_gso_pull_exthdrs ( skb , ipv6h -> nexthdr ) ; if ( skb -> encapsulation && skb_shinfo ( skb ) -> gso_type & ( SKB_GSO_SIT | SKB_GSO_IPIP ) ) udpfrag = proto == IPPROTO_UDP && encap ; else udpfrag = proto == IPPROTO_UDP && ! skb -> encapsulation ; ops = rcu_dereference ( inet6_offloads [ proto ] ) ; if ( likely ( ops && ops -> callbacks . gso_segment ) ) { skb_reset_transport_header ( skb ) ; segs = ops -> callbacks . gso_segment ( skb , features ) ; } if ( IS_ERR ( segs ) ) goto out ; for ( skb = segs ; skb ; skb = skb -> next ) { ipv6h = ( struct ipv6hdr * ) ( skb_mac_header ( skb ) + nhoff ) ; ipv6h -> payload_len = htons ( skb -> len - nhoff - sizeof ( * ipv6h ) ) ; skb -> network_header = ( u8 * ) ipv6h - skb -> head ; if ( udpfrag ) { <S2SV_StartBug> unfrag_ip6hlen = ip6_find_1stfragopt ( skb , & prevhdr ) ; <S2SV_EndBug> <S2SV_StartBug> if ( unfrag_ip6hlen < 0 ) <S2SV_EndBug> <S2SV_StartBug> return ERR_PTR ( unfrag_ip6hlen ) ; <S2SV_EndBug> <S2SV_StartBug> fptr = ( struct frag_hdr * ) ( ( u8 * ) ipv6h + unfrag_ip6hlen ) ; <S2SV_EndBug> fptr -> frag_off = htons ( offset ) ; if ( skb -> next ) fptr -> frag_off |= htons ( IP6_MF ) ; offset += ( ntohs ( ipv6h -> payload_len ) - sizeof ( struct frag_hdr ) ) ; } if ( encap ) skb_reset_inner_headers ( skb ) ; } out : return segs ; }
<S2SV_ModStart> udpfrag ) { int err <S2SV_ModEnd> = ip6_find_1stfragopt ( <S2SV_ModStart> ; if ( err <S2SV_ModEnd> < 0 ) <S2SV_ModStart> return ERR_PTR ( err <S2SV_ModEnd> ) ; fptr <S2SV_ModStart> ) ipv6h + err <S2SV_ModEnd> ) ; fptr
7,579
CWE-000 INLINE int _ReduceCharDataMatch ( XML_Char c ) { int i = ( int ) c ; if ( i >= 0 && i < 256 ) return _ReduceCharDataMatchChars [ i ] ; <S2SV_StartBug> } <S2SV_EndBug>
<S2SV_ModStart> i ] ; return 0 ;
7,580
CWE-000 <S2SV_StartBug> int sortAddressList ( eCategory_t category ) { <S2SV_EndBug> if ( pAddressList != NULL ) { if ( pAddressList -> next != NULL ) { <S2SV_StartBug> int x ; <S2SV_EndBug> <S2SV_StartBug> int strcmpResult ; <S2SV_EndBug> int requestedLoop = TRUE ; struct tAddress * currItem ; struct tAddress * nextItem ; while ( requestedLoop ) { requestedLoop = FALSE ; currItem = pAddressList ; nextItem = currItem -> next ; x = 0 ; while ( nextItem != NULL ) { switch ( category ) { case FIRSTNAME : strcmpResult = strcmp ( currItem -> firstName , nextItem -> firstName ) ; break ; case NAME : strcmpResult = strcmp ( currItem -> name , nextItem -> name ) ; break ; case STREET : strcmpResult = strcmp ( currItem -> street , nextItem -> street ) ; break ; case CITY : strcmpResult = strcmp ( currItem -> city , nextItem -> city ) ; break ; default : break ; } ; if ( strcmpResult > 0 ) { swapItems ( currItem , nextItem ) ; if ( x == 0 ) { pAddressList = nextItem ; } requestedLoop = TRUE ; } else { currItem = currItem -> next ; } nextItem = currItem -> next ; x ++ ; } } <S2SV_StartBug> } <S2SV_EndBug> } return 1 ; }
<S2SV_ModStart> <S2SV_null> <S2SV_null> <S2SV_null> eReturnCode_t <S2SV_ModEnd> sortAddressList ( eCategory_t <S2SV_ModStart> { int x = 0 <S2SV_ModStart> ; int strcmpResult = NULL <S2SV_ModStart> ; } } if ( 0 < x ) { return RET_SUCCESS ; } } } return RET_NOTHING_TO_SORT <S2SV_ModEnd> ; } <S2SV_null>
7,581
CWE-000 void init_rt_rq ( struct rt_rq * rt_rq ) { struct rt_prio_array * array ; int i ; array = & rt_rq -> active ; for ( i = 0 ; i < MAX_RT_PRIO ; i ++ ) { INIT_LIST_HEAD ( array -> queue + i ) ; __clear_bit ( i , array -> bitmap ) ; } __set_bit ( MAX_RT_PRIO , array -> bitmap ) ; # if defined CONFIG_SMP rt_rq -> highest_prio . curr = MAX_RT_PRIO ; rt_rq -> highest_prio . next = MAX_RT_PRIO ; rt_rq -> rt_nr_migratory = 0 ; rt_rq -> overloaded = 0 ; plist_head_init ( & rt_rq -> pushable_tasks ) ; <S2SV_StartBug> # ifdef HAVE_RT_PUSH_IPI <S2SV_EndBug> rt_rq -> push_flags = 0 ; rt_rq -> push_cpu = nr_cpu_ids ; raw_spin_lock_init ( & rt_rq -> push_lock ) ; init_irq_work ( & rt_rq -> push_work , push_irq_work_func ) ; # endif # endif rt_rq -> rt_queued = 0 ; rt_rq -> rt_time = 0 ; rt_rq -> rt_throttled = 0 ; rt_rq -> rt_runtime = 0 ; raw_spin_lock_init ( & rt_rq -> rt_runtime_lock ) ; }
<S2SV_ModStart> ) ; # <S2SV_ModEnd> endif rt_rq ->
7,582
CWE-000 void MCU_Temperature_Detector ( void ) { static float act_temp = 0.f ; <S2SV_StartBug> globalMCU_Temperature = InnerTempCalcus ( ADC_Temp_Channel , 1 ) ; <S2SV_EndBug> globalMCU_Temperature = Kalman_1DerivFilter ( globalMCU_Temperature , & itd_kf ) ; if ( act_temp != globalMCU_Temperature ) <S2SV_StartBug> { <S2SV_EndBug> <S2SV_StartBug> act_temp = globalMCU_Temperature ; <S2SV_EndBug> if ( act_temp >= Warning_Temperature && pwsf != JBoot ) TEMPERATUREEXCESS ; } }
<S2SV_ModStart> ; globalMCU_Temperature = Kalman_1DerivFilter ( <S2SV_ModStart> , 1 ) <S2SV_ModEnd> , & itd_kf <S2SV_ModStart> != globalMCU_Temperature ) <S2SV_ModEnd> act_temp = globalMCU_Temperature <S2SV_ModStart> act_temp = globalMCU_Temperature ; if ( act_temp >= Warning_Temperature && pwsf != JBoot ) { delay_ms ( 200 )
7,583
CWE-000 obs_weak_encoder_t * obs_encoder_get_weak_encoder ( obs_encoder_t * encoder ) { <S2SV_StartBug> if ( ! encoder ) <S2SV_EndBug> <S2SV_StartBug> return NULL ; <S2SV_EndBug> obs_weak_encoder_t * weak = encoder -> control ; obs_weak_encoder_addref ( weak ) ; return weak ; }
<S2SV_ModStart> encoder ) { obs_weak_encoder_t * weak = encoder -> control ; <S2SV_ModStart> ) return NULL <S2SV_ModEnd> ; obs_weak_encoder_addref (
7,584
CWE-000 bool object_is_shell ( object * o ) { <S2SV_StartBug> return ! object_properties_size ( o , ":" ) && ! o -> evaluator ; <S2SV_EndBug> }
<S2SV_ModStart> { return ! o -> properties <S2SV_ModEnd> && ! o
7,585
CWE-000 ssize_t my_write ( struct file * file , const char __user * user_buffer , size_t count , loff_t * ppos ) { <S2SV_StartBug> if ( count > 0 ) <S2SV_EndBug> <S2SV_StartBug> return count ; <S2SV_EndBug> int i = 0 ; while ( 1 ) { msleep ( 500 ) ; if ( my_proc_fp > PROCSIZE - 100 ) break ; if ( myioque . que_count == QUESIZE ) { i = myioque . curr_index ; while ( -- myioque . que_count != 0 ) { if ( i == QUESIZE ) i = 0 ; my_proc_fp += sprintf ( & my_proc_buf [ my_proc_fp ] , "%s" , myioque . que [ i ] . name ) ; my_proc_buf [ my_proc_fp ++ ] = ASCISPACE ; my_proc_fp += sprintf ( & my_proc_buf [ my_proc_fp ] , "%lu" , myioque . que [ i ] . sector_num ) ; my_proc_buf [ my_proc_fp ++ ] = ASCISPACE ; my_proc_fp += sprintf ( & my_proc_buf [ my_proc_fp ] , "%ld" , myioque . que [ i ] . time . tv_sec ) ; my_proc_buf [ my_proc_fp ++ ] = ASCIENTER ; i ++ ; } memset ( & myioque , 0 , sizeof ( struct myio_cir_que ) ) ; } } printk ( "my<S2SV_blank>write<S2SV_blank>function<S2SV_blank>end\\n" ) ; return count ; }
<S2SV_ModStart> ppos ) { int i = 0 ; <S2SV_ModStart> ) return count <S2SV_ModEnd> ; while (
7,586
CWE-000 static int eth_0_init ( struct device * dev ) { struct eth_context * context = dev -> driver_data ; enet_config_t enet_config ; uint32_t sys_clock ; enet_buffer_config_t buffer_config = { . rxBdNumber = CONFIG_ETH_MCUX_RX_BUFFERS , . txBdNumber = CONFIG_ETH_MCUX_TX_BUFFERS , . rxBuffSizeAlign = ETH_MCUX_BUFFER_SIZE , . txBuffSizeAlign = ETH_MCUX_BUFFER_SIZE , . rxBdStartAddrAlign = rx_buffer_desc , . txBdStartAddrAlign = tx_buffer_desc , . rxBufferAlign = rx_buffer [ 0 ] , . txBufferAlign = tx_buffer [ 0 ] , } ; k_sem_init ( & context -> tx_buf_sem , CONFIG_ETH_MCUX_TX_BUFFERS , CONFIG_ETH_MCUX_TX_BUFFERS ) ; k_work_init ( & context -> phy_work , eth_mcux_phy_work ) ; k_delayed_work_init ( & context -> delayed_phy_work , eth_mcux_delayed_phy_work ) ; sys_clock = CLOCK_GetFreq ( kCLOCK_CoreSysClk ) ; ENET_GetDefaultConfig ( & enet_config ) ; enet_config . interrupt |= kENET_RxFrameInterrupt ; enet_config . interrupt |= kENET_TxFrameInterrupt ; enet_config . interrupt |= kENET_MiiInterrupt ; <S2SV_StartBug> # if defined ( CONFIG_ETH_MCUX_0_RANDOM_MAC ) <S2SV_EndBug> generate_mac ( context -> mac_addr ) ; # endif ENET_Init ( ENET , & context -> enet_handle , & enet_config , & buffer_config , context -> mac_addr , sys_clock ) ; ENET_SetSMI ( ENET , sys_clock , false ) ; SYS_LOG_DBG ( "MAC<S2SV_blank>%02x:%02x:%02x:%02x:%02x:%02x" , context -> mac_addr [ 0 ] , context -> mac_addr [ 1 ] , context -> mac_addr [ 2 ] , context -> mac_addr [ 3 ] , context -> mac_addr [ 4 ] , context -> mac_addr [ 5 ] ) ; ENET_SetCallback ( & context -> enet_handle , eth_callback , dev ) ; eth_0_config_func ( ) ; ENET_ActiveRead ( ENET ) ; k_work_submit ( & context -> phy_work ) ; return 0 ; }
<S2SV_ModStart> |= kENET_MiiInterrupt ; enet_config . macSpecialConfig |= kENET_ControlPromiscuousEnable ;
7,587
CWE-000 static void gimp_airbrush_paint ( GimpPaintCore * paint_core , GimpDrawable * drawable , GimpPaintOptions * paint_options , GimpSymmetry * sym , GimpPaintState paint_state , guint32 time ) { GimpAirbrush * airbrush = GIMP_AIRBRUSH ( paint_core ) ; GimpAirbrushOptions * options = GIMP_AIRBRUSH_OPTIONS ( paint_options ) ; GimpDynamics * dynamics = GIMP_BRUSH_CORE ( paint_core ) -> dynamics ; if ( airbrush -> timeout_id ) { g_source_remove ( airbrush -> timeout_id ) ; airbrush -> timeout_id = 0 ; } switch ( paint_state ) { case GIMP_PAINT_STATE_INIT : GIMP_PAINT_CORE_CLASS ( parent_class ) -> paint ( paint_core , drawable , paint_options , sym , paint_state , time ) ; break ; case GIMP_PAINT_STATE_MOTION : gimp_airbrush_motion ( paint_core , drawable , paint_options , sym ) ; if ( ( options -> rate != 0.0 ) && ! options -> motion_only ) { GimpImage * image = gimp_item_get_image ( GIMP_ITEM ( drawable ) ) ; gdouble fade_point ; gdouble dynamic_rate ; gint timeout ; GimpCoords * coords ; fade_point = gimp_paint_options_get_fade ( paint_options , image , paint_core -> pixel_dist ) ; <S2SV_StartBug> coords = gimp_symmetry_get_origin ( sym ) ; <S2SV_EndBug> dynamic_rate = gimp_dynamics_get_linear_value ( dynamics , GIMP_DYNAMICS_OUTPUT_RATE , coords , paint_options , fade_point ) ; timeout = 10000 / ( options -> rate * dynamic_rate ) ; airbrush -> timeout_id = g_timeout_add ( timeout , gimp_airbrush_timeout , airbrush ) ; } break ; case GIMP_PAINT_STATE_FINISH : GIMP_PAINT_CORE_CLASS ( parent_class ) -> paint ( paint_core , drawable , paint_options , sym , paint_state , time ) ; <S2SV_StartBug> break ; <S2SV_EndBug> } }
<S2SV_ModStart> pixel_dist ) ; airbrush -> drawable = drawable ; airbrush -> paint_options = paint_options ; if ( airbrush -> sym ) g_object_unref ( airbrush -> sym ) ; airbrush -> sym = g_object_ref ( sym ) ; <S2SV_ModStart> time ) ; g_clear_object ( & airbrush -> sym ) ;
7,588
CWE-000 _db6_local_function ( db6result , _rawgen_nextvec , ( Db6Executor * self , Db6ExecVector * vector ) ) { db6result result = DB6_SUCCESS ; RawGen * gen = RAWGEN ( self ) ; db6ssize k , * vals ; DB6_ASSERT ( self != DB6_NULL ) ; if ( gen -> delivered_recs >= gen -> max_recs ) { return DB6_EXHAUSTED ; } if ( pthread_spin_lock ( & gen -> lock ) ) { DB6_ASSERT ( DB6_FALSE ) ; goto func_end ; } vector -> n_recs = vector -> n_bytes / ELEM_BYTES ; vals = ( db6ssize * ) vector -> data ; for ( k = 0 ; k < vector -> n_recs ; ++ k ) { vals [ k * ELEM_WORDS ] = ELEM_BYTES ; vals [ k * ELEM_WORDS + 1 ] = gen -> currpart ; vals [ k * ELEM_WORDS + 2 ] = gen -> currkey + ( gen -> currpart * gen -> partsize ) ; if ( ( gen -> delivered_recs += 1L ) == gen -> max_recs ) { <S2SV_StartBug> break ; <S2SV_EndBug> } if ( ( gen -> currkey += 1 ) == gen -> partsize ) { gen -> currpart += 1 ; gen -> currkey = 0 ; } } unlock : if ( pthread_spin_unlock ( & gen -> lock ) ) { DB6_ASSERT ( DB6_FALSE ) ; } func_end : return result ; }
<S2SV_ModStart> max_recs ) { vector -> n_recs = k + 1L ;
7,589
CWE-000 static ofdpa_sai_vlan_member_t * get_ofdpa_sai_vlan_member_by_vlan_member_id ( sai_object_id_t oid ) { int i ; ofdpa_sai_vlan_member_t * vlan = NULL ; for ( i = 0 ; i < port_num ; i ++ ) { vlan = ports [ i ] . vlans ; while ( vlan != NULL ) { if ( vlan -> oid == oid ) { return vlan ; } <S2SV_StartBug> } <S2SV_EndBug> } return NULL ; }
<S2SV_ModStart> vlan ; } vlan = vlan -> next ;
7,590
CWE-000 EXPR * makeEXPRvariable ( char * var_name ) { EXPR * e = malloc ( sizeof ( EXPR ) ) ; <S2SV_StartBug> e -> expression_type = get_type ( var_name ) ; <S2SV_EndBug> <S2SV_StartBug> if ( e -> expression_type == error_type ) { <S2SV_EndBug> printf ( "ERROR:<S2SV_blank>%s<S2SV_blank>has<S2SV_blank>not<S2SV_blank>been<S2SV_blank>declared\\n" , var_name ) ; exit ( EXIT_FAILURE ) ; return NULL ; } <S2SV_StartBug> e -> type = variable_type ; <S2SV_EndBug> e -> val . id = var_name ; return e ; }
<S2SV_ModStart> -> expression_type = variable_type ; e -> type = <S2SV_ModStart> ( e -> type <S2SV_ModEnd> == error_type ) <S2SV_ModStart> } e -> <S2SV_ModEnd> val . id
7,591
CWE-000 static int gs_usb_probe ( struct usb_interface * intf , const struct usb_device_id * id ) { struct gs_usb * dev ; int rc = - ENOMEM ; unsigned int icount , i ; struct gs_host_config * hconf ; struct gs_device_config * dconf ; hconf = kmalloc ( sizeof ( * hconf ) , GFP_KERNEL ) ; if ( ! hconf ) return - ENOMEM ; hconf -> byte_order = 0x0000beef ; rc = usb_control_msg ( interface_to_usbdev ( intf ) , usb_sndctrlpipe ( interface_to_usbdev ( intf ) , 0 ) , GS_USB_BREQ_HOST_FORMAT , USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE , 1 , intf -> altsetting [ 0 ] . desc . bInterfaceNumber , hconf , sizeof ( * hconf ) , 1000 ) ; kfree ( hconf ) ; if ( rc < 0 ) { dev_err ( & intf -> dev , "Couldn\'t<S2SV_blank>send<S2SV_blank>data<S2SV_blank>format<S2SV_blank>(err=%d)\\n" , rc ) ; return rc ; } dconf = kmalloc ( sizeof ( * dconf ) , GFP_KERNEL ) ; if ( ! dconf ) return - ENOMEM ; rc = usb_control_msg ( interface_to_usbdev ( intf ) , usb_rcvctrlpipe ( interface_to_usbdev ( intf ) , 0 ) , GS_USB_BREQ_DEVICE_CONFIG , USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE , 1 , intf -> altsetting [ 0 ] . desc . bInterfaceNumber , dconf , sizeof ( * dconf ) , 1000 ) ; if ( rc < 0 ) { dev_err ( & intf -> dev , "Couldn\'t<S2SV_blank>get<S2SV_blank>device<S2SV_blank>config:<S2SV_blank>(err=%d)\\n" , rc ) ; kfree ( dconf ) ; return rc ; } icount = dconf -> icount + 1 ; kfree ( dconf ) ; dev_info ( & intf -> dev , "Configuring<S2SV_blank>for<S2SV_blank>%d<S2SV_blank>interfaces\\n" , icount ) ; if ( icount > GS_MAX_INTF ) { dev_err ( & intf -> dev , "Driver<S2SV_blank>cannot<S2SV_blank>handle<S2SV_blank>more<S2SV_blank>that<S2SV_blank>%d<S2SV_blank>CAN<S2SV_blank>interfaces\\n" , GS_MAX_INTF ) ; return - EINVAL ; } dev = kzalloc ( sizeof ( * dev ) , GFP_KERNEL ) ; init_usb_anchor ( & dev -> rx_submitted ) ; atomic_set ( & dev -> active_channels , 0 ) ; usb_set_intfdata ( intf , dev ) ; dev -> udev = interface_to_usbdev ( intf ) ; for ( i = 0 ; i < icount ; i ++ ) { dev -> canch [ i ] = gs_make_candev ( i , intf ) ; if ( IS_ERR_OR_NULL ( dev -> canch [ i ] ) ) { <S2SV_StartBug> icount = i ; <S2SV_EndBug> <S2SV_StartBug> for ( i = 0 ; i < icount ; i ++ ) { <S2SV_EndBug> gs_destroy_candev ( dev -> canch [ i ] ) ; <S2SV_StartBug> dev -> canch [ i ] = NULL ; <S2SV_EndBug> } kfree ( dev ) ; return rc ; } dev -> canch [ i ] -> parent = dev ; } return 0 ; }
<S2SV_ModStart> ) ) { rc = PTR_ERR ( dev -> canch [ i ] ) ; <S2SV_ModStart> i ++ ) <S2SV_ModEnd> gs_destroy_candev ( dev <S2SV_ModStart> ] ) ; usb_kill_anchored_urbs ( & dev -> rx_submitted ) ; <S2SV_ModEnd> kfree ( dev
7,592
CWE-000 int insert ( State * st , Buffer * buf , Arg * arg , char * error ) { Line * new ; <S2SV_StartBug> if ( arg -> addr && gotol ( st , buf , arg , error ) ) <S2SV_EndBug> return 1 ; arg -> addr = 0 ; if ( arg -> mode ) { if ( ! strcmp ( arg -> mode , "insert" ) ) { ; } else if ( ! strcmp ( arg -> mode , "append" ) ) { if ( ! buf -> curline -> next ) { new = makeline ( ) ; linklines ( buf -> curline , new ) ; } ++ buf -> lineno ; buf -> curline = buf -> curline -> next ; } else if ( ! strcmp ( arg -> mode , "change" ) ) { <S2SV_StartBug> if ( ! delete ( st , buf , arg , error ) ) <S2SV_EndBug> return 1 ; } else { strcpy ( error , "unknown<S2SV_blank>option" ) ; <S2SV_StartBug> return 1 ; <S2SV_EndBug> } } setmode ( st , buf , "insert" ) ; <S2SV_StartBug> return 0 ; <S2SV_EndBug> }
<S2SV_ModStart> -> addr && ( <S2SV_ModStart> , error ) == FAIL ) ) return FAIL <S2SV_ModEnd> ; arg -> <S2SV_ModStart> { if ( <S2SV_ModEnd> delete ( st <S2SV_ModStart> , error ) == FAIL ) return FAIL <S2SV_ModEnd> ; } else <S2SV_ModStart> ) ; return SUCC <S2SV_ModEnd> ; } } <S2SV_ModStart> ) ; return SUCC <S2SV_ModEnd> ; } <S2SV_null>
7,593
CWE-000 void pios_gpio_pinmode ( uint32_t pin , uint32_t val ) { if ( val > 7 ) return ; if ( pin > 53 ) return ; volatile uint32_t * base = & pios_gpio -> fn_select [ 0 ] ; while ( pin >= 10 ) { base ++ ; pin -= 10 ; } uint32_t v = * base ; <S2SV_StartBug> v &= ( 7 << ( ( pin << 1 ) + pin ) ) ; <S2SV_EndBug> v |= ( val << ( ( pin << 1 ) + pin ) ) ; * base = v ; }
<S2SV_ModStart> ; v &= ~
7,594
CWE-000 int main ( int argc , char * argv [ ] ) { int error = EXIT_SUCCESS ; char * str = NULL ; char * reader = NULL ; LONG err ; MifareTag * tags = NULL ; if ( argc > 1 ) errx ( EXIT_FAILURE , "usage:<S2SV_blank>%s" , argv [ 0 ] ) ; struct pcsc_context * context ; pcsc_init ( & context ) ; if ( ! context ) { fprintf ( stderr , "unable<S2SV_blank>to<S2SV_blank>init<S2SV_blank>pcsc<S2SV_blank>context\\n" ) ; exit ( EXIT_FAILURE ) ; } err = pcsc_list_devices ( context , & str ) ; if ( err != SCARD_S_SUCCESS ) { fprintf ( stderr , "no<S2SV_blank>readers<S2SV_blank>found\\n" ) ; exit ( EXIT_FAILURE ) ; } size_t device_count = 0 ; reader = str ; while ( * reader != '\\0' ) { printf ( "Reader<S2SV_blank>%s<S2SV_blank>found\\n" , reader ) ; device_count ++ ; reader += strlen ( reader ) + 1 ; } reader = str ; while ( * reader != '\\0' ) { tags = freefare_get_tags_pcsc ( context , reader ) ; if ( ! tags ) { pcsc_exit ( context ) ; errx ( EXIT_FAILURE , "Error<S2SV_blank>listing<S2SV_blank>tags." ) ; } for ( int i = 0 ; ( ! error ) && tags [ i ] ; i ++ ) { <S2SV_StartBug> if ( DESFIRE != freefare_get_tag_type ( tags [ i ] ) ) <S2SV_EndBug> continue ; int res ; char * tag_uid = freefare_get_tag_uid ( tags [ i ] ) ; res = mifare_desfire_connect ( tags [ i ] ) ; if ( res < 0 ) { warnx ( "Can\'t<S2SV_blank>connect<S2SV_blank>to<S2SV_blank>Mifare<S2SV_blank>DESFire<S2SV_blank>target." ) ; error = EXIT_FAILURE ; break ; } MifareDESFireKey key = mifare_desfire_des_key_new_with_version ( key_data_null ) ; res = mifare_desfire_authenticate ( tags [ i ] , 0 , key ) ; if ( res < 0 ) errx ( EXIT_FAILURE , "Authentication<S2SV_blank>on<S2SV_blank>master<S2SV_blank>application<S2SV_blank>failed" ) ; MadAid mad_aid = { 0x12 , 0x34 } ; MifareDESFireAID aid = mifare_desfire_aid_new_with_mad_aid ( mad_aid , 0x5 ) ; res = mifare_desfire_create_application ( tags [ i ] , aid , 0xFF , 0x1 ) ; if ( res < 0 ) errx ( EXIT_FAILURE , "Application<S2SV_blank>creation<S2SV_blank>failed" ) ; res = mifare_desfire_select_application ( tags [ i ] , aid ) ; if ( res < 0 ) errx ( EXIT_FAILURE , "Application<S2SV_blank>selection<S2SV_blank>failed" ) ; res = mifare_desfire_authenticate ( tags [ i ] , 0 , key ) ; if ( res < 0 ) errx ( EXIT_FAILURE , "Authentication<S2SV_blank>on<S2SV_blank>application<S2SV_blank>failed" ) ; res = mifare_desfire_create_std_data_file ( tags [ i ] , 1 , MDCM_ENCIPHERED , 0x0000 , 20 ) ; if ( res < 0 ) errx ( EXIT_FAILURE , "File<S2SV_blank>creation<S2SV_blank>failed" ) ; const char * s = "Hello<S2SV_blank>World" ; res = mifare_desfire_write_data ( tags [ i ] , 1 , 0 , strlen ( s ) , s ) ; if ( res < 0 ) errx ( EXIT_FAILURE , "File<S2SV_blank>write<S2SV_blank>failed" ) ; char buffer [ 20 ] ; res = mifare_desfire_read_data ( tags [ i ] , 1 , 0 , 0 , buffer ) ; if ( res < 0 ) errx ( EXIT_FAILURE , "File<S2SV_blank>read<S2SV_blank>failed" ) ; res = mifare_desfire_select_application ( tags [ i ] , NULL ) ; if ( res < 0 ) errx ( EXIT_FAILURE , "Master<S2SV_blank>application<S2SV_blank>selection<S2SV_blank>failed" ) ; res = mifare_desfire_authenticate ( tags [ i ] , 0 , key ) ; if ( res < 0 ) errx ( EXIT_FAILURE , "Authentication<S2SV_blank>on<S2SV_blank>master<S2SV_blank>application<S2SV_blank>failed" ) ; res = mifare_desfire_format_picc ( tags [ i ] ) ; if ( res < 0 ) errx ( EXIT_FAILURE , "PICC<S2SV_blank>format<S2SV_blank>failed" ) ; mifare_desfire_key_free ( key ) ; free ( tag_uid ) ; free ( aid ) ; mifare_desfire_disconnect ( tags [ i ] ) ; } reader += strlen ( reader ) + 1 ; freefare_free_tags ( tags ) ; } pcsc_exit ( context ) ; exit ( error ) ; }
<S2SV_ModStart> { if ( MIFARE_DESFIRE <S2SV_ModEnd> != freefare_get_tag_type (
7,595
CWE-000 static int any_array_ufunc_overrides ( PyObject * args , PyObject * kwds ) { int i ; int nin , nout ; PyObject * out_kwd_obj ; PyObject * fast ; PyObject * * in_objs , * * out_objs ; nin = PyTuple_Size ( args ) ; if ( nin < 0 ) { return - 1 ; } fast = PySequence_Fast ( args , "Could<S2SV_blank>not<S2SV_blank>convert<S2SV_blank>object<S2SV_blank>to<S2SV_blank>sequence" ) ; if ( fast == NULL ) { return - 1 ; } in_objs = PySequence_Fast_ITEMS ( fast ) ; for ( i = 0 ; i < nin ; ++ i ) { if ( PyUFunc_HasOverride ( in_objs [ i ] ) ) { Py_DECREF ( fast ) ; return 1 ; } } Py_DECREF ( fast ) ; nout = PyUFuncOverride_GetOutObjects ( kwds , & out_kwd_obj , & out_objs ) ; if ( nout < 0 ) { <S2SV_StartBug> Py_XDECREF ( out_kwd_obj ) ; <S2SV_EndBug> return - 1 ; } for ( i = 0 ; i < nout ; i ++ ) { if ( PyUFunc_HasOverride ( out_objs [ i ] ) ) { <S2SV_StartBug> Py_XDECREF ( out_kwd_obj ) ; <S2SV_EndBug> <S2SV_StartBug> return 1 ; <S2SV_EndBug> } } Py_XDECREF ( out_kwd_obj ) ; return 0 ; }
<S2SV_ModStart> 0 ) { <S2SV_ModEnd> return - 1 <S2SV_ModStart> ) ) { Py_DECREF ( out_kwd_obj ) ; return 1 ; } } <S2SV_ModStart> ) ; return <S2SV_ModEnd> 0 ; }
7,596
CWE-000 tThread * Thread ( ) { static U32 threadID = 0 ; tThread * pThis ; tThread * pThread ; pThis = ( tThread * ) Heap_AllocType ( types [ TYPE_SYSTEM_THREADING_THREAD ] ) ; Heap_MakeUndeletable ( ( HEAP_PTR ) pThis ) ; pThis -> threadID = ++ threadID ; pThis -> pCurrentMethodState = NULL ; pThis -> threadExitValue = 0 ; pThis -> nextFinallyUnwindStack = 0 ; pThis -> pAsync = NULL ; pThis -> hasParam = 0 ; pThis -> startDelegate = NULL ; pThis -> param = NULL ; pThis -> state = THREADSTATE_UNSTARTED ; pThis -> pThreadStack = TMALLOC ( tThreadStack ) ; pThis -> pThreadStack -> ofs = 0 ; pThis -> pThreadStack -> pNext = NULL ; pThread = pAllThreads ; <S2SV_StartBug> log_f ( 1 , "Creating<S2SV_blank>thread<S2SV_blank>%d\\n." , ( int ) pThis -> threadID ) ; <S2SV_EndBug> pThis -> pNextThread = pAllThreads ; pAllThreads = pThis ; return pThis ; }
<S2SV_ModStart> ( 1 , "Creating<S2SV_blank>thread<S2SV_blank>%d.\\n" <S2SV_ModEnd> , ( int
7,597
CWE-000 int dht_setxattr2 ( xlator_t * this , xlator_t * subvol , call_frame_t * frame , int ret ) { dht_local_t * local = NULL ; int op_errno = EINVAL ; if ( ! frame || ! frame -> local ) goto err ; local = frame -> local ; <S2SV_StartBug> if ( we_are_not_migrating ( ret ) ) { <S2SV_EndBug> DHT_STACK_UNWIND ( setxattr , frame , local -> op_ret , local -> op_errno , local -> rebalance . xdata ) ; return 0 ; } if ( subvol == NULL ) <S2SV_StartBug> goto err ; <S2SV_EndBug> op_errno = local -> op_errno ; local -> call_cnt = 2 ; if ( local -> fop == GF_FOP_SETXATTR ) { STACK_WIND_COOKIE ( frame , dht_file_setxattr_cbk , subvol , subvol , subvol -> fops -> setxattr , & local -> loc , local -> rebalance . xattr , local -> rebalance . flags , NULL ) ; } else { STACK_WIND_COOKIE ( frame , dht_file_setxattr_cbk , subvol , subvol , subvol -> fops -> fsetxattr , local -> fd , local -> rebalance . xattr , local -> rebalance . flags , NULL ) ; } return 0 ; err : DHT_STACK_UNWIND ( setxattr , frame , ( local ? local -> op_ret : - 1 ) , op_errno , NULL ) ; return 0 ; }
<S2SV_ModStart> -> local ; op_errno = local -> op_errno ; <S2SV_ModStart> ) goto err <S2SV_ModEnd> ; local ->
7,598
CWE-000 int yield_handler ( thread_node * ptr ) { <S2SV_StartBug> printf ( "handling<S2SV_blank>yield()\\n" ) ; <S2SV_EndBug> switch ( ptr -> thread -> yield_purpose ) { case 1 : { my_pthread_t exit_pid = ptr -> thread -> pid ; thread_node * temp = ptr ; free ( temp -> thread ) ; free ( temp ) ; join_waiting_queue_node * wait_prev = NULL ; join_waiting_queue_node * wait_ptr = scheduler -> join_waiting_queue ; while ( wait_ptr != NULL ) { if ( wait_ptr -> thread -> pid == exit_pid ) { thread_node * new_node = ( thread_node * ) malloc ( sizeof ( thread_node ) ) ; new_node -> thread = wait_ptr -> thread ; add_to_run_queue_priority_based ( new_node ) ; if ( wait_prev == NULL ) { scheduler -> join_waiting_queue = wait_ptr -> next ; free ( wait_ptr ) ; } else { wait_prev -> next = wait_ptr -> next ; free ( wait_ptr ) ; } } wait_prev = wait_ptr ; wait_ptr = wait_ptr -> next ; } break ; } case 2 : { ptr -> thread -> yield_purpose = 0 ; break ; } case 3 : { thread_node * current_running_queue ; switch ( scheduler -> current_queue_number ) { case 1 : current_running_queue = scheduler -> first_running_queue ; break ; case 2 : current_running_queue = scheduler -> second_running_queue ; break ; case 3 : current_running_queue = scheduler -> third_running_queue ; break ; } if ( ptr -> next != NULL ) { current_running_queue = ptr -> next ; current_running_queue -> next = ptr ; ptr -> next = ptr -> next -> next ; } ptr -> thread -> yield_purpose = 0 ; } default : switch ( scheduler -> current_queue_number ) { case 1 : ptr -> thread -> priority = 50 ; add_to_run_queue ( 2 , ptr ) ; break ; case 2 : ptr -> thread -> priority = 0 ; add_to_run_queue ( 3 , ptr ) ; break ; default : break ; } break ; } }
<S2SV_ModStart> { printf ( "handling<S2SV_blank>yield()<S2SV_blank>%d\\n" , ptr -> thread -> yield_purpose <S2SV_ModEnd> ) ; switch
7,599
CWE-000 DEFUN ( ospf_mpls_te_router_addr , ospf_mpls_te_router_addr_cmd , "mpls-te<S2SV_blank>router-address<S2SV_blank>A.B.C.D" , MPLS_TE_STR "Stable<S2SV_blank>IP<S2SV_blank>address<S2SV_blank>of<S2SV_blank>the<S2SV_blank>advertising<S2SV_blank>router\\n" "MPLS-TE<S2SV_blank>router<S2SV_blank>address<S2SV_blank>in<S2SV_blank>IPv4<S2SV_blank>address<S2SV_blank>format\\n" ) { <S2SV_StartBug> VTY_DECLVAR_CONTEXT ( ospf , ospf ) ; <S2SV_EndBug> int idx_ipv4 = 2 ; struct te_tlv_router_addr * ra = & OspfMplsTE . router_addr ; struct in_addr value ; if ( ! inet_aton ( argv [ idx_ipv4 ] -> arg , & value ) ) { vty_out ( vty , "Please<S2SV_blank>specify<S2SV_blank>Router-Addr<S2SV_blank>by<S2SV_blank>A.B.C.D\\n" ) ; return CMD_WARNING ; } if ( ntohs ( ra -> header . type ) == 0 || ntohl ( ra -> value . s_addr ) != ntohl ( value . s_addr ) ) { struct listnode * node , * nnode ; struct mpls_te_link * lp ; int need_to_reoriginate = 0 ; set_mpls_te_router_addr ( value ) ; if ( ! OspfMplsTE . enabled ) return CMD_SUCCESS ; for ( ALL_LIST_ELEMENTS ( OspfMplsTE . iflist , node , nnode , lp ) ) { if ( ( lp -> area == NULL ) || IS_FLOOD_AS ( lp -> type ) ) continue ; if ( ! CHECK_FLAG ( lp -> flags , LPFLG_LSA_ENGAGED ) ) { need_to_reoriginate = 1 ; break ; } } for ( ALL_LIST_ELEMENTS ( OspfMplsTE . iflist , node , nnode , lp ) ) { if ( ( lp -> area == NULL ) || IS_FLOOD_AS ( lp -> type ) ) continue ; if ( need_to_reoriginate ) SET_FLAG ( lp -> flags , LPFLG_LSA_FORCED_REFRESH ) ; else ospf_mpls_te_lsa_schedule ( lp , REFRESH_THIS_LSA ) ; } if ( need_to_reoriginate ) ospf_mpls_te_foreach_area ( ospf_mpls_te_lsa_schedule , REORIGINATE_THIS_LSA ) ; } return CMD_SUCCESS ; }
<S2SV_ModStart> "MPLS-TE<S2SV_blank>router<S2SV_blank>address<S2SV_blank>in<S2SV_blank>IPv4<S2SV_blank>address<S2SV_blank>format\\n" ) { VTY_DECLVAR_INSTANCE_CONTEXT <S2SV_ModEnd> ( ospf ,