Unnamed: 0
int64 0
535k
| source
stringlengths 50
89.8k
| target
stringlengths 23
37.7k
|
---|---|---|
5,000 | CWE-000 t_mapfile * map_get_fat_header ( t_mapfile * map ) { map -> fat_subtype = get_fat_subtype ( map ) ; if ( map -> fat_subtype == B32 || map -> fat_subtype == B64 ) { <S2SV_StartBug> if ( map -> file_size < sizeof ( t_fh ) ) <S2SV_EndBug> { ft_fdprint ( 2 , "File<S2SV_blank>%s<S2SV_blank>is<S2SV_blank>corrupted<S2SV_blank>(no<S2SV_blank>fat<S2SV_blank>header)\\n" , map -> file_name ) ; return ( map_release ( map ) ) ; } ft_memcpy ( & map -> fat_header , map -> file_addr , sizeof ( t_fh ) ) ; map -> fat_header . nfat_arch = swap_uint32_t ( map -> fat_header . nfat_arch , map -> fat_swap ) ; map -> fat_header . magic = swap_uint32_t ( map -> fat_header . magic , map -> fat_swap ) ; } else { ft_fdprint ( 2 , "Internal<S2SV_blank>error<S2SV_blank>on<S2SV_blank>file<S2SV_blank>%s,<S2SV_blank>not<S2SV_blank>recognized\\n" , map -> file_name ) ; return ( map_release ( map ) ) ; } return ( map ) ; } | <S2SV_ModStart> sizeof ( t_fh ) + sizeof ( uint32_t |
5,001 | CWE-000 RmFile * rm_file_new ( struct RmSession * session , const char * path , RmStat * statp , RmLintType type , bool is_ppath , unsigned path_index , short depth ) { RmCfg * cfg = session -> cfg ; RmOff actual_file_size = statp -> st_size ; RmOff start_seek = 0 ; if ( actual_file_size != 0 ) { if ( cfg -> use_absolute_start_offset ) { start_seek = cfg -> skip_start_offset ; if ( cfg -> skip_start_offset >= actual_file_size ) { return NULL ; } } else { start_seek = cfg -> skip_start_factor * actual_file_size ; if ( ( int ) ( actual_file_size * cfg -> skip_end_factor ) == 0 ) { return NULL ; } if ( start_seek >= actual_file_size ) { return NULL ; } } } RmFile * self = g_slice_new0 ( RmFile ) ; self -> session = session ; rm_file_set_path ( self , ( char * ) path ) ; self -> depth = depth ; self -> path_depth = rm_util_path_depth ( path ) ; self -> file_size = 0 ; self -> actual_file_size = 0 ; self -> inode = statp -> st_ino ; self -> dev = statp -> st_dev ; self -> mtime = rm_sys_stat_mtime_float ( statp ) ; if ( type == RM_LINT_TYPE_DUPE_CANDIDATE ) { if ( cfg -> use_absolute_end_offset ) { self -> file_size = CLAMP ( actual_file_size , 1 , cfg -> skip_end_offset ) ; } else { self -> file_size = actual_file_size * cfg -> skip_end_factor ; } <S2SV_StartBug> self -> actual_file_size = actual_file_size ; <S2SV_EndBug> } self -> hash_offset = start_seek ; self -> lint_type = type ; self -> is_prefd = is_ppath ; self -> is_original = false ; self -> is_symlink = false ; self -> path_index = path_index ; self -> outer_link_count = - 1 ; return self ; } | <S2SV_ModStart> skip_end_factor ; } if ( ( self -> file_size - start_seek ) == 0 && actual_file_size != 0 ) { return NULL ; } |
5,002 | CWE-000 void SCC_Init ( void ) { SCC_Reset ( ) ; oldTBE = 0 ; oldStatus = 0 ; D ( bug ( "SCC:<S2SV_blank>interface<S2SV_blank>initialized\\n" ) ) ; if ( ! ConfigureParams . RS232 . bEnableSccB || ! ConfigureParams . RS232 . sSccBFileName [ 0 ] ) { handle = - 1 ; return ; } handle = open ( ConfigureParams . RS232 . sSccBFileName , <S2SV_StartBug> O_RDWR | O_NDELAY | O_NONBLOCK ) ; <S2SV_EndBug> if ( handle >= 0 ) { # if HAVE_TERMIOS_H bFileHandleIsATTY = isatty ( handle ) ; # else bFileHandleIsATTY = false ; # endif } else { Log_Printf ( LOG_ERROR , "SCC_Init:<S2SV_blank>Can<S2SV_blank>not<S2SV_blank>open<S2SV_blank>device<S2SV_blank>\'%s\'\\n" , ConfigureParams . RS232 . sSccBFileName ) ; } } | <S2SV_ModStart> O_RDWR | O_NDELAY <S2SV_ModEnd> ) ; if |
5,003 | CWE-000 int handlehandshakeframes ( time_t tvsec , uint8_t * mac_ap , int handshake ) { apl_t * zeiger ; int c ; zeiger = beaconliste ; for ( c = 0 ; c < aplistesize ; c ++ ) { if ( memcmp ( mac_ap , zeiger -> addr_ap . addr , 6 ) == 0 ) { zeiger -> tv_sec = tvsec ; zeiger -> handshake |= handshake ; <S2SV_StartBug> qsort ( beaconliste , aplistesize + 1 , APL_SIZE , sort_by_time ) ; <S2SV_EndBug> if ( statuslines > 0 ) printstatus1 ( ) ; return TRUE ; } if ( memcmp ( & nullmac , zeiger -> addr_ap . addr , 6 ) == 0 ) break ; zeiger ++ ; } return FALSE ; } | <S2SV_ModStart> , APL_SIZE , sortaplist_by_time <S2SV_ModEnd> ) ; if |
5,004 | CWE-000 void DeleteObject ( void * this ) { <S2SV_StartBug> StringDestruct ( this ) ; <S2SV_EndBug> free ( ( ( Object * ) this ) -> pVFTable ) ; free ( this ) ; this = NULL ; } | <S2SV_ModStart> this ) { ObjectDestruct <S2SV_ModEnd> ( this ) |
5,005 | CWE-000 void gal_fits_img_info ( fitsfile * fptr , int * type , size_t * ndim , size_t * * dsize , char * * name , char * * unit ) { char * * str ; size_t i , dsize_key = 1 ; int bitpix , status = 0 , naxis ; double bzero = NAN , bscale = NAN ; gal_data_t * key , * keysll = NULL ; long naxes [ GAL_FITS_MAX_NDIM ] ; if ( fits_get_img_param ( fptr , GAL_FITS_MAX_NDIM , & bitpix , & naxis , naxes , & status ) ) gal_fits_io_error ( status , NULL ) ; * ndim = naxis ; * type = gal_fits_bitpix_to_type ( bitpix ) ; gal_list_data_add_alloc ( & keysll , NULL , GAL_TYPE_STRING , 1 , & dsize_key , NULL , 0 , - 1 , "BUNIT" , NULL , NULL ) ; gal_list_data_add_alloc ( & keysll , NULL , GAL_TYPE_STRING , 1 , & dsize_key , NULL , 0 , - 1 , "EXTNAME" , NULL , NULL ) ; gal_list_data_add_alloc ( & keysll , NULL , GAL_TYPE_FLOAT64 , 1 , & dsize_key , NULL , 0 , - 1 , "BSCALE" , NULL , NULL ) ; gal_list_data_add_alloc ( & keysll , NULL , GAL_TYPE_FLOAT64 , 1 , & dsize_key , NULL , 0 , - 1 , "BZERO" , NULL , NULL ) ; gal_fits_key_read_from_ptr ( fptr , keysll , 0 , 0 ) ; i = 1 ; for ( key = keysll ; key != NULL ; key = key -> next ) { if ( key -> status == 0 ) { switch ( i ) { <S2SV_StartBug> case 4 : if ( unit ) { str = key -> array ; * unit = * str ; } break ; <S2SV_EndBug> <S2SV_StartBug> case 3 : if ( name ) { str = key -> array ; * name = * str ; } break ; <S2SV_EndBug> case 2 : bscale = * ( double * ) ( key -> array ) ; break ; case 1 : bzero = * ( double * ) ( key -> array ) ; break ; default : error ( EXIT_FAILURE , 0 , "%s:<S2SV_blank>a<S2SV_blank>bug!<S2SV_blank>Please<S2SV_blank>contact<S2SV_blank>us<S2SV_blank>at<S2SV_blank>%s<S2SV_blank>to<S2SV_blank>" "fix<S2SV_blank>the<S2SV_blank>problem.<S2SV_blank>For<S2SV_blank>some<S2SV_blank>reason,<S2SV_blank>there<S2SV_blank>are<S2SV_blank>more<S2SV_blank>" "keywords<S2SV_blank>requested<S2SV_blank>" , __func__ , PACKAGE_BUGREPORT ) ; } } ++ i ; } if ( ! isnan ( bscale ) || ! isnan ( bzero ) ) fits_type_correct ( type , bscale , bzero ) ; * dsize = gal_data_malloc_array ( GAL_TYPE_INT64 , * ndim , __func__ , "dsize" ) ; for ( i = 0 ; i < * ndim ; ++ i ) ( * dsize ) [ i ] = naxes [ * ndim - 1 - i ] ; gal_list_data_free ( keysll ) ; } | <S2SV_ModStart> * str ; * str = NULL ; <S2SV_ModStart> * str ; * str = NULL ; |
5,006 | CWE-000 static void update_crc ( struct rar5 * rar , const uint8_t * p , size_t to_read ) { int verify_crc ; if ( rar -> skip_mode ) { # if defined CHECK_CRC_ON_SOLID_SKIP verify_crc = 1 ; # else verify_crc = 0 ; # endif } else verify_crc = 1 ; if ( verify_crc ) { if ( rar -> file . stored_crc32 > 0 ) { rar -> file . calculated_crc32 = crc32 ( rar -> file . calculated_crc32 , p , to_read ) ; rar -> file . crc_sum += to_read ; <S2SV_StartBug> LOG ( "update_crc:<S2SV_blank>to_read=0x%zx,<S2SV_blank>crc_sum=%zu" , to_read , rar -> file . crc_sum ) ; <S2SV_EndBug> } if ( rar -> file . has_blake2 > 0 ) { ( void ) blake2sp_update ( & rar -> file . b2state , p , to_read ) ; } } } | <S2SV_ModStart> += to_read ; <S2SV_ModEnd> } if ( |
5,007 | CWE-000 static int xgene_enet_tx_completion ( struct xgene_enet_desc_ring * cp_ring , struct xgene_enet_raw_desc * raw_desc ) { struct xgene_enet_pdata * pdata = netdev_priv ( cp_ring -> ndev ) ; struct sk_buff * skb ; struct device * dev ; skb_frag_t * frag ; dma_addr_t * frag_dma_addr ; u16 skb_index ; <S2SV_StartBug> u8 status ; <S2SV_EndBug> <S2SV_StartBug> int i , ret = 0 ; <S2SV_EndBug> u8 mss_index ; skb_index = GET_VAL ( USERINFO , le64_to_cpu ( raw_desc -> m0 ) ) ; skb = cp_ring -> cp_skb [ skb_index ] ; frag_dma_addr = & cp_ring -> frag_dma_addr [ skb_index * MAX_SKB_FRAGS ] ; dev = ndev_to_dev ( cp_ring -> ndev ) ; dma_unmap_single ( dev , GET_VAL ( DATAADDR , le64_to_cpu ( raw_desc -> m1 ) ) , skb_headlen ( skb ) , DMA_TO_DEVICE ) ; for ( i = 0 ; i < skb_shinfo ( skb ) -> nr_frags ; i ++ ) { frag = & skb_shinfo ( skb ) -> frags [ i ] ; dma_unmap_page ( dev , frag_dma_addr [ i ] , skb_frag_size ( frag ) , DMA_TO_DEVICE ) ; } if ( GET_BIT ( ET , le64_to_cpu ( raw_desc -> m3 ) ) ) { mss_index = GET_VAL ( MSS , le64_to_cpu ( raw_desc -> m3 ) ) ; spin_lock ( & pdata -> mss_lock ) ; pdata -> mss_refcnt [ mss_index ] -- ; spin_unlock ( & pdata -> mss_lock ) ; } status = GET_VAL ( LERR , le64_to_cpu ( raw_desc -> m0 ) ) ; if ( unlikely ( status > 2 ) ) { <S2SV_StartBug> xgene_enet_parse_error ( cp_ring , netdev_priv ( cp_ring -> ndev ) , <S2SV_EndBug> status ) ; ret = - EIO ; } if ( likely ( skb ) ) { dev_kfree_skb_any ( skb ) ; } else { netdev_err ( cp_ring -> ndev , "completion<S2SV_blank>skb<S2SV_blank>is<S2SV_blank>NULL\\n" ) ; <S2SV_StartBug> ret = - EIO ; <S2SV_EndBug> } return ret ; } | <S2SV_ModStart> skb_index ; u8 mss_index ; u8 <S2SV_ModStart> ; int i <S2SV_ModEnd> ; skb_index = <S2SV_ModStart> ) ) { cp_ring -> tx_dropped ++ ; cp_ring -> tx_errors ++ ; } if ( likely ( skb ) ) { dev_kfree_skb_any ( skb ) ; } else { netdev_err <S2SV_ModEnd> ( cp_ring -> <S2SV_ModStart> cp_ring -> ndev <S2SV_ModEnd> , "completion<S2SV_blank>skb<S2SV_blank>is<S2SV_blank>NULL\\n" ) <S2SV_ModStart> "completion<S2SV_blank>skb<S2SV_blank>is<S2SV_blank>NULL\\n" ) ; } return 0 <S2SV_ModEnd> ; } <S2SV_null> |
5,008 | CWE-000 <S2SV_StartBug> const char * sunlight_status_string ( const struct predict_orbit * orbit , const struct predict_observation * obs ) <S2SV_EndBug> { if ( obs -> visible ) { return SUNLIGHT_BASESTRING "visible<S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank>" ; } else if ( ! ( orbit -> eclipsed ) ) { return SUNLIGHT_BASESTRING "in<S2SV_blank>sunlight" ; } else { return SUNLIGHT_BASESTRING "in<S2SV_blank>eclipse<S2SV_blank>" ; } } | <S2SV_ModStart> ( const struct predict_position <S2SV_ModEnd> * orbit , |
5,009 | CWE-000 void test_tx_cmd_a2dof_r ( void ) { uint8_t test_cmdCode = 0 , test_cmdType = 0 ; uint16_t test_len = 0 ; uint8_t slave = 17 , controller = CTRL_OPEN ; int16_t pwm = - 1234 , current = 12500 ; int16_t res_pwm = 0 , res_current = 0 ; uint16_t numb = 0 ; uint8_t outputBuf [ 48 ] ; uint16_t index = 0 ; <S2SV_StartBug> numb = tx_cmd_ankle2dof_r ( outputBuf , & test_cmdCode , & test_cmdType , & test_len , slave , controller , current , pwm ) ; <S2SV_EndBug> TEST_ASSERT_EQUAL ( CMD_A2DOF , test_cmdCode ) ; TEST_ASSERT_EQUAL ( CMD_READ , test_cmdType ) ; TEST_ASSERT_EQUAL ( 6 , test_len ) ; index = 0 ; TEST_ASSERT_EQUAL ( slave , outputBuf [ index ++ ] ) ; TEST_ASSERT_EQUAL ( controller , outputBuf [ index ++ ] ) ; res_current = ( int16_t ) REBUILD_UINT16 ( outputBuf , & index ) ; res_pwm = ( int16_t ) REBUILD_UINT16 ( outputBuf , & index ) ; TEST_ASSERT_EQUAL ( current , res_current ) ; TEST_ASSERT_EQUAL ( pwm , res_pwm ) ; } | <S2SV_ModStart> = 0 ; <S2SV_ModEnd> tx_cmd_ankle2dof_r ( outputBuf |
5,010 | CWE-000 <S2SV_StartBug> const char * get_libname ( const char * base_libname ) <S2SV_EndBug> { DIR * dp ; struct dirent * dirp ; int index = 0 ; char * libname_path = NULL ; char current_test_path [ LARGEBUF ] ; for ( index = 0 ; ( search_paths [ index ] != NULL ) && ( libname_path == NULL ) ; index ++ ) { memset ( current_test_path , 0 , LARGEBUF ) ; if ( ( dp = opendir ( search_paths [ index ] ) ) == NULL ) continue ; while ( ( dirp = readdir ( dp ) ) != NULL ) { if ( ! strncmp ( dirp -> d_name , base_libname , strlen ( base_libname ) ) ) { snprintf ( current_test_path , LARGEBUF , "%s/%s" , search_paths [ index ] , dirp -> d_name ) ; libname_path = realpath ( current_test_path , NULL ) ; if ( libname_path != NULL ) break ; } } closedir ( dp ) ; } return libname_path ; } | <S2SV_ModStart> <S2SV_null> <S2SV_null> <S2SV_null> <S2SV_ModEnd> char * get_libname |
5,011 | CWE-000 int zephir_update_static_property_array_multi_ce ( zend_class_entry * ce , const char * property , zend_uint property_length , zval * value , const char * types , int types_length , int types_count , ... ) { va_list ap ; zval tmp_arr ; int separated = 0 ; ZVAL_UNDEF ( & tmp_arr ) ; zephir_read_static_property_ce ( & tmp_arr , ce , property , property_length , PH_NOISY | PH_READONLY ) ; if ( Z_REFCOUNTED ( tmp_arr ) ) { if ( Z_REFCOUNT ( tmp_arr ) > 1 ) { if ( ! Z_ISREF ( tmp_arr ) ) { zval new_zv ; ZVAL_DUP ( & new_zv , & tmp_arr ) ; ZVAL_COPY_VALUE ( & tmp_arr , & new_zv ) ; Z_TRY_DELREF ( new_zv ) ; separated = 1 ; } } } else { zval new_zv ; ZVAL_DUP ( & new_zv , & tmp_arr ) ; ZVAL_COPY_VALUE ( & tmp_arr , & new_zv ) ; Z_TRY_DELREF ( new_zv ) ; separated = 1 ; } if ( Z_TYPE ( tmp_arr ) != IS_ARRAY ) { if ( separated ) { convert_to_array ( & tmp_arr ) ; } else { array_init ( & tmp_arr ) ; separated = 1 ; } Z_DELREF ( tmp_arr ) ; } va_start ( ap , types_count ) ; SEPARATE_ZVAL_IF_NOT_REF ( & tmp_arr ) ; zephir_array_update_multi_ex ( & tmp_arr , value , types , types_length , types_count , ap ) ; va_end ( ap ) ; if ( separated ) { <S2SV_StartBug> zephir_update_static_property_ce ( ce , property , property_length , & tmp_arr ) ; <S2SV_EndBug> } return SUCCESS ; } | <S2SV_ModStart> separated ) { zend_update_static_property <S2SV_ModEnd> ( ce , |
5,012 | CWE-000 int parse_and ( t_lexer * lex ) { t_lexer * tmp ; tmp = lex ; if ( tmp -> token_id == SAND && ! LNEXT ) return ( 1 ) ; <S2SV_StartBug> else if ( tmp -> token_id == PIPE && LNEXT && ! LDNEXT <S2SV_EndBug> && is_full_spaces ( LNEXT -> content ) ) return ( 1 ) ; else if ( tmp -> token_id == SAND && LNEXT && tmp -> prev && ( tmp -> prev -> token_id != GREAT || ft_strncmp ( LNEXT -> content , "-" , 1 ) ) ) return ( 1 ) ; else return ( 0 ) ; } | <S2SV_ModStart> -> token_id == SAND && LNEXT && tmp -> prev && tmp -> prev -> token_id == GREAT && LNEXT -> token_id == 14 ) return ( 0 ) ; else if ( tmp -> token_id == AND <S2SV_ModEnd> && LNEXT && |
5,013 | CWE-000 static void set_beams ( struct SYMBOL * sym ) { struct SYSTEM * sy ; struct SYMBOL * s , * t , * g , * s_opp ; int n , m , beam , laststem , mid_p ; beam = 0 ; laststem = - 1 ; s_opp = NULL ; sy = cursys ; for ( s = sym ; s ; s = s -> next ) { if ( s -> abc_type != ABC_T_NOTE ) { switch ( s -> type ) { default : continue ; case STAVES : sy = sy -> next ; continue ; case GRACE : break ; } g = s -> extra ; while ( g -> abc_type != ABC_T_NOTE ) g = g -> next ; if ( g -> stem == 2 ) { s_opp = s ; continue ; } if ( s -> stem == 0 && ( s -> stem = s -> multi ) == 0 ) s -> stem = 1 ; for ( ; g ; g = g -> next ) { g -> stem = s -> stem ; g -> multi = s -> multi ; } continue ; } mid_p = s -> mid / 3 + 18 ; if ( s -> stem == 0 && ( s -> stem = s -> multi ) == 0 ) { if ( beam ) { s -> stem = laststem ; } else if ( ( s -> sflags & ( S_BEAM_ST | S_BEAM_END ) ) == S_BEAM_ST ) { int pu = s -> pits [ s -> nhd ] , pd = s -> pits [ 0 ] ; beam = 1 ; for ( t = s -> next ; t ; t = t -> next ) { if ( t -> abc_type != ABC_T_NOTE ) continue ; if ( t -> stem || t -> multi ) { s -> stem = t -> multi ? t -> multi : t -> stem ; break ; } if ( t -> pits [ t -> nhd ] > pu ) pu = t -> pits [ t -> nhd ] ; if ( t -> pits [ 0 ] < pd ) pd = t -> pits [ 0 ] ; if ( t -> sflags & S_BEAM_END ) break ; } if ( t -> sflags & S_BEAM_END ) { mid_p *= 2 ; if ( pu + pd < mid_p ) { s -> stem = 1 ; <S2SV_StartBug> } else if ( pu + pd < mid_p ) { <S2SV_EndBug> s -> stem = - 1 ; } else { if ( cfmt . bstemdown ) s -> stem = - 1 ; } } if ( ! s -> stem ) s -> stem = laststem ; } else { n = s -> pits [ s -> nhd ] + s -> pits [ 0 ] ; if ( n == mid_p * 2 ) { n = 0 ; for ( m = 0 ; m <= s -> nhd ; m ++ ) n += s -> pits [ m ] ; mid_p *= s -> nhd + 1 ; } else { mid_p *= 2 ; } if ( n < mid_p ) s -> stem = 1 ; else if ( n > mid_p ) s -> stem = - 1 ; else if ( cfmt . bstemdown ) s -> stem = - 1 ; else s -> stem = laststem ; } } else { if ( ( s -> sflags & ( S_BEAM_ST | S_BEAM_END ) ) == S_BEAM_ST ) beam = 1 ; } if ( s -> sflags & S_BEAM_END ) beam = 0 ; laststem = s -> stem ; if ( s_opp ) { for ( g = s_opp -> extra ; g ; g = g -> next ) g -> stem = - laststem ; s_opp -> stem = - laststem ; s_opp = NULL ; } } } | <S2SV_ModStart> pu + pd > <S2SV_ModEnd> mid_p ) { |
5,014 | CWE-000 int replica_update_ruv ( Replica * r , const CSN * updated_csn , const char * replica_purl ) { char csn_str [ CSN_STRSIZE ] ; int rc = RUV_SUCCESS ; PR_ASSERT ( NULL != r ) ; PR_ASSERT ( NULL != updated_csn ) ; # ifdef DEBUG slapi_log_err ( SLAPI_LOG_REPL , repl_plugin_name , "replica_update_ruv:<S2SV_blank>csn<S2SV_blank>%s\\n" , csn_as_string ( updated_csn , PR_FALSE , csn_str ) ) ; # endif if ( NULL == r ) { slapi_log_err ( SLAPI_LOG_ERR , repl_plugin_name , "replica_update_ruv<S2SV_blank>-<S2SV_blank>Replica<S2SV_blank>" "is<S2SV_blank>NULL\\n" ) ; rc = RUV_BAD_DATA ; } else if ( NULL == updated_csn ) { slapi_log_err ( SLAPI_LOG_ERR , repl_plugin_name , "replica_update_ruv<S2SV_blank>-<S2SV_blank>csn<S2SV_blank>" "is<S2SV_blank>NULL<S2SV_blank>when<S2SV_blank>updating<S2SV_blank>replica<S2SV_blank>%s\\n" , slapi_sdn_get_dn ( r -> repl_root ) ) ; rc = RUV_BAD_DATA ; } else { RUV * ruv ; replica_lock ( r -> repl_lock ) ; if ( r -> repl_ruv != NULL ) { ruv = object_get_data ( r -> repl_ruv ) ; if ( NULL != ruv ) { ReplicaId rid = csn_get_replicaid ( updated_csn ) ; if ( rid == r -> repl_rid ) { if ( NULL != r -> min_csn_pl ) { CSN * min_csn ; PRBool committed ; ( void ) csnplCommit ( r -> min_csn_pl , updated_csn ) ; min_csn = csnplGetMinCSN ( r -> min_csn_pl , & committed ) ; if ( NULL != min_csn ) { if ( committed ) { ruv_set_min_csn ( ruv , min_csn , replica_purl ) ; csnplFree ( & r -> min_csn_pl ) ; } csn_free ( & min_csn ) ; } } } <S2SV_StartBug> rc = ruv_update_ruv ( ruv , updated_csn , replica_purl , rid == r -> repl_rid ) ; <S2SV_EndBug> if ( RUV_COVERS_CSN == rc ) { slapi_log_err ( SLAPI_LOG_REPL , repl_plugin_name , "replica_update_ruv<S2SV_blank>-<S2SV_blank>RUV<S2SV_blank>" "for<S2SV_blank>replica<S2SV_blank>%s<S2SV_blank>already<S2SV_blank>covers<S2SV_blank>max_csn<S2SV_blank>=<S2SV_blank>%s\\n" , slapi_sdn_get_dn ( r -> repl_root ) , csn_as_string ( updated_csn , PR_FALSE , csn_str ) ) ; } else if ( RUV_SUCCESS != rc ) { slapi_log_err ( SLAPI_LOG_ERR , repl_plugin_name , "replica_update_ruv<S2SV_blank>-<S2SV_blank>Unable<S2SV_blank>" "to<S2SV_blank>update<S2SV_blank>RUV<S2SV_blank>for<S2SV_blank>replica<S2SV_blank>%s,<S2SV_blank>csn<S2SV_blank>=<S2SV_blank>%s\\n" , slapi_sdn_get_dn ( r -> repl_root ) , csn_as_string ( updated_csn , PR_FALSE , csn_str ) ) ; } else { r -> repl_ruv_dirty = PR_TRUE ; } } else { slapi_log_err ( SLAPI_LOG_ERR , repl_plugin_name , "replica_update_ruv<S2SV_blank>-<S2SV_blank>Unable<S2SV_blank>to<S2SV_blank>get<S2SV_blank>RUV<S2SV_blank>object<S2SV_blank>for<S2SV_blank>replica<S2SV_blank>" "%s\\n" , slapi_sdn_get_dn ( r -> repl_root ) ) ; rc = RUV_NOTFOUND ; } } else { slapi_log_err ( SLAPI_LOG_ERR , repl_plugin_name , "replica_update_ruv<S2SV_blank>-<S2SV_blank>" "Unable<S2SV_blank>to<S2SV_blank>initialize<S2SV_blank>RUV<S2SV_blank>for<S2SV_blank>replica<S2SV_blank>%s\\n" , slapi_sdn_get_dn ( r -> repl_root ) ) ; rc = RUV_NOTFOUND ; } replica_unlock ( r -> repl_lock ) ; } return rc ; } | <S2SV_ModStart> , replica_purl , <S2SV_ModEnd> r -> repl_rid |
5,015 | CWE-000 int test_string_substr ( ) { allocator_t * allocator = allocator_get_default_alloc ( ) ; String * string , * pstr , * substr ; int ret ; char * test = "&rsv//_sug1<S2SV_blank>=<S2SV_blank>107&rsv_sug7<S2SV_blank>=<S2SV_blank>100&rsv_sug2<S2SV_blank>=<S2SV_blank>0&prefixsug<S2SV_blank>=<S2SV_blank>ffmpeg%2520hls%2520%2520%25E6%25A8%25A1%25" ; string = OBJECT_NEW ( allocator , String , NULL ) ; pstr = OBJECT_NEW ( allocator , String , NULL ) ; string -> assign ( string , test ) ; pstr -> assign ( pstr , "&" ) ; substr = string -> substr ( string , 3 , 10 ) ; printf ( "substr<S2SV_blank>%s\\n<S2SV_blank>" , pstr -> value ) ; <S2SV_StartBug> return 1 ; <S2SV_EndBug> } | <S2SV_ModStart> value ) ; object_destroy ( string ) ; object_destroy ( pstr ) ; object_destroy ( substr ) ; |
5,016 | CWE-000 v_U8_t vos_pkt_get_proto_type ( void * pskb , v_U8_t tracking_map ) { v_U8_t pkt_proto_type = 0 ; v_U16_t ether_type ; v_U16_t SPort ; v_U16_t DPort ; struct sk_buff * skb = NULL ; if ( NULL == pskb ) { return pkt_proto_type ; } else { skb = ( struct sk_buff * ) pskb ; } if ( VOS_PKT_PROTO_TYPE_EAPOL & tracking_map ) { ether_type = ( v_U16_t ) ( * ( v_U16_t * ) ( skb -> data + VOS_PKT_PROT_ETH_TYPE_OFFSET ) ) ; if ( VOS_PKT_PROT_EAPOL_ETH_TYPE == VOS_SWAP_U16 ( ether_type ) ) { pkt_proto_type |= VOS_PKT_PROTO_TYPE_EAPOL ; } } <S2SV_StartBug> if ( VOS_PKT_PROTO_TYPE_DHCP & tracking_map ) <S2SV_EndBug> { SPort = ( v_U16_t ) ( * ( v_U16_t * ) ( skb -> data + VOS_PKT_PROT_IP_OFFSET + VOS_PKT_PROT_IP_HEADER_SIZE ) ) ; DPort = ( v_U16_t ) ( * ( v_U16_t * ) ( skb -> data + VOS_PKT_PROT_IP_OFFSET + VOS_PKT_PROT_IP_HEADER_SIZE + sizeof ( v_U16_t ) ) ) ; if ( ( ( VOS_PKT_PROT_DHCP_SRV_PORT == VOS_SWAP_U16 ( SPort ) ) && ( VOS_PKT_PROT_DHCP_CLI_PORT == VOS_SWAP_U16 ( DPort ) ) ) || ( ( VOS_PKT_PROT_DHCP_CLI_PORT == VOS_SWAP_U16 ( SPort ) ) && ( VOS_PKT_PROT_DHCP_SRV_PORT == VOS_SWAP_U16 ( DPort ) ) ) ) { pkt_proto_type |= VOS_PKT_PROTO_TYPE_DHCP ; } } return pkt_proto_type ; } | <S2SV_ModStart> } if ( VOS_PKT_PROTO_TYPE_ARP & tracking_map ) { ether_type = ( v_U16_t ) ( * ( v_U16_t * ) ( skb -> data + VOS_PKT_PROT_ETH_TYPE_OFFSET ) ) ; if ( VOS_PKT_PROT_ARP_ETH_TYPE == VOS_SWAP_U16 ( ether_type ) ) { pkt_proto_type |= VOS_PKT_PROTO_TYPE_ARP ; } } if ( |
5,017 | CWE-000 int mlx5_init_cq_table ( struct mlx5_core_dev * dev ) { struct mlx5_cq_table * table = & dev -> priv . cq_table ; int err ; <S2SV_StartBug> int x ; <S2SV_EndBug> spin_lock_init ( & table -> lock ) ; for ( x = 0 ; x != MLX5_CQ_LINEAR_ARRAY_SIZE ; x ++ ) spin_lock_init ( & table -> linear_array [ x ] . lock ) ; INIT_RADIX_TREE ( & table -> tree , GFP_ATOMIC ) ; err = 0 ; return err ; } | <S2SV_ModStart> ; int x ; memset ( table , 0 , sizeof ( * table ) ) |
5,018 | CWE-000 int xta_acquired_xa_resource_init ( xta_acquired_xa_resource_t * this , const char * name , const char * open_info ) { enum Exception { NULL_OBJECT , OBJ_CORRUPTED , INVALID_OPTION1 , INVALID_OPTION2 , G_STRDUP_ERROR , NONE } excp ; int ret_cod = LIXA_RC_INTERNAL_ERROR ; LIXA_TRACE ( ( "xta_acquired_xa_resource_init\\n" ) ) ; TRY { if ( NULL == this ) THROW ( NULL_OBJECT ) ; if ( NULL != this -> name ) THROW ( OBJ_CORRUPTED ) ; if ( NULL == name || 0 == strlen ( name ) ) THROW ( INVALID_OPTION1 ) ; if ( NULL == open_info || 0 == strlen ( open_info ) ) THROW ( INVALID_OPTION2 ) ; if ( strlen ( open_info ) >= MAXINFOSIZE ) { LIXA_TRACE ( ( "xta_acquired_xa_resource_init:<S2SV_blank>option<S2SV_blank>open_info<S2SV_blank>" "(" SIZE_T_FORMAT ")" "exceeds<S2SV_blank>MAXINFOSIZE<S2SV_blank>%d\\n" , strlen ( open_info ) , MAXINFOSIZE ) ) ; } if ( NULL == ( this -> name = g_strdup ( name ) ) ) THROW ( G_STRDUP_ERROR ) ; strncpy ( this -> open_info , open_info , MAXINFOSIZE ) ; <S2SV_StartBug> this -> open_info [ MAXINFOSIZE ] = '\\0' ; <S2SV_EndBug> THROW ( NONE ) ; } CATCH { switch ( excp ) { case NULL_OBJECT : ret_cod = LIXA_RC_NULL_OBJECT ; break ; case OBJ_CORRUPTED : ret_cod = LIXA_RC_OBJ_CORRUPTED ; break ; case INVALID_OPTION1 : case INVALID_OPTION2 : ret_cod = LIXA_RC_INVALID_OPTION ; break ; case G_STRDUP_ERROR : ret_cod = LIXA_RC_G_STRDUP_ERROR ; break ; case NONE : ret_cod = LIXA_RC_OK ; break ; default : ret_cod = LIXA_RC_INTERNAL_ERROR ; } } LIXA_TRACE ( ( "xta_acquired_xa_resource_init/excp=%d/" "ret_cod=%d/errno=%d\\n" , excp , ret_cod , errno ) ) ; return ret_cod ; } | <S2SV_ModStart> open_info [ MAXINFOSIZE - 1 |
5,019 | CWE-000 static int msm_eeprom_config ( struct msm_eeprom_ctrl_t * e_ctrl , void __user * argp ) { struct msm_eeprom_cfg_data * cdata = ( struct msm_eeprom_cfg_data * ) argp ; int rc = 0 ; <S2SV_StartBug> CDBG ( "%s<S2SV_blank>E\\n" , __func__ ) ; <S2SV_EndBug> switch ( cdata -> cfgtype ) { case CFG_EEPROM_GET_INFO : CDBG ( "%s<S2SV_blank>E<S2SV_blank>CFG_EEPROM_GET_INFO\\n" , __func__ ) ; <S2SV_StartBug> cdata -> is_supported = e_ctrl -> is_supported ; <S2SV_EndBug> memcpy ( cdata -> cfg . eeprom_name , e_ctrl -> eboard_info -> eeprom_name , sizeof ( cdata -> cfg . eeprom_name ) ) ; break ; case CFG_EEPROM_GET_CAL_DATA : CDBG ( "%s<S2SV_blank>E<S2SV_blank>CFG_EEPROM_GET_CAL_DATA\\n" , __func__ ) ; cdata -> cfg . get_data . num_bytes = e_ctrl -> cal_data . num_data ; break ; case CFG_EEPROM_READ_CAL_DATA : CDBG ( "%s<S2SV_blank>E<S2SV_blank>CFG_EEPROM_READ_CAL_DATA\\n" , __func__ ) ; rc = eeprom_config_read_cal_data ( e_ctrl , cdata ) ; break ; case CFG_EEPROM_GET_MM_INFO : CDBG ( "%s<S2SV_blank>E<S2SV_blank>CFG_EEPROM_GET_MM_INFO\\n" , __func__ ) ; rc = msm_eeprom_get_cmm_data ( e_ctrl , cdata ) ; break ; default : break ; } CDBG ( "%s<S2SV_blank>X<S2SV_blank>rc:<S2SV_blank>%d\\n" , __func__ , rc ) ; return rc ; } | <S2SV_ModStart> = 0 ; size_t length = 0 ; <S2SV_ModStart> -> is_supported ; length = strlen ( e_ctrl -> eboard_info -> eeprom_name ) + 1 ; if ( length > MAX_EEPROM_NAME ) { pr_err ( "%s:%d<S2SV_blank>invalid<S2SV_blank>eeprom<S2SV_blank>name<S2SV_blank>length<S2SV_blank>%d\\n" , __func__ , __LINE__ , ( int ) length ) ; rc = - EINVAL ; break ; } |
5,020 | CWE-000 static int adjust ( double * val ) { int i ; i = 0 ; if ( * val >= 10 ) { while ( * val >= 10 ) { * val /= 10 ; i ++ ; } <S2SV_StartBug> i ++ ; <S2SV_EndBug> } else if ( * val < 1 ) { while ( * val < 1 ) { * val *= 10 ; i -- ; } <S2SV_StartBug> i -- ; <S2SV_EndBug> } return ( i ) ; } | <S2SV_ModStart> ++ ; } <S2SV_ModEnd> } else if <S2SV_ModStart> -- ; } <S2SV_ModEnd> } return ( |
5,021 | CWE-000 void c_term_mv_down ( t_comp * c ) { int i ; int value ; i = 0 ; <S2SV_StartBug> if ( c -> c_sy > c -> win_y ) <S2SV_EndBug> value = c -> m_size ; else value = c -> c_line ; while ( i < value ) { ft_putstr ( tgetstr ( "do" , NULL ) ) ; ft_putstr ( tgetstr ( "cd" , NULL ) ) ; i ++ ; } i = 0 ; <S2SV_StartBug> if ( c -> c_sy > c -> win_y ) <S2SV_EndBug> value = c -> m_size - 1 ; else value = c -> c_line - 1 ; while ( i != value ) { ft_putstr ( tgetstr ( "up" , NULL ) ) ; i ++ ; } } | <S2SV_ModStart> ( c -> c_line <S2SV_ModEnd> > c -> <S2SV_ModStart> ( c -> c_line <S2SV_ModEnd> > c -> |
5,022 | CWE-000 static RealF _add_annuals ( const GrpIndex rg , const SppIndex sp , const RealF lastyear_relsize ) { IntU i , num_est ; RealF viable_seeds ; float var ; GroupType * g ; SpeciesType * s ; g = RGroup [ rg ] ; s = Species [ sp ] ; _add_annual_seedprod ( sp , lastyear_relsize ) ; viable_seeds = ( g -> regen_ok ) ? _get_annual_maxestab ( sp ) : 0 ; <S2SV_StartBug> var = RandBeta ( Species [ sp ] -> alpha , Species [ sp ] -> alpha ) ; <S2SV_EndBug> num_est = min ( viable_seeds * var , s -> max_seed_estab ) ; for ( i = 0 ; i <= s -> viable_yrs ; i ++ ) { s -> seedprod [ i ] = s -> seedprod [ i ] - round ( num_est * s -> seedprod [ i ] / viable_seeds ) ; } return num_est ; } | <S2SV_ModStart> sp ] -> beta <S2SV_ModEnd> ) ; num_est |
5,023 | CWE-000 void ntreeGPUMaterialNodes ( bNodeTree * localtree , GPUMaterial * mat , bool * has_surface_output , bool * has_volume_output ) { bNode * output = ntreeShaderOutputNode ( localtree , SHD_OUTPUT_EEVEE ) ; <S2SV_StartBug> bNodeTreeExec * exec ; <S2SV_EndBug> ntree_shader_relink_displacement ( localtree , output ) ; ntree_shader_tag_ssr_node ( localtree , output ) ; ntree_shader_tag_sss_node ( localtree , output ) ; exec = ntreeShaderBeginExecTree ( localtree ) ; ntreeExecGPUNodes ( exec , mat , 1 ) ; ntreeShaderEndExecTree ( exec ) ; * has_surface_output = false ; * has_volume_output = false ; if ( output != NULL ) { bNodeSocket * surface_sock = ntree_shader_node_find_input ( output , "Surface" ) ; bNodeSocket * volume_sock = ntree_shader_node_find_input ( output , "Volume" ) ; if ( surface_sock != NULL ) { * has_surface_output = ( nodeCountSocketLinks ( localtree , surface_sock ) > 0 ) ; } if ( volume_sock != NULL ) { * has_volume_output = ( nodeCountSocketLinks ( localtree , volume_sock ) > 0 ) ; } } } | <S2SV_ModStart> bNodeTreeExec * exec ; ntree_shader_groups_expand_inputs ( localtree ) |
5,024 | CWE-000 static void create_base_gui ( appdata_s * ad ) { ad -> win = elm_win_util_standard_add ( PACKAGE , PACKAGE ) ; elm_win_autodel_set ( ad -> win , EINA_TRUE ) ; ad -> interval = 5 ; ad -> xml . writeNextWpt = 0 ; ad -> xml . docWpt = NULL ; ad -> tracker . maxSpeed = 0 ; ad -> tracker . distance = 0 ; <S2SV_StartBug> ad -> tracker . maxAcceleration = 15 ; <S2SV_EndBug> ad -> visor . zoom = 7 ; if ( elm_win_wm_rotation_supported_get ( ad -> win ) ) { int rots [ 4 ] = { 0 , 90 , 180 , 270 } ; elm_win_wm_rotation_available_rotations_set ( ad -> win , ( const int * ) ( & rots ) , 4 ) ; } evas_object_smart_callback_add ( ad -> win , "delete,request" , win_delete_request_cb , NULL ) ; eext_object_event_callback_add ( ad -> win , EEXT_CALLBACK_BACK , win_back_cb , ad ) ; ad -> conform = elm_conformant_add ( ad -> win ) ; elm_win_indicator_mode_set ( ad -> win , ELM_WIN_INDICATOR_SHOW ) ; elm_win_indicator_opacity_set ( ad -> win , ELM_WIN_INDICATOR_OPAQUE ) ; evas_object_size_hint_weight_set ( ad -> conform , EVAS_HINT_EXPAND , EVAS_HINT_EXPAND ) ; elm_win_resize_object_add ( ad -> win , ad -> conform ) ; evas_object_show ( ad -> conform ) ; Evas_Object * table , * btn_exit , * btn_record ; table = elm_table_add ( ad -> win ) ; elm_object_content_set ( ad -> conform , table ) ; evas_object_show ( table ) ; int max , screen_size_w , screen_size_h ; system_info_get_platform_int ( "tizen.org/feature/screen.height" , & screen_size_h ) ; system_info_get_platform_int ( "tizen.org/feature/screen.width" , & screen_size_w ) ; if ( screen_size_w < screen_size_h ) max = screen_size_w - 20 ; else max = screen_size_h - 20 ; ad -> map = elm_map_add ( ad -> conform ) ; elm_map_zoom_mode_set ( ad -> map , ELM_MAP_ZOOM_MODE_MANUAL ) ; <S2SV_StartBug> evas_object_size_hint_max_set ( ad -> map , max , max ) ; <S2SV_EndBug> evas_object_size_hint_min_set ( ad -> map , max , max ) ; evas_object_size_hint_weight_set ( ad -> map , EVAS_HINT_EXPAND , EVAS_HINT_EXPAND ) ; evas_object_size_hint_align_set ( ad -> map , EVAS_HINT_FILL , 0.5 ) ; elm_table_pack ( table , ad -> map , 0 , 0 , 4 , 4 ) ; evas_object_show ( ad -> map ) ; ad -> labelGps = elm_label_add ( table ) ; elm_object_text_set ( ad -> labelGps , "<align=center>Waiting<S2SV_blank>GPS<S2SV_blank>status</align>" ) ; elm_table_pack ( table , ad -> labelGps , 0 , 4 , 4 , 1 ) ; evas_object_show ( ad -> labelGps ) ; ad -> labelCalc = elm_label_add ( table ) ; elm_object_text_set ( ad -> labelCalc , "<align=center>GPS<S2SV_blank>Tracker</align>" ) ; elm_table_pack ( table , ad -> labelCalc , 0 , 5 , 4 , 1 ) ; evas_object_show ( ad -> labelCalc ) ; ad -> labelDist = elm_label_add ( table ) ; elm_object_text_set ( ad -> labelDist , "<align=center>By<S2SV_blank>Zipotron</align>" ) ; elm_table_pack ( table , ad -> labelDist , 0 , 6 , 4 , 1 ) ; evas_object_show ( ad -> labelDist ) ; ad -> sliderInterval = elm_slider_add ( table ) ; elm_slider_min_max_set ( ad -> sliderInterval , 1 , 100 ) ; elm_slider_value_set ( ad -> sliderInterval , ad -> interval ) ; elm_slider_indicator_show_set ( ad -> sliderInterval , EINA_TRUE ) ; elm_slider_indicator_format_set ( ad -> sliderInterval , "%1.0f" ) ; evas_object_smart_callback_add ( ad -> sliderInterval , "changed" , slider_Interval_changed_cb , ad ) ; evas_object_size_hint_weight_set ( ad -> sliderInterval , EVAS_HINT_EXPAND , EVAS_HINT_EXPAND ) ; evas_object_size_hint_align_set ( ad -> sliderInterval , EVAS_HINT_FILL , 0.5 ) ; evas_object_color_set ( ad -> sliderInterval , 0 , 200 , 0 , 255 ) ; elm_table_pack ( table , ad -> sliderInterval , 0 , 7 , 4 , 1 ) ; <S2SV_StartBug> evas_object_show ( ad -> sliderInterval ) ; <S2SV_EndBug> ad -> sliderZoom = elm_slider_add ( table ) ; elm_slider_min_max_set ( ad -> sliderZoom , 1 , 14 ) ; elm_slider_value_set ( ad -> sliderZoom , ad -> visor . zoom ) ; elm_slider_indicator_show_set ( ad -> sliderZoom , EINA_TRUE ) ; elm_slider_indicator_format_set ( ad -> sliderZoom , "%1.0f" ) ; evas_object_smart_callback_add ( ad -> sliderZoom , "changed" , slider_Zoom_changed_cb , ad ) ; evas_object_size_hint_weight_set ( ad -> sliderZoom , EVAS_HINT_EXPAND , EVAS_HINT_EXPAND ) ; evas_object_size_hint_align_set ( ad -> sliderZoom , EVAS_HINT_FILL , 0.5 ) ; evas_object_color_set ( ad -> sliderZoom , 0 , 200 , 0 , 255 ) ; elm_table_pack ( table , ad -> sliderZoom , 0 , 8 , 4 , 1 ) ; evas_object_show ( ad -> sliderZoom ) ; btn_exit = elm_button_add ( table ) ; elm_object_text_set ( btn_exit , "Exit" ) ; evas_object_smart_callback_add ( btn_exit , "clicked" , btn_exit_clicked_cb , ad ) ; evas_object_size_hint_weight_set ( btn_exit , EVAS_HINT_EXPAND , EVAS_HINT_EXPAND ) ; evas_object_size_hint_align_set ( btn_exit , EVAS_HINT_FILL , 0.5 ) ; evas_object_color_set ( btn_exit , 200 , 0 , 0 , 255 ) ; elm_table_pack ( table , btn_exit , 0 , 9 , 2 , 1 ) ; evas_object_show ( btn_exit ) ; btn_record = elm_button_add ( table ) ; elm_object_text_set ( btn_record , "Record" ) ; evas_object_smart_callback_add ( btn_record , "clicked" , btn_record_clicked_cb , ad ) ; evas_object_size_hint_weight_set ( btn_record , EVAS_HINT_EXPAND , EVAS_HINT_EXPAND ) ; evas_object_size_hint_align_set ( btn_record , EVAS_HINT_FILL , 0.5 ) ; elm_table_pack ( table , btn_record , 2 , 9 , 2 , 1 ) ; evas_object_show ( btn_record ) ; evas_object_show ( ad -> win ) ; show_state ( ad ) ; location_manager_set_position_updated_cb ( ad -> manager , position_updated_cb , ad -> interval , ad ) ; } | <S2SV_ModStart> maxAcceleration = 15 <S2SV_ModEnd> ; if ( <S2SV_ModStart> ELM_MAP_ZOOM_MODE_MANUAL ) ; elm_map_zoom_set ( ad -> map , 12 ) ; <S2SV_ModStart> ad -> sliderInterval <S2SV_ModEnd> ) ; btn_exit |
5,025 | CWE-000 AST * re2ast ( const char * re ) { <S2SV_StartBug> RE = re ; <S2SV_EndBug> return parse_re ( ) ; } | <S2SV_ModStart> re ) { set_re ( re ) <S2SV_ModEnd> ; return parse_re |
5,026 | CWE-000 int bnxt_re_query_port ( struct ib_device * ibdev , u8 port_num , struct ib_port_attr * port_attr ) { struct bnxt_re_dev * rdev = to_bnxt_re_dev ( ibdev , ibdev ) ; struct bnxt_qplib_dev_attr * dev_attr = & rdev -> dev_attr ; memset ( port_attr , 0 , sizeof ( * port_attr ) ) ; if ( netif_running ( rdev -> netdev ) && netif_carrier_ok ( rdev -> netdev ) ) { port_attr -> state = IB_PORT_ACTIVE ; port_attr -> phys_state = 5 ; } else { port_attr -> state = IB_PORT_DOWN ; port_attr -> phys_state = 3 ; } port_attr -> max_mtu = IB_MTU_4096 ; port_attr -> active_mtu = iboe_get_mtu ( rdev -> netdev -> mtu ) ; port_attr -> gid_tbl_len = dev_attr -> max_sgid ; port_attr -> port_cap_flags = IB_PORT_CM_SUP | IB_PORT_REINIT_SUP | IB_PORT_DEVICE_MGMT_SUP | IB_PORT_VENDOR_CLASS_SUP | IB_PORT_IP_BASED_GIDS ; port_attr -> max_msg_sz = 0x80000000 ; port_attr -> bad_pkey_cntr = 0 ; port_attr -> qkey_viol_cntr = 0 ; port_attr -> pkey_tbl_len = dev_attr -> max_pkey ; port_attr -> lid = 0 ; port_attr -> sm_lid = 0 ; port_attr -> lmc = 0 ; port_attr -> max_vl_num = 4 ; port_attr -> sm_sl = 0 ; port_attr -> subnet_timeout = 0 ; port_attr -> init_type_reply = 0 ; <S2SV_StartBug> if ( test_bit ( BNXT_RE_FLAG_IBDEV_REGISTERED , & rdev -> flags ) ) <S2SV_EndBug> <S2SV_StartBug> if ( ib_get_eth_speed ( ibdev , port_num , & port_attr -> active_speed , <S2SV_EndBug> <S2SV_StartBug> & port_attr -> active_width ) ) <S2SV_EndBug> return - EINVAL ; return 0 ; } | <S2SV_ModStart> = 0 ; <S2SV_ModEnd> port_attr -> active_speed <S2SV_ModStart> port_attr -> active_speed = rdev -> active_speed ; <S2SV_ModEnd> port_attr -> active_width <S2SV_ModStart> port_attr -> active_width = rdev -> active_width <S2SV_ModEnd> ; return 0 |
5,027 | CWE-000 <S2SV_StartBug> inline void NEG_Overflow_Flag ( uint8_t u8Result_ ) <S2SV_EndBug> { stCPU . pstRAM -> stRegisters . SREG . V = ( u8Result_ == 0x80 ) ; } | <S2SV_ModStart> <S2SV_null> <S2SV_null> <S2SV_null> static <S2SV_ModEnd> void NEG_Overflow_Flag ( |
5,028 | CWE-000 static int fib_nl_fill_rule ( struct sk_buff * skb , struct fib_rule * rule , u32 pid , u32 seq , int type , int flags , struct fib_rules_ops * ops ) { struct nlmsghdr * nlh ; struct fib_rule_hdr * frh ; nlh = nlmsg_put ( skb , pid , seq , type , sizeof ( * frh ) , flags ) ; if ( nlh == NULL ) return - EMSGSIZE ; frh = nlmsg_data ( nlh ) ; frh -> family = ops -> family ; frh -> table = rule -> table ; if ( nla_put_u32 ( skb , FRA_TABLE , rule -> table ) ) goto nla_put_failure ; if ( nla_put_u32 ( skb , FRA_SUPPRESS_PREFIXLEN , rule -> suppress_prefixlen ) ) goto nla_put_failure ; frh -> res1 = 0 ; frh -> res2 = 0 ; frh -> action = rule -> action ; frh -> flags = rule -> flags ; if ( nla_put_u8 ( skb , FRA_PROTOCOL , rule -> proto ) ) goto nla_put_failure ; if ( rule -> action == FR_ACT_GOTO && rcu_access_pointer ( rule -> ctarget ) == NULL ) frh -> flags |= FIB_RULE_UNRESOLVED ; if ( rule -> iifname [ 0 ] ) { if ( nla_put_string ( skb , FRA_IIFNAME , rule -> iifname ) ) goto nla_put_failure ; if ( rule -> iifindex == - 1 ) frh -> flags |= FIB_RULE_IIF_DETACHED ; } if ( rule -> oifname [ 0 ] ) { if ( nla_put_string ( skb , FRA_OIFNAME , rule -> oifname ) ) goto nla_put_failure ; if ( rule -> oifindex == - 1 ) frh -> flags |= FIB_RULE_OIF_DETACHED ; } if ( ( rule -> pref && nla_put_u32 ( skb , FRA_PRIORITY , rule -> pref ) ) || ( rule -> mark && nla_put_u32 ( skb , FRA_FWMARK , rule -> mark ) ) || ( ( rule -> mark_mask || rule -> mark ) && nla_put_u32 ( skb , FRA_FWMASK , rule -> mark_mask ) ) || ( rule -> target && nla_put_u32 ( skb , FRA_GOTO , rule -> target ) ) || ( rule -> tun_id && nla_put_be64 ( skb , FRA_TUN_ID , rule -> tun_id , FRA_PAD ) ) || ( rule -> l3mdev && nla_put_u8 ( skb , FRA_L3MDEV , rule -> l3mdev ) ) || ( uid_range_set ( & rule -> uid_range ) && <S2SV_StartBug> nla_put_uid_range ( skb , & rule -> uid_range ) ) ) <S2SV_EndBug> goto nla_put_failure ; if ( rule -> suppress_ifgroup != - 1 ) { if ( nla_put_u32 ( skb , FRA_SUPPRESS_IFGROUP , rule -> suppress_ifgroup ) ) goto nla_put_failure ; } if ( ops -> fill ( rule , skb , frh ) < 0 ) goto nla_put_failure ; nlmsg_end ( skb , nlh ) ; return 0 ; nla_put_failure : nlmsg_cancel ( skb , nlh ) ; return - EMSGSIZE ; } | <S2SV_ModStart> uid_range ) ) || ( fib_rule_port_range_set ( & rule -> sport_range ) && nla_put_port_range ( skb , FRA_SPORT_RANGE , & rule -> sport_range ) ) || ( fib_rule_port_range_set ( & rule -> dport_range ) && nla_put_port_range ( skb , FRA_DPORT_RANGE , & rule -> dport_range ) ) || ( rule -> ip_proto && nla_put_u8 ( skb , FRA_IP_PROTO , rule -> ip_proto ) ) |
5,029 | CWE-000 static Bool msStartFlippingPixmapTracking ( RRCrtcPtr crtc , DrawablePtr src , PixmapPtr slave_dst1 , PixmapPtr slave_dst2 , int x , int y , int dst_x , int dst_y , Rotation rotation ) { ScreenPtr pScreen = src -> pScreen ; modesettingPtr ms = modesettingPTR ( xf86ScreenToScrn ( pScreen ) ) ; <S2SV_StartBug> msPixmapPrivPtr ppriv1 = msGetPixmapPriv ( & ms -> drmmode , slave_dst1 ) , <S2SV_EndBug> <S2SV_StartBug> ppriv2 = msGetPixmapPriv ( & ms -> drmmode , slave_dst2 ) ; <S2SV_EndBug> if ( ! PixmapStartDirtyTracking ( src , slave_dst1 , x , y , dst_x , dst_y , rotation ) ) { return FALSE ; } if ( ! PixmapStartDirtyTracking ( src , slave_dst2 , x , y , dst_x , dst_y , rotation ) ) { PixmapStopDirtyTracking ( src , slave_dst1 ) ; return FALSE ; } ppriv1 -> slave_src = src ; ppriv2 -> slave_src = src ; ppriv1 -> dirty = ms_dirty_get_ent ( pScreen , slave_dst1 ) ; ppriv2 -> dirty = ms_dirty_get_ent ( pScreen , slave_dst2 ) ; ppriv1 -> defer_dirty_update = TRUE ; ppriv2 -> defer_dirty_update = TRUE ; return TRUE ; } | <S2SV_ModStart> drmmode , slave_dst1 -> master_pixmap <S2SV_ModStart> drmmode , slave_dst2 -> master_pixmap |
5,030 | CWE-000 static herr_t H5L_delete_cb ( H5G_loc_t * grp_loc , const char * name , const H5O_link_t * lnk , H5G_loc_t H5_ATTR_UNUSED * obj_loc , void * _udata , H5G_own_loc_t * own_loc ) { H5L_trav_rm_t * udata = ( H5L_trav_rm_t * ) _udata ; herr_t ret_value = SUCCEED ; FUNC_ENTER_NOAPI_NOINIT if ( grp_loc == NULL ) HGOTO_ERROR ( H5E_SYM , H5E_NOTFOUND , FAIL , "group<S2SV_blank>doesn\'t<S2SV_blank>exist" ) if ( name == NULL ) HGOTO_ERROR ( H5E_SYM , H5E_NOTFOUND , FAIL , "name<S2SV_blank>doesn\'t<S2SV_blank>exist" ) if ( lnk == NULL ) <S2SV_StartBug> HGOTO_ERROR ( H5E_SYM , H5E_CANTDELETE , FAIL , "can\'t<S2SV_blank>delete<S2SV_blank>self" ) <S2SV_EndBug> if ( H5G_obj_remove ( grp_loc -> oloc , grp_loc -> path -> full_path_r , name , udata -> dxpl_id ) < 0 ) HGOTO_ERROR ( H5E_SYM , H5E_CANTDELETE , FAIL , "unable<S2SV_blank>to<S2SV_blank>remove<S2SV_blank>link<S2SV_blank>from<S2SV_blank>group" ) done : * own_loc = H5G_OWN_NONE ; FUNC_LEAVE_NOAPI ( ret_value ) } | <S2SV_ModStart> , FAIL , "callback<S2SV_blank>link<S2SV_blank>pointer<S2SV_blank>is<S2SV_blank>NULL<S2SV_blank>(specified<S2SV_blank>link<S2SV_blank>may<S2SV_blank>be<S2SV_blank>\'.\'<S2SV_blank>or<S2SV_blank>not<S2SV_blank>exist)" <S2SV_ModEnd> ) if ( |
5,031 | CWE-000 char * concString ( char * s1 , char * s2 ) { char * newString = ( char * ) malloc ( 100 ) ; int i ; for ( i = 0 ; s1 [ i ] != '\\0' ; i ++ ) { newString [ i ] = s1 [ i ] ; } <S2SV_StartBug> for ( int j = 0 ; s2 [ j ] != '\\0' ; j ++ , i ++ ) { <S2SV_EndBug> newString [ i ] = s2 [ j ] ; } newString [ i ] = '\\0' ; return newString ; } | <S2SV_ModStart> ] ; } newString [ i ] = '/' ; i ++ ; |
5,032 | CWE-000 void ApplyFirmware ( ) { system ( "unzip<S2SV_blank>-o<S2SV_blank>remote_monitoring.zip<S2SV_blank>-d<S2SV_blank>cmake/samples/remote_monitoring/" ) ; <S2SV_StartBug> system ( "sudo<S2SV_blank>chmod<S2SV_blank>+x<S2SV_blank>firmwareupdate.sh" ) ; <S2SV_EndBug> system ( "sudo<S2SV_blank>chmod<S2SV_blank>+x<S2SV_blank>cmake/samples/remote_monitoring/remote_monitoring" ) ; system ( "rm<S2SV_blank>-f<S2SV_blank>remote_monitoring.zip" ) ; <S2SV_StartBug> system ( "nohup<S2SV_blank>./firmwareupdate.sh<S2SV_blank>><S2SV_blank>/dev/null<S2SV_blank>2>&1<S2SV_blank>&" ) ; <S2SV_EndBug> } | <S2SV_ModStart> ; system ( "sudo<S2SV_blank>mv<S2SV_blank>cmake/samples/remote_monitoring/firmwarereboot.sh<S2SV_blank>." ) ; system ( "sudo<S2SV_blank>chmod<S2SV_blank>+x<S2SV_blank>firmwarereboot.sh" ) ; system ( "sed<S2SV_blank>-i<S2SV_blank>\'s/\\r//\'<S2SV_blank>firmwarereboot.sh" <S2SV_ModEnd> ) ; system <S2SV_ModStart> ; system ( "sudo<S2SV_blank>nohup<S2SV_blank>sh<S2SV_blank>./firmwarereboot.sh<S2SV_blank>><S2SV_blank>/tmp/reboot.txt<S2SV_blank>&" <S2SV_ModEnd> ) ; } |
5,033 | CWE-000 BAT * BATsample ( BAT * b , BUN n ) { BAT * bn ; BUN cnt , slen ; BUN rescnt ; struct oidtreenode * tree = NULL ; mtwist * mt_rng ; unsigned int range ; <S2SV_StartBug> dbl random ; <S2SV_EndBug> BATcheck ( b , "BATsample" , NULL ) ; ERRORcheck ( n > BUN_MAX , "BATsample:<S2SV_blank>sample<S2SV_blank>size<S2SV_blank>larger<S2SV_blank>than<S2SV_blank>BUN_MAX\\n" , NULL ) ; ALGODEBUG fprintf ( stderr , "#BATsample:<S2SV_blank>sample<S2SV_blank>" BUNFMT "<S2SV_blank>elements.\\n" , n ) ; cnt = BATcount ( b ) ; if ( n == 0 ) { bn = COLnew ( 0 , TYPE_void , 0 , TRANSIENT ) ; if ( bn == NULL ) { return NULL ; } BATsetcount ( bn , 0 ) ; BATtseqbase ( bn , 0 ) ; } else if ( cnt <= n ) { bn = COLnew ( 0 , TYPE_void , cnt , TRANSIENT ) ; if ( bn == NULL ) { return NULL ; } BATsetcount ( bn , cnt ) ; BATtseqbase ( bn , b -> hseqbase ) ; } else { oid minoid = b -> hseqbase ; oid maxoid = b -> hseqbase + cnt ; bit antiset = n > cnt / 2 ; slen = n ; if ( antiset ) n = cnt - n ; tree = GDKmalloc ( n * sizeof ( struct oidtreenode ) ) ; if ( tree == NULL ) { return NULL ; } bn = COLnew ( 0 , TYPE_oid , slen , TRANSIENT ) ; if ( bn == NULL ) { GDKfree ( tree ) ; return NULL ; } mt_rng = mtwist_new ( ) ; mtwist_seed ( mt_rng , rand ( ) ) ; range = maxoid - minoid ; for ( rescnt = 0 ; rescnt < n ; rescnt ++ ) { oid candoid ; do { candoid = ( oid ) ( minoid + ( mtwist_u32rand ( mt_rng ) % range ) ) ; } while ( ! OIDTreeMaybeInsert ( tree , candoid , rescnt ) ) ; } if ( ! antiset ) { OIDTreeToBAT ( tree , bn ) ; } else { OIDTreeToBATAntiset ( tree , bn , minoid , maxoid ) ; } GDKfree ( tree ) ; BATsetcount ( bn , slen ) ; bn -> trevsorted = bn -> batCount <= 1 ; bn -> tsorted = 1 ; bn -> tkey = 1 ; bn -> tdense = bn -> batCount <= 1 ; if ( bn -> batCount == 1 ) bn -> tseqbase = * ( oid * ) Tloc ( bn , 0 ) ; } return bn ; } | <S2SV_ModStart> int range ; <S2SV_ModEnd> BATcheck ( b |
5,034 | CWE-000 static void py_byref ( lua_State * L ) { <S2SV_StartBug> python_setnumber ( L , PY_OBJECT_BY_REFERENCE , 1 ) ; <S2SV_EndBug> py_object_index_get ( L ) ; <S2SV_StartBug> python_setnumber ( L , PY_OBJECT_BY_REFERENCE , 0 ) ; <S2SV_EndBug> } | <S2SV_ModStart> L ) { int stacked = is_byref ( L ) ; if ( ! stacked ) set_byref ( L <S2SV_ModEnd> , 1 ) <S2SV_ModStart> L ) ; if ( ! stacked ) set_byref ( L <S2SV_ModEnd> , 0 ) |
5,035 | CWE-000 static void <S2SV_StartBug> record_btrace_insn_history ( struct target_ops * self , int size , int flags ) <S2SV_EndBug> { struct btrace_thread_info * btinfo ; struct btrace_insn_history * history ; struct btrace_insn_iterator begin , end ; struct ui_out * uiout ; unsigned int context , covered ; uiout = current_uiout ; ui_out_emit_tuple tuple_emitter ( uiout , "insn<S2SV_blank>history" ) ; context = abs ( size ) ; if ( context == 0 ) error ( _ ( "Bad<S2SV_blank>record<S2SV_blank>instruction-history-size." ) ) ; btinfo = require_btrace ( ) ; history = btinfo -> insn_history ; if ( history == NULL ) { struct btrace_insn_iterator * replay ; <S2SV_StartBug> DEBUG ( "insn-history<S2SV_blank>(0x%x):<S2SV_blank>%d" , flags , size ) ; <S2SV_EndBug> replay = btinfo -> replay ; if ( replay != NULL ) begin = * replay ; else btrace_insn_end ( & begin , btinfo ) ; end = begin ; if ( size < 0 ) { covered = btrace_insn_next ( & end , 1 ) ; covered += btrace_insn_prev ( & begin , context - covered ) ; covered += btrace_insn_next ( & end , context - covered ) ; } else { covered = btrace_insn_next ( & end , context ) ; covered += btrace_insn_prev ( & begin , context - covered ) ; } } else { begin = history -> begin ; end = history -> end ; <S2SV_StartBug> DEBUG ( "insn-history<S2SV_blank>(0x%x):<S2SV_blank>%d,<S2SV_blank>prev:<S2SV_blank>[%u;<S2SV_blank>%u)" , flags , size , <S2SV_EndBug> btrace_insn_number ( & begin ) , btrace_insn_number ( & end ) ) ; if ( size < 0 ) { end = begin ; covered = btrace_insn_prev ( & begin , context ) ; } else { begin = end ; covered = btrace_insn_next ( & end , context ) ; } } if ( covered > 0 ) btrace_insn_history ( uiout , btinfo , & begin , & end , flags ) ; else { if ( size < 0 ) printf_unfiltered ( _ ( "At<S2SV_blank>the<S2SV_blank>start<S2SV_blank>of<S2SV_blank>the<S2SV_blank>branch<S2SV_blank>trace<S2SV_blank>record.\\n" ) ) ; else printf_unfiltered ( _ ( "At<S2SV_blank>the<S2SV_blank>end<S2SV_blank>of<S2SV_blank>the<S2SV_blank>branch<S2SV_blank>trace<S2SV_blank>record.\\n" ) ) ; } btrace_set_insn_history ( btinfo , & begin , & end ) ; } | <S2SV_ModStart> int size , gdb_disassembly_flags <S2SV_ModEnd> flags ) { <S2SV_ModStart> ( "insn-history<S2SV_blank>(0x%x):<S2SV_blank>%d" , ( unsigned ) <S2SV_ModStart> ( "insn-history<S2SV_blank>(0x%x):<S2SV_blank>%d,<S2SV_blank>prev:<S2SV_blank>[%u;<S2SV_blank>%u)" , ( unsigned ) |
5,036 | CWE-000 static int ov7740_set_ctrl ( struct v4l2_ctrl * ctrl ) { struct ov7740 * ov7740 = container_of ( ctrl -> handler , struct ov7740 , ctrl_handler ) ; struct i2c_client * client = v4l2_get_subdevdata ( & ov7740 -> subdev ) ; struct regmap * regmap = ov7740 -> regmap ; int ret ; u8 val = 0 ; <S2SV_StartBug> if ( pm_runtime_get_if_in_use ( & client -> dev ) <= 0 ) <S2SV_EndBug> return 0 ; switch ( ctrl -> id ) { case V4L2_CID_AUTO_WHITE_BALANCE : ret = ov7740_set_white_balance ( ov7740 , ctrl -> val ) ; break ; case V4L2_CID_SATURATION : ret = ov7740_set_saturation ( regmap , ctrl -> val ) ; break ; case V4L2_CID_BRIGHTNESS : ret = ov7740_set_brightness ( regmap , ctrl -> val ) ; break ; case V4L2_CID_CONTRAST : ret = ov7740_set_contrast ( regmap , ctrl -> val ) ; break ; case V4L2_CID_VFLIP : ret = regmap_update_bits ( regmap , REG_REG0C , REG0C_IMG_FLIP , val ) ; break ; case V4L2_CID_HFLIP : val = ctrl -> val ? REG0C_IMG_MIRROR : 0x00 ; ret = regmap_update_bits ( regmap , REG_REG0C , REG0C_IMG_MIRROR , val ) ; break ; case V4L2_CID_AUTOGAIN : if ( ! ctrl -> val ) return ov7740_set_gain ( regmap , ov7740 -> gain -> val ) ; ret = ov7740_set_autogain ( regmap , ctrl -> val ) ; break ; case V4L2_CID_EXPOSURE_AUTO : if ( ctrl -> val == V4L2_EXPOSURE_MANUAL ) return ov7740_set_exp ( regmap , ov7740 -> exposure -> val ) ; ret = ov7740_set_autoexp ( regmap , ctrl -> val ) ; break ; default : ret = - EINVAL ; break ; } pm_runtime_put ( & client -> dev ) ; return ret ; } | <S2SV_ModStart> ; if ( ! <S2SV_ModStart> -> dev ) <S2SV_ModEnd> ) return 0 |
5,037 | CWE-000 GLvoid glColorPointer ( GLint size , GLenum type , GLsizei stride , const GLvoid * ptr ) <S2SV_StartBug> { <S2SV_EndBug> vt_attrib_pointer [ WES_ACOLOR0 ] . isenabled = GL_TRUE ; vt_attrib_pointer [ WES_ACOLOR0 ] . size = size ; vt_attrib_pointer [ WES_ACOLOR0 ] . type = type ; vt_attrib_pointer [ WES_ACOLOR0 ] . stride = stride ; vt_attrib_pointer [ WES_ACOLOR0 ] . ptr = ptr ; <S2SV_StartBug> wes_gl -> glVertexAttribPointer ( WES_ACOLOR0 , size , type , GL_FALSE , stride , ptr ) ; <S2SV_EndBug> } | <S2SV_ModStart> ptr ) { wes_vertbuffer_flush ( ) ; <S2SV_ModStart> , type , GL_TRUE <S2SV_ModEnd> , stride , |
5,038 | CWE-000 static void pthreads_prepared_entry_static_members ( pthreads_object_t * thread , zend_class_entry * candidate , zend_class_entry * prepared ) { if ( candidate -> default_static_members_count ) { int i ; if ( prepared -> default_static_members_table != NULL ) { efree ( prepared -> default_static_members_table ) ; } prepared -> default_static_members_table = ( zval * ) ecalloc ( sizeof ( zval ) , candidate -> default_static_members_count ) ; prepared -> default_static_members_count = candidate -> default_static_members_count ; memcpy ( prepared -> default_static_members_table , candidate -> default_static_members_table , sizeof ( zval ) * candidate -> default_static_members_count ) ; for ( i = 0 ; i < prepared -> default_static_members_count ; i ++ ) { pthreads_store_separate ( & candidate -> default_static_members_table [ i ] , & prepared -> default_static_members_table [ i ] , 0 ) ; } prepared -> static_members_table = prepared -> default_static_members_table ; } else prepared -> default_static_members_count = 0 ; { zend_string * key ; zval * value ; ZEND_HASH_FOREACH_STR_KEY_VAL ( & candidate -> constants_table , key , value ) { zend_string * name ; zval separated ; if ( zend_hash_exists ( & prepared -> constants_table , key ) ) { continue ; } switch ( Z_TYPE_P ( value ) ) { case IS_PTR : { zend_class_constant * zc = Z_PTR_P ( value ) , rc ; memcpy ( & rc , zc , sizeof ( zend_class_constant ) ) ; if ( pthreads_store_separate ( & zc -> value , & rc . value , 1 ) == SUCCESS ) { if ( zc -> doc_comment != NULL ) { rc . doc_comment = zend_string_new ( zc -> doc_comment ) ; } <S2SV_StartBug> rc . ce = pthreads_prepared_entry ( thread , zc -> ce ) ; <S2SV_EndBug> name = zend_string_new ( key ) ; zend_hash_add_mem ( & prepared -> constants_table , name , & rc , sizeof ( zend_class_constant ) ) ; zend_string_release ( name ) ; } continue ; } case IS_STRING : case IS_ARRAY : { if ( pthreads_store_separate ( value , & separated , 1 ) != SUCCESS ) { continue ; } } break ; default : ZVAL_COPY ( & separated , value ) ; } name = zend_string_new ( key ) ; zend_hash_update ( & prepared -> constants_table , name , & separated ) ; zend_string_release ( name ) ; } ZEND_HASH_FOREACH_END ( ) ; } } | <S2SV_ModStart> . ce = pthreads_prepared_entry_internal <S2SV_ModEnd> ( thread , <S2SV_ModStart> zc -> ce , 0 |
5,039 | CWE-000 static FLAC__StreamDecoderWriteStatus write_callback ( const FLAC__StreamDecoder * decoder , const FLAC__Frame * frame , const FLAC__int32 * const ibuffer [ ] , void * obuffer ) { FLAC__uint64 i , ch ; unsigned channels = frame -> header . channels ; ( void ) decoder ; switch ( round_to_bytes ( frame -> header . bits_per_sample ) ) { case 1 : for ( i = 0 ; i < frame -> header . blocksize ; i ++ ) { for ( ch = 0 ; ch < channels ; ch ++ ) { * ( ( FLAC__uint8 * ) obuffer + i * channels + ch ) <S2SV_StartBug> = ( FLAC__uint8 ) ibuffer [ ch ] [ i ] ; <S2SV_EndBug> } } break ; case 2 : for ( i = 0 ; i < frame -> header . blocksize ; i ++ ) { for ( ch = 0 ; ch < channels ; ch ++ ) { * ( ( FLAC__int16 * ) obuffer + i * channels + ch ) = ( FLAC__int16 ) ibuffer [ ch ] [ i ] ; } } break ; case 3 : for ( i = 0 ; i < frame -> header . blocksize ; i ++ ) { for ( ch = 0 ; ch < channels ; ch ++ ) { * ( FLAC__int32 * ) ( ( FLAC__byte * ) obuffer + ( i * channels + ch ) * 3 ) = ( FLAC__int32 ) ibuffer [ ch ] [ i ] ; } } break ; } return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE ; } | <S2SV_ModStart> [ i ] + 0x80 |
5,040 | CWE-000 void Draw ( ESContext * esContext ) { UserData * userData = esContext -> userData ; GLfloat vVertices [ ] = { - 1.0f , 1.0f , 0.0f , 0.0f , 0.0f , - 1.0f , - 1.0f , 0.0f , 0.0f , 1.0f , 1.0f , - 1.0f , 0.0f , 1.0f , 1.0f , 1.0f , 1.0f , 0.0f , 1.0f , 0.0f } ; GLushort indices [ ] = { 0 , 1 , 2 , 0 , 2 , 3 } ; glViewport ( 0 , 0 , esContext -> width , esContext -> height ) ; glClear ( GL_COLOR_BUFFER_BIT ) ; glUseProgram ( userData -> programObject ) ; glVertexAttribPointer ( userData -> positionLoc , 3 , GL_FLOAT , GL_FALSE , 5 * sizeof ( GLfloat ) , vVertices ) ; glVertexAttribPointer ( userData -> texCoordLoc , 2 , GL_FLOAT , GL_FALSE , 5 * sizeof ( GLfloat ) , & vVertices [ 3 ] ) ; glEnableVertexAttribArray ( userData -> positionLoc ) ; glEnableVertexAttribArray ( userData -> texCoordLoc ) ; glActiveTexture ( GL_TEXTURE0 ) ; glBindTexture ( GL_TEXTURE_2D , userData -> textureId ) ; glUniform1i ( userData -> samplerLoc , 0 ) ; <S2SV_StartBug> glDrawElements ( GL_TRIANGLES , 6 , GL_UNSIGNED_SHORT , indices ) ; <S2SV_EndBug> } | <S2SV_ModStart> 0 ) ; imwLoc = glGetUniformLocation ( userData -> programObject , "uimage_width" ) ; if ( - 1 == imwLoc ) { fprintf ( stderr , "warning<S2SV_blank>imwLoc<S2SV_blank>error\\n" ) ; check_error ( "war<S2SV_blank>imwLoc" ) ; } else { glUniform1i ( imwLoc , im_width ) ; check_error ( "war<S2SV_blank>after<S2SV_blank>imwLoc" ) ; } |
5,041 | CWE-000 int reserve_memtype ( u64 start , u64 end , enum page_cache_mode req_type , enum page_cache_mode * new_type ) { struct memtype * new ; enum page_cache_mode actual_type ; int is_range_ram ; int err = 0 ; start = sanitize_phys ( start ) ; end = sanitize_phys ( end ) ; <S2SV_StartBug> BUG_ON ( start >= end ) ; <S2SV_EndBug> if ( ! pat_enabled ( ) ) { if ( new_type ) * new_type = req_type ; return 0 ; } if ( x86_platform . is_untracked_pat_range ( start , end ) ) { if ( new_type ) * new_type = _PAGE_CACHE_MODE_WB ; return 0 ; } actual_type = pat_x_mtrr_type ( start , end , req_type ) ; if ( new_type ) * new_type = actual_type ; is_range_ram = pat_pagerange_is_ram ( start , end ) ; if ( is_range_ram == 1 ) { err = reserve_ram_pages_type ( start , end , req_type , new_type ) ; return err ; } else if ( is_range_ram < 0 ) { return - EINVAL ; } new = kzalloc ( sizeof ( struct memtype ) , GFP_KERNEL ) ; if ( ! new ) return - ENOMEM ; new -> start = start ; new -> end = end ; new -> type = actual_type ; spin_lock ( & memtype_lock ) ; err = rbt_memtype_check_insert ( new , new_type ) ; if ( err ) { pr_info ( "x86/PAT:<S2SV_blank>reserve_memtype<S2SV_blank>failed<S2SV_blank>[mem<S2SV_blank>%#010Lx-%#010Lx],<S2SV_blank>track<S2SV_blank>%s,<S2SV_blank>req<S2SV_blank>%s\\n" , start , end - 1 , cattr_name ( new -> type ) , cattr_name ( req_type ) ) ; kfree ( new ) ; spin_unlock ( & memtype_lock ) ; return err ; } spin_unlock ( & memtype_lock ) ; dprintk ( "reserve_memtype<S2SV_blank>added<S2SV_blank>[mem<S2SV_blank>%#010Lx-%#010Lx],<S2SV_blank>track<S2SV_blank>%s,<S2SV_blank>req<S2SV_blank>%s,<S2SV_blank>ret<S2SV_blank>%s\\n" , start , end - 1 , cattr_name ( new -> type ) , cattr_name ( req_type ) , new_type ? cattr_name ( * new_type ) : "-" ) ; return err ; } | <S2SV_ModStart> end ) ; if <S2SV_ModEnd> ( start >= <S2SV_ModStart> >= end ) { WARN ( 1 , "%s<S2SV_blank>failed:<S2SV_blank>[mem<S2SV_blank>%#010Lx-%#010Lx],<S2SV_blank>req<S2SV_blank>%s\\n" , __func__ , start , end - 1 , cattr_name ( req_type ) ) ; return - EINVAL ; } <S2SV_ModEnd> if ( ! |
5,042 | CWE-000 void ugl_start ( struct ifnet * ifp ) { struct ugl_softc * sc = ifp -> if_softc ; struct mbuf * m_head = NULL ; if ( usbd_is_dying ( sc -> sc_udev ) ) return ; DPRINTFN ( 10 , ( "%s:<S2SV_blank>%s:<S2SV_blank>enter\\n" , sc -> sc_dev . dv_xname , __func__ ) ) ; if ( ifq_is_oactive ( & ifp -> if_snd ) ) return ; m_head = ifq_deq_begin ( & ifp -> if_snd ) ; if ( m_head == NULL ) return ; if ( ugl_send ( sc , m_head , 0 ) ) { <S2SV_StartBug> ifq_deq_commit ( & ifp -> if_snd , m_head ) ; <S2SV_EndBug> ifq_set_oactive ( & ifp -> if_snd ) ; return ; } ifq_deq_commit ( & ifp -> if_snd , m_head ) ; # if NBPFILTER > 0 if ( ifp -> if_bpf ) bpf_mtap ( ifp -> if_bpf , m_head , BPF_DIRECTION_OUT ) ; # endif ifq_set_oactive ( & ifp -> if_snd ) ; ifp -> if_timer = 5 ; } | <S2SV_ModStart> ) ) { ifq_deq_rollback <S2SV_ModEnd> ( & ifp |
5,043 | CWE-000 GtkTreeIter * keyword_add_from_config ( GtkTreeStore * keyword_tree , GtkTreeIter * parent , const gchar * * attribute_names , const gchar * * attribute_values ) { gchar * name = NULL ; gboolean is_kw = TRUE ; <S2SV_StartBug> while ( * attribute_names ) <S2SV_EndBug> { const gchar * option = * attribute_names ++ ; const gchar * value = * attribute_values ++ ; if ( READ_CHAR_FULL ( "name" , name ) ) continue ; <S2SV_StartBug> if ( READ_BOOL_FULL ( "kw" , is_kw ) ) continue ; <S2SV_EndBug> log_printf ( "unknown<S2SV_blank>attribute<S2SV_blank>%s<S2SV_blank>=<S2SV_blank>%s\\n" , option , value ) ; } if ( name && name [ 0 ] ) { GtkTreeIter iter ; if ( ! keyword_exists ( GTK_TREE_MODEL ( keyword_tree ) , parent , NULL , name , FALSE , & iter ) ) { gtk_tree_store_append ( keyword_tree , & iter , parent ) ; } keyword_set ( keyword_tree , & iter , name , is_kw ) ; <S2SV_StartBug> g_free ( name ) ; <S2SV_EndBug> return gtk_tree_iter_copy ( & iter ) ; } g_free ( name ) ; return NULL ; } | <S2SV_ModStart> = TRUE ; gchar * mark_str = NULL ; <S2SV_ModStart> "kw" , is_kw ) ) continue ; if ( READ_CHAR_FULL ( "mark" , mark_str <S2SV_ModStart> is_kw ) ; if ( mark_str ) { meta_data_connect_mark_with_keyword ( GTK_TREE_MODEL ( keyword_tree ) , & iter , ( gint ) atoi ( mark_str ) - 1 ) ; } |
5,044 | CWE-000 void sort_players ( t_vm * vm ) { int c ; t_player * tmp ; t_player * tmp2 ; int i ; c = count_players ( vm ) ; tmp = vm -> player ; i = 0 ; while ( tmp != NULL ) { i ++ ; if ( tmp -> idx > c ) die ( "Error:<S2SV_blank>Player<S2SV_blank>index<S2SV_blank>cannot<S2SV_blank>exceed<S2SV_blank>players<S2SV_blank>count!" ) ; if ( ( tmp -> idx > 0 ) && ( tmp -> idx != i ) ) { i = 1 ; tmp2 = vm -> player ; while ( i ++ < tmp -> idx ) tmp2 = tmp2 -> next ; tmp -> next = tmp2 -> next ; tmp2 -> next = tmp ; tmp = vm -> player ; i = 0 ; } else tmp = tmp -> next ; } <S2SV_StartBug> int n = 1 ; <S2SV_EndBug> tmp = vm -> player ; while ( tmp != NULL ) { <S2SV_StartBug> tmp -> n = n ++ ; <S2SV_EndBug> tmp = tmp -> next ; } } | <S2SV_ModStart> next ; } i = - <S2SV_ModEnd> 1 ; tmp <S2SV_ModStart> { tmp -> idx = i -- <S2SV_ModEnd> ; tmp = |
5,045 | CWE-000 static void file_load_delete_cb ( GObject * source_object , GAsyncResult * result , gpointer user_data ) { GFile * file = G_FILE ( source_object ) ; g_autoptr ( GTask ) task = G_TASK ( user_data ) ; g_autoptr ( GError ) local_error = NULL ; EpgManager * self = g_task_get_source_object ( task ) ; g_autoptr ( GFile ) expiry_time_file = get_expiry_time_file ( self ) ; <S2SV_StartBug> if ( ! g_file_delete_finish ( file , result , & local_error ) && <S2SV_EndBug> ! g_error_matches ( local_error , G_IO_ERROR , G_IO_ERROR_NOT_FOUND ) ) <S2SV_StartBug> g_debug ( "%s:<S2SV_blank>Error:<S2SV_blank>%s" , G_STRFUNC , local_error -> message ) ; <S2SV_EndBug> <S2SV_StartBug> if ( ! g_file_equal ( file , expiry_time_file ) ) <S2SV_EndBug> { g_autofree gchar * file_path = g_file_get_path ( file ) ; g_clear_error ( & local_error ) ; local_error = g_error_new ( G_IO_ERROR , G_IO_ERROR_INVALID_DATA , _ ( "State<S2SV_blank>file<S2SV_blank>‘%s’<S2SV_blank>was<S2SV_blank>the<S2SV_blank>wrong<S2SV_blank>length." ) , file_path ) ; } else if ( local_error == NULL ) epg_multi_task_return_boolean ( task , TRUE ) ; <S2SV_StartBug> epg_multi_task_return_error ( task , G_STRFUNC , g_steal_pointer ( & local_error ) ) ; <S2SV_EndBug> } | <S2SV_ModStart> self ) ; GError * error = g_task_get_task_data ( task ) ; <S2SV_ModStart> G_IO_ERROR_NOT_FOUND ) ) { if ( error == NULL ) error = local_error ; else <S2SV_ModStart> message ) ; } if ( error <S2SV_ModEnd> == NULL ) <S2SV_ModStart> , G_STRFUNC , g_error_copy ( error <S2SV_ModEnd> ) ) ; |
5,046 | CWE-000 status_t sl_get_maxkey ( skiplist_t * sl , void * * key , size_t * size ) { <S2SV_StartBug> status_t _status = _sl_get_maxkey ( sl , key , size ) ; <S2SV_EndBug> if ( _status . code == STATUS_SKIPLIST_MAXKEY_NOTFOUND ) { * key = sl -> maxkey ; * size = sl -> maxkey_len ; _status . code = 0 ; } <S2SV_StartBug> return _status ; <S2SV_EndBug> } | <S2SV_ModStart> ) { status_t _status ; uint64_t _offsets [ ] = { } ; _status = sl_rdlock ( sl , _offsets , 0 ) ; if ( _status . code != 0 ) { return _status ; } <S2SV_ModStart> 0 ; } sl_unlock ( sl , _offsets , 0 ) ; |
5,047 | CWE-000 static NTSTATUS Kph2Extract ( _In_ PPH_STRING KphFileName ) { NTSTATUS status = STATUS_FAIL_CHECK ; HANDLE fileHandle = NULL ; HANDLE sectionHandle = NULL ; PVOID viewBase = NULL ; PVOID fileResource ; HRSRC resourceHandle ; HGLOBAL fileResourceHandle ; SIZE_T viewSize = 0 ; SIZE_T resourceLength ; LARGE_INTEGER maximumSize ; if ( ! ( resourceHandle = FindResource ( PluginInstance -> DllBase , PhIsExecutingInWow64 ( ) ? MAKEINTRESOURCE ( IDR_KPH2_32 ) : MAKEINTRESOURCE ( IDR_KPH2_64 ) , RT_RCDATA ) ) ) { goto CleanupExit ; } if ( ! ( fileResourceHandle = LoadResource ( PluginInstance -> DllBase , resourceHandle ) ) ) goto CleanupExit ; if ( ! ( fileResource = LockResource ( fileResourceHandle ) ) ) goto CleanupExit ; resourceLength = ( SIZE_T ) SizeofResource ( PluginInstance -> DllBase , resourceHandle ) ; maximumSize . QuadPart = resourceLength ; if ( ! NT_SUCCESS ( status = PhCreateFileWin32 ( & fileHandle , PhGetString ( KphFileName ) , <S2SV_StartBug> FILE_ALL_ACCESS , <S2SV_EndBug> 0 , <S2SV_StartBug> FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE , <S2SV_EndBug> FILE_OVERWRITE_IF , FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT ) ) ) { goto CleanupExit ; } if ( ! NT_SUCCESS ( status = NtCreateSection ( & sectionHandle , SECTION_ALL_ACCESS , NULL , & maximumSize , PAGE_READWRITE , SEC_COMMIT , fileHandle ) ) ) { goto CleanupExit ; } if ( ! NT_SUCCESS ( status = NtMapViewOfSection ( sectionHandle , NtCurrentProcess ( ) , & viewBase , 0 , 0 , NULL , & viewSize , ViewShare , 0 , PAGE_READWRITE ) ) ) { goto CleanupExit ; } RtlCopyMemory ( viewBase , fileResource , resourceLength ) ; CleanupExit : if ( viewBase ) NtUnmapViewOfSection ( NtCurrentProcess ( ) , viewBase ) ; if ( sectionHandle ) NtClose ( sectionHandle ) ; if ( fileHandle ) NtClose ( fileHandle ) ; if ( resourceHandle ) FreeResource ( resourceHandle ) ; return status ; } | <S2SV_ModStart> KphFileName ) , FILE_GENERIC_READ | FILE_GENERIC_WRITE , FILE_ATTRIBUTE_NORMAL <S2SV_ModEnd> , FILE_SHARE_READ | <S2SV_ModStart> FILE_SHARE_READ | FILE_SHARE_WRITE , FILE_OPEN_IF <S2SV_ModEnd> , FILE_NON_DIRECTORY_FILE | |
5,048 | CWE-000 static int qh_link_periodic ( struct ehci_hcd * ehci , struct ehci_qh * qh ) { unsigned i ; unsigned period = qh -> period ; dev_dbg ( & qh -> dev -> dev , <S2SV_StartBug> "link<S2SV_blank>qh%d-%04x/%p<S2SV_blank>start<S2SV_blank>%d<S2SV_blank>[%d/%d<S2SV_blank>us]\\n" , <S2SV_EndBug> period , hc32_to_cpup ( ehci , & qh -> hw -> hw_info2 ) & ( QH_CMASK | QH_SMASK ) , qh , qh -> start , qh -> usecs , qh -> c_usecs ) ; if ( period == 0 ) period = 1 ; for ( i = qh -> start ; i < ehci -> periodic_size ; i += period ) { union ehci_shadow * prev = & ehci -> pshadow [ i ] ; __hc32 * hw_p = & ehci -> periodic [ i ] ; union ehci_shadow here = * prev ; __hc32 type = 0 ; while ( here . ptr ) { type = Q_NEXT_TYPE ( ehci , * hw_p ) ; if ( type == cpu_to_hc32 ( ehci , Q_TYPE_QH ) ) break ; prev = periodic_next_shadow ( ehci , prev , type ) ; hw_p = shadow_next_periodic ( ehci , & here , type ) ; here = * prev ; } while ( here . ptr && qh != here . qh ) { if ( qh -> period > here . qh -> period ) break ; prev = & here . qh -> qh_next ; hw_p = & here . qh -> hw -> hw_next ; here = * prev ; } if ( qh != here . qh ) { qh -> qh_next = here ; if ( here . qh ) qh -> hw -> hw_next = * hw_p ; wmb ( ) ; prev -> qh = qh ; * hw_p = QH_NEXT ( ehci , qh -> qh_dma ) ; } } qh -> qh_state = QH_STATE_LINKED ; qh -> xacterrs = 0 ; qh_get ( qh ) ; ehci_to_hcd ( ehci ) -> self . bandwidth_allocated += qh -> period ? ( ( qh -> usecs + qh -> c_usecs ) / qh -> period ) : ( qh -> usecs * 8 ) ; return enable_periodic ( ehci ) ; } | <S2SV_ModStart> -> dev , "link<S2SV_blank>qh%d-%04x/%pK<S2SV_blank>start<S2SV_blank>%d<S2SV_blank>[%d/%d<S2SV_blank>us]\\n" <S2SV_ModEnd> , period , |
5,049 | CWE-000 static int thread_aff_line ( void * arg ) { t_th_data * a ; t_env * e ; a = ( t_th_data * ) arg ; <S2SV_StartBug> e = copy_env ( a -> e ) ; <S2SV_EndBug> ft_aff_line ( a , e ) ; <S2SV_StartBug> return ( 0 ) ; <S2SV_EndBug> } | <S2SV_ModStart> ) arg ; while ( pthread_mutex_lock ( & ( a -> mutex ) ) != 0 ) ; ++ a -> th_nb ; pthread_mutex_unlock ( & ( a -> mutex ) ) ; <S2SV_ModStart> e ) ; while ( pthread_mutex_lock ( & ( a -> mutex ) ) != 0 ) ; -- a -> th_nb ; pthread_mutex_unlock ( & ( a -> mutex ) ) ; |
5,050 | CWE-000 boolean dri_create_buffer ( __DRIscreen * sPriv , __DRIdrawable * dPriv , const struct gl_config * visual , boolean isPixmap ) { struct dri_screen * screen = sPriv -> driverPrivate ; struct dri_drawable * drawable = NULL ; if ( isPixmap ) goto fail ; drawable = CALLOC_STRUCT ( dri_drawable ) ; if ( drawable == NULL ) goto fail ; dri_fill_st_visual ( & drawable -> stvis , screen , visual ) ; drawable -> base . visual = & drawable -> stvis ; drawable -> base . flush_front = dri_st_framebuffer_flush_front ; drawable -> base . validate = dri_st_framebuffer_validate ; drawable -> base . st_manager_private = ( void * ) drawable ; drawable -> screen = screen ; drawable -> sPriv = sPriv ; drawable -> dPriv = dPriv ; drawable -> desired_fences = screen -> default_throttle_frames ; if ( drawable -> desired_fences > DRI_SWAP_FENCES_MAX ) drawable -> desired_fences = DRI_SWAP_FENCES_MAX ; dPriv -> driverPrivate = ( void * ) drawable ; p_atomic_set ( & drawable -> base . stamp , 1 ) ; <S2SV_StartBug> return GL_TRUE ; <S2SV_EndBug> fail : FREE ( drawable ) ; return GL_FALSE ; } | <S2SV_ModStart> 1 ) ; drawable -> base . ID = p_atomic_inc_return ( & drifb_ID ) ; |
5,051 | CWE-000 static BOOL android_post_connect ( freerdp * instance ) { rdpSettings * settings ; rdpUpdate * update ; if ( ! instance || ! instance -> settings || ! instance -> context || ! instance -> update ) return FALSE ; update = instance -> update ; settings = instance -> settings ; if ( ! gdi_init ( instance , PIXEL_FORMAT_RGBA32 ) ) return FALSE ; if ( ! android_register_pointer ( instance -> context -> graphics ) ) return FALSE ; instance -> update -> BeginPaint = android_begin_paint ; instance -> update -> EndPaint = android_end_paint ; instance -> update -> DesktopResize = android_desktop_resize ; <S2SV_StartBug> pointer_cache_register_callbacks ( update ) ; <S2SV_EndBug> freerdp_callback ( "OnSettingsChanged" , "(JIII)V" , ( jlong ) instance , settings -> DesktopWidth , settings -> DesktopHeight , settings -> ColorDepth ) ; freerdp_callback ( "OnConnectionSuccess" , "(J)V" , ( jlong ) instance ) ; return TRUE ; } | <S2SV_ModStart> = android_desktop_resize ; <S2SV_ModEnd> freerdp_callback ( "OnSettingsChanged" |
5,052 | CWE-000 mbox_t do_mbox_open ( const char * name ) { ( void ) name ; int size = strlen ( name ) ; if ( free_head == 0 ) { bcopy ( name , MessageBoxen [ boxArr [ free_head ] ] . name , size ) ; return boxArr [ free_head ++ ] ; } for ( int i = 0 ; i < free_head ; i ++ ) { <S2SV_StartBug> bool res = same_string ( MessageBoxen [ boxArr [ i ] ] . name , name ) ; <S2SV_EndBug> <S2SV_StartBug> if ( res == true ) { <S2SV_EndBug> MessageBoxen [ boxArr [ i ] ] . usageCnt ++ ; return boxArr [ i ] ; } } if ( free_head == MAX_MBOXEN ) return - 1 ; bcopy ( name , MessageBoxen [ boxArr [ free_head ] ] . name , size ) ; return boxArr [ free_head ++ ] ; } | <S2SV_ModStart> ++ ) { bool_t <S2SV_ModEnd> res = same_string <S2SV_ModStart> ( res == TRUE <S2SV_ModEnd> ) { MessageBoxen |
5,053 | CWE-000 int atoip ( char * buf , u_int32_t * ip_addr ) { <S2SV_StartBug> u_int i0 , i1 , i2 , i3 ; <S2SV_EndBug> if ( sscanf ( buf , "%u.%u.%u.%u" , & i0 , & i1 , & i2 , & i3 ) == 4 ) { * ip_addr = ( i0 << 24 ) + ( i1 << 16 ) + ( i2 << 8 ) + i3 ; <S2SV_StartBug> return ( 0 ) ; <S2SV_EndBug> } <S2SV_StartBug> if ( sscanf ( buf , "0x%lx" , ( unsigned long * ) ip_addr ) == 1 ) <S2SV_EndBug> return ( 0 ) ; return ( - 1 ) ; } | <S2SV_ModStart> ip_addr ) { unsigned <S2SV_ModEnd> i0 , i1 <S2SV_ModStart> i2 , i3 ; unsigned long hex_addr <S2SV_ModStart> i3 ; return 0 <S2SV_ModEnd> ; } if <S2SV_ModStart> , "0x%lx" , & hex_addr ) >= 1 ) { * ip_addr = ( u_int32_t ) hex_addr ; return 0 ; } return - 1 <S2SV_ModEnd> ; } <S2SV_null> |
5,054 | CWE-000 void display_game ( void ) { int i ; volatile unsigned int * JP1_IRQ_MASK = ( unsigned int * ) 0xFF200068 ; if ( game_begin ) { initChessBoard ( & chess_board ) ; for ( i = 0 ; i < 8 ; i ++ ) { last_move_highlight [ i ] = 0 ; } LCD_Clear ( LCD_BLACK ) ; vga_clear_screen ( ) ; time1 . hours = 0 ; <S2SV_StartBug> time1 . minutes = 5 ; <S2SV_EndBug> <S2SV_StartBug> time1 . seconds = 0 ; <S2SV_EndBug> time2 . hours = 0 ; <S2SV_StartBug> time2 . minutes = 5 ; <S2SV_EndBug> <S2SV_StartBug> time2 . seconds = 0 ; <S2SV_EndBug> game_begin = 0 ; if ( game_mode == 2 ) { * JP1_IRQ_MASK |= 0x2 ; key_IRQ_set ( 0 ) ; } } switch ( input_mode ) { case NO_INPUT : break ; case INPUT_START : if ( enter_pressed == 1 ) { enter_pressed = 0 ; start_coordinate = BoardCoordinateConstructor ( cursor_xy [ 0 ] , 7 - cursor_xy [ 1 ] ) ; inputMoveStart ( & chess_board , start_coordinate , & end_move_list ) ; if ( end_move_list . move_count > 0 ) { for ( i = 0 ; i < end_move_list . move_count ; i ++ ) { board_highlight [ end_move_list . moves [ i ] . x ] |= 0x1 << end_move_list . moves [ i ] . y ; } input_mode = INPUT_END ; } } break ; case INPUT_END : if ( enter_pressed == 1 ) { enter_pressed = 0 ; end_coordinate = BoardCoordinateConstructor ( cursor_xy [ 0 ] , 7 - cursor_xy [ 1 ] ) ; if ( isMoveInMoveList ( end_move_list , end_coordinate ) ) { inputEndMove ( & chess_board , start_coordinate , end_coordinate ) ; if ( chess_board . promotion & 0x88 ) { input_mode = INPUT_PROMOTION ; } else { if ( game_mode != 0 ) { move_data = 0 ; move_data += ( ( start_coordinate . x ) & 0xF ) << 12 ; move_data += ( ( start_coordinate . y ) & 0xF ) << 8 ; move_data += ( ( end_coordinate . x ) & 0xF ) << 4 ; move_data += ( ( end_coordinate . y ) & 0xF ) << 0 ; send_data ( move_data ) ; } move_made = 1 ; } } } break ; case INPUT_PROMOTION : if ( promotion_no != 0 ) { inputPawnPromotion ( & chess_board , promotion_no ) ; move_made = 1 ; } break ; case OPP_P_MOVE : inputEndMove ( & chess_board , start_coordinate , end_coordinate ) ; move_made = 1 ; break ; default : while ( 1 ) ; break ; } promotion_no = 0 ; if ( move_made ) { move_made = 0 ; for ( i = 0 ; i < 8 ; i ++ ) { last_move_highlight [ i ] = 0x00 ; } <S2SV_StartBug> last_move_highlight [ start_coordinate . x ] |= 0x1 << start_coordinate . y ; <S2SV_EndBug> last_move_highlight [ end_coordinate . x ] |= 0x1 << end_coordinate . y ; input_mode = NO_INPUT ; endGameCheck ( & chess_board ) ; refresh_display = 1 ; } if ( refresh_display ) { sprintf ( time1_str , "%02d:%02d:%02d" , time1 . hours , time1 . minutes , time1 . seconds ) ; LCD_PutStr ( 1 , 1 , time1_str , LCD_WHITE , LCD_BLACK ) ; sprintf ( time2_str , "%02d:%02d:%02d" , time2 . hours , time2 . minutes , time2 . seconds ) ; LCD_PutStr ( ( LCD_WIDTH - 1 ) - ( strlen ( time2_str ) * 8 ) , 1 , time2_str , LCD_WHITE , LCD_BLACK ) ; generate_end_message ( & chess_board , LCD_BLACK , LCD_WHITE ) ; LCD_DrawBoard ( chess_board . board ) ; refresh_display = 0 ; if ( input_mode == INPUT_PROMOTION ) { LCD_PutStr ( 1 , 248 , "1.<S2SV_blank>Queen" , LCD_WHITE , LCD_BLACK ) ; LCD_PutStr ( 1 , 256 , "2.<S2SV_blank>Knight" , LCD_WHITE , LCD_BLACK ) ; LCD_PutStr ( 1 , 264 , "3.<S2SV_blank>Rook" , LCD_WHITE , LCD_BLACK ) ; LCD_PutStr ( 1 , 272 , "4.<S2SV_blank>Bishop" , LCD_WHITE , LCD_BLACK ) ; } else { LCD_PutStr ( 1 , 248 , "<S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank>" , LCD_BLACK , LCD_BLACK ) ; LCD_PutStr ( 1 , 256 , "<S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank>" , LCD_BLACK , LCD_BLACK ) ; LCD_PutStr ( 1 , 264 , "<S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank>" , LCD_BLACK , LCD_BLACK ) ; LCD_PutStr ( 1 , 272 , "<S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank>" , LCD_BLACK , LCD_BLACK ) ; } } } | <S2SV_ModStart> . minutes = 0 <S2SV_ModEnd> ; time1 . <S2SV_ModStart> . seconds = 20 <S2SV_ModEnd> ; time2 . <S2SV_ModStart> . minutes = 0 <S2SV_ModEnd> ; time2 . <S2SV_ModStart> . seconds = 20 <S2SV_ModEnd> ; game_begin = <S2SV_ModStart> 0x00 ; } increment_time_sec ( 30 ) ; |
5,055 | CWE-000 static void XLogDumpDisplayRecord ( XLogDumpConfig * config , XLogReaderState * record ) { const char * id ; const RmgrDescData * desc = & RmgrDescTable [ XLogRecGetRmid ( record ) ] ; <S2SV_StartBug> RelFileNode rnode ; <S2SV_EndBug> ForkNumber forknum ; BlockNumber blk ; int block_id ; uint8 info = XLogRecGetInfo ( record ) ; XLogRecPtr xl_prev = XLogRecGetPrev ( record ) ; <S2SV_StartBug> id = desc -> rm_identify ( info ) ; <S2SV_EndBug> if ( id == NULL ) id = psprintf ( "UNKNOWN<S2SV_blank>(%x)" , info & ~ XLR_INFO_MASK ) ; printf ( "rmgr:<S2SV_blank>%-11s<S2SV_blank>len<S2SV_blank>(rec/tot):<S2SV_blank>%6u/%6u,<S2SV_blank>tx:<S2SV_blank>%10u,<S2SV_blank>lsn:<S2SV_blank>%X/%08X,<S2SV_blank>prev<S2SV_blank>%X/%08X,<S2SV_blank>" , desc -> rm_name , <S2SV_StartBug> XLogRecGetDataLen ( record ) , XLogRecGetTotalLen ( record ) , <S2SV_EndBug> XLogRecGetXid ( record ) , ( uint32 ) ( record -> ReadRecPtr >> 32 ) , ( uint32 ) record -> ReadRecPtr , ( uint32 ) ( xl_prev >> 32 ) , ( uint32 ) xl_prev ) ; printf ( "desc:<S2SV_blank>%s<S2SV_blank>" , id ) ; desc -> rm_desc ( NULL , record ) ; if ( ! config -> bkp_details ) { for ( block_id = 0 ; block_id <= record -> max_block_id ; block_id ++ ) { if ( ! XLogRecHasBlockRef ( record , block_id ) ) continue ; XLogRecGetBlockTag ( record , block_id , & rnode , & forknum , & blk ) ; if ( forknum != MAIN_FORKNUM ) printf ( ",<S2SV_blank>blkref<S2SV_blank>#%u:<S2SV_blank>rel<S2SV_blank>%u/%u/%u<S2SV_blank>fork<S2SV_blank>%s<S2SV_blank>blk<S2SV_blank>%u" , block_id , rnode . spcNode , rnode . dbNode , rnode . relNode , forkNames [ forknum ] , blk ) ; else printf ( ",<S2SV_blank>blkref<S2SV_blank>#%u:<S2SV_blank>rel<S2SV_blank>%u/%u/%u<S2SV_blank>blk<S2SV_blank>%u" , block_id , rnode . spcNode , rnode . dbNode , rnode . relNode , blk ) ; if ( XLogRecHasBlockImage ( record , block_id ) ) { if ( XLogRecBlockImageApply ( record , block_id ) ) printf ( "<S2SV_blank>FPW" ) ; else printf ( "<S2SV_blank>FPW<S2SV_blank>for<S2SV_blank>WAL<S2SV_blank>verification" ) ; } } putchar ( '\\n' ) ; } else { putchar ( '\\n' ) ; for ( block_id = 0 ; block_id <= record -> max_block_id ; block_id ++ ) { if ( ! XLogRecHasBlockRef ( record , block_id ) ) continue ; XLogRecGetBlockTag ( record , block_id , & rnode , & forknum , & blk ) ; printf ( "\\tblkref<S2SV_blank>#%u:<S2SV_blank>rel<S2SV_blank>%u/%u/%u<S2SV_blank>fork<S2SV_blank>%s<S2SV_blank>blk<S2SV_blank>%u" , block_id , rnode . spcNode , rnode . dbNode , rnode . relNode , forkNames [ forknum ] , blk ) ; if ( XLogRecHasBlockImage ( record , block_id ) ) { if ( record -> blocks [ block_id ] . bimg_info & BKPIMAGE_IS_COMPRESSED ) { printf ( "<S2SV_blank>(FPW%s);<S2SV_blank>hole:<S2SV_blank>offset:<S2SV_blank>%u,<S2SV_blank>length:<S2SV_blank>%u,<S2SV_blank>" "compression<S2SV_blank>saved:<S2SV_blank>%u\\n" , XLogRecBlockImageApply ( record , block_id ) ? "" : "<S2SV_blank>for<S2SV_blank>WAL<S2SV_blank>verification" , record -> blocks [ block_id ] . hole_offset , record -> blocks [ block_id ] . hole_length , BLCKSZ - record -> blocks [ block_id ] . hole_length - record -> blocks [ block_id ] . bimg_len ) ; } else { printf ( "<S2SV_blank>(FPW%s);<S2SV_blank>hole:<S2SV_blank>offset:<S2SV_blank>%u,<S2SV_blank>length:<S2SV_blank>%u\\n" , XLogRecBlockImageApply ( record , block_id ) ? "" : "<S2SV_blank>for<S2SV_blank>WAL<S2SV_blank>verification" , record -> blocks [ block_id ] . hole_offset , record -> blocks [ block_id ] . hole_length ) ; } } putchar ( '\\n' ) ; } } } | <S2SV_ModStart> ) ] ; uint32 rec_len ; uint32 fpi_len ; <S2SV_ModStart> record ) ; XLogDumpRecordLen ( record , & rec_len , & fpi_len ) ; <S2SV_ModStart> -> rm_name , rec_len <S2SV_ModEnd> , XLogRecGetTotalLen ( |
5,056 | CWE-000 static int get_index ( size_t size ) { int i ; for ( i = DATA_SIZES - 1 ; i >= 0 ; i -- ) { <S2SV_StartBug> if ( size >= ( 1 << ( i + 3 ) ) ) { <S2SV_EndBug> break ; } } return i ; } | <S2SV_ModStart> if ( size > <S2SV_ModEnd> ( 1 << <S2SV_ModStart> ( i + MIN_ALLOC_BITS - 1 <S2SV_ModEnd> ) ) ) |
5,057 | CWE-000 static int add_to_xchild_list ( afni_xml_t * parent , afni_xml_t * child ) { if ( parent -> nchild <= 0 ) { parent -> nchild = 0 ; parent -> xchild = NULL ; } parent -> nchild ++ ; <S2SV_StartBug> parent -> xchild = ( afni_xml_t * * ) realloc ( parent -> xchild , <S2SV_EndBug> parent -> nchild * sizeof ( afni_xml_t * ) ) ; if ( ! parent -> xchild ) { fprintf ( stderr , "**<S2SV_blank>failed<S2SV_blank>to<S2SV_blank>alloc<S2SV_blank>%d<S2SV_blank>AXML<S2SV_blank>pointers\\n" , parent -> nchild ) ; return 1 ; } parent -> xchild [ parent -> nchild - 1 ] = child ; child -> xparent = parent ; return 0 ; } | <S2SV_ModStart> * * ) safe_realloc <S2SV_ModEnd> ( parent -> |
5,058 | CWE-000 static ssize_t punc_store ( struct kobject * kobj , struct kobj_attribute * attr , const char * buf , size_t count ) { int x ; struct st_var_header * p_header ; struct punc_var_t * var ; char punc_buf [ 100 ] ; unsigned long flags ; x = strlen ( buf ) ; if ( x < 1 || x > 99 ) return - EINVAL ; p_header = spk_var_header_by_name ( attr -> attr . name ) ; if ( p_header == NULL ) { pr_warn ( "p_header<S2SV_blank>is<S2SV_blank>null,<S2SV_blank>attr->attr.name<S2SV_blank>is<S2SV_blank>%s\\n" , attr -> attr . name ) ; return - EINVAL ; } var = spk_get_punc_var ( p_header -> var_id ) ; if ( var == NULL ) { pr_warn ( "var<S2SV_blank>is<S2SV_blank>null,<S2SV_blank>p_header->var_id<S2SV_blank>is<S2SV_blank>%i\\n" , p_header -> var_id ) ; return - EINVAL ; } <S2SV_StartBug> strncpy ( punc_buf , buf , x ) ; <S2SV_EndBug> while ( x && punc_buf [ x - 1 ] == '\\n' ) x -- ; punc_buf [ x ] = '\\0' ; spin_lock_irqsave ( & speakup_info . spinlock , flags ) ; if ( * punc_buf == 'd' || * punc_buf == 'r' ) x = spk_set_mask_bits ( NULL , var -> value , 3 ) ; else x = spk_set_mask_bits ( punc_buf , var -> value , 3 ) ; spin_unlock_irqrestore ( & speakup_info . spinlock , flags ) ; return count ; } | <S2SV_ModStart> EINVAL ; } memcpy <S2SV_ModEnd> ( punc_buf , |
5,059 | CWE-000 static int ubifs_xattr_remove ( struct inode * host , const char * name ) { struct inode * inode ; struct ubifs_info * c = host -> i_sb -> s_fs_info ; struct fscrypt_name nm = { . disk_name = FSTR_INIT ( ( char * ) name , strlen ( name ) ) } ; struct ubifs_dent_node * xent ; union ubifs_key key ; int err ; ubifs_assert ( c , inode_is_locked ( host ) ) ; <S2SV_StartBug> if ( ! host -> i_nlink ) <S2SV_EndBug> return - ENOENT ; if ( fname_len ( & nm ) > UBIFS_MAX_NLEN ) return - ENAMETOOLONG ; xent = kmalloc ( UBIFS_MAX_XENT_NODE_SZ , GFP_NOFS ) ; if ( ! xent ) return - ENOMEM ; xent_key_init ( c , & key , host -> i_ino , & nm ) ; err = ubifs_tnc_lookup_nm ( c , & key , xent , & nm ) ; if ( err ) { if ( err == - ENOENT ) err = - ENODATA ; goto out_free ; } inode = iget_xattr ( c , le64_to_cpu ( xent -> inum ) ) ; if ( IS_ERR ( inode ) ) { err = PTR_ERR ( inode ) ; goto out_free ; } ubifs_assert ( c , inode -> i_nlink == 1 ) ; clear_nlink ( inode ) ; err = remove_xattr ( c , host , inode , & nm ) ; if ( err ) set_nlink ( inode , 1 ) ; iput ( inode ) ; out_free : kfree ( xent ) ; return err ; } | <S2SV_ModStart> ; if ( <S2SV_ModEnd> fname_len ( & |
5,060 | CWE-000 static void esdhc_init ( struct platform_device * pdev , struct sdhci_host * host ) { struct sdhci_pltfm_host * pltfm_host ; struct sdhci_esdhc * esdhc ; struct device_node * np ; struct clk * clk ; u32 val ; u16 host_ver ; pltfm_host = sdhci_priv ( host ) ; esdhc = sdhci_pltfm_priv ( pltfm_host ) ; <S2SV_StartBug> val = sdhci_readl ( host , ESDHC_TBCTL ) ; <S2SV_EndBug> val &= ~ ESDHC_TB_EN ; sdhci_writel ( host , val , ESDHC_TBCTL ) ; host_ver = sdhci_readw ( host , SDHCI_HOST_VERSION ) ; esdhc -> vendor_ver = ( host_ver & SDHCI_VENDOR_VER_MASK ) >> SDHCI_VENDOR_VER_SHIFT ; esdhc -> spec_ver = host_ver & SDHCI_SPEC_VER_MASK ; if ( soc_device_match ( soc_incorrect_hostver ) ) esdhc -> quirk_incorrect_hostver = true ; else esdhc -> quirk_incorrect_hostver = false ; np = pdev -> dev . of_node ; clk = of_clk_get ( np , 0 ) ; if ( ! IS_ERR ( clk ) ) { if ( of_device_is_compatible ( np , "fsl,ls1046a-esdhc" ) ) esdhc -> peripheral_clock = clk_get_rate ( clk ) / 2 ; else esdhc -> peripheral_clock = clk_get_rate ( clk ) ; clk_put ( clk ) ; } if ( esdhc -> peripheral_clock ) { esdhc_clock_enable ( host , false ) ; val = sdhci_readl ( host , ESDHC_DMA_SYSCTL ) ; val |= ESDHC_PERIPHERAL_CLK_SEL ; sdhci_writel ( host , val , ESDHC_DMA_SYSCTL ) ; esdhc_clock_enable ( host , true ) ; } } | <S2SV_ModStart> pltfm_host ) ; <S2SV_ModEnd> host_ver = sdhci_readw |
5,061 | CWE-000 int main ( int argc , char * argv [ ] ) { if ( argc != 4 ) { printf ( "Usage:<S2SV_blank>./resize<S2SV_blank>n<S2SV_blank>infile<S2SV_blank>outfile\\n" ) ; return 1 ; } char * factorArg = argv [ 1 ] ; char * inName = argv [ 2 ] ; char * outName = argv [ 3 ] ; int factor ; if ( ! checkFactor ( factorArg ) ) { printf ( "Please<S2SV_blank>enter<S2SV_blank>a<S2SV_blank>valid<S2SV_blank>factor<S2SV_blank>from<S2SV_blank>1<S2SV_blank>to<S2SV_blank>N.\\n" ) ; return 4 ; } else { factor = StrToInt ( factorArg ) ; } FILE * inFile = fopen ( inName , "r" ) ; if ( inFile == NULL ) { printf ( "could<S2SV_blank>not<S2SV_blank>open<S2SV_blank>file<S2SV_blank>%s.<S2SV_blank>Maybe<S2SV_blank>it<S2SV_blank>doesn\'t<S2SV_blank>exist<S2SV_blank>?\\n" , inName ) ; return 2 ; } FILE * outFile = fopen ( outName , "w" ) ; if ( outFile == NULL ) { printf ( "Could<S2SV_blank>not<S2SV_blank>create<S2SV_blank>file<S2SV_blank>%s.\\n" , outName ) ; fclose ( inFile ) ; return 3 ; } BITMAPFILEHEADER fHeader ; fread ( & fHeader , sizeof ( BITMAPFILEHEADER ) , 1 , inFile ) ; BITMAPINFOHEADER infHeader ; fread ( & infHeader , sizeof ( BITMAPINFOHEADER ) , 1 , inFile ) ; if ( fHeader . bfType != 0x4d42 || fHeader . bfOffBits != 54 || infHeader . biSize != 40 || infHeader . biBitCount != 24 || infHeader . biCompression != 0 ) { printf ( "Sorry,<S2SV_blank>File<S2SV_blank>is<S2SV_blank>not<S2SV_blank>supported.\\n" ) ; fclose ( inFile ) ; fclose ( outFile ) ; return 4 ; } LONG oldBiWidth = infHeader . biWidth ; LONG oldBiHeight = infHeader . biHeight ; int oldPadding = ( 4 - ( infHeader . biWidth * sizeof ( RGBTRIPLE ) ) % 4 ) % 4 ; infHeader . biWidth *= factor ; infHeader . biHeight *= factor ; int padding = ( 4 - ( infHeader . biWidth * sizeof ( RGBTRIPLE ) ) % 4 ) % 4 ; <S2SV_StartBug> infHeader . biSizeImage = ( infHeader . biWidth * abs ( infHeader . biHeight ) ) * BYTES_PER_PIXEL + ( padding * infHeader . biHeight ) ; <S2SV_EndBug> fHeader . bfSize = infHeader . biSizeImage + fHeader . bfOffBits ; fwrite ( & fHeader , sizeof ( BITMAPFILEHEADER ) , 1 , outFile ) ; fwrite ( & infHeader , sizeof ( BITMAPINFOHEADER ) , 1 , outFile ) ; for ( int i = 0 , biHeight = abs ( oldBiHeight ) ; i < biHeight ; i ++ ) { RGBTRIPLE * tripleRow = malloc ( sizeof ( RGBTRIPLE ) * oldBiWidth ) ; for ( int j = 0 ; j < oldBiWidth ; j ++ ) { fread ( & tripleRow [ j ] , sizeof ( RGBTRIPLE ) , 1 , inFile ) ; } fseek ( inFile , oldPadding , SEEK_CUR ) ; for ( int h = 0 ; h < factor ; h ++ ) { for ( int w = 0 ; w < oldBiWidth ; w ++ ) { for ( int k = 0 ; k < factor ; k ++ ) { fwrite ( & tripleRow [ w ] , sizeof ( RGBTRIPLE ) , 1 , outFile ) ; } } for ( int p = 0 ; p < padding ; p ++ ) { fputc ( 0x00 , outFile ) ; } } free ( tripleRow ) ; } fclose ( inFile ) ; fclose ( outFile ) ; return 0 ; } | <S2SV_ModStart> ( padding * abs ( <S2SV_ModStart> infHeader . biHeight ) |
5,062 | CWE-000 iota_api_result_t iota_api_broadcast_transactions ( const iota_http_service_t * const service , broadcast_transactions_req_t * req ) { iota_api_result_t result = { 0 } ; char_buffer_t * res_buff = char_buffer_new ( ) ; <S2SV_StartBug> char_buffer_t * req_buff = char_buffer_new ( ) ; <S2SV_EndBug> if ( req_buff == NULL || res_buff == NULL ) { <S2SV_StartBug> result . error = RC_CCLIENT_OOM ; <S2SV_EndBug> goto done ; } result . error = service -> serializer . vtable . broadcast_transactions_serialize_request ( & service -> serializer , req , req_buff ) ; if ( result . error != RC_OK ) { goto done ; } result = iota_service_query ( service , req_buff , res_buff ) ; if ( result . error != RC_OK ) { <S2SV_StartBug> goto done ; <S2SV_EndBug> } done : if ( req_buff ) { char_buffer_free ( req_buff ) ; } if ( res_buff ) { char_buffer_free ( res_buff ) ; } return result ; } | <S2SV_ModStart> = char_buffer_new ( ) ; log_info ( CCLIENT_CORE_LOGGER_ID , "[%s:%d]\\n" , __func__ , __LINE__ <S2SV_ModStart> NULL ) { log_critical ( CCLIENT_CORE_LOGGER_ID , "[%s:%d]<S2SV_blank>%s\\n" , __func__ , __LINE__ , STR_CCLIENT_OOM ) ; <S2SV_ModStart> RC_OK ) { log_error ( CCLIENT_CORE_LOGGER_ID , "[%s:%d]<S2SV_blank>%s\\n" , __func__ , __LINE__ , error_2_string ( result . error ) ) ; |
5,063 | CWE-000 static void * worker_thread ( void * thread_func_param ) { <S2SV_StartBug> struct worker_thread_args * pwta = <S2SV_EndBug> ( struct worker_thread_args * ) thread_func_param ; struct sigaction sa ; memset ( & sa , 0 , sizeof ( sa ) ) ; sa . sa_handler = SIG_IGN ; sigaction ( SIGPIPE , & sa , NULL ) ; <S2SV_StartBug> worker_thread_run ( pwta ) ; <S2SV_EndBug> mg_free ( thread_func_param ) ; return NULL ; } | <S2SV_ModStart> thread_func_param ) { <S2SV_ModEnd> struct sigaction sa <S2SV_ModStart> ; worker_thread_run ( ( struct mg_connection * ) <S2SV_ModEnd> thread_func_param ) ; |
5,064 | CWE-000 int blkfree ( void * ptr ) { if ( ! ptr ) { return - 1 ; } blkhead_t * h = ptr - sizeof ( blkhead_t ) ; if ( h -> bh_magic != MAGIC ) { <S2SV_StartBug> fprintf ( stderr , "memory<S2SV_blank>boundaries<S2SV_blank>corrupted\\n" ) ; <S2SV_EndBug> <S2SV_StartBug> return - 1 ; <S2SV_EndBug> } blist -> b_holes = blksmall_refurbish ( h , blist -> b_holes ) ; blist -> b_numh ++ ; return 0 ; } | <S2SV_ModStart> ( stderr , "Memory<S2SV_blank>boundaries<S2SV_blank>corrupted\\n" ) ; fprintf ( stderr , "(or<S2SV_blank>pointer<S2SV_blank>is<S2SV_blank>from<S2SV_blank>a<S2SV_blank>different<S2SV_blank>allocator)\\n" <S2SV_ModEnd> ) ; return <S2SV_ModStart> return - 1 ; } if ( h -> bh_size + sizeof ( blkhead_t ) > BLOCK_SIZE ) { BLK_FREE ( h ) ; return 0 |
5,065 | CWE-000 const char * virDomainGraphicsGetRenderNode ( const virDomainGraphicsDef * graphics ) { const char * ret = NULL ; switch ( graphics -> type ) { case VIR_DOMAIN_GRAPHICS_TYPE_SPICE : <S2SV_StartBug> if ( graphics -> data . spice . gl == VIR_TRISTATE_BOOL_YES ) <S2SV_EndBug> ret = graphics -> data . spice . rendernode ; break ; case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS : ret = graphics -> data . egl_headless . rendernode ; break ; case VIR_DOMAIN_GRAPHICS_TYPE_SDL : case VIR_DOMAIN_GRAPHICS_TYPE_VNC : case VIR_DOMAIN_GRAPHICS_TYPE_RDP : case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP : case VIR_DOMAIN_GRAPHICS_TYPE_LAST : break ; } return ret ; } | <S2SV_ModStart> case VIR_DOMAIN_GRAPHICS_TYPE_SPICE : <S2SV_ModEnd> ret = graphics |
5,066 | CWE-000 <S2SV_StartBug> static bool icp_tc_port_hotplug_long_detect ( enum port port , u32 val ) <S2SV_EndBug> { <S2SV_StartBug> switch ( port ) { <S2SV_EndBug> <S2SV_StartBug> case PORT_C : <S2SV_EndBug> return val & ICP_TC_HPD_LONG_DETECT ( PORT_TC1 ) ; <S2SV_StartBug> case PORT_D : <S2SV_EndBug> return val & ICP_TC_HPD_LONG_DETECT ( PORT_TC2 ) ; <S2SV_StartBug> case PORT_E : <S2SV_EndBug> return val & ICP_TC_HPD_LONG_DETECT ( PORT_TC3 ) ; <S2SV_StartBug> case PORT_F : <S2SV_EndBug> return val & ICP_TC_HPD_LONG_DETECT ( PORT_TC4 ) ; default : return false ; } } | <S2SV_ModStart> icp_tc_port_hotplug_long_detect ( enum hpd_pin pin <S2SV_ModEnd> , u32 val <S2SV_ModStart> { switch ( pin <S2SV_ModEnd> ) { case <S2SV_ModStart> ) { case HPD_PORT_C <S2SV_ModEnd> : return val <S2SV_ModStart> ) ; case HPD_PORT_D <S2SV_ModEnd> : return val <S2SV_ModStart> ) ; case HPD_PORT_E <S2SV_ModEnd> : return val <S2SV_ModStart> ) ; case HPD_PORT_F <S2SV_ModEnd> : return val |
5,067 | CWE-000 void decodeToBinBase64 ( const char * source , unsigned char * destination ) { decodeToBinValidateBase64 ( source ) ; int destinationIdx = 0 ; <S2SV_StartBug> for ( int sourceIdx = 0 ; sourceIdx < strlen ( source ) ; sourceIdx += 4 ) <S2SV_EndBug> { destination [ destinationIdx ++ ] = ( unsigned char ) ( decodeBase64Lookup [ ( int ) source [ sourceIdx ] ] << 2 | decodeBase64Lookup [ ( int ) source [ sourceIdx + 1 ] ] >> 4 ) ; if ( source [ sourceIdx + 2 ] != 0x3d ) { destination [ destinationIdx ++ ] = ( unsigned char ) ( decodeBase64Lookup [ ( int ) source [ sourceIdx + 1 ] ] << 4 | decodeBase64Lookup [ ( int ) source [ sourceIdx + 2 ] ] >> 2 ) ; } if ( source [ sourceIdx + 3 ] != 0x3d ) { destination [ destinationIdx ++ ] = ( unsigned char ) ( ( ( decodeBase64Lookup [ ( int ) source [ sourceIdx + 2 ] ] << 6 ) & 0xc0 ) | decodeBase64Lookup [ ( int ) source [ sourceIdx + 3 ] ] ) ; } } } | <S2SV_ModStart> ; for ( unsigned |
5,068 | CWE-000 INLINE void <S2SV_StartBug> AddEntry ( HeapP * h1 , HeapP * h2 ) <S2SV_EndBug> { assert ( ( h1 != NULL ) && ( h2 != NULL ) ) ; if ( CHILD ( h1 ) == NULL ) { CHILD ( h1 ) = h2 ; } else { CombineLists ( CHILD ( h1 ) , h2 ) ; } PARENT ( h2 ) = h1 ; RANK ( h1 ) = RANK ( h1 ) + RANK ( h2 ) + 1 ; } | <S2SV_ModStart> void AddEntry ( _Ptr < HeapP > h1 , _Ptr < HeapP > <S2SV_ModEnd> h2 ) { |
5,069 | CWE-000 static Bool gridCommon ( CompDisplay * d , CompAction * action , CompActionState state , CompOption * option , int nOption , GridType where ) { Window xid ; CompWindow * cw ; xid = getIntOptionNamed ( option , nOption , "window" , 0 ) ; cw = findWindowAtDisplay ( d , xid ) ; <S2SV_StartBug> gridCommonWindow ( cw , where ) ; <S2SV_EndBug> return TRUE ; } | <S2SV_ModStart> cw , where , TRUE |
5,070 | CWE-000 <S2SV_StartBug> static void <S2SV_EndBug> json_print_anydata ( struct lyout * out , int level , const struct lyd_node * node , int toplevel , int options ) { const char * schema = NULL ; struct lyd_node_anydata * any = ( struct lyd_node_anydata * ) node ; if ( toplevel || ! node -> parent || nscmp ( node , node -> parent ) ) { schema = lys_node_module ( node -> schema ) -> name ; ly_print ( out , "%*s\\"%s:%s\\":%s{%s" , LEVEL , INDENT , schema , node -> schema -> name , ( level ? "<S2SV_blank>" : "" ) , ( level ? "\\n" : "" ) ) ; } else { ly_print ( out , "%*s\\"%s\\":%s{%s" , LEVEL , INDENT , node -> schema -> name , ( level ? "<S2SV_blank>" : "" ) , ( level ? "\\n" : "" ) ) ; } if ( level ) { level ++ ; } switch ( any -> value_type ) { case LYD_ANYDATA_DATATREE : <S2SV_StartBug> json_print_nodes ( out , level , any -> value . tree , 1 , 0 , LYP_WITHSIBLINGS | ( options & LYP_FORMAT ) ) ; <S2SV_EndBug> break ; case LYD_ANYDATA_JSON : if ( any -> value . str ) { ly_print ( out , "%*s%s%s" , LEVEL , INDENT , any -> value . str , ( level ? "\\n" : "" ) ) ; } break ; default : LOGWRN ( "Unable<S2SV_blank>to<S2SV_blank>print<S2SV_blank>anydata<S2SV_blank>content<S2SV_blank>(type<S2SV_blank>%d)<S2SV_blank>as<S2SV_blank>JSON." , any -> value_type ) ; break ; } if ( node -> attr ) { if ( schema ) { ly_print ( out , ",%s%*s\\"@%s:%s\\":%s{%s" , ( level ? "\\n" : "" ) , LEVEL , INDENT , schema , node -> schema -> name , ( level ? "<S2SV_blank>" : "" ) , ( level ? "\\n" : "" ) ) ; } else { ly_print ( out , ",%s%*s\\"@%s\\":%s{%s" , ( level ? "\\n" : "" ) , LEVEL , INDENT , node -> schema -> name , ( level ? "<S2SV_blank>" : "" ) , ( level ? "\\n" : "" ) ) ; } <S2SV_StartBug> json_print_attrs ( out , ( level ? level + 1 : level ) , node , NULL ) ; <S2SV_EndBug> ly_print ( out , "%*s}" , LEVEL , INDENT ) ; } if ( level ) { level -- ; } ly_print ( out , "%*s}" , LEVEL , INDENT ) ; <S2SV_StartBug> } <S2SV_EndBug> | <S2SV_ModStart> <S2SV_null> <S2SV_null> static int <S2SV_ModEnd> json_print_anydata ( struct <S2SV_ModStart> case LYD_ANYDATA_DATATREE : if ( <S2SV_ModStart> LYP_FORMAT ) ) ) { return EXIT_FAILURE ; } <S2SV_ModEnd> break ; case <S2SV_ModStart> ) ; } if ( <S2SV_ModStart> , NULL ) ) { return EXIT_FAILURE ; } <S2SV_ModEnd> ly_print ( out <S2SV_ModStart> INDENT ) ; return EXIT_SUCCESS ; |
5,071 | CWE-000 void InsertWhodata ( const sk_sum_t * sum ) { if ( sum -> wdata . user_id && sum -> wdata . user_name && * sum -> wdata . user_id != '\\0' ) { snprintf ( sdb . user_name , OS_FLSIZE , "(Audit)<S2SV_blank>User:<S2SV_blank>\'%s<S2SV_blank>(%s)\'\\n" , sum -> wdata . user_name , sum -> wdata . user_id ) ; } else { * sdb . user_name = '\\0' ; } if ( sum -> wdata . effective_uid && sum -> wdata . effective_name && * sum -> wdata . effective_uid != '\\0' ) { snprintf ( sdb . effective_name , OS_FLSIZE , "(Audit)<S2SV_blank>Effective<S2SV_blank>user:<S2SV_blank>\'%s<S2SV_blank>(%s)\'\\n" , sum -> wdata . effective_name , sum -> wdata . effective_uid ) ; } else { * sdb . effective_name = '\\0' ; } if ( sum -> wdata . audit_uid && sum -> wdata . audit_name && * sum -> wdata . audit_uid != '\\0' ) { snprintf ( sdb . audit_name , OS_FLSIZE , "(Audit)<S2SV_blank>Login<S2SV_blank>user:<S2SV_blank>\'%s<S2SV_blank>(%s)\'\\n" , sum -> wdata . audit_name , sum -> wdata . audit_uid ) ; } else { * sdb . audit_name = '\\0' ; } if ( sum -> wdata . group_id && sum -> wdata . group_name && * sum -> wdata . group_id != '\\0' ) { snprintf ( sdb . group_name , OS_FLSIZE , "(Audit)<S2SV_blank>Group:<S2SV_blank>\'%s<S2SV_blank>(%s)\'\\n" , sum -> wdata . group_name , sum -> wdata . group_id ) ; } else { * sdb . group_name = '\\0' ; } <S2SV_StartBug> if ( sum -> wdata . process_id && * sum -> wdata . process_id != '\\0' ) { <S2SV_EndBug> snprintf ( sdb . process_id , OS_FLSIZE , "(Audit)<S2SV_blank>Process<S2SV_blank>id:<S2SV_blank>\'%s\'\\n" , sum -> wdata . process_id ) ; } else { * sdb . process_id = '\\0' ; } if ( sum -> wdata . process_name && * sum -> wdata . process_name != '\\0' ) { snprintf ( sdb . process_name , OS_FLSIZE , "(Audit)<S2SV_blank>Process<S2SV_blank>name:<S2SV_blank>\'%s\'\\n" , sum -> wdata . process_name ) ; } else { * sdb . process_name = '\\0' ; } } | <S2SV_ModStart> process_id != '\\0' && strcmp ( sum -> wdata . process_id , "0" ) |
5,072 | CWE-000 void RotateFiles ( char * name , int number ) { int i , fd ; struct stat statbuf ; char from [ CF_BUFSIZE ] , to [ CF_BUFSIZE ] ; if ( IsItemIn ( ROTATED , name ) ) { return ; } PrependItem ( & ROTATED , name , NULL ) ; if ( stat ( name , & statbuf ) == - 1 ) { Log ( LOG_LEVEL_VERBOSE , "No<S2SV_blank>access<S2SV_blank>to<S2SV_blank>file<S2SV_blank>%s" , name ) ; return ; } for ( i = number - 1 ; i > 0 ; i -- ) { snprintf ( from , CF_BUFSIZE , "%s.%d" , name , i ) ; snprintf ( to , CF_BUFSIZE , "%s.%d" , name , i + 1 ) ; if ( rename ( from , to ) == - 1 ) { Log ( LOG_LEVEL_DEBUG , "Rename<S2SV_blank>failed<S2SV_blank>in<S2SV_blank>RotateFiles<S2SV_blank>\'%s\'<S2SV_blank>-><S2SV_blank>\'%s\'" , name , from ) ; } snprintf ( from , CF_BUFSIZE , "%s.%d.gz" , name , i ) ; snprintf ( to , CF_BUFSIZE , "%s.%d.gz" , name , i + 1 ) ; if ( rename ( from , to ) == - 1 ) { Log ( LOG_LEVEL_DEBUG , "Rename<S2SV_blank>failed<S2SV_blank>in<S2SV_blank>RotateFiles<S2SV_blank>\'%s\'<S2SV_blank>-><S2SV_blank>\'%s\'" , name , from ) ; } snprintf ( from , CF_BUFSIZE , "%s.%d.Z" , name , i ) ; snprintf ( to , CF_BUFSIZE , "%s.%d.Z" , name , i + 1 ) ; if ( rename ( from , to ) == - 1 ) { Log ( LOG_LEVEL_DEBUG , "Rename<S2SV_blank>failed<S2SV_blank>in<S2SV_blank>RotateFiles<S2SV_blank>\'%s\'<S2SV_blank>-><S2SV_blank>\'%s\'" , name , from ) ; } snprintf ( from , CF_BUFSIZE , "%s.%d.bz" , name , i ) ; snprintf ( to , CF_BUFSIZE , "%s.%d.bz" , name , i + 1 ) ; if ( rename ( from , to ) == - 1 ) { Log ( LOG_LEVEL_DEBUG , "Rename<S2SV_blank>failed<S2SV_blank>in<S2SV_blank>RotateFiles<S2SV_blank>\'%s\'<S2SV_blank>-><S2SV_blank>\'%s\'" , name , from ) ; } snprintf ( from , CF_BUFSIZE , "%s.%d.bz2" , name , i ) ; snprintf ( to , CF_BUFSIZE , "%s.%d.bz2" , name , i + 1 ) ; if ( rename ( from , to ) == - 1 ) { Log ( LOG_LEVEL_DEBUG , "Rename<S2SV_blank>failed<S2SV_blank>in<S2SV_blank>RotateFiles<S2SV_blank>\'%s\'<S2SV_blank>-><S2SV_blank>\'%s\'" , name , from ) ; } } snprintf ( to , CF_BUFSIZE , "%s.1" , name ) ; if ( CopyRegularFileDisk ( name , to ) == false ) { Log ( LOG_LEVEL_DEBUG , "Copy<S2SV_blank>failed<S2SV_blank>in<S2SV_blank>RotateFiles<S2SV_blank>\'%s\'<S2SV_blank>-><S2SV_blank>\'%s\'" , name , to ) ; return ; } safe_chmod ( to , statbuf . st_mode ) ; if ( safe_chown ( to , statbuf . st_uid , statbuf . st_gid ) ) { UnexpectedError ( "Failed<S2SV_blank>to<S2SV_blank>chown<S2SV_blank>%s" , to ) ; } safe_chmod ( name , 0600 ) ; if ( ( fd = safe_creat ( name , statbuf . st_mode ) ) == - 1 ) { <S2SV_StartBug> Log ( LOG_LEVEL_ERR , "Failed<S2SV_blank>to<S2SV_blank>create<S2SV_blank>new<S2SV_blank>\'%s\'<S2SV_blank>in<S2SV_blank>disable(rotate).<S2SV_blank>(creat:<S2SV_blank>%s)" , <S2SV_EndBug> name , GetErrorStr ( ) ) ; } else { if ( safe_chown ( name , statbuf . st_uid , statbuf . st_gid ) ) { UnexpectedError ( "Failed<S2SV_blank>to<S2SV_blank>chown<S2SV_blank>\'%s\'" , name ) ; } fchmod ( fd , statbuf . st_mode ) ; close ( fd ) ; } } | <S2SV_ModStart> ( LOG_LEVEL_ERR , "Failed<S2SV_blank>to<S2SV_blank>create<S2SV_blank>new<S2SV_blank>\'%s\'<S2SV_blank>in<S2SV_blank>disable(rotate).<S2SV_blank>(create:<S2SV_blank>%s)" <S2SV_ModEnd> , name , |
5,073 | CWE-000 <S2SV_StartBug> static PHP_METHOD ( Phalcon_Session_Adapter_Libmemcached , getLifetime ) { <S2SV_EndBug> zval * this_ptr = getThis ( ) ; <S2SV_StartBug> RETURN_MEMBER ( getThis ( ) , "_lifetime" ) ; <S2SV_EndBug> } | <S2SV_ModStart> static PHP_METHOD ( Phalcon_Annotations_Collection , getAnnotations ) { <S2SV_ModEnd> RETURN_MEMBER ( getThis <S2SV_ModStart> ( ) , "_annotations" <S2SV_ModEnd> ) ; } |
5,074 | CWE-000 int main ( ) { <S2SV_StartBug> unsigned long int a , b , c , d , e , f , q ; <S2SV_EndBug> FILE * input = fopen ( "input.txt" , "r" ) ; FILE * output = fopen ( "output.txt" , "w" ) ; fscanf ( input , "%lu<S2SV_blank>%lu<S2SV_blank>%lu<S2SV_blank>%lu<S2SV_blank>%lu<S2SV_blank>%lu<S2SV_blank>%lu" , & a , & b , & c , & d , & e , & f , & q ) ; for ( int i = 0 ; i < q ; ++ i ) { fscanf ( input , "%lu<S2SV_blank>%lu<S2SV_blank>%lu<S2SV_blank>%lu<S2SV_blank>%lu<S2SV_blank>%lu" , & a , & b , & c , & d , & e , & f ) ; unsigned long int res = ( ++ a * ++ b * ++ c * ++ d * ++ e * ++ f - 1 ) * 4 ; fprintf ( output , "%lu\\n" , res ) ; } <S2SV_StartBug> fclose ( input ) ; <S2SV_EndBug> fclose ( output ) ; return 0 ; } | <S2SV_ModStart> ( ) { char arr [ MAX_LEN_STR ] = { 0 } ; int qty_perm ; scanf ( "%10s" , arr ) ; scanf ( "%d" , & qty_perm ) ; int len = strlen ( arr ) ; test ( arr , len ) ; print_permutation ( arr , qty_perm , len <S2SV_ModEnd> ) ; } <S2SV_ModStart> ) ; } <S2SV_ModEnd> <S2SV_null> <S2SV_null> <S2SV_null> |
5,075 | CWE-000 void record_dump ( struct seq_file * file ) { struct atom * i ; struct hlist_node * tmp ; int bkt ; mutex_lock ( & record_lock ) ; hash_for_each_safe ( atoms , bkt , tmp , i , hlist ) { if ( current -> pid == i -> pid ) { continue ; } <S2SV_StartBug> if ( is_alive ( i -> pid ) ) { <S2SV_EndBug> _record_dump_detail ( file , i ) ; <S2SV_StartBug> } else { <S2SV_EndBug> _destroy_atom ( i ) ; } } mutex_unlock ( & record_lock ) ; } | <S2SV_ModStart> continue ; } <S2SV_ModEnd> _record_dump_detail ( file <S2SV_ModStart> i ) ; <S2SV_ModEnd> } mutex_unlock ( |
5,076 | CWE-000 LF_PINS * lf_pinbox_get_pins ( LF_PINBOX * pinbox ) { <S2SV_StartBug> uint32 pins , next , top_ver ; <S2SV_EndBug> LF_PINS * el ; top_ver = pinbox -> pinstack_top_ver ; do { if ( ! ( pins = top_ver % LF_PINBOX_MAX_PINS ) ) { <S2SV_StartBug> pins = my_atomic_add32 ( ( int32 volatile * ) & pinbox -> pins_in_array , 1 ) + 1 ; <S2SV_EndBug> if ( unlikely ( pins >= LF_PINBOX_MAX_PINS ) ) return 0 ; el = ( LF_PINS * ) lf_dynarray_lvalue ( & pinbox -> pinarray , pins ) ; if ( unlikely ( ! el ) ) return 0 ; break ; } el = ( LF_PINS * ) lf_dynarray_value ( & pinbox -> pinarray , pins ) ; next = el -> link ; <S2SV_StartBug> } while ( ! my_atomic_cas32 ( ( int32 volatile * ) & pinbox -> pinstack_top_ver , <S2SV_EndBug> <S2SV_StartBug> ( int32 * ) & top_ver , <S2SV_EndBug> top_ver - pins + next + LF_PINBOX_MAX_PINS ) ) ; el -> link = pins ; el -> purgatory_count = 0 ; el -> pinbox = pinbox ; return el ; } | <S2SV_ModStart> pinbox ) { uint64 <S2SV_ModEnd> pins , next <S2SV_ModStart> { pins = my_atomic_add64 ( ( int64 <S2SV_ModEnd> volatile * ) <S2SV_ModStart> while ( ! my_atomic_cas64 ( ( int64 <S2SV_ModEnd> volatile * ) <S2SV_ModStart> pinstack_top_ver , ( int64 <S2SV_ModEnd> * ) & |
5,077 | CWE-000 static int direct_specular_OK ( COLOR cval , FVECT ldir , double omega , BSDFDAT * ndp ) { int nsamp , ok = 0 ; FVECT vsrc , vsmp , vjit ; double tomega , tomega2 ; double sf , tsr , sd [ 2 ] ; COLOR csmp , cdiff ; double diffY ; SDValue sv ; SDError ec ; int i ; setcolor ( cval , .0 , .0 , .0 ) ; if ( SDmapDir ( vsrc , ndp -> toloc , ldir ) != SDEnone ) return ( 0 ) ; switch ( ( vsrc [ 2 ] > 0 ) << 1 | ( ndp -> vray [ 2 ] > 0 ) ) { case 3 : if ( ndp -> sd -> rf == NULL ) return ( 0 ) ; sv = ndp -> sd -> rLambFront ; break ; case 0 : if ( ndp -> sd -> rb == NULL ) return ( 0 ) ; sv = ndp -> sd -> rLambBack ; break ; default : if ( ( ndp -> sd -> tf == NULL ) & ( ndp -> sd -> tb == NULL ) ) return ( 0 ) ; sv = ndp -> sd -> tLamb ; break ; } if ( sv . cieY > FTINY ) { diffY = sv . cieY *= 1. / PI ; cvt_sdcolor ( cdiff , & sv ) ; } else { diffY = .0 ; setcolor ( cdiff , .0 , .0 , .0 ) ; } omega *= fabs ( vsrc [ 2 ] ) ; ec = SDsizeBSDF ( & tomega , ndp -> vray , vsrc , SDqueryMin , ndp -> sd ) ; if ( ec ) goto baderror ; <S2SV_StartBug> if ( ( ndp -> thick != 0 || bright ( ndp -> cthru ) > FTINY ) <S2SV_EndBug> && ndp -> pr -> crtype & ( SPECULAR | AMBIENT ) <S2SV_StartBug> && ( vsrc [ 2 ] > 0 ) ^ ( ndp -> vray [ 2 ] > 0 ) ) { <S2SV_EndBug> double dx = vsrc [ 0 ] + ndp -> vray [ 0 ] ; double dy = vsrc [ 1 ] + ndp -> vray [ 1 ] ; if ( dx * dx + dy * dy <= ( 4. / PI ) * ( omega + tomega + 2. * sqrt ( omega * tomega ) ) ) return ( 0 ) ; } sf = specjitter * ndp -> pr -> rweight ; if ( tomega <= .0 ) nsamp = 1 ; else if ( 25. * tomega <= omega ) nsamp = 100. * sf + .5 ; else nsamp = 4. * sf * omega / tomega + .5 ; nsamp += ! nsamp ; sf = sqrt ( omega ) ; tsr = sqrt ( tomega ) ; for ( i = nsamp ; i -- ; ) { VCOPY ( vsmp , vsrc ) ; if ( nsamp > 1 ) { multisamp ( sd , 2 , ( i + frandom ( ) ) / ( double ) nsamp ) ; vsmp [ 0 ] += ( sd [ 0 ] - .5 ) * sf ; vsmp [ 1 ] += ( sd [ 1 ] - .5 ) * sf ; normalize ( vsmp ) ; } bsdf_jitter ( vjit , ndp , tsr ) ; ec = SDevalBSDF ( & sv , vjit , vsmp , ndp -> sd ) ; if ( ec ) goto baderror ; if ( sv . cieY - diffY <= FTINY ) continue ; ec = SDsizeBSDF ( & tomega2 , vjit , vsmp , SDqueryMin , ndp -> sd ) ; if ( ec ) goto baderror ; if ( tomega2 < .12 * tomega ) continue ; cvt_sdcolor ( csmp , & sv ) ; addcolor ( cval , csmp ) ; ++ ok ; } if ( ! ok ) return ( 0 ) ; sf = 1. / ( double ) ok ; scalecolor ( cval , sf ) ; for ( i = 3 * ( diffY > FTINY ) ; i -- ; ) if ( ( colval ( cval , i ) -= colval ( cdiff , i ) ) < .0 ) colval ( cval , i ) = .0 ; return ( 1 ) ; baderror : objerror ( ndp -> mp , USER , transSDError ( ec ) ) ; return ( 0 ) ; } | <S2SV_ModStart> ; if ( <S2SV_ModEnd> ndp -> pr <S2SV_ModStart> > 0 ) && bright ( ndp -> cthru ) > FTINY |
5,078 | CWE-000 static int parse_tpmstate_options ( char * options , char * * tpmstatedir ) { OptionValues * ovs = NULL ; char * error = NULL ; const char * directory = NULL ; ovs = options_parse ( options , tpmstate_opt_desc , & error ) ; if ( ! ovs ) { <S2SV_StartBug> fprintf ( stderr , "Error<S2SV_blank>parsing<S2SV_blank>tpmstate<S2SV_blank>options:<S2SV_blank>%s\\n" , <S2SV_EndBug> error ) ; goto error ; } directory = option_get_string ( ovs , "dir" , NULL ) ; if ( ! directory ) { <S2SV_StartBug> fprintf ( stderr , <S2SV_EndBug> "The<S2SV_blank>file<S2SV_blank>parameter<S2SV_blank>is<S2SV_blank>required<S2SV_blank>for<S2SV_blank>the<S2SV_blank>tpmstate<S2SV_blank>option.\\n" ) ; goto error ; } * tpmstatedir = strdup ( directory ) ; if ( ! * tpmstatedir ) { <S2SV_StartBug> fprintf ( stderr , "Out<S2SV_blank>of<S2SV_blank>memory." ) ; <S2SV_EndBug> goto error ; } option_values_free ( ovs ) ; return 0 ; error : option_values_free ( ovs ) ; return - 1 ; } | <S2SV_ModStart> ovs ) { logprintf ( STDERR_FILENO <S2SV_ModEnd> , "Error<S2SV_blank>parsing<S2SV_blank>tpmstate<S2SV_blank>options:<S2SV_blank>%s\\n" , <S2SV_ModStart> directory ) { logprintf ( STDERR_FILENO <S2SV_ModEnd> , "The<S2SV_blank>file<S2SV_blank>parameter<S2SV_blank>is<S2SV_blank>required<S2SV_blank>for<S2SV_blank>the<S2SV_blank>tpmstate<S2SV_blank>option.\\n" ) <S2SV_ModStart> tpmstatedir ) { logprintf ( STDERR_FILENO <S2SV_ModEnd> , "Out<S2SV_blank>of<S2SV_blank>memory." ) |
5,079 | CWE-000 <S2SV_StartBug> static void AlarmTimeout ( unsigned long data ) <S2SV_EndBug> { <S2SV_StartBug> OSS_ALARM_HANDLE * alarm = ( OSS_ALARM_HANDLE * ) data ; <S2SV_EndBug> OSS_ALARM_STATE flags ; flags = OSS_AlarmMask ( alarm -> oss ) ; alarm -> funct ( alarm -> arg ) ; if ( ! alarm -> cyclic ) alarm -> active = FALSE ; else { alarm -> tmr . expires = jiffies + alarm -> interval ; add_timer ( & alarm -> tmr ) ; } OSS_AlarmRestore ( alarm -> oss , flags ) ; } | <S2SV_ModStart> void AlarmTimeout ( struct timer_list * t ) # endif { # if LINUX_VERSION_CODE <= KERNEL_VERSION ( 4 , 14 , 34 ) <S2SV_ModEnd> OSS_ALARM_HANDLE * alarm <S2SV_ModStart> ) data ; # else OSS_ALARM_HANDLE * alarm = from_timer ( alarm , t , tmr ) ; # endif |
5,080 | CWE-000 bool uxr_discovery_agents_unicast ( int64_t time , int period , uxrOnAgentFound on_agent_func , void * args , uxrAgentAddress * choosen , const uxrAgentAddress * agent_list , size_t agent_list_size ) { CallbackData callback = { choosen , on_agent_func , args } ; uint8_t output_buffer [ UXR_UDP_TRANSPORT_MTU_DATAGRAM ] ; ucdrBuffer mb ; ucdr_init_buffer ( & mb , output_buffer , UXR_UDP_TRANSPORT_MTU_DATAGRAM ) ; write_get_info_message ( & mb ) ; size_t message_length = ucdr_buffer_length ( & mb ) ; bool consumed = false ; uxrUDPTransportDatagram transport ; if ( uxr_init_udp_transport_datagram ( & transport ) ) { int64_t remining_time = time ; while ( 0 < remining_time && ! consumed ) { for ( size_t i = 0 ; i < agent_list_size && ! consumed ; ++ i ) { ( void ) uxr_udp_send_datagram_to ( & transport , output_buffer , message_length , agent_list [ i ] . ip , agent_list [ i ] . port ) ; <S2SV_StartBug> printf ( "aaaaaaaa\\n" ) ; <S2SV_EndBug> UXR_DEBUG_PRINT_MESSAGE ( UXR_SEND , output_buffer , message_length , 0 ) ; } <S2SV_StartBug> printf ( "bbbbbbbb\\n" ) ; <S2SV_EndBug> int64_t timestamp = uxr_milli_time ( ) ; int poll = period ; while ( 0 < poll && ! consumed ) { consumed = listen_info_message ( & transport , poll , & callback ) ; <S2SV_StartBug> poll -= ( int ) ( timestamp - uxr_milli_time ( ) ) ; <S2SV_EndBug> } remining_time -= period ; } } return consumed ; } | <S2SV_ModStart> port ) ; <S2SV_ModEnd> UXR_DEBUG_PRINT_MESSAGE ( UXR_SEND <S2SV_ModStart> ) ; } <S2SV_ModEnd> int64_t timestamp = <S2SV_ModStart> int ) ( uxr_milli_time ( ) - timestamp <S2SV_ModEnd> ) ; } |
5,081 | CWE-000 void i2c_start ( void ) { TWCR = ( 1 << TWINT ) | ( 1 << TWEN ) | ( 1 << TWSTA ) ; <S2SV_StartBug> while ( ! ( TWCR & ( 1 << TWINT ) ) ) ; <S2SV_EndBug> } | <S2SV_ModStart> TWSTA ) ; timeout_timer = TIMEOUT_VALUE ; <S2SV_ModStart> TWINT ) ) && ( timeout_timer -- ) |
5,082 | CWE-000 static rsRetVal closeSess ( ptcpsess_t * pSess ) { DEFiRet ; if ( pSess -> compressionMode >= COMPRESS_STREAM_ALWAYS ) doZipFinish ( pSess ) ; const int sock = pSess -> sock ; close ( sock ) ; pthread_mutex_lock ( & pSess -> pLstn -> pSrv -> mutSessLst ) ; if ( pSess -> next != NULL ) pSess -> next -> prev = pSess -> prev ; if ( pSess -> prev == NULL ) { pSess -> pLstn -> pSrv -> pSess = pSess -> next ; } else { pSess -> prev -> next = pSess -> next ; } pthread_mutex_unlock ( & pSess -> pLstn -> pSrv -> mutSessLst ) ; if ( pSess -> pLstn -> pSrv -> bEmitMsgOnClose ) { LogMsg ( 0 , RS_RET_NO_ERRCODE , LOG_INFO , "imptcp:<S2SV_blank>session<S2SV_blank>on<S2SV_blank>socket<S2SV_blank>%d<S2SV_blank>closed<S2SV_blank>" "with<S2SV_blank>iRet<S2SV_blank>%d.\\n" , sock , iRet ) ; } <S2SV_StartBug> destructSess ( pSess ) ; <S2SV_EndBug> <S2SV_StartBug> STATSCOUNTER_INC ( pSess -> pLstn -> ctrSessClose , pSess -> pLstn -> mutCtrSessClose ) ; <S2SV_EndBug> DBGPRINTF ( "imptcp:<S2SV_blank>session<S2SV_blank>on<S2SV_blank>socket<S2SV_blank>%d<S2SV_blank>closed<S2SV_blank>with<S2SV_blank>iRet<S2SV_blank>%d.\\n" , sock , iRet ) ; RETiRet ; } | <S2SV_ModStart> ) ; } STATSCOUNTER_INC ( pSess -> pLstn -> ctrSessClose , pSess -> pLstn -> mutCtrSessClose ) ; <S2SV_ModStart> pSess ) ; <S2SV_ModEnd> DBGPRINTF ( "imptcp:<S2SV_blank>session<S2SV_blank>on<S2SV_blank>socket<S2SV_blank>%d<S2SV_blank>closed<S2SV_blank>with<S2SV_blank>iRet<S2SV_blank>%d.\\n" |
5,083 | CWE-000 void make_arr ( t_wolf * wolf , int fd ) { int i ; int j ; char * line ; i = 0 ; <S2SV_StartBug> wolf -> map = ( char * * ) malloc ( sizeof ( char * ) * ( wolf -> map_height * 200 ) ) ; <S2SV_EndBug> wolf -> map_tmp = ( char * * ) malloc ( sizeof ( char * ) * ( wolf -> map_height * 200 ) ) ; wolf -> map [ wolf -> map_height ] = NULL ; wolf -> map_tmp [ wolf -> map_height ] = NULL ; while ( get_next_line ( fd , & line ) == 1 ) { <S2SV_StartBug> wolf -> map [ i ] = ( char * ) malloc ( sizeof ( char ) * ( wolf -> map_len * 200 ) ) ; <S2SV_EndBug> wolf -> map_tmp [ i ] = ( char * ) malloc ( sizeof ( char ) * ( wolf -> map_len * 200 ) ) ; wolf -> map [ i ] [ wolf -> map_len ] = '\\0' ; wolf -> map_tmp [ i ] [ wolf -> map_len ] = '\\0' ; j = - 1 ; while ( ++ j != wolf -> map_len ) { wolf -> map [ i ] [ j ] = line [ j ] ; wolf -> map_tmp [ i ] [ j ] = line [ j ] ; } i ++ ; ft_strdel ( & line ) ; } ft_strdel ( & line ) ; } | <S2SV_ModStart> wolf -> map_height + 1 ) ) ; wolf -> map_tmp = ( char * * ) malloc ( sizeof ( char * ) * ( wolf -> map_height + 1 <S2SV_ModEnd> ) ) ; <S2SV_ModStart> wolf -> map_len + 1 ) ) ; wolf -> map_tmp [ i ] = ( char * ) malloc ( sizeof ( char ) * ( wolf -> map_len + 1 <S2SV_ModEnd> ) ) ; |
5,084 | CWE-000 static void sds_bptree_txn_decrement ( sds_bptree_transaction * btxn ) { # ifdef DEBUG sds_log ( "sds_bptree_txn_decrement" , "<S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank>txn_%p<S2SV_blank>%d<S2SV_blank>-<S2SV_blank>1" , btxn , btxn -> reference_count ) ; # endif sds_bptree_cow_instance * binst = btxn -> binst ; uint32_t result = __atomic_sub_fetch ( & ( btxn -> reference_count ) , 1 , __ATOMIC_SEQ_CST ) ; # ifdef DEBUG sds_log ( "sds_bptree_txn_decrement" , "<S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank>==<S2SV_blank>%d" , result ) ; if ( result > 0 && binst -> bi -> offline_checksumming ) { sds_bptree_crc32c_update_btxn ( btxn ) ; } # endif if ( result == 0 ) { <S2SV_StartBug> pthread_mutex_lock ( binst -> vacuum_lock ) ; <S2SV_EndBug> while ( result == 0 && btxn != NULL && btxn == binst -> tail_txn ) { # ifdef DEBUG sds_log ( "sds_bptree_txn_decrement" , "<S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank>txn_%p<S2SV_blank>has<S2SV_blank>reached<S2SV_blank>0,<S2SV_blank>and<S2SV_blank>is<S2SV_blank>at<S2SV_blank>the<S2SV_blank>tail,<S2SV_blank>vacuumming!" , btxn ) ; # endif binst -> tail_txn = btxn -> child_txn ; sds_bptree_txn_free ( btxn ) ; btxn = binst -> tail_txn ; if ( btxn != NULL ) { <S2SV_StartBug> __atomic_load ( & ( btxn -> reference_count ) , & result , __ATOMIC_SEQ_CST ) ; <S2SV_EndBug> } } <S2SV_StartBug> pthread_mutex_unlock ( binst -> vacuum_lock ) ; <S2SV_EndBug> } # ifdef DEBUG if ( btxn != NULL ) { sds_log ( "sds_bptree_txn_decrement" , "<S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank>txn_%p<S2SV_blank>is<S2SV_blank>at<S2SV_blank>count<S2SV_blank>%d,<S2SV_blank>and<S2SV_blank>is<S2SV_blank>at<S2SV_blank>the<S2SV_blank>tail,<S2SV_blank>NOT<S2SV_blank>vacuumming!" , btxn , result ) ; } else { sds_log ( "sds_bptree_txn_decrement" , "<S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank>txn<S2SV_blank>tail<S2SV_blank>is<S2SV_blank>now<S2SV_blank>NULL,<S2SV_blank>NOT<S2SV_blank>vacuumming!" , btxn , result ) ; } # endif # ifdef DEBUG if ( binst -> bi -> offline_checksumming ) { sds_bptree_crc32c_update_cow_instance ( binst ) ; } # endif } | <S2SV_ModStart> 0 ) { <S2SV_ModEnd> while ( result <S2SV_ModStart> NULL ) { result = __atomic_sub_fetch <S2SV_ModEnd> ( & ( <S2SV_ModStart> reference_count ) , 1 <S2SV_ModEnd> , __ATOMIC_SEQ_CST ) <S2SV_ModStart> ; } } <S2SV_ModEnd> } # ifdef |
5,085 | CWE-000 static ssize_t i2schar_read ( FAR struct file * filep , FAR char * buffer , size_t buflen ) { <S2SV_StartBug> FAR struct inode * inode = filep -> f_inode ; <S2SV_EndBug> FAR struct i2schar_dev_s * priv ; FAR struct ap_buffer_s * apb ; size_t nbytes ; int ret ; i2sinfo ( "buffer=%p<S2SV_blank>buflen=%d\\n" , buffer , ( int ) buflen ) ; DEBUGASSERT ( filep && buffer ) ; inode = filep -> f_inode ; DEBUGASSERT ( inode ) ; priv = ( FAR struct i2schar_dev_s * ) inode -> i_private ; DEBUGASSERT ( priv ) ; DEBUGASSERT ( buflen >= sizeof ( struct ap_buffer_s ) ) ; apb = ( FAR struct ap_buffer_s * ) buffer ; nbytes = apb -> nmaxbytes ; DEBUGASSERT ( buflen >= ( sizeof ( struct ap_buffer_s ) + nbytes ) ) ; apb_reference ( apb ) ; ret = nxsem_wait ( & priv -> exclsem ) ; if ( ret < 0 ) { i2serr ( "ERROR:<S2SV_blank>nxsem_wait<S2SV_blank>returned:<S2SV_blank>%d\\n" , ret ) ; goto errout_with_reference ; } ret = I2S_RECEIVE ( priv -> i2s , apb , i2schar_rxcallback , priv , CONFIG_AUDIO_I2SCHAR_RXTIMEOUT ) ; if ( ret < 0 ) { i2serr ( "ERROR:<S2SV_blank>I2S_RECEIVE<S2SV_blank>returned:<S2SV_blank>%d\\n" , ret ) ; goto errout_with_reference ; } nxsem_post ( & priv -> exclsem ) ; return sizeof ( struct ap_buffer_s ) + nbytes ; errout_with_reference : apb_free ( apb ) ; nxsem_post ( & priv -> exclsem ) ; return ret ; } | <S2SV_ModStart> inode * inode <S2SV_ModEnd> ; FAR struct |
5,086 | CWE-000 static int hash_netportnet4_uadt ( struct ip_set * set , struct nlattr * tb [ ] , enum ipset_adt adt , u32 * lineno , u32 flags , bool retried ) { const struct hash_netportnet4 * h = set -> data ; ipset_adtfn adtfn = set -> variant -> adt [ adt ] ; struct hash_netportnet4_elem e = { } ; struct ip_set_ext ext = IP_SET_INIT_UEXT ( set ) ; u32 ip = 0 , ip_to = 0 , p = 0 , port , port_to ; u32 ip2_from = 0 , ip2_to = 0 , ip2 ; bool with_ports = false ; int ret ; if ( tb [ IPSET_ATTR_LINENO ] ) * lineno = nla_get_u32 ( tb [ IPSET_ATTR_LINENO ] ) ; hash_netportnet4_init ( & e ) ; if ( unlikely ( ! tb [ IPSET_ATTR_IP ] || ! tb [ IPSET_ATTR_IP2 ] || ! ip_set_attr_netorder ( tb , IPSET_ATTR_PORT ) || ! ip_set_optattr_netorder ( tb , IPSET_ATTR_PORT_TO ) || ! ip_set_optattr_netorder ( tb , IPSET_ATTR_CADT_FLAGS ) ) ) return - IPSET_ERR_PROTOCOL ; ret = ip_set_get_hostipaddr4 ( tb [ IPSET_ATTR_IP ] , & ip ) ; if ( ret ) return ret ; ret = ip_set_get_hostipaddr4 ( tb [ IPSET_ATTR_IP2 ] , & ip2_from ) ; if ( ret ) return ret ; ret = ip_set_get_extensions ( set , tb , & ext ) ; if ( ret ) return ret ; if ( tb [ IPSET_ATTR_CIDR ] ) { e . cidr [ 0 ] = nla_get_u8 ( tb [ IPSET_ATTR_CIDR ] ) ; <S2SV_StartBug> if ( ! e . cidr [ 0 ] || e . cidr [ 0 ] > HOST_MASK ) <S2SV_EndBug> return - IPSET_ERR_INVALID_CIDR ; } if ( tb [ IPSET_ATTR_CIDR2 ] ) { e . cidr [ 1 ] = nla_get_u8 ( tb [ IPSET_ATTR_CIDR2 ] ) ; <S2SV_StartBug> if ( ! e . cidr [ 1 ] || e . cidr [ 1 ] > HOST_MASK ) <S2SV_EndBug> return - IPSET_ERR_INVALID_CIDR ; } e . port = nla_get_be16 ( tb [ IPSET_ATTR_PORT ] ) ; if ( tb [ IPSET_ATTR_PROTO ] ) { e . proto = nla_get_u8 ( tb [ IPSET_ATTR_PROTO ] ) ; with_ports = ip_set_proto_with_ports ( e . proto ) ; if ( e . proto == 0 ) return - IPSET_ERR_INVALID_PROTO ; } else { return - IPSET_ERR_MISSING_PROTO ; } if ( ! ( with_ports || e . proto == IPPROTO_ICMP ) ) e . port = 0 ; if ( tb [ IPSET_ATTR_CADT_FLAGS ] ) { u32 cadt_flags = ip_set_get_h32 ( tb [ IPSET_ATTR_CADT_FLAGS ] ) ; if ( cadt_flags & IPSET_FLAG_NOMATCH ) flags |= ( IPSET_FLAG_NOMATCH << 16 ) ; } with_ports = with_ports && tb [ IPSET_ATTR_PORT_TO ] ; if ( adt == IPSET_TEST || ! ( tb [ IPSET_ATTR_IP_TO ] || with_ports || tb [ IPSET_ATTR_IP2_TO ] ) ) { e . ip [ 0 ] = htonl ( ip & ip_set_hostmask ( e . cidr [ 0 ] ) ) ; e . ip [ 1 ] = htonl ( ip2_from & ip_set_hostmask ( e . cidr [ 1 ] ) ) ; ret = adtfn ( set , & e , & ext , & ext , flags ) ; return ip_set_enomatch ( ret , flags , adt , set ) ? - ret : ip_set_eexist ( ret , flags ) ? 0 : ret ; } ip_to = ip ; if ( tb [ IPSET_ATTR_IP_TO ] ) { ret = ip_set_get_hostipaddr4 ( tb [ IPSET_ATTR_IP_TO ] , & ip_to ) ; if ( ret ) return ret ; if ( ip > ip_to ) swap ( ip , ip_to ) ; if ( unlikely ( ip + UINT_MAX == ip_to ) ) return - IPSET_ERR_HASH_RANGE ; } else { ip_set_mask_from_to ( ip , ip_to , e . cidr [ 0 ] ) ; } port_to = port = ntohs ( e . port ) ; if ( tb [ IPSET_ATTR_PORT_TO ] ) { port_to = ip_set_get_h16 ( tb [ IPSET_ATTR_PORT_TO ] ) ; if ( port > port_to ) swap ( port , port_to ) ; } ip2_to = ip2_from ; if ( tb [ IPSET_ATTR_IP2_TO ] ) { ret = ip_set_get_hostipaddr4 ( tb [ IPSET_ATTR_IP2_TO ] , & ip2_to ) ; if ( ret ) return ret ; if ( ip2_from > ip2_to ) swap ( ip2_from , ip2_to ) ; if ( unlikely ( ip2_from + UINT_MAX == ip2_to ) ) return - IPSET_ERR_HASH_RANGE ; } else { ip_set_mask_from_to ( ip2_from , ip2_to , e . cidr [ 1 ] ) ; } if ( retried ) { ip = ntohl ( h -> next . ip [ 0 ] ) ; p = ntohs ( h -> next . port ) ; ip2 = ntohl ( h -> next . ip [ 1 ] ) ; } else { p = port ; ip2 = ip2_from ; } do { e . ip [ 0 ] = htonl ( ip ) ; ip = ip_set_range_to_cidr ( ip , ip_to , & e . cidr [ 0 ] ) ; for ( ; p <= port_to ; p ++ ) { e . port = htons ( p ) ; do { e . ip [ 1 ] = htonl ( ip2 ) ; ip2 = ip_set_range_to_cidr ( ip2 , ip2_to , & e . cidr [ 1 ] ) ; ret = adtfn ( set , & e , & ext , & ext , flags ) ; if ( ret && ! ip_set_eexist ( ret , flags ) ) return ret ; ret = 0 ; } while ( ip2 ++ < ip2_to ) ; ip2 = ip2_from ; } p = port ; } while ( ip ++ < ip_to ) ; return ret ; } | <S2SV_ModStart> ; if ( <S2SV_ModEnd> e . cidr <S2SV_ModStart> ; if ( <S2SV_ModEnd> e . cidr |
5,087 | CWE-000 <S2SV_StartBug> void copy_point ( struct point * src , struct point * dst , int num ) { <S2SV_EndBug> int i ; # pragma omp parallel for <S2SV_StartBug> for ( i = 0 ; i < num ; i ++ ) { <S2SV_EndBug> dst -> values [ i ] = src -> values [ i ] ; } dst -> label = src -> label ; } | <S2SV_ModStart> dst , int size <S2SV_ModEnd> ) { int <S2SV_ModStart> ; i < size <S2SV_ModEnd> ; i ++ |
5,088 | CWE-000 int32_t odp_recv_pkts ( struct mtcp_thread_context * ctxt , int ifidx ) { <S2SV_StartBug> # ifdef _DEBUG_ <S2SV_EndBug> TRACE_INFO ( "[MTCP-ODP]:<S2SV_blank>recv_pkts.\\n" ) ; # endif struct odp_private_context * opc ; odp_pktin_queue_t pktin ; int total , got , expected , qidx , q_num ; opc = ( struct odp_private_context * ) ctxt -> io_private_context ; q_num = opc -> pktin [ ifidx ] . num ; if ( opc -> rcv_pkttbl [ ifidx ] . num != 0 ) { odp_packet_free_multi ( opc -> rcv_pkttbl [ ifidx ] . pkts , opc -> rcv_pkttbl [ ifidx ] . num ) ; opc -> rcv_pkttbl [ ifidx ] . num = 0 ; } total = 0 ; expected = MAX_PKT_BURST ; for ( qidx = 0 ; qidx < q_num ; ++ qidx ) { pktin = opc -> pktin [ ifidx ] . queues [ qidx ] ; got = odp_pktio_recv_queue ( pktin , opc -> rcv_pkttbl [ ifidx ] . pkts + total , expected ) ; expected -= got ; total += got ; if ( expected == 0 ) { break ; } } opc -> rcv_pkttbl [ ifidx ] . num = total ; <S2SV_StartBug> # ifdef _DEBUG_ <S2SV_EndBug> if ( total > 0 ) { dump_packets ( ctxt , ifidx , opc -> rcv_pkttbl [ ifidx ] . pkts , total , "[LYB-IN]" ) ; } # endif return total ; } | <S2SV_ModStart> ifidx ) { <S2SV_ModEnd> struct odp_private_context * <S2SV_ModStart> = total ; <S2SV_ModEnd> return total ; |
5,089 | CWE-000 int main ( int argc , char * argv [ ] ) { bool appendFlags = false ; <S2SV_StartBug> char * fileName = NULL ; <S2SV_EndBug> for ( int i = 0 ; argv [ i ] != NULL ; i ++ ) { if ( appendFlags == false && strcmp ( argv [ i ] , "run" ) == 0 ) { appendFlags = true ; if ( argv [ i + 1 ] == NULL ) { errno = EBADF ; perror ( "Cannot<S2SV_blank>find<S2SV_blank>source<S2SV_blank>file" ) ; exit ( EXIT_NO_SRC ) ; } else { fileName = argv [ i + 1 ] ; FILE * src = fopen ( argv [ i + 1 ] , "rb" ) ; if ( src == NULL ) { perror ( "Unable<S2SV_blank>to<S2SV_blank>duplicate<S2SV_blank>source<S2SV_blank>file" ) ; exit ( EXIT_NO_SRC ) ; } char * dir = ( char * ) malloc ( strlen ( DATA_VOLUME ) - strlen ( strpbrk ( DATA_VOLUME , ":" ) ) + 1 ) ; memcpy ( dir , DATA_VOLUME , strlen ( DATA_VOLUME ) - strlen ( strpbrk ( DATA_VOLUME , ":" ) ) ) ; dir [ strlen ( DATA_VOLUME ) - strlen ( strpbrk ( DATA_VOLUME , ":" ) ) ] = '\\0' ; char * filePath = malloc ( strlen ( dir ) + strlen ( argv [ i + 1 ] ) + 1 ) ; filePath [ 0 ] = '\\0' ; strcat ( strcat ( filePath , dir ) , argv [ i + 1 ] ) ; struct stat st ; if ( stat ( filePath , & st ) == - 1 ) { if ( stat ( dir , & st ) == - 1 ) { if ( mkdir ( dir , 0700 ) == - 1 ) { perror ( "Unable<S2SV_blank>to<S2SV_blank>duplicate<S2SV_blank>source<S2SV_blank>file" ) ; fclose ( src ) ; free ( dir ) ; free ( filePath ) ; exit ( EXIT_NO_SRC ) ; } } else { } FILE * dest = fopen ( filePath , "wb" ) ; if ( dest == NULL ) { perror ( "Unable<S2SV_blank>to<S2SV_blank>duplicate<S2SV_blank>source<S2SV_blank>file" ) ; fclose ( src ) ; free ( dir ) ; free ( filePath ) ; exit ( EXIT_NO_SRC ) ; } char buf [ 1 ] ; while ( ! feof ( src ) ) { fread ( buf , sizeof ( char ) , sizeof ( buf ) , src ) ; fwrite ( buf , sizeof ( char ) , sizeof ( buf ) , dest ) ; } fclose ( dest ) ; } else { } fclose ( src ) ; free ( dir ) ; free ( filePath ) ; SHIFT_ARRAY_LEFT_BY_ONE ( argv , i + 1 , getCmdSize ( argv ) + 1 , sizeof ( char * ) ) ; } } for ( int j = 0 ; iotCmd [ j ] != NULL ; j ++ ) { if ( strcmp ( argv [ i ] , iotCmd [ j ] ) == 0 ) { SHIFT_ARRAY_LEFT_BY_ONE ( argv , i , getCmdSize ( argv ) + 1 , sizeof ( char * ) ) ; } } } char * * argvList = NULL ; if ( appendFlags == true ) { <S2SV_StartBug> argvList = makeDynaMount ( argv , addedCmd ) ; <S2SV_EndBug> argvList = appendCmdByList ( argvList , OVERWRITE_CMD ) ; } else { argvList = argv ; } printCmd ( argvList ) ; pid_t pid = fork ( ) ; if ( pid > 0 ) { wait ( NULL ) ; } else if ( pid == 0 ) { if ( execvp ( "docker" , argvList ) == - 1 ) { perror ( "Error<S2SV_blank>initiating<S2SV_blank>docker" ) ; } exit ( EXIT_ERR_CHILD ) ; } else { perror ( "Error<S2SV_blank>creating<S2SV_blank>child<S2SV_blank>process" ) ; exit ( EXIT_ERR_FORK ) ; } if ( appendFlags == true ) { for ( int i = getCmdSize ( argv ) + getCmdSize ( addedCmd ) ; strcmp ( argvList [ i ] , "-v" ) != 0 ; i ++ ) { free ( argvList [ i ] ) ; } free ( argvList ) ; } return EXIT_SUCCESS ; } | <S2SV_ModStart> fileName = NULL ; action_t action = { . allField = 0 } <S2SV_ModStart> { argvList = appendCmdByVar ( argvList , argv ) ; argvList = appendCmdByVar ( argvList , addedCmd ) ; argvList = appendDevices ( argvList ) ; argvList = appendCmdByList ( argvList , APPEND_CMD <S2SV_ModEnd> ) ; argvList |
5,090 | CWE-000 int mrsas_ioc_init ( struct mrsas_softc * sc ) { struct mrsas_init_frame * init_frame ; pMpi2IOCInitRequest_t IOCInitMsg ; MRSAS_REQUEST_DESCRIPTOR_UNION req_desc ; u_int8_t max_wait = MRSAS_INTERNAL_CMD_WAIT_TIME ; bus_addr_t phys_addr ; int i , retcode = 0 ; u_int32_t scratch_pad_2 ; if ( mrsas_alloc_ioc_cmd ( sc ) ) { device_printf ( sc -> mrsas_dev , "Cannot<S2SV_blank>allocate<S2SV_blank>IOC<S2SV_blank>command.\\n" ) ; return ( 1 ) ; } if ( ! sc -> block_sync_cache ) { <S2SV_StartBug> scratch_pad_2 = mrsas_read_reg ( sc , offsetof ( mrsas_reg_set , <S2SV_EndBug> outbound_scratch_pad_2 ) ) ; sc -> fw_sync_cache_support = ( scratch_pad_2 & MR_CAN_HANDLE_SYNC_CACHE_OFFSET ) ? 1 : 0 ; } IOCInitMsg = ( pMpi2IOCInitRequest_t ) ( ( ( char * ) sc -> ioc_init_mem ) + 1024 ) ; IOCInitMsg -> Function = MPI2_FUNCTION_IOC_INIT ; IOCInitMsg -> WhoInit = MPI2_WHOINIT_HOST_DRIVER ; IOCInitMsg -> MsgVersion = MPI2_VERSION ; IOCInitMsg -> HeaderVersion = MPI2_HEADER_VERSION ; IOCInitMsg -> SystemRequestFrameSize = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE / 4 ; IOCInitMsg -> ReplyDescriptorPostQueueDepth = sc -> reply_q_depth ; IOCInitMsg -> ReplyDescriptorPostQueueAddress = sc -> reply_desc_phys_addr ; IOCInitMsg -> SystemRequestFrameBaseAddress = sc -> io_request_phys_addr ; IOCInitMsg -> HostMSIxVectors = ( sc -> msix_vectors > 0 ? sc -> msix_vectors : 0 ) ; IOCInitMsg -> HostPageSize = MR_DEFAULT_NVME_PAGE_SHIFT ; init_frame = ( struct mrsas_init_frame * ) sc -> ioc_init_mem ; init_frame -> cmd = MFI_CMD_INIT ; init_frame -> cmd_status = 0xFF ; init_frame -> flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE ; if ( sc -> mrsas_gen3_ctrl || sc -> is_ventura || sc -> is_aero ) { init_frame -> driver_operations . mfi_capabilities . support_additional_msix = 1 ; } if ( sc -> verbuf_mem ) { snprintf ( ( char * ) sc -> verbuf_mem , strlen ( MRSAS_VERSION ) + 2 , "%s\\n" , MRSAS_VERSION ) ; init_frame -> driver_ver_lo = ( bus_addr_t ) sc -> verbuf_phys_addr ; init_frame -> driver_ver_hi = 0 ; } init_frame -> driver_operations . mfi_capabilities . support_ndrive_r1_lb = 1 ; init_frame -> driver_operations . mfi_capabilities . support_max_255lds = 1 ; init_frame -> driver_operations . mfi_capabilities . security_protocol_cmds_fw = 1 ; if ( sc -> max_chain_frame_sz > MEGASAS_CHAIN_FRAME_SZ_MIN ) init_frame -> driver_operations . mfi_capabilities . support_ext_io_size = 1 ; phys_addr = ( bus_addr_t ) sc -> ioc_init_phys_mem + 1024 ; init_frame -> queue_info_new_phys_addr_lo = phys_addr ; init_frame -> data_xfer_len = sizeof ( Mpi2IOCInitRequest_t ) ; req_desc . addr . Words = ( bus_addr_t ) sc -> ioc_init_phys_mem ; req_desc . MFAIo . RequestFlags = ( MRSAS_REQ_DESCRIPT_FLAGS_MFA << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT ) ; mrsas_disable_intr ( sc ) ; mrsas_dprint ( sc , MRSAS_OCR , "Issuing<S2SV_blank>IOC<S2SV_blank>INIT<S2SV_blank>command<S2SV_blank>to<S2SV_blank>FW.\\n" ) ; mrsas_write_64bit_req_desc ( sc , req_desc . addr . u . low , req_desc . addr . u . high ) ; if ( init_frame -> cmd_status == 0xFF ) { for ( i = 0 ; i < ( max_wait * 1000 ) ; i ++ ) { if ( init_frame -> cmd_status == 0xFF ) DELAY ( 1000 ) ; else break ; } } if ( init_frame -> cmd_status == 0 ) mrsas_dprint ( sc , MRSAS_OCR , "IOC<S2SV_blank>INIT<S2SV_blank>response<S2SV_blank>received<S2SV_blank>from<S2SV_blank>FW.\\n" ) ; else { if ( init_frame -> cmd_status == 0xFF ) device_printf ( sc -> mrsas_dev , "IOC<S2SV_blank>Init<S2SV_blank>timed<S2SV_blank>out<S2SV_blank>after<S2SV_blank>%d<S2SV_blank>seconds.\\n" , max_wait ) ; else device_printf ( sc -> mrsas_dev , "IOC<S2SV_blank>Init<S2SV_blank>failed,<S2SV_blank>status<S2SV_blank>=<S2SV_blank>0x%x\\n" , init_frame -> cmd_status ) ; retcode = 1 ; } if ( sc -> is_aero ) { <S2SV_StartBug> scratch_pad_2 = mrsas_read_reg ( sc , offsetof ( mrsas_reg_set , <S2SV_EndBug> outbound_scratch_pad_2 ) ) ; sc -> atomic_desc_support = ( scratch_pad_2 & MR_ATOMIC_DESCRIPTOR_SUPPORT_OFFSET ) ? 1 : 0 ; device_printf ( sc -> mrsas_dev , "FW<S2SV_blank>supports<S2SV_blank>atomic<S2SV_blank>descriptor:<S2SV_blank>%s\\n" , sc -> atomic_desc_support ? "Yes" : "No" ) ; } mrsas_free_ioc_cmd ( sc ) ; return ( retcode ) ; } | <S2SV_ModStart> { scratch_pad_2 = mrsas_read_reg_with_retries <S2SV_ModEnd> ( sc , <S2SV_ModStart> { scratch_pad_2 = mrsas_read_reg_with_retries <S2SV_ModEnd> ( sc , |
5,091 | CWE-000 static void test_setPathGradientSurroundColorsWithCount ( ) { GpStatus status ; GpPathGradient * brush ; ARGB threeSurroundColors [ 3 ] = { 1 , 2 , 3 } ; ARGB threeEmptyColors [ 3 ] = { 0 , 0 , 0 } ; ARGB twoSameColors [ 2 ] = { 1 , 1 } ; ARGB colors [ 3 ] ; INT count = 3 ; GdipCreatePathGradient ( threePoints , 3 , WrapModeTileFlipX , & brush ) ; status = GdipSetPathGradientSurroundColorsWithCount ( brush , threeSurroundColors , & count ) ; assertEqualInt ( status , Ok ) ; assertEqualInt ( count , 3 ) ; status = GdipGetPathGradientSurroundColorsWithCount ( brush , colors , & count ) ; assertEqualInt ( status , Ok ) ; assertEqualInt ( count , 3 ) ; assertEqualInt ( colors [ 0 ] , 1 ) ; assertEqualInt ( colors [ 1 ] , 2 ) ; assertEqualInt ( colors [ 2 ] , 3 ) ; count = 2 ; status = GdipSetPathGradientSurroundColorsWithCount ( brush , threeEmptyColors , & count ) ; assertEqualInt ( status , Ok ) ; assertEqualInt ( count , 2 ) ; count = 3 ; status = GdipGetPathGradientSurroundColorsWithCount ( brush , colors , & count ) ; assertEqualInt ( status , Ok ) ; assertEqualInt ( count , 1 ) ; assertEqualInt ( colors [ 0 ] , 0 ) ; assertEqualInt ( colors [ 1 ] , 0 ) ; assertEqualInt ( colors [ 2 ] , 0 ) ; count = 2 ; status = GdipSetPathGradientSurroundColorsWithCount ( brush , twoSameColors , & count ) ; assertEqualInt ( status , Ok ) ; assertEqualInt ( count , 2 ) ; count = 3 ; status = GdipGetPathGradientSurroundColorsWithCount ( brush , colors , & count ) ; assertEqualInt ( status , Ok ) ; assertEqualInt ( count , 1 ) ; assertEqualInt ( colors [ 0 ] , 1 ) ; assertEqualInt ( colors [ 1 ] , 1 ) ; assertEqualInt ( colors [ 2 ] , 1 ) ; GdipCreatePathGradient ( threePoints , 3 , WrapModeTileFlipX , & brush ) ; count = 1 ; status = GdipSetPathGradientSurroundColorsWithCount ( brush , threeSurroundColors , & count ) ; assertEqualInt ( status , Ok ) ; count = 3 ; status = GdipGetPathGradientSurroundColorsWithCount ( brush , colors , & count ) ; assertEqualInt ( status , Ok ) ; assertEqualInt ( count , 1 ) ; assertEqualInt ( colors [ 0 ] , 1 ) ; assertEqualInt ( colors [ 1 ] , 1 ) ; assertEqualInt ( colors [ 2 ] , 1 ) ; status = GdipSetPathGradientSurroundColorsWithCount ( NULL , colors , & count ) ; assertEqualInt ( status , InvalidParameter ) ; status = GdipSetPathGradientSurroundColorsWithCount ( brush , NULL , & count ) ; assertEqualInt ( status , InvalidParameter ) ; <S2SV_StartBug> count = 4 ; <S2SV_EndBug> status = GdipSetPathGradientSurroundColorsWithCount ( brush , colors , & count ) ; assertEqualInt ( status , InvalidParameter ) ; count = 0 ; status = GdipSetPathGradientSurroundColorsWithCount ( brush , colors , & count ) ; assertEqualInt ( status , InvalidParameter ) ; count = - 1 ; status = GdipSetPathGradientSurroundColorsWithCount ( brush , colors , & count ) ; assertEqualInt ( status , InvalidParameter ) ; GdipDeleteBrush ( ( GpBrush * ) brush ) ; } | <S2SV_ModStart> InvalidParameter ) ; # if ! defined ( USE_WINDOWS_GDIPLUS ) status = GdipSetPathGradientSurroundColorsWithCount ( brush , colors , NULL ) ; assertEqualInt ( status , InvalidParameter ) ; # endif |
5,092 | CWE-000 uint32_t demand_create ( lower_info * li , algorithm * algo ) { num_page = _NOP ; num_block = _NOS ; p_p_b = _PPS ; num_tblock = ( ( num_block / EPP ) + ( ( num_block % EPP != 0 ) ? 1 : 0 ) ) * 8 ; num_tpage = num_tblock * p_p_b ; num_dblock = num_block - num_tblock - 2 ; num_dpage = num_dblock * p_p_b ; max_cache_entry = ( num_page / EPP ) + ( ( num_page % EPP != 0 ) ? 1 : 0 ) ; <S2SV_StartBug> num_max_cache = max_cache_entry / 4 ; <S2SV_EndBug> real_max_cache = num_max_cache ; num_caching = 0 ; max_write_buf = 1024 ; # if C_CACHE max_clean_cache = num_max_cache / 2 ; num_max_cache -= max_clean_cache ; num_clean = 0 ; # endif printf ( "!!!<S2SV_blank>print<S2SV_blank>info<S2SV_blank>!!!\\n" ) ; printf ( "Async<S2SV_blank>status:<S2SV_blank>%d\\n" , ASYNC ) ; printf ( "use<S2SV_blank>wirte<S2SV_blank>buffer:<S2SV_blank>%d\\n" , W_BUFF ) ; printf ( "Wait<S2SV_blank>same<S2SV_blank>mapping<S2SV_blank>request(FLYING):<S2SV_blank>%d\\n" , FLYING ) ; printf ( "use<S2SV_blank>gc<S2SV_blank>polling:<S2SV_blank>%d\\n" , GC_POLL ) ; printf ( "use<S2SV_blank>eviction<S2SV_blank>polling:<S2SV_blank>%d\\n" , EVICT_POLL ) ; printf ( "#<S2SV_blank>of<S2SV_blank>total<S2SV_blank>block:<S2SV_blank>%d\\n" , num_block ) ; printf ( "#<S2SV_blank>of<S2SV_blank>total<S2SV_blank>page:<S2SV_blank>%d\\n" , num_page ) ; printf ( "page<S2SV_blank>per<S2SV_blank>block:<S2SV_blank>%d\\n" , p_p_b ) ; printf ( "#<S2SV_blank>of<S2SV_blank>translation<S2SV_blank>block:<S2SV_blank>%d\\n" , num_tblock ) ; printf ( "#<S2SV_blank>of<S2SV_blank>translation<S2SV_blank>page:<S2SV_blank>%d\\n" , num_tpage ) ; printf ( "#<S2SV_blank>of<S2SV_blank>data<S2SV_blank>block:<S2SV_blank>%d\\n" , num_dblock ) ; printf ( "#<S2SV_blank>of<S2SV_blank>data<S2SV_blank>page:<S2SV_blank>%d\\n" , num_dpage ) ; printf ( "#<S2SV_blank>of<S2SV_blank>total<S2SV_blank>cache<S2SV_blank>mapping<S2SV_blank>entry:<S2SV_blank>%d\\n" , max_cache_entry ) ; printf ( "max<S2SV_blank>#<S2SV_blank>of<S2SV_blank>ram<S2SV_blank>reside<S2SV_blank>cme:<S2SV_blank>%d\\n" , real_max_cache ) ; # if C_CACHE printf ( "max<S2SV_blank>#<S2SV_blank>of<S2SV_blank>clean<S2SV_blank>translation<S2SV_blank>cache<S2SV_blank>table:<S2SV_blank>%d\\n" , max_clean_cache ) ; # endif printf ( "cache<S2SV_blank>percentage:<S2SV_blank>%0.3f%%\\n" , ( ( float ) real_max_cache / max_cache_entry ) * 100 ) ; printf ( "!!!<S2SV_blank>print<S2SV_blank>info<S2SV_blank>!!!\\n" ) ; algo -> li = li ; lru_init ( & lru ) ; # if C_CACHE lru_init ( & c_lru ) ; # endif q_init ( & dftl_q , 1024 ) ; bm = BM_Init ( num_block , p_p_b , 2 , 1 ) ; BM_Queue_Init ( & free_b ) ; for ( int i = 0 ; i < num_block - 2 ; i ++ ) { BM_Enqueue ( free_b , & bm -> barray [ i ] ) ; } t_reserved = & bm -> barray [ num_block - 2 ] ; d_reserved = & bm -> barray [ num_block - 1 ] ; data_b = BM_Heap_Init ( num_dblock ) ; trans_b = BM_Heap_Init ( num_tblock ) ; bm -> harray [ 0 ] = data_b ; bm -> harray [ 1 ] = trans_b ; bm -> qarray [ 0 ] = free_b ; # if W_BUFF write_buffer = skiplist_init ( ) ; # endif CMT = ( C_TABLE * ) malloc ( sizeof ( C_TABLE ) * max_cache_entry ) ; mem_arr = ( mem_table * ) malloc ( sizeof ( mem_table ) * max_cache_entry ) ; demand_OOB = ( D_OOB * ) malloc ( sizeof ( D_OOB ) * num_page ) ; ppa_prefetch = ( struct prefetch_struct * ) malloc ( sizeof ( struct prefetch_struct ) * max_write_buf ) ; waiting_arr = ( request * * ) malloc ( sizeof ( request * ) * max_write_buf ) ; for ( int i = 0 ; i < max_cache_entry ; i ++ ) { CMT [ i ] . t_ppa = - 1 ; CMT [ i ] . idx = i ; CMT [ i ] . p_table = NULL ; CMT [ i ] . queue_ptr = NULL ; # if C_CACHE CMT [ i ] . clean_ptr = NULL ; # endif CMT [ i ] . state = CLEAN ; CMT [ i ] . flying = false ; CMT [ i ] . flying_arr = ( request * * ) malloc ( sizeof ( request * ) * 1024 ) ; CMT [ i ] . num_waiting = 0 ; CMT [ i ] . read_hit = 0 ; CMT [ i ] . write_hit = 0 ; } for ( int i = 0 ; i < max_cache_entry ; i ++ ) { mem_arr [ i ] . mem_p = ( D_TABLE * ) malloc ( PAGESIZE ) ; memset ( mem_arr [ i ] . mem_p , - 1 , PAGESIZE ) ; } memset ( demand_OOB , - 1 , sizeof ( D_OOB ) * num_page ) ; for ( size_t i = 0 ; i < max_write_buf ; i ++ ) { ppa_prefetch [ i ] . ppa = dp_alloc ( ) ; ppa_prefetch [ i ] . sn = NULL ; } return 0 ; } | <S2SV_ModStart> num_max_cache = max_cache_entry <S2SV_ModEnd> ; real_max_cache = |
5,093 | CWE-000 void make_new_buffer ( void ) { openfilestruct * newnode = make_new_opennode ( ) ; if ( openfile == NULL ) { newnode -> prev = newnode ; newnode -> next = newnode ; firstfile = newnode ; } else { newnode -> prev = openfile ; newnode -> next = openfile -> next ; openfile -> next -> prev = newnode ; openfile -> next = newnode ; exitfunc -> desc = close_tag ; more_than_one = ! inhelp || more_than_one ; } openfile = newnode ; openfile -> filename = mallocstrcpy ( NULL , "" ) ; initialize_buffer_text ( ) ; openfile -> placewewant = 0 ; openfile -> current_y = 0 ; openfile -> modified = FALSE ; # ifndef NANO_TINY openfile -> mark = NULL ; openfile -> fmt = NIX_FILE ; openfile -> undotop = NULL ; openfile -> current_undo = NULL ; openfile -> last_action = OTHER ; <S2SV_StartBug> openfile -> current_stat = NULL ; <S2SV_EndBug> openfile -> lock_filename = NULL ; # endif # ifdef ENABLE_COLOR openfile -> syntax = NULL ; openfile -> colorstrings = NULL ; # endif } | <S2SV_ModStart> ; openfile -> pristine = TRUE ; openfile -> |
5,094 | CWE-000 static void fast_xmit ( struct recvbuf * rbufp , int xmode , keyid_t xkeyid , int flags ) { struct pkt xpkt ; struct pkt * rpkt ; l_fp xmt_tx , xmt_ty ; size_t sendlen ; rpkt = & rbufp -> recv_pkt ; if ( flags & RES_KOD ) { sys_kodsent ++ ; xpkt . li_vn_mode = PKT_LI_VN_MODE ( LEAP_NOTINSYNC , PKT_VERSION ( rpkt -> li_vn_mode ) , xmode ) ; xpkt . stratum = STRATUM_PKT_UNSPEC ; xpkt . ppoll = max ( rpkt -> ppoll , ntp_minpoll ) ; xpkt . precision = rpkt -> precision ; memcpy ( & xpkt . refid , "RATE" , REFIDLEN ) ; xpkt . rootdelay = rpkt -> rootdelay ; xpkt . rootdisp = rpkt -> rootdisp ; xpkt . reftime = rpkt -> reftime ; xpkt . org = rpkt -> xmt ; xpkt . rec = rpkt -> xmt ; xpkt . xmt = rpkt -> xmt ; } else { # ifdef ENABLE_LEAP_SMEAR l_fp this_ref_time ; l_fp this_recv_time ; # endif xpkt . li_vn_mode = PKT_LI_VN_MODE ( sys_leap , PKT_VERSION ( rpkt -> li_vn_mode ) , xmode ) ; xpkt . stratum = STRATUM_TO_PKT ( sys_stratum ) ; xpkt . ppoll = max ( rpkt -> ppoll , ntp_minpoll ) ; xpkt . precision = sys_precision ; xpkt . refid = sys_refid ; xpkt . rootdelay = HTONS_FP ( DTOUFP ( sys_rootdelay ) ) ; xpkt . rootdisp = HTONS_FP ( DTOUFP ( sys_rootdisp ) ) ; # ifdef ENABLE_LEAP_SMEAR this_ref_time = sys_reftime ; if ( leap_smear . in_progress ) { leap_smear_add_offs ( & this_ref_time , NULL ) ; xpkt . refid = convertLFPToRefID ( leap_smear . offset ) ; DPRINTF ( 2 , ( "fast_xmit:<S2SV_blank>leap_smear.in_progress:<S2SV_blank>refid<S2SV_blank>%8x,<S2SV_blank>smear<S2SV_blank>%s\\n" , ntohl ( xpkt . refid ) , lfptoa ( leap_smear . offset , 8 ) ) ) ; } xpkt . reftime = htonl_fp ( this_ref_time ) ; # else xpkt . reftime = htonl_fp ( sys_reftime ) ; # endif xpkt . org = rpkt -> xmt ; # ifdef ENABLE_LEAP_SMEAR this_recv_time = rbufp -> recv_time ; if ( leap_smear . in_progress ) leap_smear_add_offs ( & this_recv_time , NULL ) ; xpkt . rec = htonl_fp ( this_recv_time ) ; # else xpkt . rec = htonl_fp ( rbufp -> recv_time ) ; # endif get_systime ( & xmt_tx ) ; # ifdef ENABLE_LEAP_SMEAR if ( leap_smear . in_progress ) leap_smear_add_offs ( & xmt_tx , & this_recv_time ) ; # endif xpkt . xmt = htonl_fp ( xmt_tx ) ; } # ifdef ENABLE_MSSNTP if ( flags & RES_MSSNTP ) { send_via_ntp_signd ( rbufp , xmode , xkeyid , flags , & xpkt ) ; return ; } # endif sendlen = LEN_PKT_NOMAC ; if ( rbufp -> recv_length == sendlen ) { sendpkt ( & rbufp -> recv_srcadr , rbufp -> dstadr , & xpkt , sendlen ) ; # ifdef DEBUG if ( debug ) printf ( <S2SV_StartBug> "transmit:<S2SV_blank>at<S2SV_blank>%ld<S2SV_blank>%s->%s<S2SV_blank>mode<S2SV_blank>%d<S2SV_blank>len<S2SV_blank>%zd\\n" , <S2SV_EndBug> current_time , socktoa ( & rbufp -> dstadr -> sin ) , socktoa ( & rbufp -> recv_srcadr ) , xmode , sendlen ) ; # endif return ; } get_systime ( & xmt_tx ) ; sendlen += ( size_t ) authencrypt ( xkeyid , ( uint32_t * ) & xpkt , sendlen ) ; sendpkt ( & rbufp -> recv_srcadr , rbufp -> dstadr , & xpkt , sendlen ) ; get_systime ( & xmt_ty ) ; xmt_ty -= xmt_tx ; sys_authdelay = xmt_ty ; # ifdef DEBUG if ( debug ) printf ( <S2SV_StartBug> "transmit:<S2SV_blank>at<S2SV_blank>%ld<S2SV_blank>%s->%s<S2SV_blank>mode<S2SV_blank>%d<S2SV_blank>keyid<S2SV_blank>%08x<S2SV_blank>len<S2SV_blank>%zd\\n" , <S2SV_EndBug> current_time , socktoa ( & rbufp -> dstadr -> sin ) , socktoa ( & rbufp -> recv_srcadr ) , xmode , xkeyid , sendlen ) ; # endif } | <S2SV_ModStart> ) printf ( "transmit:<S2SV_blank>at<S2SV_blank>%lu<S2SV_blank>%s->%s<S2SV_blank>mode<S2SV_blank>%d<S2SV_blank>len<S2SV_blank>%zu\\n" <S2SV_ModEnd> , current_time , <S2SV_ModStart> ) printf ( "transmit:<S2SV_blank>at<S2SV_blank>%lu<S2SV_blank>%s->%s<S2SV_blank>mode<S2SV_blank>%d<S2SV_blank>keyid<S2SV_blank>%08x<S2SV_blank>len<S2SV_blank>%zu\\n" <S2SV_ModEnd> , current_time , |
5,095 | CWE-000 TechnicalSupport * getTechnicalSupport ( int idTechnicalSupport , PersonDatabase * personDatabase ) { for ( int i = 0 ; i < personDatabase -> technicalMaxCapacity ; i ++ ) { if ( personDatabase -> technicalSupportBooleanArray [ i ] != 0 ) { <S2SV_StartBug> if ( personDatabase -> technicalSupportArray [ i ] -> idTechnicalSupport == idPerson ) { <S2SV_EndBug> TechnicalSupport * technicalSupport = personDatabase -> technicalSupportArray [ i ] ; return technicalSupport ; } } } return NULL ; } | <S2SV_ModStart> -> idTechnicalSupport == idTechnicalSupport <S2SV_ModEnd> ) { TechnicalSupport |
5,096 | CWE-000 static void free_gid_entry_locked ( struct ib_gid_table_entry * entry ) { struct ib_device * device = entry -> attr . device ; u8 port_num = entry -> attr . port_num ; struct ib_gid_table * table = rdma_gid_table ( device , port_num ) ; dev_dbg ( & device -> dev , "%s<S2SV_blank>port=%d<S2SV_blank>index=%d<S2SV_blank>gid<S2SV_blank>%pI6\\n" , __func__ , <S2SV_StartBug> port_num , entry -> attr . index , entry -> attr . gid . raw ) ; <S2SV_EndBug> if ( rdma_cap_roce_gid_table ( device , port_num ) && entry -> state != GID_TABLE_ENTRY_INVALID ) device -> del_gid ( & entry -> attr , & entry -> context ) ; write_lock_irq ( & table -> rwlock ) ; if ( entry == table -> data_vec [ entry -> attr . index ] ) table -> data_vec [ entry -> attr . index ] = NULL ; write_unlock_irq ( & table -> rwlock ) ; if ( entry -> attr . ndev ) dev_put ( entry -> attr . ndev ) ; kfree ( entry ) ; } | <S2SV_ModStart> gid . raw <S2SV_ModEnd> ) ; write_lock_irq |
5,097 | CWE-000 void idle ( void ) { if ( state != last_state ) { last_state = state ; dispSeconds ( max_time ) ; BUTTON_LED = ON ; } delay_by_nop ( 2000000 ) ; state = run ; <S2SV_StartBug> if ( state != last_state ) { <S2SV_EndBug> BUTTON_LED = OFF ; } } | <S2SV_ModStart> = run ; U1_puts ( "Setup" ) ; U1_putc ( '\\r' ) ; U1_putc ( '\\n' ) ; U1_flush_tx_buffer ( ) ; |
5,098 | CWE-000 static void wiiu_joypad_poll ( void ) { wpad_driver . poll ( ) ; kpad_driver . poll ( ) ; <S2SV_StartBug> hidpad_driver . poll ( ) ; <S2SV_EndBug> <S2SV_StartBug> } <S2SV_EndBug> | <S2SV_ModStart> ( ) ; # ifdef WIIU_HID <S2SV_ModStart> ( ) ; # endif |
5,099 | CWE-000 static BEH_DECL ( map_args_beh ) { CONS * state = MINE ; <S2SV_StartBug> CONS * cust ; <S2SV_EndBug> <S2SV_StartBug> CONS * env ; <S2SV_EndBug> CONS * msg = WHAT ; CONS * appl ; CONS * lists ; CONS * k_unwrap ; <S2SV_StartBug> DBUG_ENTER ( "map_args_beh" ) ; <S2SV_EndBug> ENSURE ( is_pr ( state ) ) ; cust = hd ( state ) ; ENSURE ( actorp ( cust ) ) ; <S2SV_StartBug> env = tl ( state ) ; <S2SV_EndBug> ENSURE ( is_pr ( msg ) ) ; appl = hd ( msg ) ; ENSURE ( actorp ( appl ) ) ; lists = tl ( msg ) ; ENSURE ( is_pr ( lists ) ) ; ENSURE ( ! nilp ( lists ) ) ; k_unwrap = ACTOR ( map_unwrap_beh , pr ( lists , state ) ) ; SEND ( appl , pr ( k_unwrap , ATOM ( "unwrap" ) ) ) ; DBUG_RETURN ; } | <S2SV_ModStart> = MINE ; # if 0 <S2SV_ModStart> * env ; # endif <S2SV_ModStart> "map_args_beh" ) ; # if 0 <S2SV_ModStart> state ) ; # endif |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.