Unnamed: 0
int64 0
535k
| source
stringlengths 50
89.8k
| target
stringlengths 23
37.7k
|
---|---|---|
4,500 | CWE-000 rb_red_blk_tree * RBTreeCreate ( int ( * CompFunc ) ( const void * , const void * ) , void ( * DestFunc ) ( void * ) , void ( * InfoDestFunc ) ( void * ) , void ( * PrintFunc ) ( const void * ) , void ( * PrintFile ) ( const void * , FILE * ) , <S2SV_StartBug> void ( * PrintInfo ) ( void * ) ) { <S2SV_EndBug> rb_red_blk_tree * newTree ; rb_red_blk_node * temp ; newTree = ( rb_red_blk_tree * ) SafeMalloc ( sizeof ( rb_red_blk_tree ) ) ; newTree -> Compare = CompFunc ; newTree -> DestroyKey = DestFunc ; newTree -> PrintKey = PrintFunc ; <S2SV_StartBug> newTree -> PrintKeyFile = PrintFile ; <S2SV_EndBug> newTree -> PrintInfo = PrintInfo ; newTree -> DestroyInfo = InfoDestFunc ; temp = newTree -> nil = ( rb_red_blk_node * ) SafeMalloc ( sizeof ( rb_red_blk_node ) ) ; temp -> parent = temp -> left = temp -> right = temp ; temp -> red = 0 ; temp -> key = 0 ; temp = newTree -> root = ( rb_red_blk_node * ) SafeMalloc ( sizeof ( rb_red_blk_node ) ) ; temp -> parent = temp -> left = temp -> right = newTree -> nil ; temp -> key = 0 ; temp -> red = 0 ; return ( newTree ) ; } | <S2SV_ModStart> void ( * PrintBuf ) ( const void * , char * ) , void ( * <S2SV_ModStart> PrintKeyFile = PrintFile ; newTree -> PrintKeyBuf = PrintBuf |
4,501 | CWE-000 polycap_photon * polycap_source_get_photon ( polycap_source * source , polycap_description * description , polycap_rng * rng , size_t n_energies , double * energies , polycap_vector3 * src_start_coords ) { double n_shells ; polycap_vector3 start_coords , start_direction , start_electric_vector ; double r ; int boundary_check ; double src_rad , phi ; <S2SV_StartBug> double src_start_x , src_start_y ; <S2SV_EndBug> double pc_rad , pc_x , pc_y ; polycap_photon * photon ; n_shells = round ( sqrt ( 12. * description -> n_cap - 3. ) / 6. - 0.5 ) ; if ( n_shells == 0. ) { r = polycap_rng_uniform ( rng ) ; <S2SV_StartBug> start_coords . x = ( 2. * r - 1 ) * description -> profile -> cap [ 0 ] ; <S2SV_EndBug> r = polycap_rng_uniform ( rng ) ; <S2SV_StartBug> start_coords . y = ( 2. * r - 1 ) * description -> profile -> cap [ 0 ] ; <S2SV_EndBug> start_coords . z = 0. ; } else { boundary_check = - 1 ; do { r = polycap_rng_uniform ( rng ) ; <S2SV_StartBug> start_coords . x = ( 2. * r - 1 ) * description -> profile -> ext [ 0 ] ; <S2SV_EndBug> r = polycap_rng_uniform ( rng ) ; <S2SV_StartBug> start_coords . y = ( 2. * r - 1 ) * description -> profile -> ext [ 0 ] ; <S2SV_EndBug> start_coords . z = 0. ; boundary_check = polycap_photon_within_pc_boundary ( description -> profile -> ext [ 0 ] , start_coords ) ; } while ( boundary_check == - 1 ) ; } r = polycap_rng_uniform ( rng ) ; phi = 2.0 * M_PI * fabs ( r ) ; r = polycap_rng_uniform ( rng ) ; src_rad = sqrt ( ( 1. / ( ( ( tan ( phi ) * tan ( phi ) ) / ( source -> src_y * source -> src_y ) ) + ( 1. / ( source -> src_x * source -> src_x ) ) ) ) + ( source -> src_y * source -> src_y ) * ( 1. - ( ( ( 1. / ( ( ( tan ( phi ) * tan ( phi ) ) / ( source -> src_y * source -> src_y ) ) + ( 1. / ( source -> src_x * source -> src_x ) ) ) ) ) / ( source -> src_x * source -> src_x ) ) ) ) * sqrt ( fabs ( r ) ) ; src_start_x = src_rad * cos ( phi ) + source -> src_shiftx ; src_start_y = src_rad * sin ( phi ) + source -> src_shifty ; src_start_coords -> x = src_start_x ; src_start_coords -> y = src_start_y ; src_start_coords -> z = 0 ; if ( ( source -> src_sigx * source -> src_sigy ) < 1.e-20 ) { <S2SV_StartBug> r = polycap_rng_uniform ( rng ) ; <S2SV_EndBug> pc_rad = description -> profile -> ext [ 0 ] * sqrt ( fabs ( r ) ) ; r = polycap_rng_uniform ( rng ) ; phi = 2.0 * M_PI * fabs ( r ) ; pc_x = pc_rad * cos ( phi ) + start_coords . x ; pc_y = pc_rad * sin ( phi ) + start_coords . y ; start_direction . x = pc_x - src_start_x ; start_direction . y = pc_y - src_start_y ; start_direction . z = source -> d_source ; } else { r = polycap_rng_uniform ( rng ) ; start_direction . x = source -> src_sigx * ( 1. - 2. * fabs ( r ) ) ; r = polycap_rng_uniform ( rng ) ; start_direction . y = source -> src_sigy * ( 1. - 2. * fabs ( r ) ) ; start_direction . z = 1. ; } polycap_norm ( & start_direction ) ; r = polycap_rng_uniform ( rng ) ; start_electric_vector . x = ( 1. - 2. * fabs ( r ) ) ; r = polycap_rng_uniform ( rng ) ; start_electric_vector . y = ( 1. - 2. * fabs ( r ) ) ; r = polycap_rng_uniform ( rng ) ; start_electric_vector . z = ( 1. - 2. * fabs ( r ) ) ; polycap_norm ( & start_electric_vector ) ; photon = polycap_photon_new ( rng , start_coords , start_direction , start_electric_vector , n_energies , energies ) ; return photon ; } | <S2SV_ModStart> src_start_x , src_start_y <S2SV_ModEnd> ; polycap_photon * <S2SV_ModStart> * r - 1. <S2SV_ModEnd> ) * description <S2SV_ModStart> * r - 1. <S2SV_ModEnd> ) * description <S2SV_ModStart> * r - 1. <S2SV_ModEnd> ) * description <S2SV_ModStart> * r - 1. <S2SV_ModEnd> ) * description <S2SV_ModStart> 1.e-20 ) { start_direction . x = start_coords . x - src_start_x ; start_direction . y = start_coords . y <S2SV_ModEnd> - src_start_y ; |
4,502 | CWE-000 static gboolean _camera_stop ( GstCameraSrc * camerasrc ) { GST_DEBUG_OBJECT ( camerasrc , "ENTERED" ) ; camerasrc -> is_stopping = TRUE ; if ( camerasrc -> buffer_type == BUFFER_TYPE_GEM ) { _stop_preview ( camerasrc ) ; _destroy_buffer ( camerasrc ) ; } else { _stop_preview_mmap ( camerasrc ) ; _unmap_buffer ( camerasrc ) ; } <S2SV_StartBug> g_cond_signal ( & camerasrc -> empty_cond ) ; <S2SV_EndBug> GST_DEBUG_OBJECT ( camerasrc , "LEAVED" ) ; return TRUE ; } | <S2SV_ModStart> ) ; } if ( camerasrc -> csi_subdev_fd ) close ( camerasrc -> csi_subdev_fd ) ; if ( camerasrc -> clipper_subdev_fd ) close ( camerasrc -> clipper_subdev_fd ) ; if ( camerasrc -> clipper_video_fd ) close ( camerasrc -> clipper_video_fd ) ; if ( camerasrc -> sensor_fd ) close ( camerasrc -> sensor_fd ) ; nx_v4l2_cleanup ( ) ; |
4,503 | CWE-000 static const struct netrc_info * _netrc_lookup ( const char * host ) { const struct netrc_info * def_ni = NULL ; int i , max ; if ( ! netrc ) return ( NULL ) ; max = smartlist_len ( netrc ) ; for ( i = 0 ; i < max ; i ++ ) { const struct netrc_info * ni = smartlist_get ( netrc , i ) ; char buf [ 300 ] ; if ( ni -> is_default ) def_ni = ni ; snprintf ( buf , sizeof ( buf ) , "host:<S2SV_blank>\'%s\',<S2SV_blank>user:<S2SV_blank>\'%s\',<S2SV_blank>passw:<S2SV_blank>\'%s\',<S2SV_blank>is_default:<S2SV_blank>%d.\\n" , ni -> host , ni -> user , ni -> passw , ni -> is_default ) ; <S2SV_StartBug> if ( opt . do_tests ) <S2SV_EndBug> C_printf ( "<S2SV_blank><S2SV_blank>%s" , buf ) ; else DEBUGF ( 3 , buf ) ; if ( ni -> host && host && ! stricmp ( host , ni -> host ) ) return ( ni ) ; } if ( def_ni ) return ( def_ni ) ; return ( NULL ) ; } | <S2SV_ModStart> is_default ) ; <S2SV_ModEnd> DEBUGF ( 3 |
4,504 | CWE-000 int ff_vdpau_common_init ( AVCodecContext * avctx , VdpDecoderProfile profile , int level ) { VDPAUHWContext * hwctx = avctx -> hwaccel_context ; VDPAUContext * vdctx = avctx -> internal -> hwaccel_priv_data ; VdpVideoSurfaceQueryCapabilities * surface_query_caps ; VdpDecoderQueryCapabilities * decoder_query_caps ; VdpDecoderCreate * create ; VdpGetInformationString * info ; const char * info_string ; void * func ; VdpStatus status ; VdpBool supported ; uint32_t max_level , max_mb , max_width , max_height ; VdpChromaType type ; uint32_t width ; uint32_t height ; int ret ; vdctx -> width = UINT32_MAX ; vdctx -> height = UINT32_MAX ; if ( av_vdpau_get_surface_parameters ( avctx , & type , & width , & height ) ) return AVERROR ( ENOSYS ) ; if ( hwctx ) { hwctx -> reset = 0 ; if ( hwctx -> context . decoder != VDP_INVALID_HANDLE ) { vdctx -> decoder = hwctx -> context . decoder ; vdctx -> render = hwctx -> context . render ; vdctx -> device = VDP_INVALID_HANDLE ; return 0 ; } vdctx -> device = hwctx -> device ; vdctx -> get_proc_address = hwctx -> get_proc_address ; if ( hwctx -> flags & AV_HWACCEL_FLAG_IGNORE_LEVEL ) level = 0 ; if ( ! ( hwctx -> flags & AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH ) && type != VDP_CHROMA_TYPE_420 ) return AVERROR ( ENOSYS ) ; } else { AVHWFramesContext * frames_ctx ; AVVDPAUDeviceContext * dev_ctx ; ret = ff_decode_get_hw_frames_ctx ( avctx , AV_HWDEVICE_TYPE_VDPAU ) ; if ( ret < 0 ) return ret ; frames_ctx = ( AVHWFramesContext * ) avctx -> hw_frames_ctx -> data ; dev_ctx = frames_ctx -> device_ctx -> hwctx ; vdctx -> device = dev_ctx -> device ; vdctx -> get_proc_address = dev_ctx -> get_proc_address ; if ( avctx -> hwaccel_flags & AV_HWACCEL_FLAG_IGNORE_LEVEL ) level = 0 ; } if ( level < 0 ) return AVERROR ( ENOTSUP ) ; status = vdctx -> get_proc_address ( vdctx -> device , VDP_FUNC_ID_GET_INFORMATION_STRING , & func ) ; if ( status != VDP_STATUS_OK ) return vdpau_error ( status ) ; else info = func ; status = info ( & info_string ) ; if ( status != VDP_STATUS_OK ) return vdpau_error ( status ) ; if ( avctx -> codec_id == AV_CODEC_ID_HEVC && strncmp ( info_string , "NVIDIA<S2SV_blank>" , 7 ) == 0 && ! ( avctx -> hwaccel_flags & AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH ) ) { <S2SV_StartBug> av_log ( avctx , AV_LOG_VERBOSE , "HEVC<S2SV_blank>with<S2SV_blank>NVIDIA<S2SV_blank>VDPAU<S2SV_blank>drivers<S2SV_blank>is<S2SV_blank>buggy,<S2SV_blank>skipping.\\n" ) ; <S2SV_EndBug> <S2SV_StartBug> return AVERROR ( ENOTSUP ) ; <S2SV_EndBug> } status = vdctx -> get_proc_address ( vdctx -> device , VDP_FUNC_ID_VIDEO_SURFACE_QUERY_CAPABILITIES , & func ) ; if ( status != VDP_STATUS_OK ) return vdpau_error ( status ) ; else surface_query_caps = func ; status = surface_query_caps ( vdctx -> device , type , & supported , & max_width , & max_height ) ; if ( status != VDP_STATUS_OK ) return vdpau_error ( status ) ; if ( supported != VDP_TRUE || max_width < width || max_height < height ) return AVERROR ( ENOTSUP ) ; status = vdctx -> get_proc_address ( vdctx -> device , VDP_FUNC_ID_DECODER_QUERY_CAPABILITIES , & func ) ; if ( status != VDP_STATUS_OK ) return vdpau_error ( status ) ; else decoder_query_caps = func ; status = decoder_query_caps ( vdctx -> device , profile , & supported , & max_level , & max_mb , & max_width , & max_height ) ; # ifdef VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE if ( ( status != VDP_STATUS_OK || supported != VDP_TRUE ) && profile == VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE ) { profile = VDP_DECODER_PROFILE_H264_MAIN ; status = decoder_query_caps ( vdctx -> device , profile , & supported , & max_level , & max_mb , & max_width , & max_height ) ; } # endif if ( status != VDP_STATUS_OK ) return vdpau_error ( status ) ; if ( supported != VDP_TRUE || max_level < level || max_width < width || max_height < height ) return AVERROR ( ENOTSUP ) ; status = vdctx -> get_proc_address ( vdctx -> device , VDP_FUNC_ID_DECODER_CREATE , & func ) ; if ( status != VDP_STATUS_OK ) return vdpau_error ( status ) ; else create = func ; status = vdctx -> get_proc_address ( vdctx -> device , VDP_FUNC_ID_DECODER_RENDER , & func ) ; if ( status != VDP_STATUS_OK ) return vdpau_error ( status ) ; else vdctx -> render = func ; status = create ( vdctx -> device , profile , width , height , avctx -> refs , & vdctx -> decoder ) ; if ( status == VDP_STATUS_OK ) { vdctx -> width = avctx -> coded_width ; vdctx -> height = avctx -> coded_height ; } return vdpau_error ( status ) ; } | <S2SV_ModStart> ) ) { int driver_version ; sscanf ( info_string , "NVIDIA<S2SV_blank>VDPAU<S2SV_blank>Driver<S2SV_blank>Shared<S2SV_blank>Library<S2SV_blank><S2SV_blank>%d" , & driver_version ) ; if ( driver_version < 410 ) { <S2SV_ModStart> ENOTSUP ) ; } |
4,505 | CWE-000 static int vdbeSorterFlushPMA ( VdbeSorter * pSorter ) { # if SQLITE_MAX_WORKER_THREADS == 0 pSorter -> bUsePMA = 1 ; return vdbeSorterListToPMA ( & pSorter -> aTask [ 0 ] , & pSorter -> list ) ; # else int rc = SQLITE_OK ; int i ; SortSubtask * pTask = 0 ; int nWorker = ( pSorter -> nTask - 1 ) ; pSorter -> bUsePMA = 1 ; for ( i = 0 ; i < nWorker ; i ++ ) { int iTest = ( pSorter -> iPrev + i + 1 ) % nWorker ; pTask = & pSorter -> aTask [ iTest ] ; if ( pTask -> bDone ) { rc = vdbeSorterJoinThread ( pTask ) ; } if ( rc != SQLITE_OK || pTask -> pThread == 0 ) break ; } if ( rc == SQLITE_OK ) { if ( i == nWorker ) { rc = vdbeSorterListToPMA ( & pSorter -> aTask [ nWorker ] , & pSorter -> list ) ; } else { u8 * aMem = pTask -> list . aMemory ; void * pCtx = ( void * ) pTask ; assert ( pTask -> pThread == 0 && pTask -> bDone == 0 ) ; assert ( pTask -> list . pList == 0 ) ; assert ( pTask -> list . aMemory == 0 || pSorter -> list . aMemory != 0 ) ; pSorter -> iPrev = ( u8 ) ( pTask - pSorter -> aTask ) ; pTask -> list = pSorter -> list ; pSorter -> list . pList = 0 ; pSorter -> list . szPMA = 0 ; if ( aMem ) { pSorter -> list . aMemory = aMem ; pSorter -> nMemory = sqlite3MallocSize ( aMem ) ; } else if ( pSorter -> list . aMemory ) { pSorter -> list . aMemory = sqlite3Malloc ( pSorter -> nMemory ) ; <S2SV_StartBug> if ( ! pSorter -> list . aMemory ) return SQLITE_NOMEM ; <S2SV_EndBug> } rc = vdbeSorterCreateThread ( pTask , vdbeSorterFlushThread , pCtx ) ; } } return rc ; # endif } | <S2SV_ModStart> aMemory ) return SQLITE_NOMEM_BKPT <S2SV_ModEnd> ; } rc |
4,506 | CWE-000 ZZSTATUS ZzBuildHook ( zz_ptr_t target_ptr , zz_ptr_t replace_call_ptr , zz_ptr_t * origin_ptr , PRECALL pre_call_ptr , <S2SV_StartBug> POSTCALL post_call_ptr , bool try_near_jump ) { <S2SV_EndBug> # if defined ( __i386__ ) || defined ( __x86_64__ ) <S2SV_StartBug> ZzDebugInfoLog ( "%s" , "x86<S2SV_blank>&<S2SV_blank>x86_64<S2SV_blank>arch<S2SV_blank>not<S2SV_blank>support" ) ; <S2SV_EndBug> return ZZ_FAILED ; # endif ZZSTATUS status = ZZ_DONE_HOOK ; ZzInterceptor * interceptor = NULL ; ZzHookFunctionEntrySet * hook_function_entry_set = NULL ; ZzHookFunctionEntry * entry = NULL ; <S2SV_StartBug> int hook_type ; <S2SV_EndBug> interceptor = ZzGlobalInterceptorInstance ( ) ; if ( ! interceptor ) { return ZZ_FAILED ; } hook_function_entry_set = & ( interceptor -> hook_function_entry_set ) ; do { if ( ZzFindHookFunctionEntry ( target_ptr ) ) { status = ZZ_ALREADY_HOOK ; break ; } entry = ( ZzHookFunctionEntry * ) zz_malloc_with_zero ( sizeof ( ZzHookFunctionEntry ) ) ; <S2SV_StartBug> if ( pre_call_ptr || post_call_ptr ) { <S2SV_EndBug> hook_type = HOOK_TYPE_FUNCTION_via_PRE_POST ; } else { hook_type = HOOK_TYPE_FUNCTION_via_REPLACE ; } ZzInitializeHookFunctionEntry ( entry , hook_type , target_ptr , replace_call_ptr , pre_call_ptr , post_call_ptr , try_near_jump ) ; ZzBuildTrampoline ( interceptor -> backend , entry ) ; ZzAddHookFunctionEntry ( entry ) ; if ( origin_ptr ) * origin_ptr = entry -> on_invoke_trampoline ; } while ( 0 ) ; return status ; } | <S2SV_ModStart> , bool try_near_jump , ZZHOOKTYPE hook_type <S2SV_ModStart> ( __x86_64__ ) HookZzDebugInfoLog <S2SV_ModEnd> ( "%s" , <S2SV_ModStart> = NULL ; <S2SV_ModEnd> interceptor = ZzGlobalInterceptorInstance <S2SV_ModStart> ) ) ; <S2SV_ModEnd> ZzInitializeHookFunctionEntry ( entry |
4,507 | CWE-000 static bool checkreturn encode_basic_field ( pb_ostream_t * stream , const pb_field_t * field , const void * pData ) { pb_encoder_t func ; <S2SV_StartBug> const void * pSize ; <S2SV_EndBug> bool implicit_has = true ; func = PB_ENCODERS [ PB_LTYPE ( field -> type ) ] ; if ( field -> size_offset ) <S2SV_StartBug> pSize = ( const char * ) pData + field -> size_offset ; <S2SV_EndBug> <S2SV_StartBug> else if ( ! field -> size_offset && PB_HTYPE ( field -> type ) == PB_HTYPE_OPTIONAL ) <S2SV_EndBug> { <S2SV_StartBug> if ( PB_LTYPE ( field -> type ) == PB_LTYPE_BYTES ) <S2SV_EndBug> { const pb_bytes_array_t * bytes = ( const pb_bytes_array_t * ) pData ; if ( bytes -> size == 0 ) implicit_has = false ; } <S2SV_StartBug> else if ( ( PB_LTYPE ( field -> type ) == PB_LTYPE_STRING && * ( const char * ) pData == '\\0' ) || <S2SV_EndBug> ( field -> data_size == sizeof ( uint_least8_t ) && * ( const uint_least8_t * ) pData == 0 ) || ( field -> data_size == sizeof ( uint_least16_t ) && * ( const uint_least16_t * ) pData == 0 ) || ( field -> data_size == sizeof ( uint32_t ) && * ( const uint_least32_t * ) pData == 0 ) || ( field -> data_size == sizeof ( uint64_t ) && * ( const uint_least64_t * ) pData == 0 ) ) { implicit_has = false ; } pSize = & implicit_has ; } else pSize = & implicit_has ; if ( PB_ATYPE ( field -> type ) == PB_ATYPE_POINTER ) { pData = * ( const void * const * ) pData ; implicit_has = ( pData != NULL ) ; } switch ( PB_HTYPE ( field -> type ) ) { case PB_HTYPE_REQUIRED : if ( ! pData ) PB_RETURN_ERROR ( stream , "missing<S2SV_blank>required<S2SV_blank>field" ) ; if ( ! pb_encode_tag_for_field ( stream , field ) ) return false ; if ( ! func ( stream , field , pData ) ) return false ; break ; case PB_HTYPE_OPTIONAL : if ( * ( const bool * ) pSize ) { if ( ! pb_encode_tag_for_field ( stream , field ) ) return false ; if ( ! func ( stream , field , pData ) ) return false ; } break ; case PB_HTYPE_REPEATED : if ( ! encode_array ( stream , field , pData , * ( const pb_size_t * ) pSize , func ) ) return false ; break ; case PB_HTYPE_ONEOF : if ( * ( const pb_size_t * ) pSize == field -> tag ) { if ( ! pb_encode_tag_for_field ( stream , field ) ) return false ; if ( ! func ( stream , field , pData ) ) return false ; } break ; default : PB_RETURN_ERROR ( stream , "invalid<S2SV_blank>field<S2SV_blank>type" ) ; } return true ; } | <S2SV_ModStart> pb_encoder_t func ; bool implicit_has ; <S2SV_ModStart> void * pSize = & implicit_has <S2SV_ModEnd> ; func = <S2SV_ModStart> -> size_offset ) { <S2SV_ModStart> -> size_offset ; } <S2SV_ModStart> else if ( <S2SV_ModEnd> PB_HTYPE ( field <S2SV_ModStart> PB_HTYPE_OPTIONAL ) { implicit_has = ! pb_check_proto3_default_value ( field , pData ) <S2SV_ModEnd> ; } else <S2SV_ModStart> ; } else { implicit_has = true ; } <S2SV_ModEnd> if ( PB_ATYPE |
4,508 | CWE-000 <S2SV_StartBug> struct ipoib_dev_priv * ipoib_intf_alloc ( struct ib_device * hca , u8 port , <S2SV_EndBug> const char * name ) { struct net_device * dev ; <S2SV_StartBug> struct ipoib_dev_priv * priv ; <S2SV_EndBug> struct rdma_netdev * rn ; priv = kzalloc ( sizeof ( * priv ) , GFP_KERNEL ) ; if ( ! priv ) return NULL ; priv -> ca = hca ; priv -> port = port ; <S2SV_StartBug> dev = ipoib_get_netdev ( hca , port , name ) ; <S2SV_EndBug> <S2SV_StartBug> if ( ! dev ) <S2SV_EndBug> goto free_priv ; priv -> rn_ops = dev -> netdev_ops ; <S2SV_StartBug> if ( priv -> hca_caps & IB_DEVICE_VIRTUAL_FUNCTION ) <S2SV_EndBug> dev -> netdev_ops = & ipoib_netdev_ops_vf ; else dev -> netdev_ops = & ipoib_netdev_ops_pf ; rn = netdev_priv ( dev ) ; rn -> clnt_priv = priv ; priv -> next_priv_destructor = dev -> priv_destructor ; dev -> priv_destructor = NULL ; ipoib_build_priv ( dev ) ; <S2SV_StartBug> return priv ; <S2SV_EndBug> free_priv : kfree ( priv ) ; return NULL ; } | <S2SV_ModStart> <S2SV_null> <S2SV_null> struct net_device <S2SV_ModEnd> * ipoib_intf_alloc ( <S2SV_ModStart> * dev ; int rc <S2SV_ModEnd> ; dev = <S2SV_ModStart> ; dev = ipoib_alloc_netdev <S2SV_ModEnd> ( hca , <S2SV_ModStart> ; if ( IS_ERR ( dev ) ) return dev ; rc = ipoib_intf_init ( hca , port , name , dev ) <S2SV_ModEnd> ; if ( <S2SV_ModStart> ; if ( rc ) { free_netdev <S2SV_ModEnd> ( dev ) <S2SV_ModStart> ) ; return ERR_PTR ( rc ) ; } return dev <S2SV_ModEnd> ; } <S2SV_null> |
4,509 | CWE-000 static HTAB * pgstat_read_statsfiles ( Oid onlydb , bool permanent , bool deep ) { PgStat_StatDBEntry * dbentry ; PgStat_StatDBEntry dbbuf ; HASHCTL hash_ctl ; HTAB * dbhash ; FILE * fpin ; int32 format_id ; bool found ; const char * statfile = permanent ? PGSTAT_STAT_PERMANENT_FILENAME : pgstat_stat_filename ; pgstat_setup_memcxt ( ) ; memset ( & hash_ctl , 0 , sizeof ( hash_ctl ) ) ; hash_ctl . keysize = sizeof ( Oid ) ; hash_ctl . entrysize = sizeof ( PgStat_StatDBEntry ) ; hash_ctl . hcxt = pgStatLocalContext ; dbhash = hash_create ( "Databases<S2SV_blank>hash" , PGSTAT_DB_HASH_SIZE , & hash_ctl , HASH_ELEM | HASH_BLOBS | HASH_CONTEXT ) ; memset ( & globalStats , 0 , sizeof ( globalStats ) ) ; memset ( & archiverStats , 0 , sizeof ( archiverStats ) ) ; globalStats . stat_reset_timestamp = GetCurrentTimestamp ( ) ; archiverStats . stat_reset_timestamp = globalStats . stat_reset_timestamp ; if ( ( fpin = AllocateFile ( statfile , PG_BINARY_R ) ) == NULL ) { if ( errno != ENOENT ) ereport ( pgStatRunningInCollector ? LOG : WARNING , ( errcode_for_file_access ( ) , errmsg ( "could<S2SV_blank>not<S2SV_blank>open<S2SV_blank>statistics<S2SV_blank>file<S2SV_blank>\\"%s\\":<S2SV_blank>%m" , statfile ) ) ) ; return dbhash ; } if ( fread ( & format_id , 1 , sizeof ( format_id ) , fpin ) != sizeof ( format_id ) || format_id != PGSTAT_FILE_FORMAT_ID ) { ereport ( pgStatRunningInCollector ? LOG : WARNING , ( errmsg ( "corrupted<S2SV_blank>statistics<S2SV_blank>file<S2SV_blank>\\"%s\\"" , statfile ) ) ) ; goto done ; } if ( fread ( & globalStats , 1 , sizeof ( globalStats ) , fpin ) != sizeof ( globalStats ) ) { ereport ( pgStatRunningInCollector ? LOG : WARNING , ( errmsg ( "corrupted<S2SV_blank>statistics<S2SV_blank>file<S2SV_blank>\\"%s\\"" , statfile ) ) ) ; <S2SV_StartBug> goto done ; <S2SV_EndBug> <S2SV_StartBug> } <S2SV_EndBug> if ( fread ( & archiverStats , 1 , sizeof ( archiverStats ) , fpin ) != sizeof ( archiverStats ) ) { ereport ( pgStatRunningInCollector ? LOG : WARNING , ( errmsg ( "corrupted<S2SV_blank>statistics<S2SV_blank>file<S2SV_blank>\\"%s\\"" , statfile ) ) ) ; <S2SV_StartBug> goto done ; <S2SV_EndBug> } for ( ; ; ) { switch ( fgetc ( fpin ) ) { case 'D' : if ( fread ( & dbbuf , 1 , offsetof ( PgStat_StatDBEntry , tables ) , fpin ) != offsetof ( PgStat_StatDBEntry , tables ) ) { ereport ( pgStatRunningInCollector ? LOG : WARNING , ( errmsg ( "corrupted<S2SV_blank>statistics<S2SV_blank>file<S2SV_blank>\\"%s\\"" , statfile ) ) ) ; goto done ; } dbentry = ( PgStat_StatDBEntry * ) hash_search ( dbhash , ( void * ) & dbbuf . databaseid , HASH_ENTER , & found ) ; if ( found ) { ereport ( pgStatRunningInCollector ? LOG : WARNING , ( errmsg ( "corrupted<S2SV_blank>statistics<S2SV_blank>file<S2SV_blank>\\"%s\\"" , statfile ) ) ) ; goto done ; } memcpy ( dbentry , & dbbuf , sizeof ( PgStat_StatDBEntry ) ) ; dbentry -> tables = NULL ; <S2SV_StartBug> dbentry -> functions = NULL ; <S2SV_EndBug> if ( onlydb != InvalidOid ) { if ( dbbuf . databaseid != onlydb && dbbuf . databaseid != InvalidOid ) break ; } memset ( & hash_ctl , 0 , sizeof ( hash_ctl ) ) ; hash_ctl . keysize = sizeof ( Oid ) ; hash_ctl . entrysize = sizeof ( PgStat_StatTabEntry ) ; hash_ctl . hcxt = pgStatLocalContext ; dbentry -> tables = hash_create ( "Per-database<S2SV_blank>table" , PGSTAT_TAB_HASH_SIZE , & hash_ctl , HASH_ELEM | HASH_BLOBS | HASH_CONTEXT ) ; hash_ctl . keysize = sizeof ( Oid ) ; hash_ctl . entrysize = sizeof ( PgStat_StatFuncEntry ) ; hash_ctl . hcxt = pgStatLocalContext ; dbentry -> functions = hash_create ( "Per-database<S2SV_blank>function" , PGSTAT_FUNCTION_HASH_SIZE , & hash_ctl , HASH_ELEM | HASH_BLOBS | HASH_CONTEXT ) ; if ( deep ) pgstat_read_db_statsfile ( dbentry -> databaseid , dbentry -> tables , dbentry -> functions , permanent ) ; break ; case 'E' : goto done ; default : ereport ( pgStatRunningInCollector ? LOG : WARNING , ( errmsg ( "corrupted<S2SV_blank>statistics<S2SV_blank>file<S2SV_blank>\\"%s\\"" , statfile ) ) ) ; goto done ; } } done : FreeFile ( fpin ) ; if ( permanent ) { elog ( DEBUG2 , "removing<S2SV_blank>permanent<S2SV_blank>stats<S2SV_blank>file<S2SV_blank>\\"%s\\"" , statfile ) ; unlink ( statfile ) ; } return dbhash ; } | <S2SV_ModStart> ) ) ; memset ( & globalStats , 0 , sizeof ( globalStats ) ) ; <S2SV_ModStart> done ; } if ( pgStatRunningInCollector ) globalStats . stats_timestamp = 0 ; <S2SV_ModStart> ) ) ; memset ( & archiverStats , 0 , sizeof ( archiverStats ) ) ; <S2SV_ModStart> functions = NULL ; if ( pgStatRunningInCollector ) dbentry -> stats_timestamp = 0 |
4,510 | CWE-000 void ui_create_main_window ( video_canvas_t * canvas ) { GtkWidget * new_window ; GtkWidget * grid ; GtkWidget * status_bar ; int target_window ; GtkWidget * crt_controls ; GtkWidget * mixer_controls ; GdkPixbuf * icon ; int xpos = - 1 ; int ypos = - 1 ; int width = 0 ; int height = 0 ; gchar title [ 256 ] ; int full = 0 ; new_window = gtk_window_new ( GTK_WINDOW_TOPLEVEL ) ; ui_menu_init_accelerators ( new_window ) ; icon = get_default_icon ( ) ; if ( icon != NULL ) { gtk_window_set_icon ( GTK_WINDOW ( new_window ) , icon ) ; } g_snprintf ( title , 256 , "VICE<S2SV_blank>(%s)" , machine_get_name ( ) ) ; gtk_window_set_title ( GTK_WINDOW ( new_window ) , title ) ; grid = gtk_grid_new ( ) ; g_signal_connect ( grid , "destroy" , G_CALLBACK ( on_window_grid_destroy ) , NULL ) ; gtk_container_add ( GTK_CONTAINER ( new_window ) , grid ) ; gtk_orientable_set_orientation ( GTK_ORIENTABLE ( grid ) , GTK_ORIENTATION_VERTICAL ) ; canvas -> grid = grid ; if ( create_window_func != NULL ) { create_window_func ( canvas ) ; } target_window = - 1 ; if ( identify_canvas_func != NULL ) { target_window = identify_canvas_func ( canvas ) ; } if ( target_window < 0 ) { log_error ( LOG_ERR , "ui_create_main_window:<S2SV_blank>canvas<S2SV_blank>not<S2SV_blank>identified!\\n" ) ; archdep_vice_exit ( 1 ) ; } if ( ui_resources . window_widget [ target_window ] != NULL ) { log_error ( LOG_ERR , "ui_create_main_window:<S2SV_blank>existing<S2SV_blank>window<S2SV_blank>recreated??\\n" ) ; archdep_vice_exit ( 1 ) ; } status_bar = ui_statusbar_create ( ) ; gtk_widget_show_all ( status_bar ) ; gtk_widget_set_no_show_all ( status_bar , TRUE ) ; gtk_container_add ( GTK_CONTAINER ( grid ) , status_bar ) ; crt_controls = NULL ; if ( machine_class != VICE_MACHINE_VSID ) { if ( create_controls_widget_func != NULL ) { crt_controls = create_controls_widget_func ( target_window ) ; } if ( crt_controls != NULL ) { gtk_widget_hide ( crt_controls ) ; gtk_container_add ( GTK_CONTAINER ( grid ) , crt_controls ) ; gtk_widget_set_no_show_all ( crt_controls , TRUE ) ; } } if ( machine_class != VICE_MACHINE_VSID ) { mixer_controls = mixer_widget_create ( TRUE , GTK_ALIGN_END ) ; gtk_widget_hide ( mixer_controls ) ; gtk_container_add ( GTK_CONTAINER ( grid ) , mixer_controls ) ; gtk_widget_set_no_show_all ( mixer_controls , TRUE ) ; } g_signal_connect ( new_window , "focus-in-event" , G_CALLBACK ( on_focus_in_event ) , NULL ) ; g_signal_connect ( new_window , "focus-out-event" , G_CALLBACK ( on_focus_out_event ) , NULL ) ; g_signal_connect ( new_window , "window-state-event" , G_CALLBACK ( on_window_state_event ) , NULL ) ; g_signal_connect ( new_window , "delete-event" , G_CALLBACK ( ui_main_window_delete_event ) , NULL ) ; g_signal_connect ( new_window , "destroy" , G_CALLBACK ( ui_main_window_destroy_callback ) , NULL ) ; g_signal_connect ( new_window , "configure-event" , G_CALLBACK ( on_window_configure_event ) , GINT_TO_POINTER ( target_window ) ) ; gtk_drag_dest_set ( new_window , GTK_DEST_DEFAULT_ALL , drag_targets , ( int ) ( sizeof drag_targets / sizeof drag_targets [ 0 ] ) , GDK_ACTION_COPY ) ; g_signal_connect ( new_window , "drag-data-received" , G_CALLBACK ( on_drag_data_received ) , NULL ) ; g_signal_connect ( new_window , "drag-drop" , G_CALLBACK ( on_drag_drop ) , NULL ) ; if ( ui_resources . start_minimized ) { gtk_window_iconify ( GTK_WINDOW ( new_window ) ) ; } ui_resources . canvas [ target_window ] = canvas ; ui_resources . window_widget [ target_window ] = new_window ; canvas -> window_index = target_window ; ui_display_speed ( 100.0f , 0.0f , 0 ) ; kbd_connect_handlers ( new_window , NULL ) ; if ( ! kbd_hotkey_add_list ( default_hotkeys ) ) { debug_gtk3 ( "adding<S2SV_blank>hotkeys<S2SV_blank>failed,<S2SV_blank>see<S2SV_blank>the<S2SV_blank>log<S2SV_blank>for<S2SV_blank>details." ) ; } if ( resources_get_int_sprintf ( "Window%dXpos" , & xpos , target_window ) < 0 ) { log_error ( LOG_ERR , "No<S2SV_blank>for<S2SV_blank>Window%dXpos" , target_window ) ; } resources_get_int_sprintf ( "Window%dYpos" , & ypos , target_window ) ; resources_get_int_sprintf ( "Window%dwidth" , & width , target_window ) ; resources_get_int_sprintf ( "Window%dheight" , & height , target_window ) ; debug_gtk3 ( "X:<S2SV_blank>%d,<S2SV_blank>Y:<S2SV_blank>%d,<S2SV_blank>W:<S2SV_blank>%d,<S2SV_blank>H:<S2SV_blank>%d" , xpos , ypos , width , height ) ; if ( xpos < 0 || ypos < 0 || width <= 0 || height <= 0 ) { <S2SV_StartBug> return ; <S2SV_EndBug> } gtk_window_move ( GTK_WINDOW ( new_window ) , xpos , ypos ) ; <S2SV_StartBug> gtk_window_resize ( GTK_WINDOW ( new_window ) , width , height ) ; <S2SV_EndBug> if ( resources_get_int ( "FullscreenEnable" , & full ) < 0 ) { debug_gtk3 ( "failed<S2SV_blank>to<S2SV_blank>get<S2SV_blank>FullscreenEnabled<S2SV_blank>resource." ) ; } else { if ( full ) { gtk_window_fullscreen ( GTK_WINDOW ( new_window ) ) ; } else { gtk_window_unfullscreen ( GTK_WINDOW ( new_window ) ) ; } } } | <S2SV_ModStart> 0 ) { debug_gtk3 ( "shit<S2SV_blank>ain\'t<S2SV_blank>legal!" ) ; } else { <S2SV_ModEnd> gtk_window_move ( GTK_WINDOW <S2SV_ModStart> height ) ; } |
4,511 | CWE-000 int main ( ) { minlevel = 5 ; <S2SV_StartBug> maxlevel = 9 ; <S2SV_EndBug> L0 = 100. ; X0 = Y0 = Z0 = 0. ; <S2SV_StartBug> for ( rot . theta = 100. * M_PI / 180. ; rot . theta <= 135. * M_PI / 180. ; rot . theta += 10. * M_PI / 180 ) <S2SV_EndBug> { init_grid ( 1 << 6 ) ; a = av ; u . x . refine = refine_linear ; u . y . refine = refine_linear ; # if dimension == 3 u . z . refine = refine_linear ; # endif fan . prolongation = fraction_refine ; p . refine = p . prolongation = refine_linear ; b . gradient = minmod2 ; meps = 10. ; DT = 10E-5 ; TOLERANCE = 10E-6 ; CFL = 0.5 ; sim_dir_create ( ) ; out . sim_i ++ ; run ( ) ; <S2SV_StartBug> } <S2SV_EndBug> } | <S2SV_ModStart> ; maxlevel = 8 <S2SV_ModEnd> ; L0 = <S2SV_ModStart> ( rot . Prho = L0 <S2SV_ModEnd> ; rot . <S2SV_ModStart> ; rot . Prho < 20 * L0 <S2SV_ModEnd> ; rot . <S2SV_ModStart> ; rot . Prho = rot . Prho * 2 <S2SV_ModEnd> ) { init_grid <S2SV_ModStart> ( ) ; free ( equifield ) ; equifield = NULL ; |
4,512 | CWE-000 int dyld_test ( void ) { struct _lf_module * module = ( void * ) 0xdeadbeef ; lf_try ( module = lf_module_create ( NULL , 0 ) ) ; lf_expect_error ( ) ; lf_assert ( module == NULL , E_UNIMPLEMENTED , "Module<S2SV_blank>was<S2SV_blank>not<S2SV_blank>NULL." ) ; lf_try ( lf_module_release ( module ) ) ; lf_expect_error ( ) ; lf_try ( module = lf_module_create ( "test" , 1 ) ) ; lf_expect_success ( ) ; lf_assert ( module , E_UNIMPLEMENTED , "Failed<S2SV_blank>to<S2SV_blank>create<S2SV_blank>module." ) ; lf_assert ( ! strcmp ( "test" , module -> name ) , E_UNIMPLEMENTED , "Module<S2SV_blank>name<S2SV_blank>doesn\'t<S2SV_blank>match." ) ; lf_assert ( module -> idx == 1 , E_UNIMPLEMENTED , "Module<S2SV_blank>name<S2SV_blank>doesn\'t<S2SV_blank>match." ) ; struct _lf_device * device = ( void * ) 0xdeadbeef ; <S2SV_StartBug> lf_try ( device = lf_device_create ( NULL , NULL ) ) ; <S2SV_EndBug> lf_expect_error ( ) ; lf_assert ( device == NULL , E_UNIMPLEMENTED , "Device<S2SV_blank>was<S2SV_blank>not<S2SV_blank>NULL." ) ; lf_try ( device = lf_device_create ( NULL , NULL , NULL ) ) ; lf_expect_success ( ) ; lf_assert ( device , E_UNIMPLEMENTED , "Device<S2SV_blank>was<S2SV_blank>NULL." ) ; lf_assert ( device -> modules == NULL , E_UNIMPLEMENTED , "Device<S2SV_blank>modules<S2SV_blank>are<S2SV_blank>not<S2SV_blank>NULL." ) ; lf_try ( dyld_register ( NULL , NULL ) ) ; lf_expect_error ( ) ; lf_try ( dyld_register ( device , module ) ) ; lf_expect_success ( ) ; lf_assert ( device -> modules , E_UNIMPLEMENTED , "Device<S2SV_blank>modules<S2SV_blank>were<S2SV_blank>NULL." ) ; struct _lf_module * loaded = NULL ; lf_try ( loaded = dyld_module ( device , "nope" ) ) ; lf_expect_error ( ) ; lf_assert ( loaded == NULL , E_UNIMPLEMENTED , "Loaded<S2SV_blank>module<S2SV_blank>was<S2SV_blank>not<S2SV_blank>NULL." ) ; lf_try ( loaded = dyld_module ( device , "test" ) ) ; lf_expect_success ( ) ; lf_assert ( loaded == module , E_UNIMPLEMENTED , "Loaded<S2SV_blank>module<S2SV_blank>did<S2SV_blank>not<S2SV_blank>mach." ) ; lf_device_release ( device ) ; lf_expect_success ( ) ; return lf_success ; fail : return lf_error ; } | <S2SV_ModStart> NULL , NULL , NULL |
4,513 | CWE-000 static void setup_variables ( void ) { struct retro_variable variables [ ] = { { "parallel-n64-cpucore" , # ifdef DYNAREC # if defined ( IOS ) "CPU<S2SV_blank>Core;<S2SV_blank>cached_interpreter|pure_interpreter|dynamic_recompiler" } , # else "CPU<S2SV_blank>Core;<S2SV_blank>dynamic_recompiler|cached_interpreter|pure_interpreter" } , # endif # else "CPU<S2SV_blank>Core;<S2SV_blank>cached_interpreter|pure_interpreter" } , # endif { "parallel-n64-audio-buffer-size" , "Audio<S2SV_blank>Buffer<S2SV_blank>Size<S2SV_blank>(restart);<S2SV_blank>2048|1024" } , { "parallel-n64-astick-deadzone" , "Analog<S2SV_blank>Deadzone<S2SV_blank>(percent);<S2SV_blank>15|20|25|30|0|5|10" } , { "parallel-n64-pak1" , "Player<S2SV_blank>1<S2SV_blank>Pak;<S2SV_blank>none|memory|rumble" } , { "parallel-n64-pak2" , "Player<S2SV_blank>2<S2SV_blank>Pak;<S2SV_blank>none|memory|rumble" } , { "parallel-n64-pak3" , "Player<S2SV_blank>3<S2SV_blank>Pak;<S2SV_blank>none|memory|rumble" } , { "parallel-n64-pak4" , "Player<S2SV_blank>4<S2SV_blank>Pak;<S2SV_blank>none|memory|rumble" } , { "parallel-n64-disable_expmem" , "Enable<S2SV_blank>Expansion<S2SV_blank>Pak<S2SV_blank>RAM;<S2SV_blank>enabled|disabled" } , { "parallel-n64-gfxplugin-accuracy" , # if defined ( IOS ) || defined ( ANDROID ) "GFX<S2SV_blank>Accuracy<S2SV_blank>(restart);<S2SV_blank>medium|high|veryhigh|low" } , # else "GFX<S2SV_blank>Accuracy<S2SV_blank>(restart);<S2SV_blank>veryhigh|high|medium|low" } , # endif # ifdef HAVE_PARALLEL { "parallel-n64-parallel-rdp-synchronous" , "ParaLLEl<S2SV_blank>Synchronous<S2SV_blank>RDP;<S2SV_blank>enabled|disabled" } , # endif { "parallel-n64-gfxplugin" , "GFX<S2SV_blank>Plugin;<S2SV_blank>auto|glide64|gln64|rice|angrylion" # if defined ( HAVE_PARALLEL ) "|parallel" # endif } , { "parallel-n64-rspplugin" , "RSP<S2SV_blank>Plugin;<S2SV_blank>auto|hle|cxd4" # ifdef HAVE_PARALLEL_RSP "|parallel" # endif } , { "parallel-n64-screensize" , "Resolution<S2SV_blank>(restart);<S2SV_blank>640x480|960x720|1280x960|1600x1200|1920x1440|2240x1680|320x240" } , { "parallel-n64-aspectratiohint" , "Aspect<S2SV_blank>ratio<S2SV_blank>hint<S2SV_blank>(reinit);<S2SV_blank>normal|widescreen" } , { "parallel-n64-filtering" , "Texture<S2SV_blank>Filtering;<S2SV_blank>automatic|N64<S2SV_blank>3-point|bilinear|nearest" } , { "parallel-n64-dithering" , "Dithering;<S2SV_blank>enabled|disabled" } , { "parallel-n64-polyoffset-factor" , "(Glide64)<S2SV_blank>Polygon<S2SV_blank>Offset<S2SV_blank>Factor;<S2SV_blank>-3.0|-2.5|-2.0|-1.5|-1.0|-0.5|0.0|0.5|1.0|1.5|2.0|2.5|3.0|3.5|4.0|4.5|5.0|-3.5|-4.0|-4.5|-5.0" } , { "parallel-n64-polyoffset-units" , "(Glide64)<S2SV_blank>Polygon<S2SV_blank>Offset<S2SV_blank>Units;<S2SV_blank>-3.0|-2.5|-2.0|-1.5|-1.0|-0.5|0.0|0.5|1.0|1.5|2.0|2.5|3.0|3.5|4.0|4.5|5.0|-3.5|-4.0|-4.5|-5.0" } , { "parallel-n64-angrylion-vioverlay" , "(Angrylion)<S2SV_blank>VI<S2SV_blank>Overlay;<S2SV_blank>disabled|enabled" } , { "parallel-n64-virefresh" , <S2SV_StartBug> "VI<S2SV_blank>Refresh<S2SV_blank>(Overclock);<S2SV_blank>1500|2200" } , <S2SV_EndBug> { "parallel-n64-bufferswap" , "Buffer<S2SV_blank>Swap;<S2SV_blank>disabled|enabled" } , { "parallel-n64-framerate" , "Framerate<S2SV_blank>(restart);<S2SV_blank>original|fullspeed" } , { "parallel-n64-alt-map" , "Independent<S2SV_blank>C-button<S2SV_blank>Controls;<S2SV_blank>disabled|enabled" } , # ifndef HAVE_PARALLEL { "parallel-n64-vcache-vbo" , "(Glide64)<S2SV_blank>Vertex<S2SV_blank>cache<S2SV_blank>VBO<S2SV_blank>(restart);<S2SV_blank>disabled|enabled" } , # endif { "parallel-n64-boot-device" , "Boot<S2SV_blank>Device;<S2SV_blank>Default|64DD<S2SV_blank>IPL" } , { "parallel-n64-64dd-hardware" , "64DD<S2SV_blank>Hardware;<S2SV_blank>disabled|enabled" } , { NULL , NULL } , } ; static const struct retro_controller_description port [ ] = { { "Controller" , RETRO_DEVICE_JOYPAD } , { "Mouse" , RETRO_DEVICE_MOUSE } , { "RetroPad" , RETRO_DEVICE_JOYPAD } , } ; static const struct retro_controller_info ports [ ] = { { port , 3 } , { port , 3 } , { port , 3 } , { port , 3 } , { 0 , 0 } } ; environ_cb ( RETRO_ENVIRONMENT_SET_VARIABLES , variables ) ; environ_cb ( RETRO_ENVIRONMENT_SET_CONTROLLER_INFO , ( void * ) ports ) ; } | <S2SV_ModStart> { "parallel-n64-virefresh" , "VI<S2SV_blank>Refresh<S2SV_blank>(Overclock);<S2SV_blank>auto|1500|2200" <S2SV_ModEnd> } , { |
4,514 | CWE-000 void exitGame ( ) { deleteBoard ( gameBoard ) ; deleteLinkedList ( gameMoves ) ; free ( filePath ) ; <S2SV_StartBug> printExit ( ) ; <S2SV_EndBug> exit ( 1 ) ; } | <S2SV_ModStart> filePath ) ; free ( commandArray ) ; |
4,515 | CWE-000 int main ( void ) { LINE * TEST = ( LINE * ) malloc ( sizeof ( LINE ) ) ; <S2SV_StartBug> TEST = ReadFile ( "../../doc/test.txt" ) ; <S2SV_EndBug> <S2SV_StartBug> printPara ( 10 , 10 , 10 , 10 , TEST ) ; <S2SV_EndBug> return 0 ; } | <S2SV_ModStart> = ReadFile ( "../../doc/Chap1-printf/printf.txt" <S2SV_ModEnd> ) ; printPara <S2SV_ModStart> , 10 , 30 , 20 <S2SV_ModEnd> , TEST ) |
4,516 | CWE-000 <S2SV_StartBug> void * malloc_pid ( size_t size , pid_t pid ) { <S2SV_EndBug> uint32_t iter = 0 ; struct MemoryHandle * mhand = getAllocatedMemory ( pid , & iter ) ; while ( mhand != NULL ) { void * res = __malloc_pid ( size , mhand ) ; if ( ! res ) { mhand = getAllocatedMemory ( pid , & iter ) ; } else { return res ; } } return NULL ; } | <S2SV_ModStart> pid ) { if ( size < 4 ) { size = 4 ; } |
4,517 | CWE-000 static char * build_output_path ( char * input_path , char * new_extension ) { int file_ext_len = 6 ; if ( input_path [ strlen ( input_path ) - 1 ] == 'z' ) { file_ext_len = 9 ; } size_t basename_len = strlen ( input_path ) - file_ext_len ; <S2SV_StartBug> char * output_path = malloc ( sizeof ( char ) * ( basename_len + strlen ( new_extension ) ) ) ; <S2SV_EndBug> strncpy ( output_path , input_path , basename_len ) ; output_path [ basename_len ] = '\\0' ; strcat ( output_path , new_extension ) ; return output_path ; } | <S2SV_ModStart> ( new_extension ) + 1 |
4,518 | CWE-000 int ft_initread ( char * str , t_env * current ) { int fd ; int index ; char buf [ 42 ] ; index = - 1 ; ft_bzero ( buf , 42 ) ; current -> map = ( int * * ) malloc ( sizeof ( int * * ) * HEIGHT_MAP ) ; if ( 0 > ( fd = open ( str , O_RDONLY ) ) ) ft_check_validread ( buf , fd , current , index + 1 ) ; while ( ( current -> bytes_read = ( read ( fd , & buf , 36 ) ) ) && index ++ != HEIGHT_MAP - 1 ) { if ( ( ft_checkcharacters ( buf ) ) == 0 ) ft_check_validread ( buf , fd , current , index ) ; current -> map [ index ] = ( ( index == 0 || index == HEIGHT_MAP - 1 ) <S2SV_StartBug> ? surround ( buf , WIDTH_MAP ) : parse ( buf , WIDTH_MAP ) ) ; <S2SV_EndBug> if ( ft_strlen ( ft_strstr ( buf , "\\n" ) ) > 1 || current -> bytes_read < 36 ) ft_check_validread ( buf , fd , current , index ) ; ft_bzero ( buf , 42 ) ; } current -> bytes_read = 36 ; ft_check_validread ( buf , fd , current , index ) ; close ( fd ) ; return ( 0 ) ; } | <S2SV_ModStart> ? surround ( <S2SV_ModEnd> WIDTH_MAP ) : |
4,519 | CWE-000 int jdns_packet_name_isvalid ( const unsigned char * name , int size ) { int n , at ; if ( size < 1 || size > ( MAX_LABEL_LENGTH - 1 ) ) return 0 ; if ( name [ size - 1 ] != '.' ) <S2SV_StartBug> return 0 ; <S2SV_EndBug> if ( size > 1 && name [ 0 ] == '.' ) return 0 ; at = 0 ; while ( 1 ) { int len ; for ( n = at ; n < size ; ++ n ) { if ( name [ n ] == '.' ) break ; } if ( n >= size ) break ; len = n - at ; if ( len < 1 || len > MAX_SUBLABEL_LENGTH ) return 0 ; at = n + 1 ; } return 1 ; } | <S2SV_ModStart> ) return 0 ; if ( size == 1 ) return 1 |
4,520 | CWE-000 static void kill_f2fs_super ( struct super_block * sb ) { if ( sb -> s_root ) { struct f2fs_sb_info * sbi = F2FS_SB ( sb ) ; set_sbi_flag ( sbi , SBI_IS_CLOSE ) ; f2fs_stop_gc_thread ( sbi ) ; f2fs_stop_discard_thread ( sbi ) ; if ( is_sbi_flag_set ( sbi , SBI_IS_DIRTY ) || ! is_set_ckpt_flags ( sbi , CP_UMOUNT_FLAG ) ) { struct cp_control cpc = { . reason = CP_UMOUNT , } ; f2fs_write_checkpoint ( sbi , & cpc ) ; } <S2SV_StartBug> } <S2SV_EndBug> kill_block_super ( sb ) ; } | <S2SV_ModStart> ) ; } if ( is_sbi_flag_set ( sbi , SBI_IS_RECOVERED ) && f2fs_readonly ( sb ) ) sb -> s_flags &= ~ SB_RDONLY ; |
4,521 | CWE-000 int semanage_mkdir ( semanage_handle_t * sh , const char * path ) { int status = 0 ; struct stat sb ; <S2SV_StartBug> if ( stat ( path , & sb ) != 0 ) { <S2SV_EndBug> <S2SV_StartBug> if ( mkdir ( path , S_IRWXU ) != 0 ) { <S2SV_EndBug> ERR ( sh , "Cannot<S2SV_blank>make<S2SV_blank>directory<S2SV_blank>at<S2SV_blank>%s" , path ) ; status = - 1 ; goto cleanup ; <S2SV_StartBug> } <S2SV_EndBug> } else { if ( ! S_ISDIR ( sb . st_mode ) ) { ERR ( sh , "Directory<S2SV_blank>path<S2SV_blank>taken<S2SV_blank>by<S2SV_blank>non-directory<S2SV_blank>file<S2SV_blank>at<S2SV_blank>%s." , path ) ; status = - 1 ; goto cleanup ; } } cleanup : return status ; } | <S2SV_ModStart> stat sb ; mode_t mask ; <S2SV_ModStart> 0 ) { mask = umask ( 0077 ) ; <S2SV_ModStart> 0 ) { umask ( mask ) ; <S2SV_ModStart> cleanup ; } umask ( mask ) ; |
4,522 | CWE-000 static void psci_set_req_local_pwr_state ( unsigned int pwrlvl , unsigned int cpu_idx , plat_local_state_t req_pwr_state ) { assert ( pwrlvl > PSCI_CPU_PWR_LVL ) ; <S2SV_StartBug> psci_req_local_pwr_states [ pwrlvl - 1 ] [ cpu_idx ] = req_pwr_state ; <S2SV_EndBug> <S2SV_StartBug> } <S2SV_EndBug> | <S2SV_ModStart> PSCI_CPU_PWR_LVL ) ; # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Warray-bounds" <S2SV_ModStart> = req_pwr_state ; # pragma GCC diagnostic pop |
4,523 | CWE-000 NEOERR * test_log_message ( ) { NEOERR * err ; HDF * hdf ; int fd_stderr ; FILE * ftmp ; int i ; char * cmd_list [ ] = { "<?cs<S2SV_blank>var:<S2SV_blank>Title<S2SV_blank>?>\\n" , "<?cs<S2SV_blank>include:<S2SV_blank>\'test_include.cs\'<S2SV_blank>?>\\n" , "<?cs<S2SV_blank>var:<S2SV_blank>Title<S2SV_blank>?>\\n" , "<?cs<S2SV_blank>linclude:<S2SV_blank>\'test_include.cs\'<S2SV_blank>?>\\n" , "<?cs<S2SV_blank>lvar:<S2SV_blank>csvar<S2SV_blank>?>\\n" , "<?cs<S2SV_blank>var:<S2SV_blank>Title<S2SV_blank>?>\\n" , } ; char * msg_list [ ] = { "tmp_auto.cs]:<S2SV_blank>Auto-escape<S2SV_blank>changed<S2SV_blank>variable<S2SV_blank>[<S2SV_blank>Title<S2SV_blank>]<S2SV_blank>from" "<S2SV_blank>[</title><script>alert(1)</script>]<S2SV_blank>to" "<S2SV_blank>[</title><script>alert(1)</script>]" , "test_include.cs]:<S2SV_blank>Auto-escape<S2SV_blank>changed<S2SV_blank>variable<S2SV_blank>[<S2SV_blank>Title<S2SV_blank>]<S2SV_blank>from" "<S2SV_blank>[</title><script>alert(1)</script>]<S2SV_blank>to" "<S2SV_blank>[</title><script>alert(1)</script>]" , "tmp_auto.cs]:<S2SV_blank>Auto-escape<S2SV_blank>changed<S2SV_blank>variable<S2SV_blank>[<S2SV_blank>Title<S2SV_blank>]<S2SV_blank>from" "<S2SV_blank>[</title><script>alert(1)</script>]<S2SV_blank>to" "<S2SV_blank>[</title><script>alert(1)</script>]" , "test_include.cs]:<S2SV_blank>Auto-escape<S2SV_blank>changed<S2SV_blank>variable<S2SV_blank>[<S2SV_blank>Title<S2SV_blank>]<S2SV_blank>from" "<S2SV_blank>[</title><script>alert(1)</script>]<S2SV_blank>to" "<S2SV_blank>[</title><script>alert(1)</script>]" , "csvar]:<S2SV_blank>Auto-escape<S2SV_blank>changed<S2SV_blank>variable<S2SV_blank>[<S2SV_blank>Title<S2SV_blank>]<S2SV_blank>from" "<S2SV_blank>[</title><script>alert(1)</script>]<S2SV_blank>to" "<S2SV_blank>[</title><script>alert(1)</script>]" , "tmp_auto.cs]:<S2SV_blank>Auto-escape<S2SV_blank>changed<S2SV_blank>variable<S2SV_blank>[<S2SV_blank>Title<S2SV_blank>]<S2SV_blank>from" "<S2SV_blank>[</title><script>alert(1)</script>]<S2SV_blank>to" "<S2SV_blank>[</title><script>alert(1)</script>]" , } ; int cmd_list_len = 6 ; char line [ 256 ] ; char tmp_auto_cs [ PATH_MAX ] ; char tmp_auto_out [ PATH_MAX ] ; snprintf ( tmp_auto_cs , sizeof ( tmp_auto_cs ) , "%s/tmp_auto.cs" , get_tmp_path ( ) ) ; snprintf ( tmp_auto_out , sizeof ( tmp_auto_out ) , "%s/tmp_auto.out" , get_tmp_path ( ) ) ; err = create_template ( tmp_auto_cs , cmd_list , cmd_list_len ) ; if ( err ) return nerr_pass ( err ) ; err = hdf_init ( & hdf ) ; if ( err ) return nerr_pass ( err ) ; if ( g_input_path ) { err = hdf_set_value ( hdf , "hdf.loadpaths.0" , g_input_path ) ; if ( err ) return nerr_pass ( err ) ; } err = hdf_read_file ( hdf , "test.hdf" ) ; if ( err ) return nerr_pass ( err ) ; fd_stderr = dup ( fileno ( stderr ) ) ; if ( freopen ( tmp_auto_out , "w" , stderr ) == NULL ) { return nerr_raise_errno ( NERR_IO , "Unable<S2SV_blank>to<S2SV_blank>freopen<S2SV_blank>stderr" ) ; } err = process_template ( hdf , tmp_auto_cs , 1 , 1 ) ; <S2SV_StartBug> if ( err ) return nerr_pass ( err ) ; <S2SV_EndBug> fclose ( stderr ) ; stderr = fdopen ( fd_stderr , "w" ) ; hdf_destroy ( & hdf ) ; ftmp = fopen ( tmp_auto_out , "r" ) ; if ( ! ftmp ) { return nerr_raise_errno ( NERR_IO , "Unable<S2SV_blank>to<S2SV_blank>fopen<S2SV_blank>%s" , tmp_auto_out ) ; } for ( i = 0 ; i < cmd_list_len ; i ++ ) { if ( fgets ( line , sizeof ( line ) , ftmp ) == NULL ) { return nerr_raise_errno ( NERR_IO , "Unable<S2SV_blank>to<S2SV_blank>fgets" ) ; } if ( ends_with ( line , msg_list [ i ] ) ) { return nerr_raise ( NERR_ASSERT , "Did<S2SV_blank>not<S2SV_blank>match:<S2SV_blank>%s<S2SV_blank>:<S2SV_blank>%s<S2SV_blank>\\n" , line , msg_list [ i ] ) ; } } remove ( tmp_auto_out ) ; remove ( tmp_auto_cs ) ; return STATUS_OK ; } | <S2SV_ModStart> 1 ) ; fclose ( stderr ) ; stderr = fdopen ( fd_stderr , "w" ) ; <S2SV_ModStart> nerr_pass ( err <S2SV_ModEnd> ) ; hdf_destroy |
4,524 | CWE-000 void run_key_handler ( const char * key , unsigned int mask ) { pid_t pid ; FILE * pfs ; bool marked = mode == MODE_THUMB && markcnt > 0 ; bool changed = false ; int f , i , pfd [ 2 ] , status ; int fcnt = marked ? markcnt : 1 ; char kstr [ 32 ] ; struct stat * oldst , st ; XEvent dump ; if ( keyhandler . f . err != 0 ) { if ( ! keyhandler . warned ) { error ( 0 , keyhandler . f . err , "%s" , keyhandler . f . cmd ) ; keyhandler . warned = true ; } return ; } if ( key == NULL ) return ; if ( pipe ( pfd ) < 0 ) { error ( 0 , errno , "pipe" ) ; return ; } if ( ( pfs = fdopen ( pfd [ 1 ] , "w" ) ) == NULL ) { error ( 0 , errno , "open<S2SV_blank>pipe" ) ; close ( pfd [ 0 ] ) , close ( pfd [ 1 ] ) ; return ; } oldst = emalloc ( fcnt * sizeof ( * oldst ) ) ; strncpy ( win . bar . l . buf , "Running<S2SV_blank>key<S2SV_blank>handler..." , win . bar . l . size ) ; win_draw ( & win ) ; win_set_cursor ( & win , CURSOR_WATCH ) ; snprintf ( kstr , sizeof ( kstr ) , "%s%s%s%s" , mask & ControlMask ? "C-" : "" , mask & Mod1Mask ? "M-" : "" , mask & ShiftMask ? "S-" : "" , key ) ; if ( ( pid = fork ( ) ) == 0 ) { close ( pfd [ 1 ] ) ; dup2 ( pfd [ 0 ] , 0 ) ; execl ( keyhandler . f . cmd , keyhandler . f . cmd , kstr , NULL ) ; error ( EXIT_FAILURE , errno , "exec:<S2SV_blank>%s" , keyhandler . f . cmd ) ; } close ( pfd [ 0 ] ) ; if ( pid < 0 ) { error ( 0 , errno , "fork" ) ; fclose ( pfs ) ; goto end ; } for ( f = i = 0 ; f < fcnt ; i ++ ) { if ( ( marked && ( files [ i ] . flags & FF_MARK ) ) || ( ! marked && i == fileidx ) ) { stat ( files [ i ] . path , & oldst [ f ] ) ; <S2SV_StartBug> fprintf ( pfs , "%s\\n" , files [ i ] . path ) ; <S2SV_EndBug> f ++ ; } } fclose ( pfs ) ; waitpid ( pid , & status , 0 ) ; if ( ! WIFEXITED ( status ) || WEXITSTATUS ( status ) != 0 ) error ( 0 , 0 , "%s:<S2SV_blank>Exited<S2SV_blank>abnormally" , keyhandler . f . cmd ) ; for ( f = i = 0 ; f < fcnt ; i ++ ) { if ( ( marked && ( files [ i ] . flags & FF_MARK ) ) || ( ! marked && i == fileidx ) ) { if ( stat ( files [ i ] . path , & st ) != 0 || memcmp ( & oldst [ f ] . st_mtime , & st . st_mtime , sizeof ( st . st_mtime ) ) != 0 ) { if ( tns . thumbs != NULL ) { tns_unload ( & tns , i ) ; tns . loadnext = MIN ( tns . loadnext , i ) ; } changed = true ; } f ++ ; } } while ( XCheckIfEvent ( win . env . dpy , & dump , is_input_ev , NULL ) ) ; end : if ( mode == MODE_IMAGE ) { if ( changed ) { img_close ( & img , true ) ; load_image ( fileidx ) ; } else if ( info . f . err == 0 ) { info . open = false ; open_info ( ) ; } } free ( oldst ) ; reset_cursor ( ) ; redraw ( ) ; } | <S2SV_ModStart> i ] . name <S2SV_ModEnd> ) ; f |
4,525 | CWE-000 int __fxstat ( int ver , int socket , struct stat * buf ) { int fd , ret ; init_preload ( ) ; if ( fd_get ( socket , & fd ) == fd_rsocket ) { ret = real . fxstat ( ver , socket , buf ) ; if ( ! ret ) <S2SV_StartBug> buf -> st_mode = ( buf -> st_mode & ~ S_IFMT ) | __S_IFSOCK ; <S2SV_EndBug> } else { ret = real . fxstat ( ver , fd , buf ) ; } return ret ; } | <S2SV_ModStart> S_IFMT ) | S_IFSOCK <S2SV_ModEnd> ; } else |
4,526 | CWE-000 static int inet_pton6 ( const char * src , unsigned char * dst ) { static const char xdigits_l [ ] = "0123456789abcdef" , xdigits_u [ ] = "0123456789ABCDEF" ; <S2SV_StartBug> unsigned char tmp [ IN6ADDRSZ ] , * tp , * endp , * colonp ; <S2SV_EndBug> const char * xdigits , * curtok ; int ch , saw_xdigit ; size_t val ; <S2SV_StartBug> memset ( ( tp = tmp ) , 0 , IN6ADDRSZ ) ; <S2SV_EndBug> <S2SV_StartBug> endp = tp + IN6ADDRSZ ; <S2SV_EndBug> colonp = NULL ; if ( * src == ':' ) if ( * ++ src != ':' ) return ( 0 ) ; curtok = src ; saw_xdigit = 0 ; val = 0 ; while ( ( ch = * src ++ ) != '\\0' ) { const char * pch ; pch = strchr ( ( xdigits = xdigits_l ) , ch ) ; if ( ! pch ) pch = strchr ( ( xdigits = xdigits_u ) , ch ) ; if ( pch != NULL ) { val <<= 4 ; val |= ( pch - xdigits ) ; if ( ++ saw_xdigit > 4 ) return ( 0 ) ; continue ; } if ( ch == ':' ) { curtok = src ; if ( ! saw_xdigit ) { if ( colonp ) return ( 0 ) ; colonp = tp ; continue ; } <S2SV_StartBug> if ( tp + INT16SZ > endp ) <S2SV_EndBug> return ( 0 ) ; * tp ++ = ( unsigned char ) ( ( val >> 8 ) & 0xff ) ; * tp ++ = ( unsigned char ) ( val & 0xff ) ; saw_xdigit = 0 ; val = 0 ; continue ; } <S2SV_StartBug> if ( ch == '.' && ( ( tp + INADDRSZ ) <= endp ) && <S2SV_EndBug> inet_pton4 ( curtok , tp ) > 0 ) { <S2SV_StartBug> tp += INADDRSZ ; <S2SV_EndBug> saw_xdigit = 0 ; break ; } return ( 0 ) ; } if ( saw_xdigit ) { <S2SV_StartBug> if ( tp + INT16SZ > endp ) <S2SV_EndBug> return ( 0 ) ; * tp ++ = ( unsigned char ) ( ( val >> 8 ) & 0xff ) ; * tp ++ = ( unsigned char ) ( val & 0xff ) ; } if ( colonp != NULL ) { const ssize_t n = tp - colonp ; ssize_t i ; if ( tp == endp ) return ( 0 ) ; for ( i = 1 ; i <= n ; i ++ ) { * ( endp - i ) = * ( colonp + n - i ) ; * ( colonp + n - i ) = 0 ; } tp = endp ; } if ( tp != endp ) return ( 0 ) ; <S2SV_StartBug> memcpy ( dst , tmp , IN6ADDRSZ ) ; <S2SV_EndBug> return ( 1 ) ; } | <S2SV_ModStart> char tmp [ INT6ADDRSZ <S2SV_ModEnd> ] , * <S2SV_ModStart> , 0 , INT6ADDRSZ <S2SV_ModEnd> ) ; endp <S2SV_ModStart> = tp + INT6ADDRSZ <S2SV_ModEnd> ; colonp = <S2SV_ModStart> ( tp + INT16SIZE <S2SV_ModEnd> > endp ) <S2SV_ModStart> ( tp + INTADDRSZ <S2SV_ModEnd> ) <= endp <S2SV_ModStart> { tp += INTADDRSZ <S2SV_ModEnd> ; saw_xdigit = <S2SV_ModStart> ( tp + INT16SIZE <S2SV_ModEnd> > endp ) <S2SV_ModStart> , tmp , INT6ADDRSZ <S2SV_ModEnd> ) ; return |
4,527 | CWE-000 static void eval_mk_bv_extract ( tstack_t * stack , stack_elem_t * f , uint32_t n ) { bvlogic_buffer_t * b ; int32_t i , j ; uint32_t size ; i = get_integer ( stack , f ) ; j = get_integer ( stack , f + 1 ) ; size = elem_bitsize ( stack , f + 2 ) ; if ( ! yices_check_bvextract ( size , j , i ) ) { report_yices_error ( stack ) ; } <S2SV_StartBug> if ( i == 0 && j == size - 1 ) { <S2SV_EndBug> copy_result_and_pop_frame ( stack , f + 2 ) ; } else { b = tstack_get_bvlbuffer ( stack ) ; bvl_set_slice_elem ( stack , b , j , i , f + 2 ) ; tstack_pop_frame ( stack ) ; set_bvlogic_result ( stack , b ) ; } } | <S2SV_ModStart> } if ( j <S2SV_ModEnd> == 0 && <S2SV_ModStart> == 0 && i <S2SV_ModEnd> == size - |
4,528 | CWE-000 void ECP2_ZZZ_mul ( ECP2_ZZZ * P , BIG_XXX e ) { int i , nb , s , ns ; BIG_XXX mt , t ; ECP2_ZZZ Q , W [ 8 ] , C ; sign8 w [ 1 + ( NLEN_XXX * BASEBITS_XXX + 3 ) / 4 ] ; if ( ECP2_ZZZ_isinf ( P ) ) return ; <S2SV_StartBug> ECP2_ZZZ_affine ( P ) ; <S2SV_EndBug> ECP2_ZZZ_copy ( & Q , P ) ; ECP2_ZZZ_dbl ( & Q ) ; ECP2_ZZZ_copy ( & W [ 0 ] , P ) ; for ( i = 1 ; i < 8 ; i ++ ) { ECP2_ZZZ_copy ( & W [ i ] , & W [ i - 1 ] ) ; ECP2_ZZZ_add ( & W [ i ] , & Q ) ; } BIG_XXX_copy ( t , e ) ; s = BIG_XXX_parity ( t ) ; BIG_XXX_inc ( t , 1 ) ; BIG_XXX_norm ( t ) ; ns = BIG_XXX_parity ( t ) ; BIG_XXX_copy ( mt , t ) ; BIG_XXX_inc ( mt , 1 ) ; BIG_XXX_norm ( mt ) ; BIG_XXX_cmove ( t , mt , s ) ; ECP2_ZZZ_cmove ( & Q , P , ns ) ; ECP2_ZZZ_copy ( & C , & Q ) ; nb = 1 + ( BIG_XXX_nbits ( t ) + 3 ) / 4 ; for ( i = 0 ; i < nb ; i ++ ) { w [ i ] = BIG_XXX_lastbits ( t , 5 ) - 16 ; BIG_XXX_dec ( t , w [ i ] ) ; BIG_XXX_norm ( t ) ; BIG_XXX_fshr ( t , 4 ) ; } w [ nb ] = BIG_XXX_lastbits ( t , 5 ) ; ECP2_ZZZ_copy ( P , & W [ ( w [ nb ] - 1 ) / 2 ] ) ; for ( i = nb - 1 ; i >= 0 ; i -- ) { ECP2_ZZZ_select ( & Q , W , w [ i ] ) ; ECP2_ZZZ_dbl ( P ) ; ECP2_ZZZ_dbl ( P ) ; ECP2_ZZZ_dbl ( P ) ; ECP2_ZZZ_dbl ( P ) ; ECP2_ZZZ_add ( P , & Q ) ; } ECP2_ZZZ_sub ( P , & C ) ; ECP2_ZZZ_affine ( P ) ; } | <S2SV_ModStart> ) return ; <S2SV_ModEnd> ECP2_ZZZ_copy ( & |
4,529 | CWE-000 static void process_ummunotify ( EV_P_ ev_io * w , int revents ) { struct ummunotify_event ev ; int len ; while ( 1 ) { len = read ( global_umn_fd , & ev , sizeof ev ) ; if ( len < 0 || len != sizeof ev ) { <S2SV_StartBug> WARN ( ) ; <S2SV_EndBug> return ; } int i ; for ( i = 0 ; i < global_ni_count ; i ++ ) { ni_t * ni = global_nis [ i ] ; switch ( ev . type ) { case UMMUNOTIFY_EVENT_TYPE_INVAL : { struct mr * mr ; PTL_FASTLOCK_LOCK ( & ni -> mr_app . tree_lock ) ; RB_FOREACH ( mr , the_root , & ni -> mr_app . tree ) { if ( mr -> umn_cookie == ev . user_cookie_counter ) { RB_REMOVE ( the_root , & ni -> mr_app . tree , mr ) ; mr_put ( mr ) ; break ; } } PTL_FASTLOCK_UNLOCK ( & ni -> mr_app . tree_lock ) ; } break ; case UMMUNOTIFY_EVENT_TYPE_LAST : generation_counter = ev . user_cookie_counter ; return ; } } } } | <S2SV_ModStart> ev ) { if ( global_umn_fake != 1 ) |
4,530 | CWE-000 static struct inode * f2fs_new_inode ( struct inode * dir , umode_t mode ) { struct f2fs_sb_info * sbi = F2FS_I_SB ( dir ) ; nid_t ino ; struct inode * inode ; bool nid_free = false ; <S2SV_StartBug> int err ; <S2SV_EndBug> inode = new_inode ( dir -> i_sb ) ; if ( ! inode ) return ERR_PTR ( - ENOMEM ) ; f2fs_lock_op ( sbi ) ; if ( ! alloc_nid ( sbi , & ino ) ) { f2fs_unlock_op ( sbi ) ; err = - ENOSPC ; goto fail ; } f2fs_unlock_op ( sbi ) ; nid_free = true ; inode_init_owner ( inode , dir , mode ) ; inode -> i_ino = ino ; inode -> i_blocks = 0 ; inode -> i_mtime = inode -> i_atime = inode -> i_ctime = current_time ( inode ) ; inode -> i_generation = sbi -> s_next_generation ++ ; err = insert_inode_locked ( inode ) ; if ( err ) { err = - EINVAL ; goto fail ; } if ( f2fs_sb_has_project_quota ( sbi -> sb ) && ( F2FS_I ( dir ) -> i_flags & FS_PROJINHERIT_FL ) ) F2FS_I ( inode ) -> i_projid = F2FS_I ( dir ) -> i_projid ; else F2FS_I ( inode ) -> i_projid = make_kprojid ( & init_user_ns , F2FS_DEF_PROJID ) ; err = dquot_initialize ( inode ) ; if ( err ) goto fail_drop ; err = dquot_alloc_inode ( inode ) ; if ( err ) goto fail_drop ; if ( f2fs_encrypted_inode ( dir ) && f2fs_may_encrypt ( inode ) ) f2fs_set_encrypted_inode ( inode ) ; set_inode_flag ( inode , FI_NEW_INODE ) ; if ( f2fs_sb_has_extra_attr ( sbi -> sb ) ) { set_inode_flag ( inode , FI_EXTRA_ATTR ) ; F2FS_I ( inode ) -> i_extra_isize = F2FS_TOTAL_EXTRA_ATTR_SIZE ; } if ( test_opt ( sbi , INLINE_XATTR ) ) set_inode_flag ( inode , FI_INLINE_XATTR ) ; if ( test_opt ( sbi , INLINE_DATA ) && f2fs_may_inline_data ( inode ) ) set_inode_flag ( inode , FI_INLINE_DATA ) ; if ( f2fs_may_inline_dentry ( inode ) ) set_inode_flag ( inode , FI_INLINE_DENTRY ) ; <S2SV_StartBug> f2fs_init_extent_tree ( inode , NULL ) ; <S2SV_EndBug> stat_inc_inline_xattr ( inode ) ; stat_inc_inline_inode ( inode ) ; stat_inc_inline_dir ( inode ) ; F2FS_I ( inode ) -> i_flags = f2fs_mask_flags ( mode , F2FS_I ( dir ) -> i_flags & F2FS_FL_INHERITED ) ; if ( S_ISDIR ( inode -> i_mode ) ) F2FS_I ( inode ) -> i_flags |= FS_INDEX_FL ; if ( F2FS_I ( inode ) -> i_flags & FS_PROJINHERIT_FL ) set_inode_flag ( inode , FI_PROJ_INHERIT ) ; trace_f2fs_new_inode ( inode , 0 ) ; return inode ; fail : trace_f2fs_new_inode ( inode , err ) ; make_bad_inode ( inode ) ; if ( nid_free ) set_inode_flag ( inode , FI_FREE_NID ) ; iput ( inode ) ; return ERR_PTR ( err ) ; fail_drop : trace_f2fs_new_inode ( inode , err ) ; dquot_drop ( inode ) ; inode -> i_flags |= S_NOQUOTA ; if ( nid_free ) set_inode_flag ( inode , FI_FREE_NID ) ; clear_nlink ( inode ) ; unlock_new_inode ( inode ) ; iput ( inode ) ; return ERR_PTR ( err ) ; } | <S2SV_ModStart> false ; int xattr_size = 0 ; int <S2SV_ModStart> FI_INLINE_DENTRY ) ; if ( f2fs_sb_has_flexible_inline_xattr ( sbi -> sb ) ) { f2fs_bug_on ( sbi , ! f2fs_has_extra_attr ( inode ) ) ; if ( f2fs_has_inline_xattr ( inode ) ) xattr_size = sbi -> inline_xattr_size ; } else if ( f2fs_has_inline_xattr ( inode ) || f2fs_has_inline_dentry ( inode ) ) { xattr_size = DEFAULT_INLINE_XATTR_ADDRS ; } F2FS_I ( inode ) -> i_inline_xattr_size = xattr_size ; |
4,531 | CWE-000 void codificarMensagem ( FILE * arquivo , Imagem img ) { int tamanho_mensagem = tamanhoMensagem ( arquivo ) ; int tamanho_imagem = 3 * img . width * img . height ; usleep ( 800000 ) ; printf ( "Sua<S2SV_blank>mensagem<S2SV_blank>possui<S2SV_blank>%d<S2SV_blank>bytes\\nA<S2SV_blank>imagem<S2SV_blank>utilizada<S2SV_blank>possui<S2SV_blank>%d<S2SV_blank>bytes\\n\\n" , tamanho_mensagem , tamanho_imagem ) ; if ( tamanho_mensagem * 8 > tamanho_imagem ) { <S2SV_StartBug> printf ( "Não<S2SV_blank>é<S2SV_blank>possível<S2SV_blank>inserir<S2SV_blank>a<S2SV_blank>mensagem<S2SV_blank>na<S2SV_blank>imagem.\\nEncerrando<S2SV_blank>o<S2SV_blank>programa...\\n" ) ; <S2SV_EndBug> exit ( 1 ) ; } else { int caracteres_codificados = 0 , contador = 0 ; int caractere_atual , i , j , k ; while ( caracteres_codificados < tamanho_mensagem ) { int * caractere_atual_binario = ( int * ) calloc ( 8 , sizeof ( int ) ) ; caractere_atual = fgetc ( arquivo ) ; if ( caractere_atual == EOF ) <S2SV_StartBug> caractere_atual = 3 ; <S2SV_EndBug> caractere_atual_binario = convertCharParaBinario ( caractere_atual ) ; for ( i = 0 ; i < 8 ; i ++ ) { int * pixel_binario = ( int * ) calloc ( 8 , sizeof ( int ) ) ; pixel_binario = convertCharParaBinario ( img . pixel [ contador ] ) ; if ( pixel_binario [ 7 ] != caractere_atual_binario [ i ] ) { pixel_binario [ 7 ] = caractere_atual_binario [ i ] ; img . pixel [ contador ] = convertBinarioParaDecimal ( pixel_binario ) ; } free ( pixel_binario ) ; contador ++ ; } free ( caractere_atual_binario ) ; caracteres_codificados ++ ; } <S2SV_StartBug> } <S2SV_EndBug> criarImagemCodificada ( img ) ; } | <S2SV_ModStart> tamanho_imagem ) { fprintf ( stderr , <S2SV_ModEnd> "Não<S2SV_blank>é<S2SV_blank>possível<S2SV_blank>inserir<S2SV_blank>a<S2SV_blank>mensagem<S2SV_blank>na<S2SV_blank>imagem.\\nEncerrando<S2SV_blank>o<S2SV_blank>programa...\\n" ) ; <S2SV_ModStart> ) caractere_atual = 0 <S2SV_ModEnd> ; caractere_atual_binario = <S2SV_ModStart> ++ ; } for ( i = 0 ; i < 8 ; i ++ ) { int * pixel_binario = ( int * ) calloc ( 8 , sizeof ( int ) ) ; pixel_binario = convertCharParaBinario ( img . pixel [ contador ] ) ; pixel_binario [ 7 ] = 0 ; img . pixel [ contador ] = convertBinarioParaDecimal ( pixel_binario ) ; free ( pixel_binario ) ; contador ++ ; } |
4,532 | CWE-000 static void sbus_opath_hash_delete_cb ( hash_entry_t * item , hash_destroy_enum deltype , void * pvt ) { struct sbus_connection * conn ; char * path ; conn = talloc_get_type ( pvt , struct sbus_connection ) ; path = sbus_opath_get_base_path ( NULL , item -> key . str ) ; <S2SV_StartBug> dbus_connection_unregister_object_path ( conn -> dbus . conn , path ) ; <S2SV_EndBug> <S2SV_StartBug> } <S2SV_EndBug> | <S2SV_ModStart> str ) ; if ( conn -> dbus . conn != NULL ) { <S2SV_ModStart> ) ; } } |
4,533 | CWE-000 static int port_parameter_get ( struct vchiq_mmal_instance * instance , struct vchiq_mmal_port * port , u32 parameter_id , void * value , u32 * value_size ) { int ret ; struct mmal_msg m ; struct mmal_msg * rmsg ; VCHI_HELD_MSG_T rmsg_handle ; m . h . type = MMAL_MSG_TYPE_PORT_PARAMETER_GET ; m . u . port_parameter_get . component_handle = port -> component -> handle ; m . u . port_parameter_get . port_handle = port -> handle ; m . u . port_parameter_get . id = parameter_id ; m . u . port_parameter_get . size = ( 2 * sizeof ( u32 ) ) + * value_size ; ret = send_synchronous_mmal_msg ( instance , & m , sizeof ( struct mmal_msg_port_parameter_get ) , & rmsg , & rmsg_handle ) ; if ( ret ) return ret ; if ( rmsg -> h . type != MMAL_MSG_TYPE_PORT_PARAMETER_GET ) { pr_err ( "Incorrect<S2SV_blank>reply<S2SV_blank>type<S2SV_blank>%d\\n" , rmsg -> h . type ) ; ret = - EINVAL ; goto release_msg ; } ret = - rmsg -> u . port_parameter_get_reply . status ; <S2SV_StartBug> if ( ret ) { <S2SV_EndBug> memcpy ( value , & rmsg -> u . port_parameter_get_reply . value , * value_size ) ; * value_size = rmsg -> u . port_parameter_get_reply . size ; } else memcpy ( value , & rmsg -> u . port_parameter_get_reply . value , rmsg -> u . port_parameter_get_reply . size ) ; pr_debug ( "%s:result:%d<S2SV_blank>component:0x%x<S2SV_blank>port:%d<S2SV_blank>parameter:%d\\n" , __func__ , ret , port -> component -> handle , port -> handle , parameter_id ) ; release_msg : vchi_held_msg_release ( & rmsg_handle ) ; return ret ; } | <S2SV_ModStart> . status ; rmsg -> u . port_parameter_get_reply . size -= ( 2 * sizeof ( u32 ) ) ; <S2SV_ModStart> if ( ret || rmsg -> u . port_parameter_get_reply . size > * value_size |
4,534 | CWE-000 static tANI_S32 hdd_ProcessGENIE ( hdd_adapter_t * pAdapter , struct ether_addr * pBssid , eCsrEncryptionType * pEncryptType , eCsrEncryptionType * mcEncryptType , eCsrAuthType * pAuthType , # ifdef WLAN_FEATURE_11W u_int8_t * pMfpRequired , u_int8_t * pMfpCapable , # endif u_int16_t gen_ie_len , u_int8_t * gen_ie ) { tHalHandle halHandle = WLAN_HDD_GET_HAL_CTX ( pAdapter ) ; eHalStatus result ; tDot11fIERSN dot11RSNIE ; tDot11fIEWPA dot11WPAIE ; tANI_U32 i ; <S2SV_StartBug> tANI_U8 * pRsnIe ; <S2SV_EndBug> tANI_U16 RSNIeLen ; tPmkidCacheInfo PMKIDCache [ 4 ] ; v_BOOL_t updatePMKCache = FALSE ; memset ( & dot11WPAIE , 0 , sizeof ( tDot11fIEWPA ) ) ; memset ( & dot11RSNIE , 0 , sizeof ( tDot11fIERSN ) ) ; if ( gen_ie [ 0 ] == DOT11F_EID_RSN ) { if ( ( gen_ie_len < DOT11F_IE_RSN_MIN_LEN ) || ( gen_ie_len > DOT11F_IE_RSN_MAX_LEN ) ) { hddLog ( LOGE , "%s:<S2SV_blank>Invalid<S2SV_blank>DOT11F<S2SV_blank>RSN<S2SV_blank>IE<S2SV_blank>length<S2SV_blank>:%d\\n" , __func__ , gen_ie_len ) ; return - EINVAL ; } pRsnIe = gen_ie + 2 ; RSNIeLen = gen_ie_len - 2 ; <S2SV_StartBug> dot11fUnpackIeRSN ( ( tpAniSirGlobal ) halHandle , <S2SV_EndBug> pRsnIe , RSNIeLen , <S2SV_StartBug> & dot11RSNIE ) ; <S2SV_EndBug> hddLog ( LOG1 , FL ( "%s:<S2SV_blank>pairwise<S2SV_blank>cipher<S2SV_blank>suite<S2SV_blank>count:<S2SV_blank>%d" ) , __func__ , dot11RSNIE . pwise_cipher_suite_count ) ; hddLog ( LOG1 , FL ( "%s:<S2SV_blank>authentication<S2SV_blank>suite<S2SV_blank>count:<S2SV_blank>%d" ) , __func__ , dot11RSNIE . akm_suite_count ) ; * pAuthType = hdd_TranslateRSNToCsrAuthType ( dot11RSNIE . akm_suites [ 0 ] ) ; * pEncryptType = hdd_TranslateRSNToCsrEncryptionType ( dot11RSNIE . pwise_cipher_suites [ 0 ] ) ; * mcEncryptType = hdd_TranslateRSNToCsrEncryptionType ( dot11RSNIE . gp_cipher_suite ) ; # ifdef WLAN_FEATURE_11W * pMfpRequired = ( dot11RSNIE . RSN_Cap [ 0 ] >> 6 ) & 0x1 ; * pMfpCapable = ( dot11RSNIE . RSN_Cap [ 0 ] >> 7 ) & 0x1 ; # endif for ( i = 0 ; i < dot11RSNIE . pmkid_count ; i ++ ) { if ( pBssid == NULL ) { hddLog ( LOGE , "%s:<S2SV_blank>pBssid<S2SV_blank>passed<S2SV_blank>is<S2SV_blank>NULL" , __func__ ) ; break ; } if ( hdd_IsMACAddrNULL ( ( u_char * ) pBssid -> ether_addr_octet , 6 ) ) { hddLog ( LOGE , "%s:<S2SV_blank>Invalid<S2SV_blank>MAC<S2SV_blank>adrr" , __func__ ) ; break ; } updatePMKCache = TRUE ; vos_mem_copy ( PMKIDCache [ i ] . BSSID , pBssid , ETHER_ADDR_LEN ) ; vos_mem_copy ( PMKIDCache [ i ] . PMKID , dot11RSNIE . pmkid [ i ] , CSR_RSN_PMKID_SIZE ) ; } if ( updatePMKCache ) { hddLog ( LOG1 , FL ( "%s:<S2SV_blank>Calling<S2SV_blank>csrRoamSetPMKIDCache<S2SV_blank>with<S2SV_blank>cache<S2SV_blank>entry<S2SV_blank>%d." ) , __func__ , i ) ; result = sme_RoamSetPMKIDCache ( halHandle , pAdapter -> sessionId , PMKIDCache , dot11RSNIE . pmkid_count , FALSE ) ; } } else if ( gen_ie [ 0 ] == DOT11F_EID_WPA ) { if ( ( gen_ie_len < DOT11F_IE_WPA_MIN_LEN ) || ( gen_ie_len > DOT11F_IE_WPA_MAX_LEN ) ) { hddLog ( LOGE , "%s:<S2SV_blank>Invalid<S2SV_blank>DOT11F<S2SV_blank>WPA<S2SV_blank>IE<S2SV_blank>length<S2SV_blank>:%d\\n" , __func__ , gen_ie_len ) ; return - EINVAL ; } pRsnIe = gen_ie + 2 + 4 ; RSNIeLen = gen_ie_len - ( 2 + 4 ) ; dot11fUnpackIeWPA ( ( tpAniSirGlobal ) halHandle , pRsnIe , RSNIeLen , & dot11WPAIE ) ; hddLog ( LOG1 , FL ( "%s:<S2SV_blank>WPA<S2SV_blank>unicast<S2SV_blank>cipher<S2SV_blank>suite<S2SV_blank>count:<S2SV_blank>%d" ) , __func__ , dot11WPAIE . unicast_cipher_count ) ; hddLog ( LOG1 , FL ( "%s:<S2SV_blank>WPA<S2SV_blank>authentication<S2SV_blank>suite<S2SV_blank>count:<S2SV_blank>%d" ) , __func__ , dot11WPAIE . auth_suite_count ) ; * pAuthType = hdd_TranslateWPAToCsrAuthType ( dot11WPAIE . auth_suites [ 0 ] ) ; * pEncryptType = hdd_TranslateWPAToCsrEncryptionType ( dot11WPAIE . unicast_ciphers [ 0 ] ) ; * mcEncryptType = hdd_TranslateWPAToCsrEncryptionType ( dot11WPAIE . multicast_cipher ) ; } else { hddLog ( LOGW , FL ( "gen_ie[0]:<S2SV_blank>%d" ) , gen_ie [ 0 ] ) ; return - EINVAL ; } return 0 ; } | <S2SV_ModStart> tANI_U32 i ; tANI_U32 status ; <S2SV_ModStart> - 2 ; status = <S2SV_ModStart> dot11RSNIE ) ; if ( DOT11F_FAILED ( status ) ) { hddLog ( LOGE , FL ( "Parse<S2SV_blank>failure<S2SV_blank>in<S2SV_blank>hdd_ProcessGENIE<S2SV_blank>(0x%08x)" ) , status ) ; return - EINVAL ; } |
4,535 | CWE-000 void core_mmu_get_user_va_range ( vaddr_t * base , size_t * size ) { <S2SV_StartBug> assert ( user_va_idx != - 1 ) ; <S2SV_EndBug> <S2SV_StartBug> if ( base ) <S2SV_EndBug> <S2SV_StartBug> * base = ( vaddr_t ) user_va_idx << L1_XLAT_ADDRESS_SHIFT ; <S2SV_EndBug> if ( size ) * size = 1 << L1_XLAT_ADDRESS_SHIFT ; } | <S2SV_ModStart> { assert ( first_free_user_va_idx <S2SV_ModEnd> != - 1 <S2SV_ModStart> if ( base && ! * base ) { uint32_t rnd ; int idx = first_free_user_va_idx ; rng_generate ( & rnd , sizeof ( rnd ) ) ; idx = idx + rnd % ( last_free_user_va_idx - first_free_user_va_idx + 1 ) ; <S2SV_ModEnd> * base = <S2SV_ModStart> ( vaddr_t ) idx <S2SV_ModEnd> << L1_XLAT_ADDRESS_SHIFT ; <S2SV_ModStart> << L1_XLAT_ADDRESS_SHIFT ; DMSG ( "generated<S2SV_blank>new<S2SV_blank>user<S2SV_blank>VA<S2SV_blank>base<S2SV_blank>%10lx" , * base ) ; } |
4,536 | CWE-000 static int mem_cgroup_resize_limit ( struct mem_cgroup * memcg , unsigned long long val ) { int retry_count ; u64 memswlimit , memlimit ; int ret = 0 ; int children = mem_cgroup_count_children ( memcg ) ; u64 curusage , oldusage ; int enlarge ; retry_count = MEM_CGROUP_RECLAIM_RETRIES * children ; oldusage = res_counter_read_u64 ( & memcg -> res , RES_USAGE ) ; enlarge = 0 ; while ( retry_count ) { if ( signal_pending ( current ) ) { ret = - EINTR ; break ; } mutex_lock ( & set_limit_mutex ) ; memswlimit = res_counter_read_u64 ( & memcg -> memsw , RES_LIMIT ) ; if ( memswlimit < val ) { ret = - EINVAL ; mutex_unlock ( & set_limit_mutex ) ; break ; } memlimit = res_counter_read_u64 ( & memcg -> res , RES_LIMIT ) ; if ( memlimit < val ) enlarge = 1 ; ret = res_counter_set_limit ( & memcg -> res , val ) ; if ( ! ret ) { if ( memswlimit == val ) memcg -> memsw_is_minimum = true ; else memcg -> memsw_is_minimum = false ; } mutex_unlock ( & set_limit_mutex ) ; <S2SV_StartBug> if ( ! ret ) <S2SV_EndBug> break ; mem_cgroup_reclaim ( memcg , GFP_KERNEL , MEM_CGROUP_RECLAIM_SHRINK ) ; curusage = res_counter_read_u64 ( & memcg -> res , RES_USAGE ) ; if ( curusage >= oldusage ) retry_count -- ; else oldusage = curusage ; } if ( ! ret && enlarge ) memcg_oom_recover ( memcg ) ; return ret ; } | <S2SV_ModStart> ! ret ) { vmpressure_update_mem_limit ( memcg , val ) ; break ; } <S2SV_ModEnd> mem_cgroup_reclaim ( memcg |
4,537 | CWE-000 <S2SV_StartBug> DEFUN ( interface_ip_pim_hello , <S2SV_EndBug> interface_ip_pim_hello_cmd , "ip<S2SV_blank>pim<S2SV_blank>hello<S2SV_blank>(1-180)<S2SV_blank>[(1-180)]" , IP_STR PIM_STR <S2SV_StartBug> IFACE_PIM_HELLO_STR <S2SV_EndBug> IFACE_PIM_HELLO_TIME_STR IFACE_PIM_HELLO_HOLD_STR ) { VTY_DECLVAR_CONTEXT ( interface , ifp ) ; <S2SV_StartBug> int idx_time = 3 ; <S2SV_EndBug> int idx_hold = 4 ; struct pim_interface * pim_ifp ; pim_ifp = ifp -> info ; <S2SV_StartBug> if ( ! pim_ifp ) { <S2SV_EndBug> <S2SV_StartBug> vty_out ( vty , "Pim<S2SV_blank>not<S2SV_blank>enabled<S2SV_blank>on<S2SV_blank>this<S2SV_blank>interface%s" , VTY_NEWLINE ) ; <S2SV_EndBug> return CMD_WARNING ; } <S2SV_StartBug> pim_ifp -> pim_hello_period = strtol ( argv [ idx_time ] -> arg , NULL , 10 ) ; <S2SV_EndBug> if ( argc == idx_hold ) pim_ifp -> pim_default_holdtime = strtol ( argv [ idx_hold ] -> arg , NULL , 10 ) ; return CMD_SUCCESS ; } | <S2SV_ModStart> <S2SV_null> DEFUN ( interface_ip_pim_sm , interface_ip_pim_sm_cmd , "ip<S2SV_blank>pim<S2SV_blank>sm" <S2SV_ModEnd> , IP_STR PIM_STR <S2SV_ModStart> , IP_STR PIM_STR IFACE_PIM_SM_STR <S2SV_ModEnd> ) { VTY_DECLVAR_CONTEXT <S2SV_ModStart> ifp ) ; <S2SV_ModEnd> if ( ! <S2SV_ModStart> if ( ! pim_cmd_interface_add ( ifp ) <S2SV_ModEnd> ) { vty_out <S2SV_ModStart> ( vty , "Could<S2SV_blank>not<S2SV_blank>enable<S2SV_blank>PIM<S2SV_blank>SM<S2SV_blank>on<S2SV_blank>interface%s" <S2SV_ModEnd> , VTY_NEWLINE ) <S2SV_ModStart> CMD_WARNING ; } pim_if_create_pimreg ( <S2SV_ModEnd> ) ; return |
4,538 | CWE-000 BitcoinResult Bitcoin_WriteAllOutput ( struct BitcoinTool * self ) { FILE * file = stdout ; struct OutputFormatString { enum OutputFormat output_format ; char * name ; } output_formats [ ] = { { OUTPUT_FORMAT_HEX , "hex" } , { OUTPUT_FORMAT_BASE58 , "base58" } , { OUTPUT_FORMAT_BASE58CHECK , "base58check" } } , * output_format = NULL ; struct OutputTypeString { enum OutputType output_type ; char * name ; int is_set ; } output_types [ ] = { <S2SV_StartBug> { OUTPUT_TYPE_ADDRESS , "address" } , <S2SV_EndBug> { OUTPUT_TYPE_PUBLIC_KEY_RIPEMD160 , "public-key-ripemd160" } , { OUTPUT_TYPE_PUBLIC_KEY_SHA256 , "public-key-sha256" } , { OUTPUT_TYPE_PUBLIC_KEY , "public-key" } , { OUTPUT_TYPE_PRIVATE_KEY_WIF , "private-key-wif" } , { OUTPUT_TYPE_PRIVATE_KEY , "private-key" } } , * output_type = NULL ; for ( output_type = output_types ; output_type != output_types + ( sizeof ( output_types ) / sizeof ( output_types [ 0 ] ) ) ; output_type ++ ) { for ( output_format = output_formats ; output_format != output_formats + ( sizeof ( output_formats ) / sizeof ( output_formats [ 0 ] ) ) ; output_format ++ ) { if ( <S2SV_StartBug> ( output_type -> output_type == OUTPUT_TYPE_ADDRESS && self -> address_set ) || <S2SV_EndBug> ( output_type -> output_type == OUTPUT_TYPE_PUBLIC_KEY_RIPEMD160 && self -> public_key_ripemd160_set ) || ( output_type -> output_type == OUTPUT_TYPE_PUBLIC_KEY_SHA256 && self -> public_key_sha256_set ) || ( output_type -> output_type == OUTPUT_TYPE_PUBLIC_KEY && self -> public_key_set ) || ( output_type -> output_type == OUTPUT_TYPE_PRIVATE_KEY_WIF && self -> private_key_wif_set ) || ( output_type -> output_type == OUTPUT_TYPE_PRIVATE_KEY && self -> private_key_set ) ) { self -> options . output_type = output_type -> output_type ; self -> options . output_format = output_format -> output_format ; fprintf ( file , "%s.%s:" , output_type -> name , output_format -> name ) ; Bitcoin_WriteOutput ( self ) ; } } } return BITCOIN_SUCCESS ; } | <S2SV_ModStart> OUTPUT_TYPE_ADDRESS , "address" } , { OUTPUT_TYPE_ADDRESS_CHECKSUM , "address-checksum" <S2SV_ModStart> { if ( output_type -> output_type == OUTPUT_TYPE_ADDRESS_CHECKSUM && output_format -> output_format == OUTPUT_FORMAT_BASE58CHECK ) { continue ; } if ( <S2SV_ModStart> output_type == OUTPUT_TYPE_ADDRESS && self -> address_set ) || ( output_type -> output_type == OUTPUT_TYPE_ADDRESS_CHECKSUM |
4,539 | CWE-000 static int handle_ept_violation ( struct kvm_vcpu * vcpu ) { unsigned long exit_qualification ; gpa_t gpa ; u64 error_code ; exit_qualification = vmcs_readl ( EXIT_QUALIFICATION ) ; <S2SV_StartBug> if ( ! ( to_vmx ( vcpu ) -> idt_vectoring_info & VECTORING_INFO_VALID_MASK ) && <S2SV_EndBug> ( exit_qualification & INTR_INFO_UNBLOCK_NMI ) ) vmcs_set_bits ( GUEST_INTERRUPTIBILITY_INFO , GUEST_INTR_STATE_NMI ) ; gpa = vmcs_read64 ( GUEST_PHYSICAL_ADDRESS ) ; trace_kvm_page_fault ( gpa , exit_qualification ) ; error_code = ( exit_qualification & EPT_VIOLATION_ACC_READ ) ? PFERR_USER_MASK : 0 ; error_code |= ( exit_qualification & EPT_VIOLATION_ACC_WRITE ) ? PFERR_WRITE_MASK : 0 ; error_code |= ( exit_qualification & EPT_VIOLATION_ACC_INSTR ) ? PFERR_FETCH_MASK : 0 ; error_code |= ( exit_qualification & ( EPT_VIOLATION_READABLE | EPT_VIOLATION_WRITABLE | EPT_VIOLATION_EXECUTABLE ) ) ? PFERR_PRESENT_MASK : 0 ; error_code |= ( exit_qualification & 0x100 ) != 0 ? PFERR_GUEST_FINAL_MASK : PFERR_GUEST_PAGE_MASK ; vcpu -> arch . exit_qualification = exit_qualification ; return kvm_mmu_page_fault ( vcpu , gpa , error_code , NULL , 0 ) ; } | <S2SV_ModStart> & VECTORING_INFO_VALID_MASK ) && enable_vnmi |
4,540 | CWE-000 int callback_hutch_safe_get_list ( const struct _u_request * request , struct _u_response * response , void * user_data ) { struct config_elements * config = ( struct config_elements * ) user_data ; json_t * j_token = access_token_get ( config -> glewlwyd_client_config , u_map_get ( request -> map_header , AUTHORIZATION_HEADER ) ) , * j_safe ; if ( check_result_value ( j_token , G_OK ) ) { j_safe = safe_get_list ( config , json_string_value ( json_object_get ( json_object_get ( j_token , "grants" ) , "username" ) ) ) ; if ( check_result_value ( j_safe , HU_OK ) ) { <S2SV_StartBug> } else { <S2SV_EndBug> y_log_message ( Y_LOG_LEVEL_ERROR , "callback_hutch_safe_get_list<S2SV_blank>-<S2SV_blank>Error<S2SV_blank>getting<S2SV_blank>safe" ) ; } json_decref ( j_safe ) ; } json_decref ( j_token ) ; return U_OK ; } | <S2SV_ModStart> ) ) { response -> json_body = json_copy ( json_object_get ( j_safe , "safe" ) ) ; <S2SV_ModStart> } else { response -> status = 500 ; |
4,541 | CWE-000 int main ( int argc , char * * argv ) { OSAlarm periodicAlarm ; OSCreateAlarmEx ( & periodicAlarm , "PeriodicAlarm" ) ; OSSetPeriodicAlarm ( & periodicAlarm , OSGetTime ( ) + OSMillisecondsToTicks ( 50 ) , OSMillisecondsToTicks ( 50 ) , & PeriodicAlarmHandler ) ; test_assert ( OSGetCoreId ( ) == 1 ) ; <S2SV_StartBug> OSThread * threadCore0 = OSGetDefaultThread ( 0 ) ; <S2SV_EndBug> <S2SV_StartBug> OSRunThread ( threadCore0 , CoreEntryPoint0 , 0 , NULL ) ; <S2SV_EndBug> OSThread * threadCore2 = OSGetDefaultThread ( 2 ) ; <S2SV_StartBug> OSRunThread ( threadCore2 , CoreEntryPoint2 , 2 , NULL ) ; <S2SV_EndBug> int resultCore0 = - 1 , resultCore2 = - 1 ; <S2SV_StartBug> OSJoinThread ( threadCore0 , & resultCore0 ) ; <S2SV_EndBug> <S2SV_StartBug> OSJoinThread ( threadCore2 , & resultCore2 ) ; <S2SV_EndBug> OSCancelAlarm ( & periodicAlarm ) ; test_report ( "Core<S2SV_blank>1<S2SV_blank>fire<S2SV_blank>count<S2SV_blank>%d" , periodicFireCount ) ; test_report ( "Core<S2SV_blank>0<S2SV_blank>thread<S2SV_blank>returned<S2SV_blank>%d" , resultCore0 ) ; test_report ( "Core<S2SV_blank>2<S2SV_blank>thread<S2SV_blank>returned<S2SV_blank>%d" , resultCore2 ) ; return 0 ; } | <S2SV_ModStart> 1 ) ; OSCreateThread ( & <S2SV_ModEnd> threadCore0 , CoreEntryPoint0 <S2SV_ModStart> 0 , NULL , stackCore0 + STACK_SIZE , STACK_SIZE , 20 , OS_THREAD_ATTRIB_AFFINITY_CPU0 ) ; OSResumeThread ( & threadCore0 ) ; OSCreateThread ( & <S2SV_ModEnd> threadCore2 , CoreEntryPoint2 <S2SV_ModStart> , CoreEntryPoint2 , 0 , NULL , stackCore2 + STACK_SIZE , STACK_SIZE , 20 , OS_THREAD_ATTRIB_AFFINITY_CPU2 ) ; OSResumeThread ( & threadCore2 <S2SV_ModEnd> ) ; int <S2SV_ModStart> ; OSJoinThread ( & <S2SV_ModStart> ; OSJoinThread ( & |
4,542 | CWE-000 static void pc_dimm_plug ( HotplugHandler * hotplug_dev , DeviceState * dev , Error * * errp ) { HotplugHandlerClass * hhc ; Error * local_err = NULL ; PCMachineState * pcms = PC_MACHINE ( hotplug_dev ) ; PCMachineClass * pcmc = PC_MACHINE_GET_CLASS ( pcms ) ; PCDIMMDevice * dimm = PC_DIMM ( dev ) ; PCDIMMDeviceClass * ddc = PC_DIMM_GET_CLASS ( dimm ) ; MemoryRegion * mr = ddc -> get_memory_region ( dimm ) ; uint64_t align = TARGET_PAGE_SIZE ; <S2SV_StartBug> if ( memory_region_get_alignment ( mr ) && pcmc -> enforce_aligned_dimm ) { <S2SV_EndBug> align = memory_region_get_alignment ( mr ) ; } if ( ! pcms -> acpi_dev ) { error_setg ( & local_err , "memory<S2SV_blank>hotplug<S2SV_blank>is<S2SV_blank>not<S2SV_blank>enabled:<S2SV_blank>missing<S2SV_blank>acpi<S2SV_blank>device" ) ; goto out ; } <S2SV_StartBug> pc_dimm_memory_plug ( dev , & pcms -> hotplug_memory , mr , align , & local_err ) ; <S2SV_EndBug> if ( local_err ) { goto out ; } if ( object_dynamic_cast ( OBJECT ( dev ) , TYPE_NVDIMM ) ) { if ( ! pcms -> acpi_nvdimm_state . is_enabled ) { error_setg ( & local_err , "nvdimm<S2SV_blank>is<S2SV_blank>not<S2SV_blank>enabled:<S2SV_blank>missing<S2SV_blank>\'nvdimm\'<S2SV_blank>in<S2SV_blank>\'-M\'" ) ; goto out ; } <S2SV_StartBug> nvdimm_plug ( & pcms -> acpi_nvdimm_state ) ; <S2SV_EndBug> } hhc = HOTPLUG_HANDLER_GET_CLASS ( pcms -> acpi_dev ) ; hhc -> plug ( HOTPLUG_HANDLER ( pcms -> acpi_dev ) , dev , & error_abort ) ; out : error_propagate ( errp , local_err ) ; } | <S2SV_ModStart> = TARGET_PAGE_SIZE ; bool is_nvdimm = object_dynamic_cast ( OBJECT ( dev ) , TYPE_NVDIMM ) ; <S2SV_ModStart> out ; } if ( is_nvdimm && <S2SV_ModEnd> ! pcms -> <S2SV_ModStart> out ; } pc_dimm_memory_plug ( dev , & pcms -> hotplug_memory , mr , align , & local_err ) ; if ( local_err ) { goto out ; } if ( is_nvdimm ) { |
4,543 | CWE-000 static enum request refs_request ( struct view * view , enum request request , struct line * line ) { struct reference * reference = line -> data ; switch ( request ) { case REQ_REFRESH : load_refs ( TRUE ) ; refresh_view ( view ) ; return REQ_NONE ; case REQ_ENTER : { const struct ref * ref = reference -> ref ; const char * all_references_argv [ ] = { <S2SV_StartBug> GIT_MAIN_LOG_CUSTOM ( encoding_arg , commit_order_arg ( ) , <S2SV_EndBug> "%(mainargs)" , "" , <S2SV_StartBug> refs_is_all ( reference ) ? "--all" : ref -> name , "" ) <S2SV_EndBug> } ; if ( ! argv_format ( main_view . env , & main_view . argv , all_references_argv , FALSE , FALSE ) ) report ( "Failed<S2SV_blank>to<S2SV_blank>format<S2SV_blank>argument" ) ; else open_view ( view , & main_view , OPEN_SPLIT | OPEN_PREPARED ) ; return REQ_NONE ; } default : return request ; } } | <S2SV_ModStart> ] = { GIT_MAIN_LOG <S2SV_ModEnd> ( encoding_arg , <S2SV_ModStart> name , "" , log_custom_pretty_arg ( ) |
4,544 | CWE-000 BusConnections * bus_connections_new ( BusContext * context ) { BusConnections * connections ; if ( ! dbus_connection_allocate_data_slot ( & connection_data_slot ) ) goto failed_0 ; connections = dbus_new0 ( BusConnections , 1 ) ; if ( connections == NULL ) goto failed_1 ; connections -> completed_by_user = _dbus_hash_table_new ( DBUS_HASH_UINTPTR , NULL , NULL ) ; if ( connections -> completed_by_user == NULL ) goto failed_2 ; connections -> expire_timeout = _dbus_timeout_new ( 100 , expire_incomplete_timeout , connections , NULL ) ; if ( connections -> expire_timeout == NULL ) goto failed_3 ; <S2SV_StartBug> _dbus_timeout_set_enabled ( connections -> expire_timeout , FALSE ) ; <S2SV_EndBug> connections -> pending_replies = bus_expire_list_new ( bus_context_get_loop ( context ) , bus_context_get_reply_timeout ( context ) , bus_pending_reply_expired , connections ) ; if ( connections -> pending_replies == NULL ) goto failed_4 ; if ( ! _dbus_loop_add_timeout ( bus_context_get_loop ( context ) , connections -> expire_timeout ) ) goto failed_5 ; connections -> refcount = 1 ; connections -> context = context ; return connections ; failed_5 : bus_expire_list_free ( connections -> pending_replies ) ; failed_4 : _dbus_timeout_unref ( connections -> expire_timeout ) ; failed_3 : _dbus_hash_table_unref ( connections -> completed_by_user ) ; failed_2 : dbus_free ( connections ) ; failed_1 : dbus_connection_free_data_slot ( & connection_data_slot ) ; failed_0 : return NULL ; } | <S2SV_ModStart> goto failed_3 ; _dbus_timeout_disable ( connections -> expire_timeout <S2SV_ModEnd> ) ; connections |
4,545 | CWE-000 static int out_standby ( struct audio_stream * stream ) { struct stream_out * out = ( struct stream_out * ) stream ; struct audio_device * adev = out -> dev ; ALOGV ( "%s:<S2SV_blank>enter:<S2SV_blank>usecase(%d:<S2SV_blank>%s)" , __func__ , out -> usecase , use_case_table [ out -> usecase ] ) ; pthread_mutex_lock ( & out -> lock ) ; if ( ! out -> standby ) { <S2SV_StartBug> out -> standby = true ; <S2SV_EndBug> if ( out -> usecase != USECASE_AUDIO_PLAYBACK_OFFLOAD ) { if ( out -> pcm ) { pcm_close ( out -> pcm ) ; out -> pcm = NULL ; } } else { stop_compressed_output_l ( out ) ; out -> gapless_mdata . encoder_delay = 0 ; out -> gapless_mdata . encoder_padding = 0 ; if ( out -> compr != NULL ) { compress_close ( out -> compr ) ; out -> compr = NULL ; } } <S2SV_StartBug> pthread_mutex_lock ( & adev -> lock ) ; <S2SV_EndBug> stop_output_stream ( out ) ; pthread_mutex_unlock ( & adev -> lock ) ; } pthread_mutex_unlock ( & out -> lock ) ; ALOGV ( "%s:<S2SV_blank>exit" , __func__ ) ; return 0 ; } | <S2SV_ModStart> standby ) { pthread_mutex_lock ( & adev -> lock ) ; <S2SV_ModStart> ; } } <S2SV_ModEnd> stop_output_stream ( out |
4,546 | CWE-000 static char * colorize_asm_string ( RCore * core , const char * buf_asm , int optype ) { char * tmp , * spacer = NULL ; char * source = ( char * ) buf_asm ; bool use_color = core -> print -> flags & R_PRINT_FLAGS_COLOR ; const char * color_num = core -> cons -> pal . num ; const char * color_reg = core -> cons -> pal . reg ; if ( ! use_color ) { return strdup ( source ) ; } spacer = strstr ( source , "||" ) ; if ( spacer ) { char * scol1 , * s1 = r_str_ndup ( source , spacer - source ) ; char * scol2 , * s2 = strdup ( spacer + 2 ) ; scol1 = r_print_colorize_opcode ( core -> print , s1 , color_reg , color_num , false ) ; free ( s1 ) ; scol2 = r_print_colorize_opcode ( core -> print , s2 , color_reg , color_num , false ) ; free ( s2 ) ; if ( ! scol1 ) { scol1 = strdup ( "" ) ; } if ( ! scol2 ) { scol2 = strdup ( "" ) ; } <S2SV_StartBug> source = malloc ( strlen ( scol1 ) + strlen ( scol2 ) + 2 + 1 ) ; <S2SV_EndBug> sprintf ( source , "%s||%s" , scol1 , scol2 ) ; free ( scol1 ) ; free ( scol2 ) ; return source ; } char * res = strdup ( "" ) ; res = r_str_append ( res , r_print_color_op_type ( core -> print , optype ) ) ; tmp = r_print_colorize_opcode ( core -> print , source , color_reg , color_num , false ) ; res = r_str_append ( res , tmp ) ; free ( tmp ) ; return res ; } | <S2SV_ModStart> } source = r_str_newf ( "%s||%s" , scol1 , scol2 <S2SV_ModEnd> ) ; sprintf |
4,547 | CWE-000 static void sparc_generate_code ( FILE * output , const char * cup_name ) { be_gas_elf_type_char = '#' ; be_gas_elf_variant = ELF_VARIANT_SPARC ; sparc_constants = pmap_create ( ) ; be_begin ( output , cup_name ) ; unsigned * const sp_is_non_ssa = rbitset_alloca ( N_SPARC_REGISTERS ) ; rbitset_set ( sp_is_non_ssa , REG_SP ) ; foreach_irp_irg ( i , irg ) { if ( ! be_step_first ( irg ) ) continue ; struct obstack * obst = be_get_be_obst ( irg ) ; be_birg_from_irg ( irg ) -> isa_link = OALLOCZ ( obst , sparc_irg_data_t ) ; be_birg_from_irg ( irg ) -> non_ssa_regs = sp_is_non_ssa ; sparc_select_instructions ( irg ) ; <S2SV_StartBug> be_step_schedule ( irg ) ; <S2SV_EndBug> be_timer_push ( T_RA_PREPARATION ) ; be_sched_fix_flags ( irg , & sparc_reg_classes [ CLASS_sparc_flags ] , NULL , sparc_modifies_flags , NULL ) ; be_sched_fix_flags ( irg , & sparc_reg_classes [ CLASS_sparc_fpflags ] , NULL , sparc_modifies_fp_flags , NULL ) ; be_timer_pop ( T_RA_PREPARATION ) ; be_step_regalloc ( irg , & sparc_regalloc_if ) ; sparc_finish_graph ( irg ) ; sparc_emit_function ( irg ) ; be_step_last ( irg ) ; } be_finish ( ) ; pmap_destroy ( sparc_constants ) ; } | <S2SV_ModStart> be_step_schedule ( irg , NULL |
4,548 | CWE-000 iow_t * zlib_wopen ( iow_t * child , int compress_level ) { iow_t * iow ; if ( ! child ) return NULL ; iow = malloc ( sizeof ( iow_t ) ) ; iow -> source = & zlib_wsource ; iow -> data = malloc ( sizeof ( struct zlibw_t ) ) ; int i ; int num_chan = 0 ; <S2SV_StartBug> block_info_t * blocks = NULL ; <S2SV_EndBug> num_chan = pulseaha_get_comp_channels ( ) ; if ( ! num_chan ) { fprintf ( stderr , "No<S2SV_blank>available<S2SV_blank>channels!\\n" ) ; return NULL ; } DATA ( iow ) -> num_blocks = 4 * num_chan ; blocks = malloc ( DATA ( iow ) -> num_blocks * sizeof ( * blocks ) ) ; if ( ! blocks ) { fprintf ( stderr , "Error<S2SV_blank>allocating<S2SV_blank>memory.\\n" ) ; pulseaha_cleanup ( blocks , 0 ) ; return NULL ; } for ( i = 0 ; i < DATA ( iow ) -> num_blocks ; i ++ ) { if ( ahagz_api_open ( & blocks [ i ] . stream , 0 , 0 ) ) { fprintf ( stderr , "Error<S2SV_blank>calling<S2SV_blank>ahagz_api_open().\\n" ) ; pulseaha_cleanup ( blocks , i ) ; return NULL ; } } DATA ( iow ) -> child = child ; DATA ( iow ) -> err = ERR_OK ; return iow ; } | <S2SV_ModStart> = 0 ; ( void ) compress_level <S2SV_ModEnd> ; num_chan = |
4,549 | CWE-000 void <S2SV_StartBug> ExecEvalArrayCoerce ( ExprState * state , ExprEvalStep * op ) <S2SV_EndBug> { ArrayCoerceExpr * acoerce = op -> d . arraycoerce . coerceexpr ; Datum arraydatum ; FunctionCallInfoData locfcinfo ; if ( * op -> resnull ) return ; arraydatum = * op -> resvalue ; <S2SV_StartBug> if ( ! OidIsValid ( acoerce -> elemfuncid ) ) <S2SV_EndBug> { ArrayType * array = DatumGetArrayTypePCopy ( arraydatum ) ; ARR_ELEMTYPE ( array ) = op -> d . arraycoerce . resultelemtype ; * op -> resvalue = PointerGetDatum ( array ) ; return ; } <S2SV_StartBug> InitFunctionCallInfoData ( locfcinfo , op -> d . arraycoerce . elemfunc , 3 , <S2SV_EndBug> InvalidOid , NULL , NULL ) ; locfcinfo . arg [ 0 ] = arraydatum ; locfcinfo . arg [ 1 ] = Int32GetDatum ( acoerce -> resulttypmod ) ; locfcinfo . arg [ 2 ] = BoolGetDatum ( acoerce -> isExplicit ) ; locfcinfo . argnull [ 0 ] = false ; locfcinfo . argnull [ 1 ] = false ; locfcinfo . argnull [ 2 ] = false ; <S2SV_StartBug> * op -> resvalue = array_map ( & locfcinfo , op -> d . arraycoerce . resultelemtype , <S2SV_EndBug> op -> d . arraycoerce . amstate ) ; } | <S2SV_ModStart> ExprEvalStep * op , ExprContext * econtext ) { Datum arraydatum <S2SV_ModEnd> ; if ( <S2SV_ModStart> ; if ( op -> d . arraycoerce . elemexprstate == NULL <S2SV_ModEnd> ) { ArrayType <S2SV_ModStart> return ; } <S2SV_ModEnd> * op -> <S2SV_ModStart> = array_map ( arraydatum , op -> d . arraycoerce . elemexprstate , econtext , <S2SV_ModEnd> op -> d |
4,550 | CWE-000 void mail_serialize ( struct mail * email , enum mail_sf format , int sock ) { int i = 0 ; char ip [ 46 ] ; char hst [ NI_MAXHOST ] ; struct sockaddr_storage * a ; a = ( email -> extra ) -> origin_ip ; if ( a -> ss_family == AF_INET6 ) inet_ntop ( a -> ss_family , & ( ( struct sockaddr_in6 * ) a ) -> sin6_addr , ip , 46 ) ; else inet_ntop ( a -> ss_family , & ( ( struct sockaddr_in * ) a ) -> sin_addr , ip , 46 ) ; getnameinfo ( ( struct sockaddr * ) a , sizeof ( * a ) , hst , sizeof ( hst ) , NULL , 0 , 0 ) ; <S2SV_StartBug> printf ( "------\\num<S2SV_blank>ok<S2SV_blank>so<S2SV_blank>I<S2SV_blank>just<S2SV_blank>got<S2SV_blank>an<S2SV_blank>email<S2SV_blank>from<S2SV_blank>socket<S2SV_blank>%d!!!" , sock ) ; <S2SV_EndBug> printf ( "here\'s<S2SV_blank>some<S2SV_blank>info<S2SV_blank>about<S2SV_blank>it:\\n" ) ; printf ( "real<S2SV_blank>sender<S2SV_blank>server<S2SV_blank>ip:<S2SV_blank>`%s`<S2SV_blank>rDNS:`%s`\\n" , ip , hst ) ; printf ( "reported<S2SV_blank>sender<S2SV_blank>server:<S2SV_blank>`%s`\\n" , email -> froms_v ) ; printf ( "reported<S2SV_blank>sender<S2SV_blank>email:<S2SV_blank>`%s`\\n" , email -> from_v ) ; printf ( "reported<S2SV_blank>recipients:\\n" ) ; for ( i = 0 ; i < email -> to_c ; i ++ ) { printf ( "\\t`%s`\\n" , email -> to_v + i ) ; i += strlen ( email -> to_v + i ) ; } printf ( "data:<S2SV_blank>```\\n%s```\\n" , email -> data_v ) ; } | <S2SV_ModStart> ; printf ( "------\\num<S2SV_blank>ok<S2SV_blank>so<S2SV_blank>I<S2SV_blank>just<S2SV_blank>got<S2SV_blank>an<S2SV_blank>email<S2SV_blank>from<S2SV_blank>socket<S2SV_blank>%d!!!<S2SV_blank>" <S2SV_ModEnd> , sock ) |
4,551 | CWE-000 void ft_striteri ( char * s , void ( * f ) ( unsigned int , char * ) ) { unsigned int x ; x = 0 ; while ( s [ x ] ) { <S2SV_StartBug> f ( x , s ) ; <S2SV_EndBug> x ++ ; } } | <S2SV_ModStart> ( x , ( s + x ) <S2SV_ModEnd> ) ; x |
4,552 | CWE-000 int32_t glusterd_store_retrieve_peers ( xlator_t * this ) { int32_t ret = 0 ; glusterd_conf_t * priv = NULL ; DIR * dir = NULL ; struct dirent * entry = NULL ; struct dirent scratch [ 2 ] = { { 0 , } , } ; char path [ PATH_MAX ] = { 0 , } ; glusterd_peerinfo_t * peerinfo = NULL ; gf_store_handle_t * shandle = NULL ; char filepath [ PATH_MAX ] = { 0 , } ; gf_store_iter_t * iter = NULL ; char * key = NULL ; char * value = NULL ; glusterd_peerctx_args_t args = { 0 } ; gf_store_op_errno_t op_errno = GD_STORE_SUCCESS ; glusterd_peer_hostname_t * address = NULL ; uuid_t tmp_uuid ; gf_boolean_t is_ok ; int32_t len ; GF_ASSERT ( this ) ; priv = this -> private ; GF_ASSERT ( priv ) ; len = snprintf ( path , PATH_MAX , "%s/%s" , priv -> workdir , GLUSTERD_PEER_DIR_PREFIX ) ; if ( ( len < 0 ) || ( len >= PATH_MAX ) ) { ret = - 1 ; goto out ; } dir = sys_opendir ( path ) ; if ( ! dir ) { gf_msg ( this -> name , GF_LOG_ERROR , errno , GD_MSG_DIR_OP_FAILED , "Unable<S2SV_blank>to<S2SV_blank>open<S2SV_blank>dir<S2SV_blank>%s" , path ) ; ret = - 1 ; goto out ; } for ( ; ; ) { GF_SKIP_IRRELEVANT_ENTRIES ( entry , dir , scratch ) ; if ( ! entry ) { break ; } if ( gf_uuid_parse ( entry -> d_name , tmp_uuid ) != 0 ) { gf_log ( this -> name , GF_LOG_WARNING , "skipping<S2SV_blank>non-peer<S2SV_blank>file<S2SV_blank>%s" , entry -> d_name ) ; continue ; } is_ok = _gf_false ; len = snprintf ( filepath , PATH_MAX , "%s/%s" , path , entry -> d_name ) ; if ( ( len < 0 ) || ( len >= PATH_MAX ) ) { goto next ; } ret = gf_store_handle_retrieve ( filepath , & shandle ) ; if ( ret ) goto next ; ret = gf_store_iter_new ( shandle , & iter ) ; if ( ret ) goto next ; ret = gf_store_iter_get_next ( iter , & key , & value , & op_errno ) ; if ( ret ) <S2SV_StartBug> goto next ; <S2SV_EndBug> peerinfo = glusterd_peerinfo_new ( GD_FRIEND_STATE_DEFAULT , NULL , NULL , 0 ) ; if ( peerinfo == NULL ) { ret = - 1 ; goto next ; } while ( ! ret ) { if ( ! strncmp ( GLUSTERD_STORE_KEY_PEER_UUID , key , SLEN ( GLUSTERD_STORE_KEY_PEER_UUID ) ) ) { if ( value ) gf_uuid_parse ( value , peerinfo -> uuid ) ; } else if ( ! strncmp ( GLUSTERD_STORE_KEY_PEER_STATE , key , SLEN ( GLUSTERD_STORE_KEY_PEER_STATE ) ) ) { peerinfo -> state . state = atoi ( value ) ; } else if ( ! strncmp ( GLUSTERD_STORE_KEY_PEER_HOSTNAME , key , SLEN ( GLUSTERD_STORE_KEY_PEER_HOSTNAME ) ) ) { ret = gd_add_address_to_peer ( peerinfo , value ) ; if ( ret ) { gf_msg ( this -> name , GF_LOG_ERROR , 0 , GD_MSG_ADD_ADDRESS_TO_PEER_FAIL , "Could<S2SV_blank>not<S2SV_blank>add<S2SV_blank>address<S2SV_blank>to<S2SV_blank>peer" ) ; } } else { gf_msg ( this -> name , GF_LOG_ERROR , 0 , GD_MSG_UNKNOWN_KEY , "Unknown<S2SV_blank>key:<S2SV_blank>%s" , key ) ; } GF_FREE ( key ) ; GF_FREE ( value ) ; key = NULL ; value = NULL ; ret = gf_store_iter_get_next ( iter , & key , & value , & op_errno ) ; } if ( op_errno != GD_STORE_EOF ) { goto next ; } ( void ) gf_store_iter_destroy ( iter ) ; if ( gf_uuid_is_null ( peerinfo -> uuid ) ) { gf_log ( "" , GF_LOG_ERROR , "Null<S2SV_blank>UUID<S2SV_blank>while<S2SV_blank>attempting<S2SV_blank>to<S2SV_blank>read<S2SV_blank>peer<S2SV_blank>from<S2SV_blank>\'%s\'" , filepath ) ; goto next ; } address = cds_list_entry ( peerinfo -> hostnames . next , glusterd_peer_hostname_t , hostname_list ) ; if ( ! address ) { ret = - 1 ; goto next ; } peerinfo -> hostname = gf_strdup ( address -> hostname ) ; ret = glusterd_friend_add_from_peerinfo ( peerinfo , 1 , NULL ) ; if ( ret ) goto next ; peerinfo -> shandle = shandle ; is_ok = _gf_true ; next : if ( ! is_ok ) { gf_log ( this -> name , GF_LOG_WARNING , "skipping<S2SV_blank>malformed<S2SV_blank>peer<S2SV_blank>file<S2SV_blank>%s" , entry -> d_name ) ; if ( peerinfo ) { glusterd_peerinfo_cleanup ( peerinfo ) ; } } peerinfo = NULL ; } args . mode = GD_MODE_ON ; rcu_read_lock ( ) ; cds_list_for_each_entry_rcu ( peerinfo , & priv -> peers , uuid_list ) { ret = glusterd_friend_rpc_create ( this , peerinfo , & args ) ; if ( ret ) break ; } rcu_read_unlock ( ) ; peerinfo = NULL ; out : if ( dir ) sys_closedir ( dir ) ; gf_msg_debug ( this -> name , 0 , "Returning<S2SV_blank>with<S2SV_blank>%d" , ret ) ; return ret ; } | <S2SV_ModStart> ( ret ) { ( void ) gf_store_iter_destroy ( iter ) ; goto next ; } <S2SV_ModEnd> peerinfo = glusterd_peerinfo_new |
4,553 | CWE-000 static void _e_client_del ( E_Client * ec ) { E_Client * child ; E_Client_Volume_Sink * sink ; EINA_LIST_FREE ( ec -> sinks , sink ) e_client_volume_sink_remove ( ec , sink ) ; for ( child = ec -> stack . next ; child ; child = child -> stack . next ) e_client_act_close_begin ( child ) ; ec -> changed = 0 ; focus_stack = eina_list_remove ( focus_stack , ec ) ; raise_stack = eina_list_remove ( raise_stack , ec ) ; if ( ec -> exe_inst ) { if ( ec -> exe_inst -> phony && ( eina_list_count ( ec -> exe_inst -> clients ) == 1 ) ) { if ( e_exec_phony_del ( ec -> exe_inst ) ) ec -> exe_inst = NULL ; } else { if ( ! ec -> exe_inst -> deleted ) { ec -> exe_inst -> clients = eina_list_remove ( ec -> exe_inst -> clients , ec ) ; ec -> exe_inst = NULL ; } } } _e_client_mouse_action_end ( ec ) ; if ( action_client == ec ) _e_client_action_finish ( ) ; e_pointer_type_pop ( e_comp -> pointer , ec , NULL ) ; if ( warp_client == ec ) { E_FREE_FUNC ( warp_timer , ecore_timer_del ) ; warp_client = NULL ; } if ( ( client_drag ) && ( client_drag -> data == ec ) ) { e_object_del ( E_OBJECT ( client_drag ) ) ; client_drag = NULL ; } if ( ec -> border_menu ) e_menu_deactivate ( ec -> border_menu ) ; if ( ! stopping ) { e_client_comp_hidden_set ( ec , 1 ) ; <S2SV_StartBug> evas_object_pass_events_set ( ec -> frame , 1 ) ; <S2SV_EndBug> } E_FREE_FUNC ( ec -> border_locks_dialog , e_object_del ) ; E_FREE_FUNC ( ec -> border_remember_dialog , e_object_del ) ; E_FREE_FUNC ( ec -> border_border_dialog , e_object_del ) ; E_FREE_FUNC ( ec -> border_prop_dialog , e_object_del ) ; E_FREE_FUNC ( ec -> color_editor , evas_object_del ) ; e_int_client_menu_del ( ec ) ; E_FREE_FUNC ( ec -> raise_timer , ecore_timer_del ) ; if ( ec -> internal_elm_win ) evas_object_hide ( ec -> internal_elm_win ) ; if ( ec -> focused ) _e_client_revert_focus ( ec ) ; <S2SV_StartBug> evas_object_focus_set ( ec -> frame , 0 ) ; <S2SV_EndBug> E_FREE_FUNC ( ec -> ping_poller , ecore_poller_del ) ; eina_hash_del_by_key ( clients_hash [ e_pixmap_type_get ( ec -> pixmap ) ] , & ec -> pixmap ) ; _e_client_hook_call ( E_CLIENT_HOOK_DEL , ec ) ; E_FREE ( ec -> comp_data ) ; if ( ( ! ec -> new_client ) && ( ! stopping ) ) _e_client_event_simple ( ec , E_EVENT_CLIENT_REMOVE ) ; if ( ec -> parent ) { ec -> parent -> transients = eina_list_remove ( ec -> parent -> transients , ec ) ; ec -> parent = NULL ; } EINA_LIST_FREE ( ec -> transients , child ) child -> parent = NULL ; if ( ec -> leader ) { ec -> leader -> group = eina_list_remove ( ec -> leader -> group , ec ) ; if ( ec -> leader -> modal == ec ) ec -> leader -> modal = NULL ; ec -> leader = NULL ; } EINA_LIST_FREE ( ec -> group , child ) child -> leader = NULL ; e_comp -> clients = eina_list_remove ( e_comp -> clients , ec ) ; <S2SV_StartBug> e_comp_object_render_update_del ( ec -> frame ) ; <S2SV_EndBug> } | <S2SV_ModStart> 1 ) ; if ( ec -> frame ) <S2SV_ModStart> ec ) ; if ( ec -> frame ) <S2SV_ModStart> ec ) ; if ( ec -> frame ) |
4,554 | CWE-000 int main ( ) { int number_of_rows , number_of_columns , number_of_rows_2 , number_of_columns_2 ; get_dimentions ( & number_of_rows , & number_of_columns ) ; int * * matrix_1 = allocate_matrix ( & number_of_rows , & number_of_columns ) ; get_input ( matrix_1 , & number_of_rows , & number_of_columns ) ; get_dimentions ( & number_of_rows_2 , & number_of_columns_2 ) ; int * * matrix_2 = allocate_matrix ( & number_of_rows_2 , & number_of_columns_2 ) ; get_input ( matrix_2 , & number_of_rows_2 , & number_of_columns_2 ) ; matrix_mul ( matrix_1 , matrix_2 , & number_of_rows , & number_of_columns_2 , & number_of_columns ) ; <S2SV_StartBug> return 0 ; <S2SV_EndBug> } | <S2SV_ModStart> number_of_columns ) ; pthread_t threads [ number_of_rows * number_of_columns_2 ] ; |
4,555 | CWE-000 static void <S2SV_StartBug> daemonise ( const char * pidfile ) <S2SV_EndBug> { pid_t pid ; int rw [ 2 ] , status = 0 , fd ; FILE * fp ; if ( pipe ( rw ) ) eprintf ( "pipe:" ) ; switch ( ( pid = fork ( ) ) ) { case - 1 : eprintf ( "fork:" ) ; case 0 : close ( rw [ 0 ] ) ; setsid ( ) ; switch ( fork ( ) ) { case - 1 : eprintf ( "fork:" ) ; case 0 : if ( signal ( SIGHUP , SIG_IGN ) == SIG_ERR ) weprintf ( "signal<S2SV_blank>SIGHUP<S2SV_blank>SIG_IGN:" ) ; if ( signal ( SIGINT , sigexit ) == SIG_ERR ) weprintf ( "signal<S2SV_blank>SIGINT<S2SV_blank><exit>:" ) ; <S2SV_StartBug> if ( strcmp ( pidfile , "/dev/null" ) ) { <S2SV_EndBug> pid = getpid ( ) ; fd = open ( pidfile , O_WRONLY | O_CREAT | O_EXCL , 0644 ) ; if ( fd < 0 ) eprintf ( "open<S2SV_blank>%s<S2SV_blank>O_WRONLY<S2SV_blank>O_CREAT<S2SV_blank>O_EXCL:" , pidfile ) ; fp = fdopen ( fd , "w" ) ; fprintf ( fp , "%li\\n" , ( long int ) pid ) ; if ( fflush ( fp ) || ferror ( fp ) ) eprintf ( "fprintf<S2SV_blank>%s:" , pidfile ) ; fclose ( fp ) ; } if ( chdir ( "/" ) ) eprintf ( "chdir<S2SV_blank>/:" ) ; close ( STDIN_FILENO ) ; close ( STDOUT_FILENO ) ; if ( isatty ( STDERR_FILENO ) ) { fd = open ( "/dev/null" , O_WRONLY ) ; if ( fd ) eprintf ( "open<S2SV_blank>/dev/null<S2SV_blank>O_WRONLY:" ) ; if ( dup2 ( fd , STDERR_FILENO ) != STDERR_FILENO ) eprintf ( "dup2<S2SV_blank>/dev/null<S2SV_blank>/dev/stderr:" ) ; close ( fd ) ; } if ( write ( rw [ 1 ] , & status , 1 ) < 1 ) eprintf ( "write<S2SV_blank><pipe>:" ) ; close ( rw [ 1 ] ) ; break ; default : exit ( 0 ) ; } break ; default : close ( rw [ 1 ] ) ; if ( waitpid ( pid , & status , 0 ) != pid ) eprintf ( "waitpid:" ) ; if ( status ) exit ( 1 ) ; switch ( read ( rw [ 0 ] , & status , 1 ) ) { case - 1 : eprintf ( "read<S2SV_blank><pipe>:" ) ; case 0 : exit ( 1 ) ; default : exit ( 0 ) ; } } } | <S2SV_ModStart> void daemonise ( void <S2SV_ModEnd> ) { pid_t <S2SV_ModStart> ; if ( pidfile <S2SV_ModEnd> ) { pid |
4,556 | CWE-000 TMUErrorCode tmu_read ( struct Config * config , float * tmu ) { FILE * fp = fopen ( config -> tmu_file , "r" ) ; if ( fp == NULL ) { return TMU_ERROR ; } int sum = 0 ; int count = 0 ; char line [ TMU_LINE_BUF_LEN ] ; <S2SV_StartBug> while ( fgets ( line , TMU_LINE_BUF_LEN , fp ) ) { <S2SV_EndBug> char * cfline = strstr ( ( char * ) line , TMU_DELIM ) ; if ( cfline != NULL ) { char * value_ptr = cfline + strlen ( TMU_DELIM ) ; int tmu = atoi ( value_ptr ) ; sum += tmu ; count ++ ; } } <S2SV_StartBug> * tmu = ( sum / ( ( float ) count ) ) / TMU_FACTOR ; <S2SV_EndBug> return TMU_OK ; } | <S2SV_ModStart> , fp ) != NULL <S2SV_ModStart> ; } } fclose ( fp ) ; |
4,557 | CWE-000 <S2SV_StartBug> g2int g2_unpack4 ( unsigned char * cgrib , g2int * iofst , g2int * ipdsnum , g2int * * ipdstmpl , <S2SV_EndBug> g2int * mappdslen , g2float * * coordlist , g2int * numcoord ) { g2int ierr , needext , i , j , nbits , isecnum ; g2int lensec , isign , newlen ; g2int * coordieee ; g2int * lipdstmpl = 0 ; g2float * lcoordlist ; xxtemplate * mappds ; ierr = 0 ; * ipdstmpl = 0 ; * coordlist = 0 ; gbit ( cgrib , & lensec , * iofst , 32 ) ; * iofst = * iofst + 32 ; gbit ( cgrib , & isecnum , * iofst , 8 ) ; * iofst = * iofst + 8 ; if ( isecnum != 4 ) { ierr = 2 ; * numcoord = 0 ; * mappdslen = 0 ; return ( ierr ) ; } gbit ( cgrib , numcoord , * iofst , 16 ) ; * iofst = * iofst + 16 ; gbit ( cgrib , ipdsnum , * iofst , 16 ) ; * iofst = * iofst + 16 ; mappds = getpdstemplate ( * ipdsnum ) ; if ( mappds == 0 ) { ierr = 5 ; * mappdslen = 0 ; return ( ierr ) ; } * mappdslen = mappds -> maplen ; needext = mappds -> needext ; if ( * mappdslen > 0 ) lipdstmpl = ( g2int * ) calloc ( * mappdslen , sizeof ( g2int ) ) ; if ( lipdstmpl == 0 ) { ierr = 6 ; * mappdslen = 0 ; * ipdstmpl = 0 ; free ( mappds ) ; return ( ierr ) ; } else { * ipdstmpl = lipdstmpl ; } for ( i = 0 ; i < mappds -> maplen ; i ++ ) { nbits = abs ( mappds -> map [ i ] ) * 8 ; if ( mappds -> map [ i ] >= 0 ) { gbit ( cgrib , lipdstmpl + i , * iofst , nbits ) ; } else { gbit ( cgrib , & isign , * iofst , 1 ) ; gbit ( cgrib , lipdstmpl + i , * iofst + 1 , nbits - 1 ) ; if ( isign == 1 ) lipdstmpl [ i ] = - 1 * lipdstmpl [ i ] ; } * iofst = * iofst + nbits ; } if ( needext == 1 ) { free ( mappds ) ; mappds = extpdstemplate ( * ipdsnum , lipdstmpl ) ; newlen = mappds -> maplen + mappds -> extlen ; lipdstmpl = ( g2int * ) realloc ( lipdstmpl , newlen * sizeof ( g2int ) ) ; * ipdstmpl = lipdstmpl ; j = 0 ; for ( i = * mappdslen ; i < newlen ; i ++ ) { nbits = abs ( mappds -> ext [ j ] ) * 8 ; if ( mappds -> ext [ j ] >= 0 ) { gbit ( cgrib , lipdstmpl + i , * iofst , nbits ) ; } else { gbit ( cgrib , & isign , * iofst , 1 ) ; gbit ( cgrib , lipdstmpl + i , * iofst + 1 , nbits - 1 ) ; if ( isign == 1 ) lipdstmpl [ i ] = - 1 * lipdstmpl [ i ] ; } * iofst = * iofst + nbits ; j ++ ; } * mappdslen = newlen ; } if ( mappds -> ext != 0 ) free ( mappds -> ext ) ; if ( mappds != 0 ) free ( mappds ) ; * coordlist = 0 ; if ( * numcoord != 0 ) { coordieee = ( g2int * ) calloc ( * numcoord , sizeof ( g2int ) ) ; lcoordlist = ( g2float * ) calloc ( * numcoord , sizeof ( g2float ) ) ; if ( coordieee == 0 || lcoordlist == 0 ) { ierr = 6 ; * numcoord = 0 ; * coordlist = 0 ; if ( coordieee != 0 ) free ( coordieee ) ; if ( lcoordlist != 0 ) free ( lcoordlist ) ; return ( ierr ) ; } else { * coordlist = lcoordlist ; } <S2SV_StartBug> gbits ( cgrib , G2_UNKNOWN_SIZE , coordieee , * iofst , 32 , 0 , * numcoord ) ; <S2SV_EndBug> rdieee ( coordieee , * coordlist , * numcoord ) ; free ( coordieee ) ; * iofst = * iofst + ( 32 * ( * numcoord ) ) ; } return ( ierr ) ; } | <S2SV_ModStart> char * cgrib , g2int cgrib_length <S2SV_ModStart> ( cgrib , cgrib_length <S2SV_ModEnd> , coordieee , |
4,558 | CWE-000 int tcp_bpf_recvmsg ( struct sock * sk , struct msghdr * msg , size_t len , int nonblock , int flags , int * addr_len ) { struct sk_psock * psock ; int copied , ret ; if ( unlikely ( flags & MSG_ERRQUEUE ) ) return inet_recv_error ( sk , msg , len , addr_len ) ; if ( ! skb_queue_empty ( & sk -> sk_receive_queue ) ) return tcp_recvmsg ( sk , msg , len , nonblock , flags , addr_len ) ; psock = sk_psock_get ( sk ) ; if ( unlikely ( ! psock ) ) return tcp_recvmsg ( sk , msg , len , nonblock , flags , addr_len ) ; lock_sock ( sk ) ; msg_bytes_ready : copied = __tcp_bpf_recvmsg ( sk , psock , msg , len , flags ) ; if ( ! copied ) { int data , err = 0 ; long timeo ; timeo = sock_rcvtimeo ( sk , nonblock ) ; data = tcp_bpf_wait_data ( sk , psock , flags , timeo , & err ) ; if ( data ) { if ( skb_queue_empty ( & sk -> sk_receive_queue ) ) goto msg_bytes_ready ; release_sock ( sk ) ; sk_psock_put ( sk , psock ) ; return tcp_recvmsg ( sk , msg , len , nonblock , flags , addr_len ) ; } if ( err ) { ret = err ; goto out ; } <S2SV_StartBug> } <S2SV_EndBug> ret = copied ; out : release_sock ( sk ) ; sk_psock_put ( sk , psock ) ; return ret ; } | <S2SV_ModStart> out ; } copied = - EAGAIN ; |
4,559 | CWE-000 int mon_si ( int argc , char * * argv , struct Trapframe * tf ) { <S2SV_StartBug> uint32_t eflags ; <S2SV_EndBug> eflags = read_eflags ( ) ; write_eflags ( eflags | FL_TF ) ; env_run ( curenv ) ; return 0 ; } | <S2SV_ModStart> tf ) { tf -> tf_eflags |= FL_TF <S2SV_ModEnd> ; env_run ( |
4,560 | CWE-000 static void __bfq_put_async_bfqq ( struct bfq_data * bfqd , struct bfq_queue * * bfqq_ptr ) { struct bfq_group * root_group = bfqd -> root_group ; struct bfq_queue * bfqq = * bfqq_ptr ; bfq_log ( bfqd , "put_async_bfqq:<S2SV_blank>%p" , bfqq ) ; if ( bfqq ) { <S2SV_StartBug> bfq_bfqq_move ( bfqd , bfqq , & bfqq -> entity , root_group ) ; <S2SV_EndBug> bfq_log_bfqq ( bfqd , bfqq , "put_async_bfqq:<S2SV_blank>putting<S2SV_blank>%p,<S2SV_blank>%d" , bfqq , atomic_read ( & bfqq -> ref ) ) ; bfq_put_queue ( bfqq ) ; * bfqq_ptr = NULL ; } } | <S2SV_ModStart> , bfqq , <S2SV_ModEnd> root_group ) ; |
4,561 | CWE-000 s32 init_wr_node ( struct i2c_client * client ) { u8 i ; gt_client = client ; memset ( & cmd_head , 0 , sizeof ( cmd_head ) ) ; cmd_head . data = NULL ; i = 5 ; while ( ( ! cmd_head . data ) && i ) { <S2SV_StartBug> cmd_head . data = kzalloc ( i * DATA_LENGTH_UINT , GFP_KERNEL ) ; <S2SV_EndBug> <S2SV_StartBug> if ( NULL != cmd_head . data ) <S2SV_EndBug> break ; i -- ; } if ( i ) { DATA_LENGTH = i * DATA_LENGTH_UINT ; dev_dbg ( & client -> dev , "Applied<S2SV_blank>memory<S2SV_blank>size:%d." , DATA_LENGTH ) ; } else { GTP_ERROR ( "Apply<S2SV_blank>for<S2SV_blank>memory<S2SV_blank>failed." ) ; return FAIL ; } cmd_head . addr_len = 2 ; cmd_head . retry = 5 ; register_i2c_func ( ) ; mutex_init ( & lock ) ; tool_set_proc_name ( procname ) ; goodix_proc_entry = create_proc_entry ( procname , 0660 , NULL ) ; if ( goodix_proc_entry == NULL ) { GTP_ERROR ( "Couldn\'t<S2SV_blank>create<S2SV_blank>proc<S2SV_blank>entry!" ) ; return FAIL ; } else { GTP_INFO ( "Create<S2SV_blank>proc<S2SV_blank>entry<S2SV_blank>success!" ) ; goodix_proc_entry -> write_proc = goodix_tool_write ; dix_proc_entry -> read_proc = goodix_tool_read ; } return SUCCESS ; } | <S2SV_ModStart> . data = devm_kzalloc ( & client -> dev , <S2SV_ModEnd> i * DATA_LENGTH_UINT <S2SV_ModStart> ; if ( <S2SV_ModEnd> cmd_head . data |
4,562 | CWE-000 static ngx_int_t ngx_mrb_async_http_sub_request_done ( ngx_http_request_t * sr , void * data , ngx_int_t rc ) { ngx_mrb_async_http_ctx_t * actx = data ; ngx_mrb_reentrant_t * re = actx -> re ; <S2SV_StartBug> ngx_http_request_r * r = re -> r ; <S2SV_EndBug> ngx_int_t rc = NGX_OK ; ngx_log_debug1 ( NGX_LOG_DEBUG_HTTP , r -> connection -> log , 0 , "http_sub_request<S2SV_blank>done<S2SV_blank>s:%ui" , r -> headers_out . status ) ; ctx -> sub_response_done = 1 ; if ( ngx_http_mruby_read_sub_response ( sr , ctx ) != NGX_ERROR ) { return NGX_HTTP_INTERNAL_SERVER_ERROR ; } if ( re -> fiber != NULL ) { ngx_mrb_push_request ( re -> r ) ; if ( mrb_test ( ngx_mrb_resume_fiber ( re -> mrb , re -> fiber ) ) ) { return NGX_AGAIN ; } else { mrb_gc_unregister ( re -> mrb , * re -> fiber ) ; re -> fiber = NULL ; } ngx_http_run_posted_requests ( re -> r -> connection ) ; if ( re -> mrb -> exc ) { ngx_mrb_raise_error ( re -> mrb , mrb_obj_value ( re -> mrb -> exc ) , re -> r ) ; rc = NGX_HTTP_INTERNAL_SERVER_ERROR ; } } else { ngx_log_error ( NGX_LOG_NOTICE , re -> r -> connection -> log , 0 , "%s<S2SV_blank>NOTICE<S2SV_blank>%s:%d:<S2SV_blank>unexpected<S2SV_blank>error,<S2SV_blank>fiber<S2SV_blank>missing" MODULE_NAME , __func__ , __LINE__ ) ; rc = NGX_HTTP_INTERNAL_SERVER_ERROR ; } <S2SV_StartBug> ctx = ngx_http_get_module_ctx ( re -> r , ngx_http_mruby_module ) ; <S2SV_EndBug> if ( ctx != NULL ) { if ( rc != NGX_OK ) { re -> r -> headers_out . status = NGX_HTTP_INTERNAL_SERVER_ERROR ; rc = ngx_mrb_finalize_rputs ( re -> r , ctx ) ; ngx_http_finalize_request ( re -> r , rc ) ; <S2SV_StartBug> } <S2SV_EndBug> } else { ngx_http_finalize_request ( re -> r , NGX_ERROR ) ; } return rc ; } | <S2SV_ModStart> -> re ; ngx_http_request_t * r = re -> r ; ngx_http_mruby_ctx_t * ctx ; ctx = ngx_http_get_module_ctx ( re -> r , ngx_http_mruby_module ) ; if ( ctx == NULL ) { ngx_http_finalize_request ( re -> r , NGX_ERROR ) ; return rc ; } <S2SV_ModEnd> ngx_log_debug1 ( NGX_LOG_DEBUG_HTTP <S2SV_ModStart> NGX_HTTP_INTERNAL_SERVER_ERROR ; } <S2SV_ModEnd> ngx_http_finalize_request ( re <S2SV_ModStart> rc ) ; <S2SV_ModEnd> return rc ; |
4,563 | CWE-000 void dprint ( const char * sz ) { __asm__ __volatile__ ( "mov<S2SV_blank>r2,<S2SV_blank>%0\\n" <S2SV_StartBug> "ldr<S2SV_blank>r0,<S2SV_blank>=0xc0ded00d\\n" <S2SV_EndBug> "mov<S2SV_blank>r1,<S2SV_blank>#0\\n" "and<S2SV_blank>r0,<S2SV_blank>r0,<S2SV_blank>r0\\n" : : "r" ( sz ) : "r0" , "r1" , "r2" ) ; } | <S2SV_ModStart> __volatile__ ( "mov<S2SV_blank>r2,<S2SV_blank>%0\\n" "mov<S2SV_blank>r0,<S2SV_blank>#0xC0\\n" "lsl<S2SV_blank>r0,<S2SV_blank>#0x8\\n" "mov<S2SV_blank>r1,<S2SV_blank>#0xDE\\n" "orr<S2SV_blank>r0,<S2SV_blank>r1\\n" "lsl<S2SV_blank>r0,<S2SV_blank>#0x8\\n" "mov<S2SV_blank>r1,<S2SV_blank>#0xD0\\n" "orr<S2SV_blank>r0,<S2SV_blank>r1\\n" "lsl<S2SV_blank>r0,<S2SV_blank>#8\\n" "mov<S2SV_blank>r1,<S2SV_blank>#0x0D\\n" "orr<S2SV_blank>r0,<S2SV_blank>r1\\n" <S2SV_ModEnd> "mov<S2SV_blank>r1,<S2SV_blank>#0\\n" "and<S2SV_blank>r0,<S2SV_blank>r0,<S2SV_blank>r0\\n" : |
4,564 | CWE-000 void terminal_mdoc ( void * arg , const struct roff_man * mdoc ) { struct roff_node * n ; <S2SV_StartBug> struct termp * p ; <S2SV_EndBug> p = ( struct termp * ) arg ; p -> overstep = 0 ; p -> rmargin = p -> maxrmargin = p -> defrmargin ; p -> tabwidth = term_len ( p , 5 ) ; n = mdoc -> first -> child ; if ( p -> synopsisonly ) { while ( n != NULL ) { if ( n -> tok == MDOC_Sh && n -> sec == SEC_SYNOPSIS ) { if ( n -> child -> next -> child != NULL ) print_mdoc_nodelist ( p , NULL , & mdoc -> meta , n -> child -> next -> child ) ; term_newln ( p ) ; break ; } n = n -> next ; } } else { <S2SV_StartBug> if ( p -> defindent == 0 ) <S2SV_EndBug> p -> defindent = 5 ; term_begin ( p , print_mdoc_head , print_mdoc_foot , & mdoc -> meta ) ; while ( n != NULL && n -> flags & NODE_NOPRT ) n = n -> next ; if ( n != NULL ) { if ( n -> tok != MDOC_Sh ) term_vspace ( p ) ; print_mdoc_nodelist ( p , NULL , & mdoc -> meta , n ) ; } term_end ( p ) ; <S2SV_StartBug> } <S2SV_EndBug> } | <S2SV_ModStart> termp * p ; size_t save_defindent <S2SV_ModStart> } else { save_defindent = p -> defindent ; <S2SV_ModStart> p ) ; p -> defindent = save_defindent ; |
4,565 | CWE-000 int pktlog_setsize ( struct ol_softc * scn , int32_t size ) { struct ol_pktlog_dev_t * pl_dev = scn -> pdev_txrx_handle -> pl_dev ; struct ath_pktlog_info * pl_info = pl_dev -> pl_info ; <S2SV_StartBug> if ( size < 0 ) <S2SV_EndBug> <S2SV_StartBug> return - EINVAL ; <S2SV_EndBug> if ( size == pl_info -> buf_size ) return 0 ; if ( pl_info -> log_state ) { printk ( "Logging<S2SV_blank>should<S2SV_blank>be<S2SV_blank>disabled<S2SV_blank>before<S2SV_blank>changing<S2SV_blank>bufer<S2SV_blank>size\\n" ) ; return - EINVAL ; } if ( pl_info -> buf != NULL ) pktlog_release_buf ( scn ) ; if ( size != 0 ) pl_info -> buf_size = size ; return 0 ; } | <S2SV_ModStart> ( size < ONE_MEGABYTE || size > MAX_ALLOWED_PKTLOG_SIZE ) { printk ( "%s:<S2SV_blank>Cannot<S2SV_blank>Set<S2SV_blank>Pktlog<S2SV_blank>Buffer<S2SV_blank>size<S2SV_blank>of<S2SV_blank>%d<S2SV_blank>bytes." "Min<S2SV_blank>required<S2SV_blank>is<S2SV_blank>%d<S2SV_blank>MB<S2SV_blank>and<S2SV_blank>Max<S2SV_blank>allowed<S2SV_blank>is<S2SV_blank>%d<S2SV_blank>MB.\\n" , __func__ , size , ( ONE_MEGABYTE / ONE_MEGABYTE ) , ( MAX_ALLOWED_PKTLOG_SIZE / ONE_MEGABYTE ) ) ; <S2SV_ModEnd> return - EINVAL <S2SV_ModStart> - EINVAL ; } |
4,566 | CWE-000 void mce_unregister_decode_chain ( struct notifier_block * nb ) { atomic_dec ( & num_notifiers ) ; <S2SV_StartBug> atomic_notifier_chain_unregister ( & x86_mce_decoder_chain , nb ) ; <S2SV_EndBug> } | <S2SV_ModStart> num_notifiers ) ; blocking_notifier_chain_unregister <S2SV_ModEnd> ( & x86_mce_decoder_chain |
4,567 | CWE-000 bool resolve_type ( Context * context , Type * * type_slot , File_Pos * pos ) { Type * type = * type_slot ; if ( ! ( type -> flags & TYPE_FLAG_UNRESOLVED ) ) { return true ; } typedef struct Prefix Prefix ; struct Prefix { enum { prefix_pointer , prefix_array } kind ; u64 array_length ; Prefix * link ; } ; Prefix * prefix = null ; arena_stack_push ( & context -> stack ) ; while ( true ) { bool done = false ; switch ( type -> kind ) { case primitive_pointer : { Prefix * new = arena_new ( & context -> stack , Prefix ) ; new -> kind = prefix_pointer ; new -> link = prefix ; prefix = new ; type = type -> pointer_to ; } break ; case primitive_array : { Prefix * new = arena_new ( & context -> stack , Prefix ) ; new -> kind = prefix_array ; new -> array_length = type -> array . length ; new -> link = prefix ; prefix = new ; type = type -> array . of ; } break ; case primitive_unresolved_name : { <S2SV_StartBug> type = parse_user_type_name ( context , type -> unresolved_name ) ; <S2SV_EndBug> <S2SV_StartBug> if ( type == null ) { <S2SV_EndBug> u8 * name_string = string_table_access ( context -> string_table , type -> unresolved_name ) ; print_file_pos ( pos ) ; printf ( "No<S2SV_blank>such<S2SV_blank>type:<S2SV_blank>\'%s\'\\n" , name_string ) ; return false ; } <S2SV_StartBug> done = true ; <S2SV_EndBug> } break ; default : assert ( false ) ; } if ( done ) break ; } while ( prefix != null ) { switch ( prefix -> kind ) { case prefix_pointer : type = get_pointer_type ( context , type ) ; break ; case prefix_array : type = get_array_type ( context , type , prefix -> array_length ) ; break ; } prefix = prefix -> link ; } arena_stack_pop ( & context -> stack ) ; * type_slot = type ; return true ; } | <S2SV_ModStart> primitive_unresolved_name : { Type * new <S2SV_ModEnd> = parse_user_type_name ( <S2SV_ModStart> ; if ( new <S2SV_ModEnd> == null ) <S2SV_ModStart> false ; } type = new ; |
4,568 | CWE-000 TestSuite * ubf_fnext_tests ( void ) { TestSuite * suite = create_test_suite ( ) ; add_test ( suite , test_fnext_simple ) ; add_test ( suite , test_fnext_chk_errors ) ; <S2SV_StartBug> return suite ; <S2SV_EndBug> } | <S2SV_ModStart> test_fnext_chk_errors ) ; add_test ( suite , test_fnext_len ) ; |
4,569 | CWE-000 int lxc_clear_hooks ( struct lxc_conf * c , const char * key ) { int i ; struct lxc_list * it , * next ; const char * k = NULL ; bool all = false , done = false ; if ( strcmp ( key , "lxc.hook" ) == 0 ) all = true ; <S2SV_StartBug> else if ( strncmp ( key , "lxc.hook." , sizeof ( "lxc.hook." ) - 1 ) == 0 ) <S2SV_EndBug> <S2SV_StartBug> k = key + sizeof ( "lxc.hook." ) - 1 ; <S2SV_EndBug> else return - 1 ; for ( i = 0 ; i < NUM_LXC_HOOKS ; i ++ ) { if ( all || strcmp ( k , lxchook_names [ i ] ) == 0 ) { lxc_list_for_each_safe ( it , & c -> hooks [ i ] , next ) { lxc_list_del ( it ) ; free ( it -> elem ) ; free ( it ) ; } done = true ; } } if ( ! done ) { ERROR ( "Invalid<S2SV_blank>hook<S2SV_blank>key:<S2SV_blank>%s" , key ) ; return - 1 ; } return 0 ; } | <S2SV_ModStart> , "lxc.hook." , STRLITERALLEN <S2SV_ModEnd> ( "lxc.hook." ) <S2SV_ModStart> ( "lxc.hook." ) <S2SV_ModEnd> ) == 0 <S2SV_ModStart> = key + STRLITERALLEN <S2SV_ModEnd> ( "lxc.hook." ) <S2SV_ModStart> ( "lxc.hook." ) <S2SV_ModEnd> ; else return |
4,570 | CWE-000 void cell_appendArrayElement ( Cell * c , const Cell e ) { if ( c -> type == cNothing ) { c -> type = cArray ; } assert ( c -> type == cArray ) ; if ( c -> array ) { c -> array = realloc ( c -> array , sizeof ( Cell ) * ( c -> array_size + 1 ) ) ; if ( c -> array == NULL ) { fatal_error ( "Unable<S2SV_blank>to<S2SV_blank>expand<S2SV_blank>array." ) ; } c -> array_size ++ ; } if ( ! c -> array ) { c -> array = malloc ( sizeof ( Cell ) ) ; c -> array_size = 1 ; if ( c -> array == NULL ) { <S2SV_StartBug> fatal_error ( "Unable<S2SV_blank>to<S2SV_blank>allcoate<S2SV_blank>memory<S2SV_blank>for<S2SV_blank>Read<S2SV_blank>Array." ) ; <S2SV_EndBug> } } cell_copyCell ( & c -> array [ c -> array_size - 1 ] , & e ) ; } | <S2SV_ModStart> { fatal_error ( "Unable<S2SV_blank>to<S2SV_blank>allcoate<S2SV_blank>memory<S2SV_blank>for<S2SV_blank>appended<S2SV_blank>array<S2SV_blank>element." <S2SV_ModEnd> ) ; } |
4,571 | CWE-000 static int packet_set_ring ( struct sock * sk , union tpacket_req_u * req_u , int closing , int tx_ring ) { struct pgv * pg_vec = NULL ; struct packet_sock * po = pkt_sk ( sk ) ; int was_running , order = 0 ; struct packet_ring_buffer * rb ; struct sk_buff_head * rb_queue ; __be16 num ; int err = - EINVAL ; struct tpacket_req * req = & req_u -> req ; lock_sock ( sk ) ; if ( ! closing && tx_ring && ( po -> tp_version > TPACKET_V2 ) ) { WARN ( 1 , "Tx-ring<S2SV_blank>is<S2SV_blank>not<S2SV_blank>supported.\\n" ) ; goto out ; } rb = tx_ring ? & po -> tx_ring : & po -> rx_ring ; rb_queue = tx_ring ? & sk -> sk_write_queue : & sk -> sk_receive_queue ; err = - EBUSY ; if ( ! closing ) { if ( atomic_read ( & po -> mapped ) ) goto out ; if ( atomic_read ( & rb -> pending ) ) goto out ; } if ( req -> tp_block_nr ) { err = - EBUSY ; if ( unlikely ( rb -> pg_vec ) ) goto out ; switch ( po -> tp_version ) { case TPACKET_V1 : po -> tp_hdrlen = TPACKET_HDRLEN ; break ; case TPACKET_V2 : po -> tp_hdrlen = TPACKET2_HDRLEN ; break ; case TPACKET_V3 : po -> tp_hdrlen = TPACKET3_HDRLEN ; break ; } err = - EINVAL ; if ( unlikely ( ( int ) req -> tp_block_size <= 0 ) ) goto out ; if ( unlikely ( req -> tp_block_size & ( PAGE_SIZE - 1 ) ) ) goto out ; if ( po -> tp_version >= TPACKET_V3 && req -> tp_block_size <= BLK_PLUS_PRIV ( ( u64 ) req_u -> req3 . tp_sizeof_priv ) ) goto out ; if ( unlikely ( req -> tp_frame_size < po -> tp_hdrlen + po -> tp_reserve ) ) goto out ; if ( unlikely ( req -> tp_frame_size & ( TPACKET_ALIGNMENT - 1 ) ) ) goto out ; rb -> frames_per_block = req -> tp_block_size / req -> tp_frame_size ; if ( unlikely ( rb -> frames_per_block <= 0 ) ) goto out ; if ( unlikely ( req -> tp_block_size > UINT_MAX / req -> tp_block_nr ) ) goto out ; <S2SV_StartBug> if ( unlikely ( ( rb -> frames_per_block * req -> tp_block_nr ) != <S2SV_EndBug> req -> tp_frame_nr ) ) goto out ; err = - ENOMEM ; order = get_order ( req -> tp_block_size ) ; pg_vec = alloc_pg_vec ( req , order ) ; if ( unlikely ( ! pg_vec ) ) goto out ; switch ( po -> tp_version ) { case TPACKET_V3 : if ( ! tx_ring ) init_prb_bdqc ( po , rb , pg_vec , req_u , tx_ring ) ; break ; default : break ; } } else { err = - EINVAL ; if ( unlikely ( req -> tp_frame_nr ) ) goto out ; } spin_lock ( & po -> bind_lock ) ; was_running = po -> running ; num = po -> num ; if ( was_running ) { po -> num = 0 ; __unregister_prot_hook ( sk , false ) ; } spin_unlock ( & po -> bind_lock ) ; synchronize_net ( ) ; err = - EBUSY ; mutex_lock ( & po -> pg_vec_lock ) ; if ( closing || atomic_read ( & po -> mapped ) == 0 ) { err = 0 ; spin_lock_bh ( & rb_queue -> lock ) ; swap ( rb -> pg_vec , pg_vec ) ; rb -> frame_max = ( req -> tp_frame_nr - 1 ) ; rb -> head = 0 ; rb -> frame_size = req -> tp_frame_size ; spin_unlock_bh ( & rb_queue -> lock ) ; swap ( rb -> pg_vec_order , order ) ; swap ( rb -> pg_vec_len , req -> tp_block_nr ) ; rb -> pg_vec_pages = req -> tp_block_size / PAGE_SIZE ; po -> prot_hook . func = ( po -> rx_ring . pg_vec ) ? tpacket_rcv : packet_rcv ; skb_queue_purge ( rb_queue ) ; if ( atomic_read ( & po -> mapped ) ) pr_err ( "packet_mmap:<S2SV_blank>vma<S2SV_blank>is<S2SV_blank>busy:<S2SV_blank>%d\\n" , atomic_read ( & po -> mapped ) ) ; } mutex_unlock ( & po -> pg_vec_lock ) ; spin_lock ( & po -> bind_lock ) ; if ( was_running ) { po -> num = num ; register_prot_hook ( sk ) ; } spin_unlock ( & po -> bind_lock ) ; if ( closing && ( po -> tp_version > TPACKET_V2 ) ) { if ( ! tx_ring ) prb_shutdown_retire_blk_timer ( po , tx_ring , rb_queue ) ; } if ( pg_vec ) free_pg_vec ( pg_vec , order , req -> tp_block_nr ) ; out : release_sock ( sk ) ; return err ; } | <S2SV_ModStart> ( unlikely ( req -> tp_block_size > UINT_MAX / req -> tp_block_nr ) ) goto out ; if ( unlikely ( |
4,572 | CWE-000 int main ( int argc , char * * argv ) { char * linebuffer ; char * word ; char * word2 ; unsigned short instruction ; int line ; if ( argc < 2 ) { printf ( "Usage:<S2SV_blank>chip8c<S2SV_blank><filename>\\n" ) ; return 1 ; } FILE * in = fopen ( argv [ 1 ] , "r" ) ; if ( in == NULL ) { printf ( "File<S2SV_blank>not<S2SV_blank>found!\\n" ) ; return 1 ; } printf ( "Compiling<S2SV_blank>file<S2SV_blank>" ) ; printf ( argv [ 1 ] ) ; printf ( "\\n" ) ; FILE * out = fopen ( "program.out" , "wb" ) ; if ( out == NULL ) { printf ( "Unable<S2SV_blank>to<S2SV_blank>create<S2SV_blank>or<S2SV_blank>open<S2SV_blank>output<S2SV_blank>file\\n" ) ; return 1 ; } printf ( "Saving<S2SV_blank>binary<S2SV_blank>with<S2SV_blank>name<S2SV_blank>program.out\\n" ) ; linebuffer = ( char * ) malloc ( 256 * sizeof ( char ) ) ; line = 0 ; while ( fgets ( linebuffer , 256 , in ) != NULL ) { line += 1 ; word = strtok ( linebuffer , "<S2SV_blank>," ) ; if ( strcmp ( word , "CLS" ) ) { instruction = 0x00E0 ; } else if ( strcmp ( word , "RET" ) ) { <S2SV_StartBug> instruction = 0x0EE ; <S2SV_EndBug> } else if ( strcmp ( word , "SYS" ) ) { instruction = 0x0000 ; word = strtok ( NULL , "<S2SV_blank>," ) ; <S2SV_StartBug> instruction |= ( char2us ( word [ 0 ] ) * 256 ) + ( char2us ( word [ 1 ] ) * 16 ) + ( char2us ( word [ 0 ] ) ) ; <S2SV_EndBug> } else if ( strcmp ( word , "JP" ) ) { instruction = 0x1000 ; word = strtok ( NULL , "<S2SV_blank>," ) ; <S2SV_StartBug> instruction |= ( char2us ( word [ 0 ] ) * 256 ) + ( char2us ( word [ 1 ] ) * 16 ) + ( char2us ( word [ 0 ] ) ) ; <S2SV_EndBug> } else if ( strcmp ( word , "CALL" ) ) { instruction = 0x2000 ; word = strtok ( NULL , "<S2SV_blank>," ) ; <S2SV_StartBug> instruction |= ( char2us ( word [ 0 ] ) * 256 ) + ( char2us ( word [ 1 ] ) * 16 ) + ( char2us ( word [ 0 ] ) ) ; <S2SV_EndBug> } else if ( strcmp ( word , "SE" ) ) { word = strtok ( NULL , "<S2SV_blank>," ) ; if ( word [ 0 ] != 'V' ) { printf ( "Error<S2SV_blank>at<S2SV_blank>line<S2SV_blank>%d,<S2SV_blank>expected<S2SV_blank>register<S2SV_blank>argument\\n" , line ) ; free ( linebuffer ) ; fclose ( in ) ; fclose ( out ) ; return 1 ; } word2 = strtok ( NULL , "<S2SV_blank>," ) ; if ( word2 [ 0 ] == 'V' ) { instruction = 0x5000 ; <S2SV_StartBug> instruction |= char2us ( word [ 1 ] ) * 256 + char2us ( word2 [ 1 ] ) * 16 ; <S2SV_EndBug> } else { instruction = 0x3000 ; <S2SV_StartBug> instruction |= ( char2us ( word [ 1 ] ) * 256 ) + ( char2us ( word2 [ 1 ] ) * 16 ) + ( char2us ( word2 [ 0 ] ) ) ; <S2SV_EndBug> } } else if ( strcmp ( word , "SNE" ) ) { word = strtok ( NULL , "<S2SV_blank>," ) ; if ( word [ 0 ] != 'V' ) { printf ( "Error<S2SV_blank>at<S2SV_blank>line<S2SV_blank>%d,<S2SV_blank>expected<S2SV_blank>register<S2SV_blank>argument\\n" , line ) ; free ( linebuffer ) ; fclose ( in ) ; fclose ( out ) ; return 1 ; } word2 = strtok ( NULL , "<S2SV_blank>," ) ; if ( word2 [ 0 ] == 'V' ) { instruction = 0x9000 ; instruction |= char2us ( word [ 1 ] ) * 256 + char2us ( word2 [ 1 ] ) * 16 ; } else { instruction = 0x4000 ; instruction |= ( char2us ( word [ 0 ] ) * 256 ) + ( char2us ( word [ 1 ] ) * 16 ) + ( char2us ( word [ 0 ] ) ) ; } } else if ( strcmp ( word , "LD" ) ) { } else if ( strcmp ( word , "OR" ) ) { } else { printf ( "Found<S2SV_blank>an<S2SV_blank>error<S2SV_blank>in<S2SV_blank>the<S2SV_blank>program.<S2SV_blank>Exiting...\\n" ) ; free ( linebuffer ) ; fclose ( in ) ; fclose ( out ) ; return 1 ; } fwrite ( & instruction , 2 , 1 , out ) ; } free ( linebuffer ) ; fclose ( in ) ; fclose ( out ) ; return 0 ; } | <S2SV_ModStart> { instruction = 0x00EE <S2SV_ModEnd> ; } else <S2SV_ModStart> ( word [ 2 <S2SV_ModEnd> ] ) * <S2SV_ModStart> ( word [ 2 <S2SV_ModEnd> ] ) * <S2SV_ModStart> ( word [ 2 <S2SV_ModEnd> ] ) * <S2SV_ModStart> 1 ] ) << 8 <S2SV_ModEnd> + char2us ( <S2SV_ModStart> 1 ] ) << 4 <S2SV_ModEnd> ; } else <S2SV_ModStart> 1 ] ) << 8 <S2SV_ModEnd> ) + ( <S2SV_ModStart> 1 ] ) <S2SV_ModEnd> ) + ( |
4,573 | CWE-000 int msg_multipart_complete ( su_home_t * home , msg_content_type_t * c , msg_multipart_t * mp ) { char * boundary ; char const * b ; size_t blen , m ; if ( c == NULL || mp == NULL ) return ( errno = EINVAL ) , - 1 ; if ( ! ( b = msg_header_find_param ( c -> c_common , "boundary=" ) ) ) { enum { tlen = 16 * 4 / 3 } ; char token [ sizeof ( "boundary=" ) + tlen + 1 ] ; if ( mp -> mp_data ) { b = mp -> mp_data ; m = mp -> mp_len ; <S2SV_StartBug> if ( strncmp ( b , CR LF "--" , 4 ) == 0 ) <S2SV_EndBug> b += 4 , m -= 4 ; else if ( strncmp ( b , "--" , 2 ) == 0 ) b += 2 , m -= 2 ; else return ( errno = EBADMSG ) , - 1 ; b = su_sprintf ( home , "boundary=\\"%.*s\\"" , ( int ) m , b ) ; } else { strcpy ( token , "boundary=" ) ; msg_random_token ( token + strlen ( "boundary=" ) , ( size_t ) tlen , NULL , 0 ) ; b = su_strdup ( home , token ) ; } if ( ! b ) return - 1 ; msg_params_replace ( home , ( msg_param_t * * ) & c -> c_params , b ) ; b += strlen ( "boundary=" ) ; } if ( ! ( boundary = msg_multipart_boundary ( home , b ) ) ) return - 1 ; blen = strlen ( boundary ) ; m = blen - 2 ; for ( ; mp ; mp = mp -> mp_next ) { if ( mp -> mp_data == NULL ) { mp -> mp_data = boundary ; mp -> mp_len = ( unsigned ) blen ; } else { if ( mp -> mp_len < 3 ) return - 1 ; if ( mp -> mp_data [ 0 ] == '\\r' && mp -> mp_data [ 1 ] == '\\n' ) { if ( mp -> mp_len < m || memcmp ( mp -> mp_data + 2 , boundary + 2 , m - 2 ) ) return - 1 ; } else if ( mp -> mp_data [ 0 ] == '\\n' ) { if ( mp -> mp_len < m - 1 || memcmp ( mp -> mp_data + 1 , boundary + 2 , m - 2 ) ) return - 1 ; } else { if ( mp -> mp_len < m - 2 || memcmp ( mp -> mp_data , boundary + 2 , m - 2 ) ) return - 1 ; } } if ( mp -> mp_next == NULL ) { if ( ! mp -> mp_close_delim ) <S2SV_StartBug> mp -> mp_close_delim = msg_payload_format ( home , "%.*s--" CR LF , <S2SV_EndBug> ( int ) m , boundary ) ; if ( ! mp -> mp_close_delim ) return - 1 ; } else if ( mp -> mp_close_delim ) { msg_payload_t * e = mp -> mp_close_delim ; mp -> mp_close_delim = NULL ; if ( e -> pl_common -> h_prev ) * e -> pl_common -> h_prev = e -> pl_common -> h_succ ; if ( e -> pl_common -> h_succ ) e -> pl_common -> h_succ -> sh_prev = e -> pl_common -> h_prev ; } mp -> mp_common -> h_data = mp -> mp_data ; mp -> mp_common -> h_len = mp -> mp_len ; if ( ! mp -> mp_separator ) <S2SV_StartBug> if ( ! ( mp -> mp_separator = msg_separator_make ( home , CR LF ) ) ) <S2SV_EndBug> return - 1 ; if ( mp -> mp_multipart ) { c = mp -> mp_content_type ; if ( c == NULL ) return ( errno = EBADMSG ) , - 1 ; if ( msg_multipart_complete ( home , c , mp -> mp_multipart ) < 0 ) return - 1 ; } if ( ! mp -> mp_payload ) if ( ! ( mp -> mp_payload = msg_payload_create ( home , NULL , 0 ) ) ) return - 1 ; } return 0 ; } | <S2SV_ModStart> ( b , _CR <S2SV_ModEnd> LF "--" , <S2SV_ModStart> home , "%.*s--" _CR <S2SV_ModEnd> LF , ( <S2SV_ModStart> ( home , _CR <S2SV_ModEnd> LF ) ) |
4,574 | CWE-000 int git_repository_head_for_worktree ( git_reference * * out , git_repository * repo , const char * name ) { git_buf path = GIT_BUF_INIT ; git_reference * head = NULL ; int error ; assert ( out && repo && name ) ; * out = NULL ; if ( ( error = get_worktree_file_path ( & path , repo , name , GIT_HEAD_FILE ) ) < 0 || ( error = git_reference__read_head ( & head , repo , path . ptr ) ) < 0 ) goto out ; if ( git_reference_type ( head ) != GIT_REF_OID ) { git_reference * resolved ; error = git_reference_lookup_resolved ( & resolved , repo , git_reference_symbolic_target ( head ) , - 1 ) ; git_reference_free ( head ) ; head = resolved ; } * out = head ; out : if ( error ) git_reference_free ( head ) ; <S2SV_StartBug> git_buf_clear ( & path ) ; <S2SV_EndBug> return error ; } | <S2SV_ModStart> head ) ; git_buf_free <S2SV_ModEnd> ( & path |
4,575 | CWE-000 void GameModel_save ( GameModel * model ) { if ( model ) { char * rows = ( char * ) calloc ( 10 , sizeof ( char * ) ) ; char * cols = ( char * ) calloc ( 10 , sizeof ( char * ) ) ; char * t_time = ( char * ) calloc ( 10 , sizeof ( char * ) ) ; char * vis = ( char * ) calloc ( 10 , sizeof ( char * ) ) ; sprintf ( rows , "%d" , model -> grid -> rows ) ; sprintf ( cols , "%d" , model -> grid -> cols ) ; sprintf ( t_time , "%d" , model -> interval ) ; sprintf ( vis , "%d" , model -> visible ) ; gchar * bgrn = gdk_rgba_to_string ( & model -> bgrn_col ) ; gchar * cell = gdk_rgba_to_string ( & model -> cell_col ) ; <S2SV_StartBug> JsonObject * object = json_parse ( NULL ) ; <S2SV_EndBug> char * zoom = ( char * ) calloc ( 10 , sizeof ( char * ) ) ; sprintf ( zoom , "%f" , model -> zoom ) ; json_add_value ( object , json_keypair_create ( "gridRows" , rows ) ) ; json_add_value ( object , json_keypair_create ( "gridCols" , cols ) ) ; json_add_value ( object , json_keypair_create ( "tickInterval" , t_time ) ) ; json_add_value ( object , json_keypair_create ( "gridVisible" , vis ) ) ; json_add_value ( object , json_keypair_create ( "backgroundColor" , bgrn ) ) ; json_add_value ( object , json_keypair_create ( "cellColor" , cell ) ) ; json_add_value ( object , json_keypair_create ( "defaultTheme" , model -> themes -> sel_name ) ) ; json_add_value ( object , json_keypair_create ( "zoom" , zoom ) ) ; free ( bgrn ) ; free ( cell ) ; file_write ( object -> main_object , model -> conf -> sel_path ) ; } } | <S2SV_ModStart> cell_col ) ; printf ( "saving<S2SV_blank>bgrn:<S2SV_blank>%s\\n" , bgrn ) ; printf ( "saving<S2SV_blank>cell:<S2SV_blank>%s\\n" , cell ) ; |
4,576 | CWE-000 int main ( char argc , char * * argv ) { <S2SV_StartBug> int retval = 255 ; <S2SV_EndBug> parse_args ( argc , argv ) ; init_shell ( ) ; retval = ush_main_loop ( ) ; uninit_shell ( ) ; return retval ; } | <S2SV_ModStart> retval = 255 ; init_vars ( ) |
4,577 | CWE-000 int test_main ( ) { return test_type ( ) || test_class ( ) || test_id ( ) || test_children ( ) <S2SV_StartBug> ; <S2SV_EndBug> } | <S2SV_ModStart> test_children ( ) || test_indentation_errors ( ) |
4,578 | CWE-000 void checkButtons ( uint8_t row ) { GPIO_ResetBits ( GPIOE , 0b11111111 ) ; GPIO_SetBits ( GPIOE , ( 1 << row ) ) ; for ( uint8_t col = 8 ; col < 16 ; col ++ ) { if ( GPIO_ReadInputDataBit ( GPIOE , ( 1 << col ) ) == Bit_SET ) { <S2SV_StartBug> while ( GPIO_ReadInputDataBit ( GPIOE , ( 1 << col ) ) == Bit_SET ) ; <S2SV_EndBug> if ( instrument == 0 ) { drumArray [ col - 8 ] = drumArray [ col - 8 ] ^ ( 0b10000000 >> row ) ; } else if ( instrument == 1 ) { pianoOneArray [ col - 8 ] = pianoOneArray [ col - 8 ] ^ ( 0b10000000 >> row ) ; } else if ( instrument == 2 ) { pianoTwoArray [ col - 8 ] = pianoTwoArray [ col - 8 ] ^ ( 0b10000000 >> row ) ; } } <S2SV_StartBug> } <S2SV_EndBug> GPIO_ResetBits ( GPIOE , 0b11111111 ) ; } | <S2SV_ModStart> Bit_SET ) { delay_ms ( 5 ) ; if ( ! ( prevGridBtnStateArray [ row ] & ( 1 << ( col - 8 ) ) ) ) { <S2SV_ModEnd> if ( instrument <S2SV_ModStart> ; } } prevGridBtnStateArray [ row ] |= ( 1 << ( col - 8 ) ) ; } else { prevGridBtnStateArray [ row ] &= ( ~ ( 1 << ( col - 8 ) ) ) ; } |
4,579 | CWE-000 static struct alexa_audioplayer * audioplayer_construct ( void ) { struct alexa_audioplayer * ap = alexa_new ( struct alexa_audioplayer ) ; if ( ap ) { <S2SV_StartBug> alexa_generate_uuid ( ap -> token , sizeof ( ap -> token ) ) ; <S2SV_EndBug> ap -> state = AUDIOPLAYER_STATE_IDLE ; ap -> playerActivity = audioplayer_state [ ap -> state ] ; } return ap ; } | <S2SV_ModStart> ap ) { ALEXA_SAFE_FREE <S2SV_ModEnd> ( ap -> <S2SV_ModStart> ap -> token <S2SV_ModEnd> ) ; ap |
4,580 | CWE-000 static int encode ( const struct sproto_arg * args ) { struct encode_ud * self = args -> ud ; lua_State * L = self -> L ; if ( self -> deep >= ENCODE_DEEPLEVEL ) return luaL_error ( L , "The<S2SV_blank>table<S2SV_blank>is<S2SV_blank>too<S2SV_blank>deep" ) ; if ( args -> index > 0 ) { if ( args -> tagname != self -> array_tag ) { self -> array_tag = args -> tagname ; lua_getfield ( L , self -> tbl_index , args -> tagname ) ; if ( lua_isnil ( L , - 1 ) ) { if ( self -> array_index ) { lua_replace ( L , self -> array_index ) ; } self -> array_index = 0 ; return SPROTO_CB_NOARRAY ; } if ( ! lua_istable ( L , - 1 ) ) { return luaL_error ( L , ".*%s(%d)<S2SV_blank>should<S2SV_blank>be<S2SV_blank>a<S2SV_blank>table<S2SV_blank>(Is<S2SV_blank>a<S2SV_blank>%s)" , args -> tagname , args -> index , lua_typename ( L , lua_type ( L , - 1 ) ) ) ; } if ( self -> array_index ) { lua_replace ( L , self -> array_index ) ; } else { self -> array_index = lua_gettop ( L ) ; } } if ( args -> mainindex >= 0 ) { lua_pushvalue ( L , self -> iter_index ) ; if ( ! lua_next ( L , self -> array_index ) ) { lua_pushnil ( L ) ; lua_replace ( L , self -> iter_index ) ; return SPROTO_CB_NIL ; } lua_insert ( L , - 2 ) ; lua_replace ( L , self -> iter_index ) ; } else { lua_geti ( L , self -> array_index , args -> index ) ; } } else { lua_getfield ( L , self -> tbl_index , args -> tagname ) ; } if ( lua_isnil ( L , - 1 ) ) { lua_pop ( L , 1 ) ; return SPROTO_CB_NIL ; } switch ( args -> type ) { case SPROTO_TINTEGER : { int64_t v ; lua_Integer vh ; int isnum ; if ( args -> extra ) { lua_Number vn = lua_tonumber ( L , - 1 ) ; <S2SV_StartBug> v = ( int64_t ) ( vn * args -> extra + 0.5 ) ; <S2SV_EndBug> } else { v = lua_tointegerx ( L , - 1 , & isnum ) ; if ( ! isnum ) { return luaL_error ( L , ".%s[%d]<S2SV_blank>is<S2SV_blank>not<S2SV_blank>an<S2SV_blank>integer<S2SV_blank>(Is<S2SV_blank>a<S2SV_blank>%s)" , args -> tagname , args -> index , lua_typename ( L , lua_type ( L , - 1 ) ) ) ; } } lua_pop ( L , 1 ) ; vh = v >> 31 ; if ( vh == 0 || vh == - 1 ) { * ( uint32_t * ) args -> value = ( uint32_t ) v ; return 4 ; } else { * ( uint64_t * ) args -> value = ( uint64_t ) v ; return 8 ; } } case SPROTO_TBOOLEAN : { int v = lua_toboolean ( L , - 1 ) ; if ( ! lua_isboolean ( L , - 1 ) ) { return luaL_error ( L , ".%s[%d]<S2SV_blank>is<S2SV_blank>not<S2SV_blank>a<S2SV_blank>boolean<S2SV_blank>(Is<S2SV_blank>a<S2SV_blank>%s)" , args -> tagname , args -> index , lua_typename ( L , lua_type ( L , - 1 ) ) ) ; } * ( int * ) args -> value = v ; lua_pop ( L , 1 ) ; return 4 ; } case SPROTO_TSTRING : { size_t sz = 0 ; const char * str ; if ( ! lua_isstring ( L , - 1 ) ) { return luaL_error ( L , ".%s[%d]<S2SV_blank>is<S2SV_blank>not<S2SV_blank>a<S2SV_blank>string<S2SV_blank>(Is<S2SV_blank>a<S2SV_blank>%s)" , args -> tagname , args -> index , lua_typename ( L , lua_type ( L , - 1 ) ) ) ; } else { str = lua_tolstring ( L , - 1 , & sz ) ; } if ( sz > args -> length ) return SPROTO_CB_ERROR ; memcpy ( args -> value , str , sz ) ; lua_pop ( L , 1 ) ; return sz ; } case SPROTO_TSTRUCT : { struct encode_ud sub ; int r ; int top = lua_gettop ( L ) ; if ( ! lua_istable ( L , top ) ) { return luaL_error ( L , ".%s[%d]<S2SV_blank>is<S2SV_blank>not<S2SV_blank>a<S2SV_blank>table<S2SV_blank>(Is<S2SV_blank>a<S2SV_blank>%s)" , args -> tagname , args -> index , lua_typename ( L , lua_type ( L , - 1 ) ) ) ; } sub . L = L ; sub . st = args -> subtype ; sub . tbl_index = top ; sub . array_tag = NULL ; sub . array_index = 0 ; sub . deep = self -> deep + 1 ; lua_pushnil ( L ) ; sub . iter_index = sub . tbl_index + 1 ; r = sproto_encode ( args -> subtype , args -> value , args -> length , encode , & sub ) ; lua_settop ( L , top - 1 ) ; if ( r < 0 ) return SPROTO_CB_ERROR ; return r ; } default : return luaL_error ( L , "Invalid<S2SV_blank>field<S2SV_blank>type<S2SV_blank>%d" , args -> type ) ; } } | <S2SV_ModStart> int64_t ) ( round ( <S2SV_ModStart> args -> extra ) <S2SV_ModEnd> ) ; } |
4,581 | CWE-000 PPH_HANDLE_ITEM PhCreateHandleItem ( _In_opt_ PSYSTEM_HANDLE_TABLE_ENTRY_INFO_EX Handle ) { PPH_HANDLE_ITEM handleItem ; handleItem = PhCreateObject ( PhEmGetObjectSize ( EmHandleItemType , sizeof ( PH_HANDLE_ITEM ) ) , PhHandleItemType ) ; memset ( handleItem , 0 , sizeof ( PH_HANDLE_ITEM ) ) ; if ( Handle ) { handleItem -> Handle = ( HANDLE ) Handle -> HandleValue ; handleItem -> Object = Handle -> Object ; handleItem -> Attributes = Handle -> HandleAttributes ; handleItem -> GrantedAccess = ( ACCESS_MASK ) Handle -> GrantedAccess ; handleItem -> TypeIndex = Handle -> ObjectTypeIndex ; PhPrintPointer ( handleItem -> HandleString , ( PVOID ) handleItem -> Handle ) ; <S2SV_StartBug> PhPrintPointer ( handleItem -> ObjectString , handleItem -> Object ) ; <S2SV_EndBug> <S2SV_StartBug> PhPrintPointer ( handleItem -> GrantedAccessString , UlongToPtr ( handleItem -> GrantedAccess ) ) ; <S2SV_EndBug> } PhEmCallObjectOperation ( EmHandleItemType , handleItem , EmObjectCreate ) ; return handleItem ; } | <S2SV_ModStart> ( handleItem -> <S2SV_ModEnd> GrantedAccessString , UlongToPtr <S2SV_ModStart> -> GrantedAccess ) ) ; if ( handleItem -> Object ) PhPrintPointer ( handleItem -> ObjectString , handleItem -> Object |
4,582 | CWE-000 struct rpmsg_endpoint * rpmsg_create_ept ( struct rpmsg_channel * rp_chnl , rpmsg_rx_cb_t cb , void * priv , <S2SV_StartBug> unsigned long addr ) <S2SV_EndBug> { struct remote_device * rdev = RPMSG_NULL ; struct rpmsg_endpoint * rp_ept = RPMSG_NULL ; if ( ! rp_chnl || ! cb ) { return RPMSG_NULL ; } rdev = rp_chnl -> rdev ; rp_ept = _create_endpoint ( rdev , cb , priv , addr ) ; if ( rp_ept ) { rp_ept -> rp_chnl = rp_chnl ; } return rp_ept ; } | <S2SV_ModStart> * priv , uint32_t <S2SV_ModEnd> addr ) { |
4,583 | CWE-000 static void tcp_v4_send_reset ( struct sock * sk , struct sk_buff * skb ) { const struct tcphdr * th = tcp_hdr ( skb ) ; struct { struct tcphdr th ; # ifdef CONFIG_TCP_MD5SIG __be32 opt [ ( TCPOLEN_MD5SIG_ALIGNED >> 2 ) ] ; # endif } rep ; struct ip_reply_arg arg ; # ifdef CONFIG_TCP_MD5SIG struct tcp_md5sig_key * key ; const __u8 * hash_location = NULL ; unsigned char newhash [ 16 ] ; int genhash ; struct sock * sk1 = NULL ; # endif struct net * net ; if ( th -> rst ) return ; if ( ! sk && skb_rtable ( skb ) -> rt_type != RTN_LOCAL ) return ; memset ( & rep , 0 , sizeof ( rep ) ) ; rep . th . dest = th -> source ; rep . th . source = th -> dest ; rep . th . doff = sizeof ( struct tcphdr ) / 4 ; rep . th . rst = 1 ; if ( th -> ack ) { rep . th . seq = th -> ack_seq ; } else { rep . th . ack = 1 ; rep . th . ack_seq = htonl ( ntohl ( th -> seq ) + th -> syn + th -> fin + skb -> len - ( th -> doff << 2 ) ) ; } memset ( & arg , 0 , sizeof ( arg ) ) ; arg . iov [ 0 ] . iov_base = ( unsigned char * ) & rep ; arg . iov [ 0 ] . iov_len = sizeof ( rep . th ) ; <S2SV_StartBug> # ifdef CONFIG_TCP_MD5SIG <S2SV_EndBug> hash_location = tcp_parse_md5sig_option ( th ) ; if ( ! sk && hash_location ) { <S2SV_StartBug> sk1 = __inet_lookup_listener ( dev_net ( skb_dst ( skb ) -> dev ) , <S2SV_EndBug> & tcp_hashinfo , ip_hdr ( skb ) -> daddr , ntohs ( th -> source ) , inet_iif ( skb ) ) ; if ( ! sk1 ) return ; rcu_read_lock ( ) ; key = tcp_md5_do_lookup ( sk1 , ( union tcp_md5_addr * ) & ip_hdr ( skb ) -> saddr , AF_INET ) ; if ( ! key ) goto release_sk1 ; genhash = tcp_v4_md5_hash_skb ( newhash , key , NULL , NULL , skb ) ; if ( genhash || memcmp ( hash_location , newhash , 16 ) != 0 ) goto release_sk1 ; } else { key = sk ? tcp_md5_do_lookup ( sk , ( union tcp_md5_addr * ) & ip_hdr ( skb ) -> saddr , AF_INET ) : NULL ; } if ( key ) { rep . opt [ 0 ] = htonl ( ( TCPOPT_NOP << 24 ) | ( TCPOPT_NOP << 16 ) | ( TCPOPT_MD5SIG << 8 ) | TCPOLEN_MD5SIG ) ; arg . iov [ 0 ] . iov_len += TCPOLEN_MD5SIG_ALIGNED ; rep . th . doff = arg . iov [ 0 ] . iov_len / 4 ; tcp_v4_md5_hash_hdr ( ( __u8 * ) & rep . opt [ 1 ] , key , ip_hdr ( skb ) -> saddr , ip_hdr ( skb ) -> daddr , & rep . th ) ; } # endif arg . csum = csum_tcpudp_nofold ( ip_hdr ( skb ) -> daddr , ip_hdr ( skb ) -> saddr , arg . iov [ 0 ] . iov_len , IPPROTO_TCP , 0 ) ; arg . csumoffset = offsetof ( struct tcphdr , check ) / 2 ; arg . flags = ( sk && inet_sk ( sk ) -> transparent ) ? IP_REPLY_ARG_NOSRCCHECK : 0 ; arg . bound_dev_if = sk ? sk -> sk_bound_dev_if : inet_iif ( skb ) ; <S2SV_StartBug> net = dev_net ( skb_dst ( skb ) -> dev ) ; <S2SV_EndBug> arg . tos = ip_hdr ( skb ) -> tos ; ip_send_reply ( net -> ipv4 . tcp_sock , skb , ip_hdr ( skb ) -> saddr , & arg , arg . iov [ 0 ] . iov_len ) ; TCP_INC_STATS_BH ( net , TCP_MIB_OUTSEGS ) ; TCP_INC_STATS_BH ( net , TCP_MIB_OUTRSTS ) ; # ifdef CONFIG_TCP_MD5SIG release_sk1 : if ( sk1 ) { rcu_read_unlock ( ) ; sock_put ( sk1 ) ; } # endif } | <S2SV_ModStart> th ) ; net = sk ? sock_net ( sk ) : dev_net ( skb_dst ( skb ) -> dev ) ; <S2SV_ModStart> = __inet_lookup_listener ( net <S2SV_ModEnd> , & tcp_hashinfo <S2SV_ModStart> skb ) ; <S2SV_ModEnd> arg . tos |
4,584 | CWE-000 enum LSQUIC_CONN_STATUS lsquic_conn_status ( lsquic_conn_t * lconn , char * errbuf , size_t bufsz ) { struct full_conn * const conn = ( struct full_conn * ) lconn ; size_t n ; if ( ! ( conn -> fc_flags & ( FC_ERROR | FC_TIMED_OUT | FC_ABORTED | FC_GOT_PRST | FC_HSK_FAILED | FC_CLOSING | FC_GOING_AWAY ) ) ) { <S2SV_StartBug> if ( lconn -> cn_flags & LSCONN_HANDSHAKE_DONE ) <S2SV_EndBug> return LSCONN_ST_CONNECTED ; else return LSCONN_ST_HSK_IN_PROGRESS ; } if ( errbuf && bufsz ) { if ( conn -> fc_errmsg ) { n = bufsz < MAX_ERRMSG ? bufsz : MAX_ERRMSG ; strncpy ( errbuf , conn -> fc_errmsg , n ) ; errbuf [ n - 1 ] = '\\0' ; } else errbuf [ 0 ] = '\\0' ; } if ( conn -> fc_flags & FC_ERROR ) return LSCONN_ST_ERROR ; if ( conn -> fc_flags & FC_TIMED_OUT ) return LSCONN_ST_TIMED_OUT ; if ( conn -> fc_flags & FC_ABORTED ) return LSCONN_ST_USER_ABORTED ; if ( conn -> fc_flags & FC_GOT_PRST ) return LSCONN_ST_RESET ; if ( conn -> fc_flags & FC_HSK_FAILED ) return LSCONN_ST_HSK_FAILURE ; if ( conn -> fc_flags & FC_CLOSING ) return LSCONN_ST_CLOSED ; assert ( conn -> fc_flags & FC_GOING_AWAY ) ; return LSCONN_ST_GOING_AWAY ; } | <S2SV_ModStart> ) ) { if ( lconn -> cn_flags & LSCONN_PEER_GOING_AWAY ) return LSCONN_ST_PEER_GOING_AWAY ; else |
4,585 | CWE-000 static int print_one_job_routine ( t_jc_job * job ) { t_list * p_list ; <S2SV_StartBug> t_jc_p * p ; <S2SV_EndBug> p_list = job -> p_list ; p = ( t_jc_p * ) ( p_list -> content ) ; ft_printf ( "[%d]<S2SV_blank>+<S2SV_blank>%d<S2SV_blank>%-*s" , job -> tag , p -> pid , 11 , g_jc_status_string [ p -> status ] ) ; while ( p_list ) { <S2SV_StartBug> p = ( t_jc_p * ) ( p_list -> content ) ; <S2SV_EndBug> if ( p_list -> prev ) ft_printf ( "%*s%d<S2SV_blank>%-*s" , 6 + ft_numlen ( job -> tag ) , "<S2SV_blank>" , p -> pid , 11 , g_jc_status_string [ p -> status ] ) ; if ( p -> status == KILLED && p -> rvalue > 0 && p -> rvalue <= 32 ) ft_printf ( "(Signal<S2SV_blank>:<S2SV_blank>%s<S2SV_blank>(%d))" , sys_siglist [ p -> rvalue ] , p -> rvalue ) ; else if ( p -> status == KILLED ) ft_printf ( "(Signal<S2SV_blank>:<S2SV_blank>%d)" , p -> rvalue ) ; else if ( p -> status == DONE ) ft_printf ( "(Exit<S2SV_blank>code<S2SV_blank>:<S2SV_blank>%d)" , p -> rvalue ) ; else ft_printf ( "%*s" , 18 , "<S2SV_blank>" ) ; ft_printf ( "<S2SV_blank>%s\\n" , p -> cmd ) ; p_list = p_list -> next ; } return ( 1 ) ; } | <S2SV_ModStart> * p_list ; t_jc_proc * p ; p_list = job -> proc_list ; p = ( t_jc_proc <S2SV_ModEnd> * ) ( <S2SV_ModStart> p = ( t_jc_proc <S2SV_ModEnd> * ) ( |
4,586 | CWE-000 int command_lldi ( t_core * core , t_process * process ) { int farg ; int sarg ; int offset ; farg = ARGS [ 0 ] . type == IND_CODE ? get_value_from_ind ( MAP , ARGS [ 0 ] . arg ) : 0 ; if ( ARGS [ 0 ] . arg <= REG_NUMBER && ARGS [ 0 ] . arg > 0 ) farg = ARGS [ 0 ] . type == REG_CODE ? REG [ ARGS [ 0 ] . arg - 1 ] : farg ; farg = ARGS [ 0 ] . type == DIR_CODE ? ARGS [ 0 ] . arg : farg ; sarg = ARGS [ 1 ] . type == REG_CODE ? REG [ ARGS [ 1 ] . arg - 1 ] : 0 ; sarg = ARGS [ 1 ] . type == DIR_CODE ? ARGS [ 1 ] . arg : sarg ; offset = ( farg + sarg ) % MEM_SIZE ; offset += offset < 0 ? MEM_SIZE : 0 ; if ( ARGS [ 2 ] . arg <= REG_NUMBER && ARGS [ 2 ] . arg > 0 && <S2SV_StartBug> ARGS [ 2 ] . type == REG_CODE ) <S2SV_EndBug> { REG [ ARGS [ 2 ] . arg - 1 ] = get_value_from_map ( MAP , offset , 4 ) ; process -> carry = REG [ ARGS [ 2 ] . arg - 1 ] ? 0 : 1 ; } print_flag_v ( core , process , farg , sarg ) ; return ( 1 ) ; } | <S2SV_ModStart> type == REG_CODE && ( ( ARGS [ 0 ] . type == REG_CODE && ARGS [ 0 ] . arg <= REG_NUMBER && ARGS [ 0 ] . arg > 0 ) || ARGS [ 0 ] . type == DIR_CODE || ARGS [ 0 ] . type == IND_CODE ) && ( ( ARGS [ 1 ] . type == REG_CODE && ARGS [ 1 ] . arg <= REG_NUMBER && ARGS [ 1 ] . arg > 0 ) || ARGS [ 1 ] . type == DIR_CODE ) |
4,587 | CWE-000 <S2SV_StartBug> static void timer_init ( const uint32_t cpu_freq_mhz ) <S2SV_EndBug> { Chip_TIMER_Init ( DELAY_TIMER ) ; reset_timer ( ) ; Chip_TIMER_Reset ( DELAY_TIMER ) ; <S2SV_StartBug> Chip_TIMER_PrescaleSet ( DELAY_TIMER , cpu_freq_mhz - 1 ) ; <S2SV_EndBug> Chip_TIMER_MatchEnableInt ( DELAY_TIMER , 1 ) ; Chip_TIMER_SetMatch ( DELAY_TIMER , 1 , 0xFFFFFFFF ) ; Chip_TIMER_ResetOnMatchDisable ( DELAY_TIMER , 1 ) ; Chip_TIMER_Enable ( DELAY_TIMER ) ; NVIC_EnableIRQ ( DELAY_TIMER_IRQn ) ; NVIC_ClearPendingIRQ ( DELAY_TIMER_IRQn ) ; } | <S2SV_ModStart> void timer_init ( void <S2SV_ModEnd> ) { Chip_TIMER_Init <S2SV_ModStart> DELAY_TIMER ) ; const uint32_t cpu_freq_MHz = get_timer_clock_rate ( ) / 1000000 ; <S2SV_ModStart> ( DELAY_TIMER , cpu_freq_MHz <S2SV_ModEnd> - 1 ) |
4,588 | CWE-000 static int tpm_tis_i2c_recv ( struct tpm_chip * chip , u8 * buf , size_t count ) { int size = 0 ; <S2SV_StartBug> int expected , status ; <S2SV_EndBug> if ( count < TPM_HEADER_SIZE ) { size = - EIO ; goto out ; } size = recv_data ( chip , buf , TPM_HEADER_SIZE ) ; if ( size < TPM_HEADER_SIZE ) { dev_err ( chip -> dev , "Unable<S2SV_blank>to<S2SV_blank>read<S2SV_blank>header\\n" ) ; goto out ; } expected = be32_to_cpu ( * ( __be32 * ) ( buf + 2 ) ) ; <S2SV_StartBug> if ( ( size_t ) expected > count ) { <S2SV_EndBug> size = - EIO ; goto out ; } size += recv_data ( chip , & buf [ TPM_HEADER_SIZE ] , expected - TPM_HEADER_SIZE ) ; if ( size < expected ) { dev_err ( chip -> dev , "Unable<S2SV_blank>to<S2SV_blank>read<S2SV_blank>remainder<S2SV_blank>of<S2SV_blank>result\\n" ) ; size = - ETIME ; goto out ; } wait_for_stat ( chip , TPM_STS_VALID , chip -> vendor . timeout_c , & status ) ; if ( status & TPM_STS_DATA_AVAIL ) { dev_err ( chip -> dev , "Error<S2SV_blank>left<S2SV_blank>over<S2SV_blank>data\\n" ) ; size = - EIO ; goto out ; } out : tpm_tis_i2c_ready ( chip ) ; usleep_range ( SLEEP_DURATION_RESET_LOW , SLEEP_DURATION_RESET_HI ) ; release_locality ( chip , chip -> vendor . locality , 0 ) ; return size ; } | <S2SV_ModStart> 0 ; int status ; u32 expected <S2SV_ModEnd> ; if ( <S2SV_ModStart> if ( ( ( <S2SV_ModStart> expected > count ) || ( expected < TPM_HEADER_SIZE ) |
4,589 | CWE-000 void * threadFunc ( void * arg ) { int tid = assign_id ( ) ; int r ; int sock ; if ( ( sock = socket ( AF_INET , SOCK_STREAM , 0 ) ) < 0 ) { perror ( "socket()" ) ; report_done ( tid , 0.0 , - 1 ) ; pthread_exit ( NULL ) ; } struct sockaddr_in addr ; memset ( & addr , 0 , sizeof ( addr ) ) ; addr . sin_family = AF_INET ; addr . sin_port = htons ( CONN_PORT ) ; addr . sin_addr . s_addr = inet_addr ( CONN_ADDR ) ; clock_t begin = clock ( ) ; r = connect ( sock , ( struct sockaddr * ) & addr , sizeof ( addr ) ) ; if ( r < 0 ) { perror ( "connect()" ) ; report_done ( tid , 0.0 , - 1 ) ; pthread_exit ( NULL ) ; } set_nonblock ( sock ) ; size_t msgnum = sizeof ( reqs ) / sizeof ( reqs [ 0 ] ) ; char recvbuf [ 256 ] ; float calc_res ; int res_num = 0 ; int status ; for ( int i = 0 ; i < msgnum ; ++ i ) { status = - 1 ; r = send ( sock , reqs [ i ] , strlen ( reqs [ i ] ) , 0 ) ; if ( r < 0 ) { perror ( "send()" ) ; goto close_sock ; } do { r = recv ( sock , recvbuf , sizeof ( recvbuf ) , 0 ) ; if ( r < 0 ) { if ( errno != EWOULDBLOCK ) { perror ( "recv()" ) ; goto close_sock ; } continue ; } if ( r == 0 ) { printf ( "T%d<S2SV_blank>connection<S2SV_blank>closed<S2SV_blank>by<S2SV_blank>server\\n" , tid ) ; goto close_sock ; } recvbuf [ r ] = '\\0' ; if ( strcmp ( answs [ i ] , ANSW_FORMAT_CALCED ) == 0 ) { r = ( sscanf ( recvbuf , answs [ i ] , & calc_res ) == 1 ) ; if ( r ) { if ( results [ res_num ] != calc_res ) { printf ( "T%d<S2SV_blank>wrong<S2SV_blank>result:<S2SV_blank>%f<S2SV_blank>(%f<S2SV_blank>expected)\\n" , tid , calc_res , results [ res_num ] ) ; goto close_sock ; } <S2SV_StartBug> ++ res_num ; <S2SV_EndBug> <S2SV_StartBug> } <S2SV_EndBug> else { r = ( strcmp ( recvbuf , ANSW_BALANCEZERO ) == 0 ) ; } } else r = ( strcmp ( recvbuf , answs [ i ] ) == 0 ) ; if ( ! r ) { printf ( "T%d<S2SV_blank>:<S2SV_blank>resp<S2SV_blank>#%d<S2SV_blank>got<S2SV_blank>\'%s\'<S2SV_blank>(expected<S2SV_blank>\'%s\')\\n" , tid , i , recvbuf , answs [ i ] ) ; goto close_sock ; } } while ( r < 0 ) ; status = 0 ; } close_sock : close ( sock ) ; clock_t end = clock ( ) ; double time_spent = ( double ) ( end - begin ) / CLOCKS_PER_SEC ; report_done ( tid , time_spent , status ) ; pthread_exit ( NULL ) ; } | <S2SV_ModStart> close_sock ; } } else { r = ( strcmp ( recvbuf , ANSW_BALANCEZERO ) == 0 ) ; } <S2SV_ModStart> ++ res_num ; <S2SV_ModEnd> } else r |
4,590 | CWE-000 END_TEST <S2SV_StartBug> START_TEST ( test_misc_error_string ) <S2SV_EndBug> { if ( XML_ErrorString ( ( enum XML_Error ) - 1 ) != NULL ) fail ( "Negative<S2SV_blank>error<S2SV_blank>code<S2SV_blank>not<S2SV_blank>rejected" ) ; if ( XML_ErrorString ( ( enum XML_Error ) 100 ) != NULL ) fail ( "Large<S2SV_blank>error<S2SV_blank>code<S2SV_blank>not<S2SV_blank>rejected" ) ; } | <S2SV_ModStart> END_TEST START_TEST ( test_misc_null_parser ) { XML_ParserFree ( NULL <S2SV_ModEnd> ) ; } |
4,591 | CWE-000 static void __disk_unblock_events ( struct gendisk * disk , bool check_now ) { struct disk_events * ev = disk -> ev ; unsigned long intv ; unsigned long flags ; spin_lock_irqsave ( & ev -> lock , flags ) ; if ( WARN_ON_ONCE ( ev -> block <= 0 ) ) goto out_unlock ; if ( -- ev -> block ) goto out_unlock ; intv = disk_events_poll_jiffies ( disk ) ; set_timer_slack ( & ev -> dwork . timer , intv / 4 ) ; if ( check_now ) queue_delayed_work ( system_freezable_power_efficient_wq , & ev -> dwork , 0 ) ; else if ( intv ) queue_delayed_work ( system_freezable_power_efficient_wq , & ev -> dwork , intv ) ; <S2SV_StartBug> out_unlock : <S2SV_EndBug> spin_unlock_irqrestore ( & ev -> lock , flags ) ; } | <S2SV_ModStart> intv ) ; <S2SV_ModEnd> spin_unlock_irqrestore ( & |
4,592 | CWE-000 int drm_connector_init ( struct drm_device * dev , struct drm_connector * connector , const struct drm_connector_funcs * funcs , int connector_type ) { struct drm_mode_config * config = & dev -> mode_config ; int ret ; struct ida * connector_ida = & drm_connector_enum_list [ connector_type ] . ida ; ret = drm_mode_object_get_reg ( dev , & connector -> base , DRM_MODE_OBJECT_CONNECTOR , false , drm_connector_free ) ; if ( ret ) return ret ; connector -> base . properties = & connector -> properties ; connector -> dev = dev ; connector -> funcs = funcs ; ret = ida_simple_get ( & config -> connector_ida , 0 , 0 , GFP_KERNEL ) ; if ( ret < 0 ) goto out_put ; connector -> index = ret ; ret = 0 ; connector -> connector_type = connector_type ; connector -> connector_type_id = ida_simple_get ( connector_ida , 1 , 0 , GFP_KERNEL ) ; if ( connector -> connector_type_id < 0 ) { ret = connector -> connector_type_id ; goto out_put_id ; } connector -> name = kasprintf ( GFP_KERNEL , "%s-%d" , drm_connector_enum_list [ connector_type ] . name , connector -> connector_type_id ) ; if ( ! connector -> name ) { ret = - ENOMEM ; goto out_put_type_id ; } INIT_LIST_HEAD ( & connector -> probed_modes ) ; INIT_LIST_HEAD ( & connector -> modes ) ; mutex_init ( & connector -> mutex ) ; connector -> edid_blob_ptr = NULL ; connector -> status = connector_status_unknown ; drm_connector_get_cmdline_mode ( connector ) ; spin_lock_irq ( & config -> connector_list_lock ) ; list_add_tail ( & connector -> head , & config -> connector_list ) ; config -> num_connector ++ ; spin_unlock_irq ( & config -> connector_list_lock ) ; if ( connector_type != DRM_MODE_CONNECTOR_VIRTUAL ) drm_object_attach_property ( & connector -> base , config -> edid_property , 0 ) ; drm_object_attach_property ( & connector -> base , config -> dpms_property , 0 ) ; <S2SV_StartBug> if ( drm_core_check_feature ( dev , DRIVER_ATOMIC ) ) { <S2SV_EndBug> drm_object_attach_property ( & connector -> base , config -> prop_crtc_id , 0 ) ; } connector -> debugfs_entry = NULL ; out_put_type_id : if ( ret ) ida_simple_remove ( connector_ida , connector -> connector_type_id ) ; out_put_id : if ( ret ) ida_simple_remove ( & config -> connector_ida , connector -> index ) ; out_put : if ( ret ) drm_mode_object_unregister ( dev , & connector -> base ) ; return ret ; } | <S2SV_ModStart> 0 ) ; drm_object_attach_property ( & connector -> base , config -> link_status_property , 0 ) ; |
4,593 | CWE-000 void render ( State * state ) { int row = 1 ; display_grid ( state -> grid ) ; row = display_controls ( row ) ; row ++ ; mvprintw ( row ++ , MENU_COL , "SCORE:<S2SV_blank>%d" , state -> score ) ; mvprintw ( row ++ , MENU_COL , "LEVEL:<S2SV_blank>%d" , state -> level ) ; <S2SV_StartBug> row ++ ; <S2SV_EndBug> if ( state -> level < 5 ) { display_preview ( row , state -> next ) ; <S2SV_StartBug> } else { <S2SV_EndBug> mvprintw ( row ++ , MENU_COL , "NO<S2SV_blank>PREVIEW<S2SV_blank>AT<S2SV_blank>LEVEL<S2SV_blank>5<S2SV_blank>AND<S2SV_blank>ABOVE!" ) ; } } | <S2SV_ModStart> level ) ; mvprintw ( row ++ , MENU_COL , "CAN_HOLD:<S2SV_blank>%d<S2SV_blank>|<S2SV_blank>IN_HOLD:<S2SV_blank>%d" , state -> can_hold , state -> in_hold ) ; <S2SV_ModStart> row ++ ; mvprintw ( row , MENU_COL + 12 , "HOLD:" ) ; if ( state -> in_hold ) { display_hold ( row + 1 , state -> held ) ; } <S2SV_ModStart> ) ; } <S2SV_ModEnd> } <S2SV_null> <S2SV_null> |
4,594 | CWE-000 int bt_field_type_get_alignment ( struct bt_field_type * type ) { int ret ; enum bt_field_type_id type_id ; if ( ! type ) { BT_LOGW_STR ( "Invalid<S2SV_blank>parameter:<S2SV_blank>field<S2SV_blank>type<S2SV_blank>is<S2SV_blank>NULL." ) ; ret = - 1 ; goto end ; } if ( type -> frozen ) { ret = ( int ) type -> alignment ; goto end ; } type_id = bt_field_type_get_type_id ( type ) ; switch ( type_id ) { case BT_FIELD_TYPE_ID_SEQUENCE : { struct bt_field_type * element = bt_field_type_sequence_get_element_type ( type ) ; assert ( element ) ; ret = bt_field_type_get_alignment ( element ) ; bt_put ( element ) ; break ; } case BT_FIELD_TYPE_ID_ARRAY : { struct bt_field_type * element = bt_field_type_array_get_element_type ( type ) ; assert ( element ) ; ret = bt_field_type_get_alignment ( element ) ; bt_put ( element ) ; break ; } case BT_FIELD_TYPE_ID_STRUCT : { int64_t i , element_count ; element_count = bt_field_type_structure_get_field_count ( type ) ; assert ( element_count >= 0 ) ; for ( i = 0 ; i < element_count ; i ++ ) { <S2SV_StartBug> struct bt_field_type * field ; <S2SV_EndBug> int field_alignment ; ret = bt_field_type_structure_get_field_by_index ( type , NULL , & field , i ) ; assert ( ret == 0 ) ; assert ( field ) ; field_alignment = bt_field_type_get_alignment ( field ) ; bt_put ( field ) ; if ( field_alignment < 0 ) { ret = field_alignment ; goto end ; } type -> alignment = MAX ( field_alignment , type -> alignment ) ; } ret = ( int ) type -> alignment ; break ; } case BT_FIELD_TYPE_ID_UNKNOWN : BT_LOGW ( "Invalid<S2SV_blank>parameter:<S2SV_blank>unknown<S2SV_blank>field<S2SV_blank>type<S2SV_blank>ID:<S2SV_blank>" "addr=%p,<S2SV_blank>ft-id=%d" , type , type_id ) ; ret = - 1 ; break ; default : ret = ( int ) type -> alignment ; break ; } end : return ret ; } | <S2SV_ModStart> bt_field_type * field = NULL |
4,595 | CWE-000 void vnc_direct_bgp_del_nve ( struct bgp * bgp , struct rfapi_descriptor * rfd ) { struct listnode * node , * nnode ; struct rfapi_rfg_name * rfgn ; struct rfapi_nve_group_cfg * rfg = rfd -> rfg ; afi_t afi = family2afi ( rfd -> vn_addr . addr_family ) ; if ( ! afi ) { zlog_err ( "%s:<S2SV_blank>can\'t<S2SV_blank>get<S2SV_blank>afi<S2SV_blank>of<S2SV_blank>nve<S2SV_blank>vn<S2SV_blank>addr" , __func__ ) ; return ; } if ( ! bgp ) return ; if ( ! bgp -> rfapi_cfg ) { vnc_zlog_debug_verbose ( "%s:<S2SV_blank>bgp->rfapi_cfg<S2SV_blank>is<S2SV_blank>NULL,<S2SV_blank>skipping" , __func__ ) ; return ; } if ( ! VNC_EXPORT_BGP_GRP_ENABLED ( bgp -> rfapi_cfg ) ) { vnc_zlog_debug_verbose ( "%s:<S2SV_blank>export-to-bgp<S2SV_blank>group<S2SV_blank>mode<S2SV_blank>not<S2SV_blank>enabled,<S2SV_blank>skipping" , __func__ ) ; return ; } if ( ! bgp -> redist [ afi ] [ ZEBRA_ROUTE_VNC_DIRECT ] ) { vnc_zlog_debug_verbose ( "%s:<S2SV_blank>bgp<S2SV_blank>redistribution<S2SV_blank>of<S2SV_blank>VNC<S2SV_blank>direct<S2SV_blank>routes<S2SV_blank>is<S2SV_blank>off" , __func__ ) ; return ; } for ( ALL_LIST_ELEMENTS ( bgp -> rfapi_cfg -> rfg_export_direct_bgp_l , node , nnode , rfgn ) ) { if ( rfg && rfgn -> rfg == rfg ) { struct route_table * rt = NULL ; struct route_node * rn ; struct rfapi_import_table * import_table ; import_table = rfg -> rfapi_import_table ; if ( afi == AFI_IP || afi == AFI_IP6 ) { rt = import_table -> imported_vpn [ afi ] ; } else { zlog_err ( "%s:<S2SV_blank>bad<S2SV_blank>afi<S2SV_blank>%d" , __func__ , afi ) ; return ; } for ( rn = route_top ( rt ) ; rn ; rn = route_next ( rn ) ) { if ( rn -> info ) { struct prefix nhp ; struct rfapi_descriptor * irfd = rfd ; if ( rfapiRaddr2Qprefix ( & irfd -> vn_addr , & nhp ) ) continue ; bgp_withdraw ( irfd -> peer , & rn -> p , 0 , NULL , afi , SAFI_UNICAST , ZEBRA_ROUTE_VNC_DIRECT , BGP_ROUTE_REDISTRIBUTE , NULL , <S2SV_StartBug> NULL , NULL ) ; <S2SV_EndBug> } } } } } | <S2SV_ModStart> , NULL , 0 , |
4,596 | CWE-000 static void qemu_spice_display_init_one ( QemuConsole * con ) { SimpleSpiceDisplay * ssd = g_new0 ( SimpleSpiceDisplay , 1 ) ; qemu_spice_display_init_common ( ssd ) ; ssd -> dcl . ops = & display_listener_ops ; # ifdef HAVE_SPICE_GL if ( spice_opengl ) { ssd -> dcl . ops = & display_listener_gl_ops ; ssd -> gl_unblock_bh = qemu_bh_new ( qemu_spice_gl_unblock_bh , ssd ) ; ssd -> gl_unblock_timer = timer_new_ms ( QEMU_CLOCK_REALTIME , qemu_spice_gl_block_timer , ssd ) ; ssd -> gls = qemu_gl_init_shader ( ) ; ssd -> have_surface = false ; ssd -> have_scanout = false ; } # endif ssd -> dcl . con = con ; ssd -> qxl . base . sif = & dpy_interface . base ; qemu_spice_add_display_interface ( & ssd -> qxl , con ) ; <S2SV_StartBug> assert ( ssd -> worker ) ; <S2SV_EndBug> qemu_spice_create_host_memslot ( ssd ) ; register_displaychangelistener ( & ssd -> dcl ) ; } | <S2SV_ModStart> con ) ; <S2SV_ModEnd> qemu_spice_create_host_memslot ( ssd |
4,597 | CWE-000 void target_close ( struct target_ops * targ ) { <S2SV_StartBug> gdb_assert ( ! target_is_pushed ( targ ) ) ; <S2SV_EndBug> if ( targ -> to_xclose != NULL ) targ -> to_xclose ( targ ) ; else if ( targ -> to_close != NULL ) targ -> to_close ( targ ) ; if ( targetdebug ) fprintf_unfiltered ( gdb_stdlog , "target_close<S2SV_blank>()\\n" ) ; } | <S2SV_ModStart> ( targ ) ) ; fileio_handles_invalidate_target ( targ |
4,598 | CWE-000 static gboolean gst_adaptive_demux_stream_in_live_seek_range ( GstAdaptiveDemux * demux , GstAdaptiveDemuxStream * stream ) { gint64 range_start , range_stop ; if ( gst_adaptive_demux_get_live_seek_range ( demux , & range_start , & range_stop ) ) { GST_LOG_OBJECT ( stream -> pad , <S2SV_StartBug> "stream<S2SV_blank>position<S2SV_blank>%" GST_STIME_FORMAT "<S2SV_blank><S2SV_blank>live<S2SV_blank>seek<S2SV_blank>range<S2SV_blank>%" <S2SV_EndBug> GST_STIME_FORMAT "<S2SV_blank>-<S2SV_blank>%" GST_STIME_FORMAT , <S2SV_StartBug> GST_STIME_ARGS ( stream -> segment . position ) , GST_STIME_ARGS ( range_start ) , <S2SV_EndBug> GST_STIME_ARGS ( range_stop ) ) ; return ( stream -> segment . position >= range_start && stream -> segment . position <= range_stop ) ; } return FALSE ; } | <S2SV_ModStart> pad , "stream<S2SV_blank>position<S2SV_blank>%" GST_TIME_FORMAT <S2SV_ModEnd> "<S2SV_blank><S2SV_blank>live<S2SV_blank>seek<S2SV_blank>range<S2SV_blank>%" GST_STIME_FORMAT "<S2SV_blank>-<S2SV_blank>%" <S2SV_ModStart> "<S2SV_blank>-<S2SV_blank>%" GST_STIME_FORMAT , GST_TIME_ARGS <S2SV_ModEnd> ( stream -> |
4,599 | CWE-000 void posix_fsyncer_process ( xlator_t * this , call_stub_t * stub , gf_boolean_t do_fsync ) { struct posix_fd * pfd = NULL ; int ret = - 1 ; <S2SV_StartBug> struct posix_private * priv = NULL ; <S2SV_EndBug> <S2SV_StartBug> int op_errno = 0 ; <S2SV_EndBug> priv = this -> private ; ret = posix_fd_ctx_get ( stub -> args . fd , this , & pfd , & op_errno ) ; if ( ret < 0 ) { gf_msg ( this -> name , GF_LOG_ERROR , op_errno , P_MSG_GET_FDCTX_FAILED , "could<S2SV_blank>not<S2SV_blank>get<S2SV_blank>fdctx<S2SV_blank>for<S2SV_blank>fd(%s)" , uuid_utoa ( stub -> args . fd -> inode -> gfid ) ) ; call_unwind_error ( stub , - 1 , op_errno ) ; return ; } if ( do_fsync ) { if ( stub -> args . datasync ) ret = sys_fdatasync ( pfd -> fd ) ; else ret = sys_fsync ( pfd -> fd ) ; } else { ret = 0 ; } if ( ret ) { gf_msg ( this -> name , GF_LOG_ERROR , errno , P_MSG_FSTAT_FAILED , "could<S2SV_blank>not<S2SV_blank>fstat<S2SV_blank>fd(%s)" , uuid_utoa ( stub -> args . fd -> inode -> gfid ) ) ; call_unwind_error ( stub , - 1 , errno ) ; return ; } call_unwind_error ( stub , 0 , 0 ) ; } | <S2SV_ModStart> - 1 ; <S2SV_ModEnd> int op_errno = <S2SV_ModStart> op_errno = 0 <S2SV_ModEnd> ; ret = |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.