Unnamed: 0
int64 0
535k
| source
stringlengths 50
89.8k
| target
stringlengths 23
37.7k
|
---|---|---|
3,200 | CWE-000 int i2ccmd_dev ( FAR struct i2ctool_s * i2ctool , int argc , char * * argv ) { FAR struct i2c_dev_s * dev ; struct i2c_msg_s msg [ 2 ] ; FAR char * ptr ; union { uint16_t data16 ; uint8_t data8 ; } u ; uint8_t regaddr ; long first ; long last ; int addr ; int nargs ; int argndx ; int ret ; int i ; int j ; for ( argndx = 1 ; argndx < argc ; ) { ptr = argv [ argndx ] ; if ( * ptr != '-' ) { break ; } nargs = common_args ( i2ctool , & argv [ argndx ] ) ; if ( nargs < 0 ) { return ERROR ; } argndx += nargs ; } if ( argndx + 1 < argc ) { first = strtol ( argv [ argndx ] , NULL , 16 ) ; last = strtol ( argv [ argndx + 1 ] , NULL , 16 ) ; if ( first < 0 || first > 0x7f || last < 0 || last > 0x7f || first > last ) { i2ctool_printf ( i2ctool , g_i2cargrange , argv [ 0 ] ) ; return ERROR ; } argndx += 2 ; } else { i2ctool_printf ( i2ctool , g_i2cargrequired , argv [ 0 ] ) ; return ERROR ; } if ( argndx != argc ) { i2ctool_printf ( i2ctool , g_i2ctoomanyargs , argv [ 0 ] ) ; return ERROR ; } dev = up_i2cinitialize ( i2ctool -> bus ) ; if ( ! dev ) { i2ctool_printf ( i2ctool , "Failed<S2SV_blank>to<S2SV_blank>get<S2SV_blank>bus<S2SV_blank>%d\\n" , i2ctool -> bus ) ; return ERROR ; } I2C_SETFREQUENCY ( dev , i2ctool -> freq ) ; <S2SV_StartBug> i2ctool_printf ( i2ctool , "<S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank>0<S2SV_blank><S2SV_blank>1<S2SV_blank><S2SV_blank>2<S2SV_blank><S2SV_blank>3<S2SV_blank><S2SV_blank>4<S2SV_blank><S2SV_blank>5<S2SV_blank><S2SV_blank>6<S2SV_blank><S2SV_blank>7<S2SV_blank><S2SV_blank>8<S2SV_blank><S2SV_blank>9<S2SV_blank><S2SV_blank>a<S2SV_blank><S2SV_blank>b<S2SV_blank><S2SV_blank>c<S2SV_blank><S2SV_blank>d<S2SV_blank><S2SV_blank>e<S2SV_blank><S2SV_blank>f\\n" ) ; <S2SV_EndBug> for ( i = 0 ; i < 128 ; i += 16 ) { i2ctool_printf ( i2ctool , "%02x:<S2SV_blank>" , i ) ; for ( j = 0 ; j < 16 ; j ++ ) { addr = i + j ; if ( addr < first || addr > last ) { i2ctool_printf ( i2ctool , "<S2SV_blank><S2SV_blank><S2SV_blank>" ) ; continue ; } I2C_SETADDRESS ( dev , addr , 7 ) ; regaddr = 0 ; msg [ 0 ] . addr = addr ; msg [ 0 ] . flags = 0 ; msg [ 0 ] . buffer = & regaddr ; msg [ 0 ] . length = 1 ; msg [ 1 ] . addr = addr ; msg [ 1 ] . flags = I2C_M_READ ; if ( i2ctool -> width == 8 ) { msg [ 1 ] . buffer = & u . data8 ; msg [ 1 ] . length = 1 ; } else { msg [ 1 ] . buffer = ( uint8_t * ) & u . data16 ; msg [ 1 ] . length = 2 ; } if ( i2ctool -> start ) { ret = I2C_TRANSFER ( dev , & msg [ 0 ] , 1 ) ; <S2SV_StartBug> if ( ret == OK ) { <S2SV_EndBug> ret = I2C_TRANSFER ( dev , & msg [ 1 ] , 1 ) ; } } else { ret = I2C_TRANSFER ( dev , msg , 2 ) ; } <S2SV_StartBug> if ( ret == OK ) { <S2SV_EndBug> i2ctool_printf ( i2ctool , "%02x<S2SV_blank>" , addr ) ; } else { i2ctool_printf ( i2ctool , "--<S2SV_blank>" ) ; } } i2ctool_printf ( i2ctool , "\\n" ) ; i2ctool_flush ( i2ctool ) ; } ( void ) up_i2cuninitialize ( dev ) ; return OK ; } | <S2SV_ModStart> ( i2ctool , "\\n<S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank><S2SV_blank>0<S2SV_blank><S2SV_blank>1<S2SV_blank><S2SV_blank>2<S2SV_blank><S2SV_blank>3<S2SV_blank><S2SV_blank>4<S2SV_blank><S2SV_blank>5<S2SV_blank><S2SV_blank>6<S2SV_blank><S2SV_blank>7<S2SV_blank><S2SV_blank>8<S2SV_blank><S2SV_blank>9<S2SV_blank><S2SV_blank>a<S2SV_blank><S2SV_blank>b<S2SV_blank><S2SV_blank>c<S2SV_blank><S2SV_blank>d<S2SV_blank><S2SV_blank>e<S2SV_blank><S2SV_blank>f\\n" <S2SV_ModEnd> ) ; for <S2SV_ModStart> if ( ret > 0 <S2SV_ModEnd> ) { ret <S2SV_ModStart> if ( ret > 0 <S2SV_ModEnd> ) { i2ctool_printf |
3,201 | CWE-000 int nilfs_sufile_alloc ( struct inode * sufile , __u64 * segnump ) { <S2SV_StartBug> struct buffer_head * header_bh , * su_bh ; <S2SV_EndBug> struct the_nilfs * nilfs ; struct nilfs_sufile_header * header ; struct nilfs_segment_usage * su ; size_t susz = NILFS_MDT ( sufile ) -> mi_entry_size ; __u64 segnum , maxsegnum , last_alloc ; void * kaddr ; unsigned long nsegments , ncleansegs , nsus ; int ret , i , j ; down_write ( & NILFS_MDT ( sufile ) -> mi_sem ) ; <S2SV_StartBug> nilfs = NILFS_MDT ( sufile ) -> mi_nilfs ; <S2SV_EndBug> ret = nilfs_sufile_get_header_block ( sufile , & header_bh ) ; if ( ret < 0 ) goto out_sem ; kaddr = kmap_atomic ( header_bh -> b_page , KM_USER0 ) ; header = nilfs_sufile_block_get_header ( sufile , header_bh , kaddr ) ; ncleansegs = le64_to_cpu ( header -> sh_ncleansegs ) ; last_alloc = le64_to_cpu ( header -> sh_last_alloc ) ; kunmap_atomic ( kaddr , KM_USER0 ) ; nsegments = nilfs_sufile_get_nsegments ( sufile ) ; segnum = last_alloc + 1 ; maxsegnum = nsegments - 1 ; for ( i = 0 ; i < nsegments ; i += nsus ) { if ( segnum >= nsegments ) { segnum = 0 ; maxsegnum = last_alloc ; } ret = nilfs_sufile_get_segment_usage_block ( sufile , segnum , 1 , & su_bh ) ; if ( ret < 0 ) goto out_header ; kaddr = kmap_atomic ( su_bh -> b_page , KM_USER0 ) ; su = nilfs_sufile_block_get_segment_usage ( sufile , segnum , su_bh , kaddr ) ; nsus = nilfs_sufile_segment_usages_in_block ( sufile , segnum , maxsegnum ) ; for ( j = 0 ; j < nsus ; j ++ , su = ( void * ) su + susz , segnum ++ ) { if ( ! nilfs_segment_usage_clean ( su ) ) continue ; nilfs_segment_usage_set_dirty ( su ) ; kunmap_atomic ( kaddr , KM_USER0 ) ; kaddr = kmap_atomic ( header_bh -> b_page , KM_USER0 ) ; header = nilfs_sufile_block_get_header ( sufile , header_bh , kaddr ) ; le64_add_cpu ( & header -> sh_ncleansegs , - 1 ) ; le64_add_cpu ( & header -> sh_ndirtysegs , 1 ) ; header -> sh_last_alloc = cpu_to_le64 ( segnum ) ; kunmap_atomic ( kaddr , KM_USER0 ) ; nilfs_mdt_mark_buffer_dirty ( header_bh ) ; nilfs_mdt_mark_buffer_dirty ( su_bh ) ; nilfs_mdt_mark_dirty ( sufile ) ; brelse ( su_bh ) ; * segnump = segnum ; goto out_header ; } kunmap_atomic ( kaddr , KM_USER0 ) ; brelse ( su_bh ) ; } ret = - ENOSPC ; out_header : brelse ( header_bh ) ; out_sem : up_write ( & NILFS_MDT ( sufile ) -> mi_sem ) ; return ret ; } | <S2SV_ModStart> , * su_bh <S2SV_ModEnd> ; struct nilfs_sufile_header <S2SV_ModStart> mi_sem ) ; <S2SV_ModEnd> ret = nilfs_sufile_get_header_block |
3,202 | CWE-000 static int smb3_enum_snapshots ( const unsigned int xid , struct cifs_tcon * tcon , struct cifsFileInfo * cfile , void __user * ioc_buf ) { char * retbuf = NULL ; unsigned int ret_data_len = 0 ; int rc ; struct smb_snapshot_array snapshot_in ; rc = SMB2_ioctl ( xid , tcon , cfile -> fid . persistent_fid , cfile -> fid . volatile_fid , FSCTL_SRV_ENUMERATE_SNAPSHOTS , true , NULL , 0 , ( char * * ) & retbuf , & ret_data_len ) ; cifs_dbg ( FYI , "enum<S2SV_blank>snaphots<S2SV_blank>ioctl<S2SV_blank>returned<S2SV_blank>%d<S2SV_blank>and<S2SV_blank>ret<S2SV_blank>buflen<S2SV_blank>is<S2SV_blank>%d\\n" , rc , ret_data_len ) ; if ( rc ) return rc ; if ( ret_data_len && ( ioc_buf != NULL ) && ( retbuf != NULL ) ) { if ( copy_from_user ( & snapshot_in , ioc_buf , sizeof ( struct smb_snapshot_array ) ) ) { rc = - EFAULT ; kfree ( retbuf ) ; return rc ; } <S2SV_StartBug> if ( snapshot_in . snapshot_array_size < sizeof ( struct smb_snapshot_array ) ) { <S2SV_EndBug> rc = - ERANGE ; kfree ( retbuf ) ; return rc ; } <S2SV_StartBug> if ( ret_data_len > snapshot_in . snapshot_array_size ) <S2SV_EndBug> <S2SV_StartBug> ret_data_len = snapshot_in . snapshot_array_size ; <S2SV_EndBug> if ( copy_to_user ( ioc_buf , retbuf , ret_data_len ) ) rc = - EFAULT ; } kfree ( retbuf ) ; return rc ; } | <S2SV_ModStart> . snapshot_array_size < GMT_TOKEN_SIZE ) ret_data_len = sizeof ( struct smb_snapshot_array ) ; <S2SV_ModEnd> if ( ret_data_len <S2SV_ModStart> ( ret_data_len > ( <S2SV_ModStart> snapshot_in . snapshot_array_size + sizeof ( struct smb_snapshot_array ) ) <S2SV_ModStart> snapshot_in . snapshot_array_size + sizeof ( struct smb_snapshot_array ) |
3,203 | CWE-000 <S2SV_StartBug> inline void jvm_free ( void * ptr ) { <S2SV_EndBug> <S2SV_StartBug> free ( ptr ) ; <S2SV_EndBug> <S2SV_StartBug> } <S2SV_EndBug> | <S2SV_ModStart> <S2SV_null> <S2SV_null> <S2SV_null> <S2SV_ModEnd> void jvm_free ( <S2SV_ModStart> ptr ) { if ( ptr ) { pthread_spin_lock ( & mlock ) ; heap_size -= * ( u32 * ) ( ptr - 4 ) ; pthread_spin_unlock ( & mlock ) ; <S2SV_ModStart> free ( ptr - 4 <S2SV_ModStart> ) ; } } |
3,204 | CWE-000 void gl4es_blitTexture ( GLuint texture , float sx , float sy , float width , float height , float nwidth , float nheight , float zoomx , float zoomy , float vpwidth , float vpheight , float x , float y , int mode ) { LOAD_GLES ( glBindTexture ) ; LOAD_GLES ( glActiveTexture ) ; <S2SV_StartBug> # ifdef TEXSTREAM <S2SV_EndBug> LOAD_GLES ( glEnable ) ; LOAD_GLES ( glDisable ) ; <S2SV_StartBug> # endif <S2SV_EndBug> gl4es_glPushAttrib ( GL_TEXTURE_BIT | GL_ENABLE_BIT | GL_TRANSFORM_BIT | GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT ) ; if ( glstate -> gleshard -> active ) { glstate -> gleshard -> active = 0 ; gles_glActiveTexture ( GL_TEXTURE0 ) ; } GLint depthwrite = glstate -> depth . mask ; gl4es_glDisable ( GL_DEPTH_TEST ) ; gl4es_glDisable ( GL_CULL_FACE ) ; if ( depthwrite ) gl4es_glDepthMask ( GL_FALSE ) ; # ifdef TEXSTREAM if ( glstate -> bound_stream [ 0 ] ) { gles_glDisable ( GL_TEXTURE_STREAM_IMG ) ; DeactivateStreaming ( ) ; } # endif <S2SV_StartBug> gl4es_glEnable ( GL_TEXTURE_2D ) ; <S2SV_EndBug> if ( glstate -> actual_tex2d [ 0 ] != texture ) ; gles_glBindTexture ( GL_TEXTURE_2D , texture ) ; if ( hardext . esversion == 1 ) { gl4es_blitTexture_gles1 ( texture , sx , sy , width , height , nwidth , nheight , zoomx , zoomy , vpwidth , vpheight , x , y , mode ) ; } else { gl4es_blitTexture_gles2 ( texture , sx , sy , width , height , nwidth , nheight , zoomx , zoomy , vpwidth , vpheight , x , y , mode ) ; } # ifdef TEXSTREAM if ( glstate -> bound_stream [ 0 ] ) { gltexture_t * tex = glstate -> texture . bound [ 0 ] [ ENABLED_TEX2D ] ; ActivateStreaming ( tex -> streamingID ) ; gles_glEnable ( GL_TEXTURE_STREAM_IMG ) ; } else # endif if ( glstate -> actual_tex2d [ 0 ] != texture ) gles_glBindTexture ( GL_TEXTURE_2D , glstate -> actual_tex2d [ 0 ] ) ; <S2SV_StartBug> if ( depthwrite ) <S2SV_EndBug> gl4es_glDepthMask ( GL_TRUE ) ; gl4es_glPopAttrib ( ) ; } | <S2SV_ModStart> glActiveTexture ) ; <S2SV_ModEnd> LOAD_GLES ( glEnable <S2SV_ModStart> glDisable ) ; realize_textures ( ) ; <S2SV_ModEnd> gl4es_glPushAttrib ( GL_TEXTURE_BIT <S2SV_ModStart> } # endif int tmp = glstate -> enable . texture [ 0 ] ; if ( ! IS_TEX2D ( tmp ) ) gles_glEnable ( GL_TEXTURE_2D ) ; if ( IS_CUBE_MAP ( tmp ) ) gles_glDisable ( GL_TEXTURE_CUBE_MAP <S2SV_ModEnd> ) ; if <S2SV_ModStart> ; if ( ! IS_TEX2D ( tmp ) ) gles_glDisable ( GL_TEXTURE_2D ) ; if ( IS_CUBE_MAP ( tmp ) ) gles_glEnable ( GL_TEXTURE_CUBE_MAP ) ; if ( |
3,205 | CWE-000 int bhnd_erom_iobus_init ( struct bhnd_erom_iobus * iobus , bhnd_addr_t addr , bhnd_size_t size , bus_space_tag_t bst , bus_space_handle_t bsh ) { <S2SV_StartBug> iobus -> eio . map = bhnd_erom_iobus_map ; <S2SV_EndBug> iobus -> eio . read = bhnd_erom_iobus_read ; iobus -> eio . fini = NULL ; iobus -> addr = addr ; iobus -> size = size ; iobus -> bst = bst ; iobus -> bsh = bsh ; iobus -> mapped = false ; return ( 0 ) ; } | <S2SV_ModStart> map = bhnd_erom_iobus_map ; iobus -> eio . tell = bhnd_erom_iobus_tell |
3,206 | CWE-000 static void radeon_ttm_bo_destroy ( struct ttm_buffer_object * tbo ) { struct radeon_bo * bo ; bo = container_of ( tbo , struct radeon_bo , tbo ) ; radeon_update_memory_usage ( bo , bo -> tbo . mem . mem_type , - 1 ) ; mutex_lock ( & bo -> rdev -> gem . mutex ) ; list_del_init ( & bo -> list ) ; mutex_unlock ( & bo -> rdev -> gem . mutex ) ; radeon_bo_clear_surface_reg ( bo ) ; WARN_ON_ONCE ( ! list_empty ( & bo -> va ) ) ; <S2SV_StartBug> drm_gem_object_release ( & bo -> gem_base ) ; <S2SV_EndBug> kfree ( bo ) ; } | <S2SV_ModStart> ) ) ; if ( bo -> gem_base . import_attach ) drm_prime_gem_destroy ( & bo -> gem_base , bo -> tbo . sg ) ; |
3,207 | CWE-000 int si470x_start ( struct si470x_device * radio ) { int retval ; radio -> registers [ POWERCFG ] = POWERCFG_DMUTE | POWERCFG_ENABLE | POWERCFG_RDSM ; retval = si470x_set_register ( radio , POWERCFG ) ; if ( retval < 0 ) goto done ; <S2SV_StartBug> radio -> registers [ SYSCONFIG1 ] = <S2SV_EndBug> ( de << 11 ) & SYSCONFIG1_DE ; retval = si470x_set_register ( radio , SYSCONFIG1 ) ; if ( retval < 0 ) goto done ; radio -> registers [ SYSCONFIG2 ] = ( 0x1f << 8 ) | ( ( radio -> band << 6 ) & SYSCONFIG2_BAND ) | ( ( space << 4 ) & SYSCONFIG2_SPACE ) | 15 ; retval = si470x_set_register ( radio , SYSCONFIG2 ) ; if ( retval < 0 ) goto done ; retval = si470x_set_chan ( radio , radio -> registers [ CHANNEL ] & CHANNEL_CHAN ) ; done : return retval ; } | <S2SV_ModStart> [ SYSCONFIG1 ] |= SYSCONFIG1_RDSIEN | SYSCONFIG1_STCIEN | SYSCONFIG1_RDS ; radio -> registers [ SYSCONFIG1 ] &= ~ SYSCONFIG1_GPIO2 ; radio -> registers [ SYSCONFIG1 ] |= SYSCONFIG1_GPIO2_INT ; if ( de ) radio -> registers [ SYSCONFIG1 ] |= <S2SV_ModEnd> SYSCONFIG1_DE ; retval |
3,208 | CWE-000 ec_code_t * ec_code_create ( ec_gf_t * gf , ec_code_gen_t * gen ) { ec_code_t * code ; code = GF_MALLOC ( sizeof ( ec_code_t ) , ec_mt_ec_code_t ) ; if ( code == NULL ) { <S2SV_StartBug> return NULL ; <S2SV_EndBug> } memset ( code , 0 , sizeof ( ec_code_t ) ) ; INIT_LIST_HEAD ( & code -> spaces ) ; LOCK_INIT ( & code -> lock ) ; code -> gf = gf ; code -> gen = gen ; if ( gen == NULL ) { code -> width = sizeof ( uint64_t ) ; } else { code -> width = gen -> width ; } return code ; } | <S2SV_ModStart> ) { return EC_ERR ( ENOMEM ) <S2SV_ModEnd> ; } memset |
3,209 | CWE-000 int query_continue ( tpl_query * self ) { <S2SV_StartBug> self -> ok = 1 ; <S2SV_EndBug> if ( self -> halt ) return 0 ; if ( ! retry_me ( self ) ) return 0 ; self -> started = gettimeofday_usec ( ) ; self -> is_running ++ ; while ( ! g_abort && ! self -> pl -> abort ) { if ( ! call ( self ) ) { if ( ! self -> is_yielded ) TRACE ( self , 1 , 0 ) ; if ( self -> is_yielded || self -> halt ) break ; if ( ! retry_me ( self ) ) break ; continue ; } TRACE ( self , 0 , 1 ) ; if ( ! follow ( self ) ) break ; } self -> is_running -- ; self -> elapsed = gettimeofday_usec ( ) - self -> started ; if ( ! self -> is_yielded && self -> halt ) { if ( ! self -> pl -> abort && ( self -> halt > ABORT_ABORT ) ) printf ( "ERROR:<S2SV_blank>%s\\n" , self -> halt_s ? self -> halt_s : "ABORT" ) ; self -> ok = 0 ; } return self -> ok ; } | <S2SV_ModStart> self ) { if ( self -> halt ) return 0 ; if ( ! retry_me ( self ) ) return 0 ; <S2SV_ModStart> ok = 1 <S2SV_ModEnd> ; self -> |
3,210 | CWE-000 <S2SV_StartBug> static int expectcomma ( struct emitstate * state ) { <S2SV_EndBug> lexer_nexttok ( state -> lexer , state -> tok ) ; if ( state -> tok -> type != comma ) { printf ( "Expected<S2SV_blank>comma,<S2SV_blank>got<S2SV_blank>%d<S2SV_blank>with<S2SV_blank>val:<S2SV_blank>\\"%s\\"\\n" , state -> tok -> type , state -> tok -> val ) ; return - 1 ; } return 1 ; } | <S2SV_ModStart> int expectcomma ( emitstate_t <S2SV_ModEnd> * state ) |
3,211 | CWE-000 int board_init ( void ) { gd -> bd -> bi_boot_params = PHYS_SDRAM + 0x100 ; # if defined ( CONFIG_ADVANTECH ) && defined ( CONFIG_SUPPORT_LVDS ) setup_lvds_init ( ) ; # endif # ifdef CONFIG_MXC_SPI setup_spi ( ) ; # endif setup_i2c ( 1 , CONFIG_SYS_I2C_SPEED , 0x7f , & i2c_pad_info1 ) ; # ifdef CONFIG_USB_EHCI_MX6 setup_usb ( ) ; # endif # if defined ( CONFIG_MX6DL ) && defined ( CONFIG_MXC_EPDC ) setup_epdc ( ) ; # endif # ifdef CONFIG_FEC_MXC setup_fec ( ) ; # endif <S2SV_StartBug> return 0 ; <S2SV_EndBug> } | <S2SV_ModStart> ; # endif # ifdef CONFIG_ADVANTECH # ifndef CONFIG_MX6QP writel ( 0x514201F0 , 0x021B0400 ) ; writel ( 0x514201F0 , 0x021B4400 ) ; # endif # endif |
3,212 | CWE-000 int rte_event_dev_configure ( uint8_t dev_id , const struct rte_event_dev_config * dev_conf ) { struct rte_eventdev * dev ; struct rte_event_dev_info info ; int diag ; RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET ( dev_id , - EINVAL ) ; dev = & rte_eventdevs [ dev_id ] ; RTE_FUNC_PTR_OR_ERR_RET ( * dev -> dev_ops -> dev_infos_get , - ENOTSUP ) ; RTE_FUNC_PTR_OR_ERR_RET ( * dev -> dev_ops -> dev_configure , - ENOTSUP ) ; if ( dev -> data -> dev_started ) { RTE_EDEV_LOG_ERR ( "device<S2SV_blank>%d<S2SV_blank>must<S2SV_blank>be<S2SV_blank>stopped<S2SV_blank>to<S2SV_blank>allow<S2SV_blank>configuration" , dev_id ) ; return - EBUSY ; } if ( dev_conf == NULL ) return - EINVAL ; ( * dev -> dev_ops -> dev_infos_get ) ( dev , & info ) ; if ( ! ( dev_conf -> event_dev_cfg & RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT ) ) { if ( dev_conf -> dequeue_timeout_ns < info . min_dequeue_timeout_ns || dev_conf -> dequeue_timeout_ns > info . max_dequeue_timeout_ns ) { RTE_EDEV_LOG_ERR ( "dev%d<S2SV_blank>invalid<S2SV_blank>dequeue_timeout_ns=%d" "<S2SV_blank>min_dequeue_timeout_ns=%d<S2SV_blank>max_dequeue_timeout_ns=%d" , dev_id , dev_conf -> dequeue_timeout_ns , info . min_dequeue_timeout_ns , info . max_dequeue_timeout_ns ) ; return - EINVAL ; } } if ( dev_conf -> nb_events_limit > info . max_num_events ) { RTE_EDEV_LOG_ERR ( "dev%d<S2SV_blank>nb_events_limit=%d<S2SV_blank>><S2SV_blank>max_num_events=%d" , dev_id , dev_conf -> nb_events_limit , info . max_num_events ) ; return - EINVAL ; } if ( ! dev_conf -> nb_event_queues ) { RTE_EDEV_LOG_ERR ( "dev%d<S2SV_blank>nb_event_queues<S2SV_blank>cannot<S2SV_blank>be<S2SV_blank>zero" , dev_id ) ; return - EINVAL ; } if ( dev_conf -> nb_event_queues > info . max_event_queues ) { RTE_EDEV_LOG_ERR ( "%d<S2SV_blank>nb_event_queues=%d<S2SV_blank>><S2SV_blank>max_event_queues=%d" , dev_id , dev_conf -> nb_event_queues , info . max_event_queues ) ; return - EINVAL ; } if ( ! dev_conf -> nb_event_ports ) { RTE_EDEV_LOG_ERR ( "dev%d<S2SV_blank>nb_event_ports<S2SV_blank>cannot<S2SV_blank>be<S2SV_blank>zero" , dev_id ) ; return - EINVAL ; } if ( dev_conf -> nb_event_ports > info . max_event_ports ) { RTE_EDEV_LOG_ERR ( "id%d<S2SV_blank>nb_event_ports=%d<S2SV_blank>><S2SV_blank>max_event_ports=<S2SV_blank>%d" , dev_id , dev_conf -> nb_event_ports , info . max_event_ports ) ; return - EINVAL ; } if ( ! dev_conf -> nb_event_queue_flows ) { RTE_EDEV_LOG_ERR ( "dev%d<S2SV_blank>nb_flows<S2SV_blank>cannot<S2SV_blank>be<S2SV_blank>zero" , dev_id ) ; return - EINVAL ; } if ( dev_conf -> nb_event_queue_flows > info . max_event_queue_flows ) { RTE_EDEV_LOG_ERR ( "dev%d<S2SV_blank>nb_flows=%x<S2SV_blank>><S2SV_blank>max_flows=%x" , dev_id , dev_conf -> nb_event_queue_flows , info . max_event_queue_flows ) ; return - EINVAL ; } if ( ! dev_conf -> nb_event_port_dequeue_depth ) { RTE_EDEV_LOG_ERR ( "dev%d<S2SV_blank>nb_dequeue_depth<S2SV_blank>cannot<S2SV_blank>be<S2SV_blank>zero" , dev_id ) ; return - EINVAL ; } <S2SV_StartBug> if ( dev_conf -> nb_event_port_dequeue_depth > <S2SV_EndBug> <S2SV_StartBug> info . max_event_port_dequeue_depth ) { <S2SV_EndBug> RTE_EDEV_LOG_ERR ( "dev%d<S2SV_blank>nb_dq_depth=%d<S2SV_blank>><S2SV_blank>max_dq_depth=%d" , dev_id , dev_conf -> nb_event_port_dequeue_depth , info . max_event_port_dequeue_depth ) ; return - EINVAL ; } if ( ! dev_conf -> nb_event_port_enqueue_depth ) { RTE_EDEV_LOG_ERR ( "dev%d<S2SV_blank>nb_enqueue_depth<S2SV_blank>cannot<S2SV_blank>be<S2SV_blank>zero" , dev_id ) ; return - EINVAL ; } <S2SV_StartBug> if ( dev_conf -> nb_event_port_enqueue_depth > <S2SV_EndBug> <S2SV_StartBug> info . max_event_port_enqueue_depth ) { <S2SV_EndBug> RTE_EDEV_LOG_ERR ( "dev%d<S2SV_blank>nb_enq_depth=%d<S2SV_blank>><S2SV_blank>max_enq_depth=%d" , dev_id , dev_conf -> nb_event_port_enqueue_depth , info . max_event_port_enqueue_depth ) ; return - EINVAL ; } memcpy ( & dev -> data -> dev_conf , dev_conf , sizeof ( dev -> data -> dev_conf ) ) ; diag = rte_event_dev_queue_config ( dev , dev_conf -> nb_event_queues ) ; if ( diag != 0 ) { RTE_EDEV_LOG_ERR ( "dev%d<S2SV_blank>rte_event_dev_queue_config<S2SV_blank>=<S2SV_blank>%d" , dev_id , diag ) ; return diag ; } diag = rte_event_dev_port_config ( dev , dev_conf -> nb_event_ports ) ; if ( diag != 0 ) { rte_event_dev_queue_config ( dev , 0 ) ; RTE_EDEV_LOG_ERR ( "dev%d<S2SV_blank>rte_event_dev_port_config<S2SV_blank>=<S2SV_blank>%d" , dev_id , diag ) ; return diag ; } diag = ( * dev -> dev_ops -> dev_configure ) ( dev ) ; if ( diag != 0 ) { RTE_EDEV_LOG_ERR ( "dev%d<S2SV_blank>dev_configure<S2SV_blank>=<S2SV_blank>%d" , dev_id , diag ) ; rte_event_dev_queue_config ( dev , 0 ) ; rte_event_dev_port_config ( dev , 0 ) ; } dev -> data -> event_dev_cap = info . event_dev_cap ; return diag ; } | <S2SV_ModStart> } if ( ( info . event_dev_cap & RTE_EVENT_DEV_CAP_BURST_MODE ) && ( <S2SV_ModStart> . max_event_port_dequeue_depth ) ) <S2SV_ModStart> ; } if ( ( info . event_dev_cap & RTE_EVENT_DEV_CAP_BURST_MODE ) && <S2SV_ModStart> . max_event_port_enqueue_depth ) ) |
3,213 | CWE-000 bool VID_Is8bit ( void ) { <S2SV_StartBug> return false ; <S2SV_EndBug> } | <S2SV_ModStart> ) { return is8bit <S2SV_ModEnd> ; } <S2SV_null> |
3,214 | CWE-000 static int saved_album_add ( json_object * item , int index , void * arg ) { json_object * jsonalbum ; struct spotify_album album ; struct spotify_track track ; json_object * needle ; json_object * jsontracks ; int track_count ; int dir_id ; int i ; int ret ; if ( ! json_object_object_get_ex ( item , "album" , & jsonalbum ) ) { DPRINTF ( E_LOG , L_SPOTIFY , "Unexpected<S2SV_blank>JSON:<S2SV_blank>Item<S2SV_blank>%d<S2SV_blank>is<S2SV_blank>missing<S2SV_blank>the<S2SV_blank>\'album\'<S2SV_blank>field\\n" , index ) ; return - 1 ; } if ( ! json_object_object_get_ex ( jsonalbum , "tracks" , & needle ) ) { DPRINTF ( E_LOG , L_SPOTIFY , "Unexpected<S2SV_blank>JSON:<S2SV_blank>Item<S2SV_blank>%d<S2SV_blank>is<S2SV_blank>missing<S2SV_blank>the<S2SV_blank>\'tracks\'<S2SV_blank>field\'\\n" , index ) ; return - 1 ; } if ( jparse_array_from_obj ( needle , "items" , & jsontracks ) < 0 ) { DPRINTF ( E_LOG , L_SPOTIFY , "Unexpected<S2SV_blank>JSON:<S2SV_blank>Item<S2SV_blank>%d<S2SV_blank>has<S2SV_blank>an<S2SV_blank>empty<S2SV_blank>\'tracks\'<S2SV_blank>array\\n" , index ) ; return - 1 ; } memset ( & album , 0 , sizeof ( struct spotify_album ) ) ; parse_metadata_album ( jsonalbum , & album ) ; album . added_at = jparse_str_from_obj ( item , "added_at" ) ; album . mtime = jparse_time_from_obj ( item , "added_at" ) ; dir_id = prepare_directories ( album . artist , album . name ) ; db_transaction_begin ( ) ; <S2SV_StartBug> track_count = json_object_array_length ( jsontracks ) ; <S2SV_EndBug> for ( i = 0 ; i < track_count && ret == 0 ; i ++ ) { ret = spotifywebapi_album_track_fetch ( jsontracks , i , & track ) ; if ( ret < 0 || ! track . uri ) continue ; webapi_track_save ( & track , & album , NULL , dir_id ) ; if ( spotify_saved_plid ) db_pl_add_item_bypath ( spotify_saved_plid , track . uri ) ; } db_transaction_end ( ) ; return 0 ; } | <S2SV_ModStart> ( ) ; ret = 0 ; |
3,215 | CWE-000 static void updateSingleFadeInAnimation ( FadeIn * e , int i ) { <S2SV_StartBug> setAnimationScale ( e -> mAnimationIDs [ i ] , * e -> mSize , makePosition ( 0 , 0 , 0 ) ) ; <S2SV_EndBug> setAnimationTransparency ( e -> mAnimationIDs [ i ] , * e -> mAlpha ) ; } | <S2SV_ModStart> i ) { setAnimationSize <S2SV_ModEnd> ( e -> |
3,216 | CWE-000 static int apply_multi_file_filter ( const char * path , const char * src , size_t len , int fd , struct strbuf * dst , const char * cmd , const unsigned int wanted_capability ) { int err ; struct cmd2process * entry ; struct child_process * process ; struct strbuf nbuf = STRBUF_INIT ; struct strbuf filter_status = STRBUF_INIT ; const char * filter_type ; if ( ! cmd_process_map_initialized ) { cmd_process_map_initialized = 1 ; hashmap_init ( & cmd_process_map , ( hashmap_cmp_fn ) cmd2process_cmp , 0 ) ; entry = NULL ; } else { entry = find_multi_file_filter_entry ( & cmd_process_map , cmd ) ; } fflush ( NULL ) ; if ( ! entry ) { entry = start_multi_file_filter ( & cmd_process_map , cmd ) ; if ( ! entry ) return 0 ; } process = & entry -> process ; if ( ! ( wanted_capability & entry -> supported_capabilities ) ) return 0 ; if ( CAP_CLEAN & wanted_capability ) filter_type = "clean" ; else if ( CAP_SMUDGE & wanted_capability ) filter_type = "smudge" ; else die ( "unexpected<S2SV_blank>filter<S2SV_blank>type" ) ; sigchain_push ( SIGPIPE , SIG_IGN ) ; assert ( strlen ( filter_type ) < LARGE_PACKET_DATA_MAX - strlen ( "command=\\n" ) ) ; err = packet_write_fmt_gently ( process -> in , "command=%s\\n" , filter_type ) ; if ( err ) goto done ; err = strlen ( path ) > LARGE_PACKET_DATA_MAX - strlen ( "pathname=\\n" ) ; if ( err ) { error ( "path<S2SV_blank>name<S2SV_blank>too<S2SV_blank>long<S2SV_blank>for<S2SV_blank>external<S2SV_blank>filter" ) ; goto done ; } err = packet_write_fmt_gently ( process -> in , "pathname=%s\\n" , path ) ; if ( err ) goto done ; err = packet_flush_gently ( process -> in ) ; if ( err ) goto done ; if ( fd >= 0 ) err = write_packetized_from_fd ( fd , process -> in ) ; else err = write_packetized_from_buf ( src , len , process -> in ) ; if ( err ) goto done ; read_multi_file_filter_status ( process -> out , & filter_status ) ; err = strcmp ( filter_status . buf , "success" ) ; if ( err ) goto done ; err = read_packetized_to_strbuf ( process -> out , & nbuf ) < 0 ; if ( err ) goto done ; read_multi_file_filter_status ( process -> out , & filter_status ) ; err = strcmp ( filter_status . buf , "success" ) ; done : sigchain_pop ( SIGPIPE ) ; <S2SV_StartBug> if ( err || errno == EPIPE ) { <S2SV_EndBug> if ( ! strcmp ( filter_status . buf , "error" ) ) { } else if ( ! strcmp ( filter_status . buf , "abort" ) ) { entry -> supported_capabilities &= ~ wanted_capability ; } else { error ( "external<S2SV_blank>filter<S2SV_blank>\'%s\'<S2SV_blank>failed" , cmd ) ; kill_multi_file_filter ( & cmd_process_map , entry ) ; } } else { strbuf_swap ( dst , & nbuf ) ; } strbuf_release ( & nbuf ) ; return ! err ; } | <S2SV_ModStart> if ( err <S2SV_ModEnd> ) { if |
3,217 | CWE-000 <S2SV_StartBug> int multipl_winners ( t_skrr * skrr , long * best_cycles , int i ) <S2SV_EndBug> { return ( 1 ) ; } | <S2SV_ModStart> <S2SV_null> <S2SV_null> <S2SV_null> void <S2SV_ModEnd> multipl_winners ( t_skrr <S2SV_ModStart> skrr , long <S2SV_ModEnd> best_cycles , int <S2SV_ModStart> best_cycles , int best_player ) { t_chmp * chmp_tmp ; chmp_tmp = skrr -> chmp ; while ( chmp_tmp ) { if ( ( best_cycles == chmp_tmp -> last_live ) && ( best_player == chmp_tmp -> ac ) ) ft_printf ( "Contestant<S2SV_blank>%ld,<S2SV_blank>" GRN "\\"%s\\",<S2SV_blank>" RESET "has<S2SV_blank>won<S2SV_blank>!\\n" , chmp_tmp -> ac * ( - 1 ) , chmp_tmp -> header . prog_name ) ; chmp_tmp = chmp_tmp -> next ; } <S2SV_ModEnd> } <S2SV_null> <S2SV_null> |
3,218 | CWE-000 int runSequence ( char * block ) { if ( ! block ) { return 0 ; } else { char * command = strsep ( & block , ";" ) ; <S2SV_StartBug> printf ( "successfully<S2SV_blank>separated<S2SV_blank>first<S2SV_blank>command\\n" ) ; <S2SV_EndBug> printf ( "[%s]\\n" , command ) ; <S2SV_StartBug> char * * args = parseCommand ( command ) ; <S2SV_EndBug> printf ( "running<S2SV_blank>command...\\n" ) ; runCommand ( args ) ; runSequence ( block ) ; } } | <S2SV_ModStart> ";" ) ; <S2SV_ModEnd> char * * <S2SV_ModStart> parseCommand ( command <S2SV_ModEnd> ) ; runCommand |
3,219 | CWE-000 void nautilus_canvas_container_set_zoom_level ( NautilusCanvasContainer * container , int new_level ) { NautilusCanvasContainerDetails * details ; int pinned_level ; double pixels_per_unit ; details = container -> details ; pinned_level = new_level ; if ( pinned_level < NAUTILUS_CANVAS_ZOOM_LEVEL_SMALL ) { pinned_level = NAUTILUS_CANVAS_ZOOM_LEVEL_SMALL ; <S2SV_StartBug> } else if ( pinned_level > NAUTILUS_CANVAS_ZOOM_LEVEL_LARGE ) { <S2SV_EndBug> <S2SV_StartBug> pinned_level = NAUTILUS_CANVAS_ZOOM_LEVEL_LARGE ; <S2SV_EndBug> } if ( pinned_level == details -> zoom_level ) { return ; } details -> zoom_level = pinned_level ; pixels_per_unit = ( double ) nautilus_canvas_container_get_icon_size_for_zoom_level ( pinned_level ) / NAUTILUS_CANVAS_ICON_SIZE_STANDARD ; eel_canvas_set_pixels_per_unit ( EEL_CANVAS ( container ) , pixels_per_unit ) ; nautilus_canvas_container_request_update_all_internal ( container , TRUE ) ; } | <S2SV_ModStart> ( pinned_level > NAUTILUS_CANVAS_ZOOM_LEVEL_LARGER <S2SV_ModEnd> ) { pinned_level <S2SV_ModStart> { pinned_level = NAUTILUS_CANVAS_ZOOM_LEVEL_LARGER <S2SV_ModEnd> ; } if |
3,220 | CWE-000 void slab_free ( struct kmem_cache * cache , void * object , void * temp ) <S2SV_StartBug> { <S2SV_EndBug> kernel_printf ( "<S2SV_blank><S2SV_blank>object<S2SV_blank>to<S2SV_blank>free:<S2SV_blank>%x\\n" , object ) ; struct page * temp_page = pages + ( ( unsigned int ) temp >> PAGE_SHIFT ) ; <S2SV_StartBug> kernel_printf ( "<S2SV_blank><S2SV_blank>page<S2SV_blank>to<S2SV_blank>free:<S2SV_blank>%x\\n" , temp_page ) ; <S2SV_EndBug> unsigned int * ptr ; if ( ! ( temp_page -> nr_objs ) ) { kernel_printf ( "<S2SV_blank><S2SV_blank>ERROR<S2SV_blank>:<S2SV_blank>slab_free<S2SV_blank>error!\\n" ) ; while ( 1 ) ; } ptr = ( unsigned int * ) ( ( unsigned char * ) object + cache -> offset ) ; * ptr = ( unsigned int ) temp_page -> freeobj ; temp_page -> freeobj = object ; ( temp_page -> nr_objs ) -- ; if ( list_empty ( & ( temp_page -> list ) ) ) return ; if ( ! ( temp_page -> nr_objs ) ) { __free_pages ( temp_page , 0 ) ; return ; } list_del_init ( & ( temp_page -> list ) ) ; list_add_tail ( & ( temp_page -> list ) , & ( cache -> node . partial ) ) ; } | <S2SV_ModStart> temp ) { if ( flag == 1 ) <S2SV_ModStart> PAGE_SHIFT ) ; if ( flag == 1 ) |
3,221 | CWE-000 int main ( int argc , char * argv [ ] ) { char mark , newFile [ 2 ] = "-n" , filename [ 50 ] , idleInput [ 10 ] , userWin , otherWin , otherMark ; <S2SV_StartBug> int game_over = 0 , user , selector = 0 , index = - 1 , other , move , winner ; <S2SV_EndBug> int userid = getuid ( ) ; if ( argc == 1 ) { printf ( "Save<S2SV_blank>file<S2SV_blank>required.\\nUsage:<S2SV_blank>./tictactoe<S2SV_blank>[-n]<S2SV_blank>[<filename>]\\nUse<S2SV_blank>[-n]<S2SV_blank>to<S2SV_blank>create<S2SV_blank>new<S2SV_blank>file,<S2SV_blank>omit<S2SV_blank>to<S2SV_blank>load<S2SV_blank>existing<S2SV_blank>file\\n" ) ; return 0 ; } struct Tile * board = makeBoard ( SIZE ) ; struct Player * players = makePlayers ( 2 ) ; if ( strcmp ( newFile , argv [ 1 ] ) == 0 ) { user = 0 ; players [ user ] . userid = userid ; strcpy ( filename , argv [ 2 ] ) ; save ( players , filename , board , 0 , SIZE ) ; } else { strcpy ( filename , argv [ 1 ] ) ; if ( fileExists ( filename ) ) { if ( matchPlayers ( argv [ 1 ] , userid ) == - 1 ) { printf ( "\\nThis<S2SV_blank>game<S2SV_blank>is<S2SV_blank>full.\\n\\n" ) ; return 0 ; } else { user = matchPlayers ( argv [ 1 ] , userid ) ; } } else { printf ( "Save<S2SV_blank>file<S2SV_blank>not<S2SV_blank>found.\\nUsage:<S2SV_blank>./tictactoe<S2SV_blank>[-n]<S2SV_blank>[<filename>]\\nUse<S2SV_blank>[-n]<S2SV_blank>to<S2SV_blank>create<S2SV_blank>new<S2SV_blank>file,<S2SV_blank>omit<S2SV_blank>to<S2SV_blank>load<S2SV_blank>existing<S2SV_blank>file\\n" ) ; } } players [ user ] . userid = userid ; selector = getTurn ( 3 , filename ) ; while ( game_over == 0 ) { switch ( user ) { case 0 : mark = 'X' ; other = 1 ; otherMark = 'O' ; index ++ ; break ; case 1 : mark = 'O' ; other = 0 ; otherMark = 'X' ; break ; } <S2SV_StartBug> if ( matchOtherPlayer ( filename , userid ) != - 1 ) { <S2SV_EndBug> <S2SV_StartBug> players [ other ] . userid = matchOtherPlayer ( filename , userid ) ; <S2SV_EndBug> } board = updateBoard ( 6 , filename , 10 , SIZE ) ; userWin = checkVictory ( board , mark ) ; otherWin = checkVictory ( board , otherMark ) ; if ( userWin || otherWin ) { game_over = 1 ; printBoard ( board , SIZE ) ; winner = ( userWin == 1 ) ? user : other ; printf ( "\\nPlayer<S2SV_blank>%d<S2SV_blank>wins!\\n\\n" , winner ) ; save ( players , filename , board , selector , SIZE ) ; return 0 ; } if ( checkTie ( board ) ) { game_over = 1 ; printBoard ( board , SIZE ) ; printf ( "\\nTie!\\n" ) ; save ( players , filename , board , selector , SIZE ) ; return 0 ; } while ( getTurn ( 3 , filename ) != user ) { printBoard ( board , SIZE ) ; printf ( "\\nIt<S2SV_blank>is<S2SV_blank>not<S2SV_blank>your<S2SV_blank>turn<S2SV_blank>player<S2SV_blank>%d.<S2SV_blank>Press<S2SV_blank><ENTER><S2SV_blank>to<S2SV_blank>refresh<S2SV_blank>game:<S2SV_blank>" , user ) ; fflush ( stdin ) ; fgets ( idleInput , 9 , stdin ) ; } board = updateBoard ( 6 , filename , 10 , SIZE ) ; selector = getTurn ( 3 , filename ) ; userWin = checkVictory ( board , mark ) ; otherWin = checkVictory ( board , otherMark ) ; if ( userWin || otherWin ) { game_over = 1 ; printBoard ( board , SIZE ) ; winner = ( userWin == 1 ) ? user : other ; printf ( "\\nPlayer<S2SV_blank>%d<S2SV_blank>wins!\\n\\n" , winner ) ; save ( players , filename , board , selector , SIZE ) ; return 0 ; } if ( checkTie ( board ) ) { game_over = 1 ; printBoard ( board , SIZE ) ; printf ( "\\nTie!\\n" ) ; save ( players , filename , board , selector , SIZE ) ; return 0 ; } printBoard ( board , SIZE ) ; do { move = inputMove ( selector ) ; if ( board [ move ] . mark == 'X' || board [ move ] . mark == 'O' || move < 0 || move > 8 ) { printf ( "Invalid<S2SV_blank>move.<S2SV_blank>" ) ; } } while ( board [ move ] . mark == 'X' || board [ move ] . mark == 'O' || move < 0 || move > 8 ) ; players [ selector ] . moves [ index ] = move ; board [ players [ selector ] . moves [ index ] ] . mark = mark ; selector ^= 1 ; save ( players , filename , board , selector , SIZE ) ; } return 0 ; } | <S2SV_ModStart> move , winner , otherId = 0 <S2SV_ModStart> break ; } otherId = <S2SV_ModEnd> matchOtherPlayer ( filename <S2SV_ModStart> , userid ) ; if ( otherId <S2SV_ModStart> . userid = otherId <S2SV_ModEnd> ; } board |
3,222 | CWE-000 static rn2903_context _rn2903_postinit ( rn2903_context dev , unsigned int baudrate ) { assert ( dev != NULL ) ; if ( rn2903_set_baudrate ( dev , baudrate ) ) { printf ( "%s:<S2SV_blank>rn2903_set_baudrate()<S2SV_blank>failed.\\n" , __FUNCTION__ ) ; rn2903_close ( dev ) ; return NULL ; } if ( rn2903_set_flow_control ( dev , RN2903_FLOW_CONTROL_NONE ) ) { printf ( "%s:<S2SV_blank>rn2903_set_flow_control()<S2SV_blank>failed.\\n" , __FUNCTION__ ) ; rn2903_close ( dev ) ; return NULL ; } rn2903_set_debug ( dev , false ) ; if ( rn2903_reset ( dev ) ) { printf ( "%s:<S2SV_blank>rn2903_reset()<S2SV_blank>failed.\\n" , __FUNCTION__ ) ; rn2903_close ( dev ) ; return NULL ; } if ( rn2903_command ( dev , "sys<S2SV_blank>get<S2SV_blank>hweui" ) ) { printf ( "%s:<S2SV_blank>rn2903_command(sys<S2SV_blank>get<S2SV_blank>hweui)<S2SV_blank>failed.\\n" , __FUNCTION__ ) ; rn2903_close ( dev ) ; return NULL ; } <S2SV_StartBug> strncpy ( dev -> hardware_eui , dev -> resp_data , RN2903_MAX_HEX_EUI64 ) ; <S2SV_EndBug> return dev ; } | <S2SV_ModStart> NULL ; } memcpy <S2SV_ModEnd> ( dev -> |
3,223 | CWE-000 static void test_valid_service_v2 ( void * arg ) { int ret ; ( void ) arg ; { const char * conf = "HiddenServiceDir<S2SV_blank>/tmp/tor-test-hs-RANDOM/hs1\\n" "HiddenServiceVersion<S2SV_blank>2\\n" "HiddenServicePort<S2SV_blank>80\\n" "HiddenServicePort<S2SV_blank>22<S2SV_blank>localhost:22\\n" <S2SV_StartBug> "HiddenServicePort<S2SV_blank>42<S2SV_blank>unix:/path/to/socket\\n" <S2SV_EndBug> "HiddenServiceAuthorizeClient<S2SV_blank>basic<S2SV_blank>alice,bob,eve\\n" "HiddenServiceAllowUnknownPorts<S2SV_blank>1\\n" "HiddenServiceMaxStreams<S2SV_blank>42\\n" "HiddenServiceMaxStreamsCloseCircuit<S2SV_blank>0\\n" "HiddenServiceDirGroupReadable<S2SV_blank>1\\n" "HiddenServiceNumIntroductionPoints<S2SV_blank>7\\n" ; ret = helper_config_service ( conf , 1 ) ; tt_int_op ( ret , OP_EQ , 0 ) ; } { const char * conf = "HiddenServiceDir<S2SV_blank>/tmp/tor-test-hs-RANDOM/hs2\\n" "HiddenServiceVersion<S2SV_blank>2\\n" "HiddenServicePort<S2SV_blank>65535\\n" "HiddenServicePort<S2SV_blank>22<S2SV_blank>1.1.1.1:22\\n" "HiddenServicePort<S2SV_blank>9000<S2SV_blank>unix:/path/to/socket\\n" "HiddenServiceAuthorizeClient<S2SV_blank>stealth<S2SV_blank>charlie,romeo\\n" "HiddenServiceAllowUnknownPorts<S2SV_blank>0\\n" "HiddenServiceMaxStreams<S2SV_blank>42\\n" "HiddenServiceMaxStreamsCloseCircuit<S2SV_blank>0\\n" "HiddenServiceDirGroupReadable<S2SV_blank>1\\n" "HiddenServiceNumIntroductionPoints<S2SV_blank>8\\n" ; ret = helper_config_service ( conf , 1 ) ; tt_int_op ( ret , OP_EQ , 0 ) ; } done : ; } | <S2SV_ModStart> "HiddenServiceVersion<S2SV_blank>2\\n" "HiddenServicePort<S2SV_blank>80\\n" "HiddenServicePort<S2SV_blank>22<S2SV_blank>localhost:22\\n" # ifndef HAVE_SYS_UN_H "HiddenServicePort<S2SV_blank>42<S2SV_blank>unix:/path/to/socket\\n" # endif <S2SV_ModEnd> "HiddenServiceAuthorizeClient<S2SV_blank>basic<S2SV_blank>alice,bob,eve\\n" "HiddenServiceAllowUnknownPorts<S2SV_blank>1\\n" "HiddenServiceMaxStreams<S2SV_blank>42\\n" |
3,224 | CWE-000 void hmp_info_vnc ( Monitor * mon , const QDict * qdict ) { VncInfo2List * info2l ; Error * err = NULL ; info2l = qmp_query_vnc_servers ( & err ) ; if ( err ) { <S2SV_StartBug> error_report_err ( err ) ; <S2SV_EndBug> return ; } if ( ! info2l ) { monitor_printf ( mon , "None\\n" ) ; return ; } while ( info2l ) { VncInfo2 * info = info2l -> value ; monitor_printf ( mon , "%s:\\n" , info -> id ) ; hmp_info_vnc_servers ( mon , info -> server ) ; hmp_info_vnc_clients ( mon , info -> clients ) ; if ( ! info -> server ) { hmp_info_vnc_authcrypt ( mon , "<S2SV_blank><S2SV_blank>" , info -> auth , info -> has_vencrypt ? & info -> vencrypt : NULL ) ; } if ( info -> has_display ) { monitor_printf ( mon , "<S2SV_blank><S2SV_blank>Display:<S2SV_blank>%s\\n" , info -> display ) ; } info2l = info2l -> next ; } qapi_free_VncInfo2List ( info2l ) ; } | <S2SV_ModStart> err ) { hmp_handle_error ( mon , & <S2SV_ModEnd> err ) ; |
3,225 | CWE-000 int main ( ) <S2SV_StartBug> { <S2SV_EndBug> char line [ 1000 ] , line2 [ 1000 ] , line3 [ 1000 ] ; char * id = lpassGetID ( runCommand ( "ls" , "/usr/local/bin/lpass" ) ) ; char * domain = lpassGetData ( "domain" , id , "/usr/local/bin/lpass" ) ; char * email = lpassGetData ( "user" , id , "/usr/local/bin/lpass" ) ; char * password = lpassGetData ( "password" , id , "/usr/local/bin/lpass" ) ; char * newpassword = lpassGeneratePassword ( "/usr/local/bin/lpass" ) ; char * matchdata = malloc ( 5000 ) ; FILE * ls = fmemopen ( email , strlen ( email ) , "r" ) ; FILE * ls1 = fmemopen ( domain , strlen ( domain ) , "r" ) ; FILE * ls2 = fmemopen ( password , strlen ( password ) , "r" ) ; while ( fgets ( line , sizeof ( line ) , ls ) != NULL ) { while ( fgets ( line2 , sizeof ( line2 ) , ls1 ) != NULL ) { while ( fgets ( line3 , sizeof ( line3 ) , ls2 ) != NULL ) { strtok ( line , "\\n" ) ; strtok ( line2 , "\\n" ) ; strtok ( line3 , "\\n" ) ; strcpy ( matchdata , pullDatabaseData ( line ) ) ; if ( checkDomainAgainstBreach ( line2 , matchdata ) == true ) { if ( pythonIO ( line , line3 , newpassword , line2 ) == true ) { lpassChangePassword ( line , newpassword , runCommand ( "generate" , "/usr/local/bin/lpass" ) ) ; } } strcat ( line3 , "\\n" ) ; sleep ( 2 ) ; } strcat ( line2 , "\\n" ) ; } strcat ( line , "\\n" ) ; } fclose ( ls ) ; fclose ( ls1 ) ; fclose ( ls2 ) ; return 0 ; } | <S2SV_ModStart> ( ) { if ( lpassVerifyStatus ( runCommand ( "ls" , "/usr/local/bin/lpass" ) ) == true ) { return 0 ; } |
3,226 | CWE-000 static void range_delete_http_ssl_callback ( guint32 port , gpointer ptr _U_ ) { <S2SV_StartBug> ssl_dissector_delete ( port , http_ssl_handle ) ; <S2SV_EndBug> } | <S2SV_ModStart> ( port , http_tls_handle <S2SV_ModEnd> ) ; } |
3,227 | CWE-000 static int expand_terule_helper ( sepol_handle_t * handle , policydb_t * p , uint32_t * typemap , uint32_t specified , cond_av_list_t * * cond , cond_av_list_t * * other , uint32_t stype , uint32_t ttype , class_perm_node_t * perms , avtab_t * avtab , int enabled ) { avtab_key_t avkey ; avtab_datum_t * avdatump ; avtab_ptr_t node ; class_perm_node_t * cur ; int conflict ; uint32_t oldtype = 0 , spec = 0 ; if ( specified & AVRULE_TRANSITION ) { spec = AVTAB_TRANSITION ; } else if ( specified & AVRULE_MEMBER ) { spec = AVTAB_MEMBER ; } else if ( specified & AVRULE_CHANGE ) { spec = AVTAB_CHANGE ; } else { assert ( 0 ) ; } cur = perms ; while ( cur ) { uint32_t remapped_data = typemap ? typemap [ cur -> data - 1 ] : cur -> data ; avkey . source_type = stype + 1 ; avkey . target_type = ttype + 1 ; avkey . target_class = cur -> tclass ; avkey . specified = spec ; conflict = 0 ; node = avtab_search_node ( & p -> te_avtab , & avkey ) ; if ( node ) { conflict = 1 ; } else { node = avtab_search_node ( & p -> te_cond_avtab , & avkey ) ; if ( node && node -> parse_context != other ) { conflict = 2 ; } } if ( conflict ) { avdatump = & node -> datum ; if ( specified & AVRULE_TRANSITION ) { oldtype = avdatump -> data ; } else if ( specified & AVRULE_MEMBER ) { oldtype = avdatump -> data ; } else if ( specified & AVRULE_CHANGE ) { oldtype = avdatump -> data ; } if ( oldtype == remapped_data ) { if ( ( conflict == 1 && cond == NULL ) || node -> parse_context == cond ) return EXPAND_RULE_SUCCESS ; ERR ( handle , "duplicate<S2SV_blank>TE<S2SV_blank>rule<S2SV_blank>for<S2SV_blank>%s<S2SV_blank>%s:%s<S2SV_blank>%s" , p -> p_type_val_to_name [ avkey . source_type - 1 ] , p -> p_type_val_to_name [ avkey . target_type - 1 ] , p -> p_class_val_to_name [ avkey . target_class - 1 ] , p -> p_type_val_to_name [ oldtype - 1 ] ) ; return EXPAND_RULE_CONFLICT ; } ERR ( handle , "conflicting<S2SV_blank>TE<S2SV_blank>rule<S2SV_blank>for<S2SV_blank>(%s,<S2SV_blank>%s:%s):<S2SV_blank><S2SV_blank>old<S2SV_blank>was<S2SV_blank>%s,<S2SV_blank>new<S2SV_blank>is<S2SV_blank>%s" , p -> p_type_val_to_name [ avkey . source_type - 1 ] , p -> p_type_val_to_name [ avkey . target_type - 1 ] , p -> p_class_val_to_name [ avkey . target_class - 1 ] , p -> p_type_val_to_name [ oldtype - 1 ] , p -> p_type_val_to_name [ remapped_data - 1 ] ) ; return EXPAND_RULE_CONFLICT ; } <S2SV_StartBug> node = find_avtab_node ( handle , avtab , & avkey , cond , NULL , NULL ) ; <S2SV_EndBug> if ( ! node ) return - 1 ; if ( enabled ) { node -> key . specified |= AVTAB_ENABLED ; } else { node -> key . specified &= ~ AVTAB_ENABLED ; } avdatump = & node -> datum ; if ( specified & AVRULE_TRANSITION ) { avdatump -> data = remapped_data ; } else if ( specified & AVRULE_MEMBER ) { avdatump -> data = remapped_data ; } else if ( specified & AVRULE_CHANGE ) { avdatump -> data = remapped_data ; } else { assert ( 0 ) ; } cur = cur -> next ; } return EXPAND_RULE_SUCCESS ; } | <S2SV_ModStart> cond , NULL <S2SV_ModEnd> ) ; if |
3,228 | CWE-000 static int venus_hfi_disable_regulator ( struct regulator_info * rinfo ) { int rc = 0 ; dprintk ( VIDC_DBG , "Disabling<S2SV_blank>regulator<S2SV_blank>%s\\n" , rinfo -> name ) ; rc = venus_hfi_acquire_regulator ( rinfo ) ; if ( rc ) { dprintk ( VIDC_WARN , "Failed<S2SV_blank>to<S2SV_blank>acquire<S2SV_blank>control<S2SV_blank>on<S2SV_blank>%s\\n" , rinfo -> name ) ; goto disable_regulator_failed ; } rc = regulator_disable ( rinfo -> regulator ) ; if ( rc ) { dprintk ( VIDC_WARN , "Failed<S2SV_blank>to<S2SV_blank>disable<S2SV_blank>%s:<S2SV_blank>%d\\n" , rinfo -> name , rc ) ; goto disable_regulator_failed ; } return 0 ; disable_regulator_failed : <S2SV_StartBug> WARN_ON ( 1 ) ; <S2SV_EndBug> return rc ; } | <S2SV_ModStart> : WARN_ON ( msm_vidc_debug & VIDC_INFO <S2SV_ModEnd> ) ; return |
3,229 | CWE-000 enum qnnp_status qnnp_create_max_pooling2d_nhwc_u8 ( uint32_t input_padding_top , uint32_t input_padding_right , uint32_t input_padding_bottom , uint32_t input_padding_left , uint32_t pooling_height , uint32_t pooling_width , uint32_t stride_height , uint32_t stride_width , uint32_t dilation_height , uint32_t dilation_width , size_t channels , uint8_t output_min , uint8_t output_max , qnnp_operator_t * max_pooling_out ) { qnnp_operator_t max_pooling = NULL ; enum qnnp_status status = qnnp_status_uninitialized ; if ( ! qnnp_params . initialized ) { <S2SV_StartBug> qnnp_log_error ( "qnnp_create_max_pooling2d_nhwc_q8<S2SV_blank>failed<S2SV_blank>because<S2SV_blank>QNNPACK<S2SV_blank>is<S2SV_blank>not<S2SV_blank>properly<S2SV_blank>initialized" ) ; <S2SV_EndBug> goto error ; } status = qnnp_status_invalid_parameter ; const uint32_t pooling_size = pooling_height * pooling_width ; if ( pooling_size == 0 ) { qnnp_log_error ( "failed<S2SV_blank>to<S2SV_blank>create<S2SV_blank>max<S2SV_blank>pooling<S2SV_blank>with<S2SV_blank>%" PRIu32 "x%" PRIu32 "<S2SV_blank>pooling<S2SV_blank>size:<S2SV_blank>" "pooling<S2SV_blank>size<S2SV_blank>dimensions<S2SV_blank>must<S2SV_blank>be<S2SV_blank>non-zero" , pooling_width , pooling_height ) ; goto error ; } if ( pooling_size == 1 ) { qnnp_log_error ( "failed<S2SV_blank>to<S2SV_blank>create<S2SV_blank>max<S2SV_blank>pooling<S2SV_blank>with<S2SV_blank>1<S2SV_blank>pooling<S2SV_blank>element:<S2SV_blank>" "1x1<S2SV_blank>pooling<S2SV_blank>is<S2SV_blank>meaningless" ) ; goto error ; } if ( stride_height == 0 || stride_width == 0 ) { qnnp_log_error ( "failed<S2SV_blank>to<S2SV_blank>create<S2SV_blank>max<S2SV_blank>pooling<S2SV_blank>with<S2SV_blank>%" PRIu32 "x%" PRIu32 "<S2SV_blank>stride:<S2SV_blank>" "stride<S2SV_blank>dimensions<S2SV_blank>must<S2SV_blank>be<S2SV_blank>non-zero" , stride_width , stride_height ) ; goto error ; } if ( dilation_height == 0 || dilation_width == 0 ) { qnnp_log_error ( "failed<S2SV_blank>to<S2SV_blank>create<S2SV_blank>max<S2SV_blank>pooling<S2SV_blank>with<S2SV_blank>%" PRIu32 "x%" PRIu32 "<S2SV_blank>dilation:<S2SV_blank>" "dilation<S2SV_blank>dimensions<S2SV_blank>must<S2SV_blank>be<S2SV_blank>non-zero" , dilation_width , dilation_height ) ; goto error ; } if ( channels == 0 ) { qnnp_log_error ( "failed<S2SV_blank>to<S2SV_blank>create<S2SV_blank>max<S2SV_blank>pooling<S2SV_blank>with<S2SV_blank>%zu<S2SV_blank>channels:<S2SV_blank>" "number<S2SV_blank>of<S2SV_blank>channels<S2SV_blank>must<S2SV_blank>be<S2SV_blank>non-zero" , channels ) ; goto error ; } status = qnnp_status_out_of_memory ; max_pooling = calloc ( 1 , sizeof ( struct qnnp_operator ) ) ; if ( max_pooling == NULL ) { qnnp_log_error ( "failed<S2SV_blank>to<S2SV_blank>allocate<S2SV_blank>%zu<S2SV_blank>bytes<S2SV_blank>for<S2SV_blank>qnnp_operator<S2SV_blank>structure" , sizeof ( struct qnnp_operator ) ) ; goto error ; } max_pooling -> input_padding_top = input_padding_top ; max_pooling -> input_padding_right = input_padding_right ; max_pooling -> input_padding_bottom = input_padding_bottom ; max_pooling -> input_padding_left = input_padding_left ; max_pooling -> kernel_height = pooling_height ; max_pooling -> kernel_width = pooling_width ; max_pooling -> stride_height = stride_height ; max_pooling -> stride_width = stride_width ; max_pooling -> dilation_height = dilation_height ; max_pooling -> dilation_width = dilation_width ; max_pooling -> channels = channels ; max_pooling -> maxpool_quantization_params = qnnp_compute_maxpool_quantization_params ( output_min , output_max ) ; max_pooling -> ukernel_type = qnnp_ukernel_type_max_pooling ; max_pooling -> format = qnnp_format_quint8 ; * max_pooling_out = max_pooling ; return qnnp_status_success ; error : qnnp_delete_operator ( max_pooling ) ; return status ; } | <S2SV_ModStart> { qnnp_log_error ( "qnnp_create_max_pooling2d_nhwc_u8<S2SV_blank>failed<S2SV_blank>because<S2SV_blank>QNNPACK<S2SV_blank>is<S2SV_blank>not<S2SV_blank>properly<S2SV_blank>initialized" <S2SV_ModEnd> ) ; goto |
3,230 | CWE-000 LOCALPROC DiskUI_Finish ( void ) { <S2SV_StartBug> C3D_RenderTargetSetClear ( MainRenderTarget , C3D_CLEAR_ALL , 0xFF , 0 ) ; <S2SV_EndBug> IsInDiskInsertUI = falseblnr ; <S2SV_StartBug> } <S2SV_EndBug> | <S2SV_ModStart> { C3D_RenderTargetSetClear ( SubRenderTarget <S2SV_ModEnd> , C3D_CLEAR_ALL , <S2SV_ModStart> = falseblnr ; CanScrollDown = falseblnr ; SelectedEntry = 0 ; ScrollOffset = 0 ; VertexCount = 0 ; |
3,231 | CWE-000 static ngx_rtmp_gop_cache_t * ngx_rtmp_gop_free_cache ( ngx_rtmp_session_t * s , ngx_rtmp_gop_cache_t * cache ) { ngx_rtmp_core_srv_conf_t * cscf ; ngx_rtmp_live_ctx_t * ctx ; ngx_rtmp_gop_cache_ctx_t * gop_cache_ctx ; ngx_rtmp_gop_frame_t * frame ; ctx = ngx_rtmp_get_module_ctx ( s , ngx_rtmp_live_module ) ; if ( ctx == NULL ) { return NULL ; } gop_cache_ctx = & ctx -> gop_cache_ctx ; cscf = ngx_rtmp_get_module_srv_conf ( s , ngx_rtmp_core_module ) ; if ( cscf == NULL ) { <S2SV_StartBug> return ; <S2SV_EndBug> } if ( cache -> video_seq_header_data ) { ngx_rtmp_free_shared_chain ( cscf , cache -> video_seq_header_data ) ; cache -> video_seq_header_data = NULL ; } if ( cache -> meta_data ) { ngx_rtmp_free_shared_chain ( cscf , cache -> meta_data ) ; cache -> meta_data = NULL ; } for ( frame = cache -> head ; frame ; frame = frame -> next ) { ngx_rtmp_gop_free_frame ( s , frame ) ; } cache -> tail -> next = gop_cache_ctx -> free_frame ; gop_cache_ctx -> free_frame = cache -> head ; -- gop_cache_ctx -> cache_cnt ; return cache -> next ; } | <S2SV_ModStart> ) { return NULL |
3,232 | CWE-000 void sv_PrintObjectID ( FILE * out , SECItem * oid , char * m ) { <S2SV_StartBug> char * name ; <S2SV_EndBug> SECOidData * oiddata ; oiddata = SECOID_FindOID ( oid ) ; if ( oiddata == NULL ) { sv_PrintAsHex ( out , oid , m ) ; return ; } name = oiddata -> desc ; if ( m != NULL ) fprintf ( out , "%s" , m ) ; fprintf ( out , "%s\\n" , name ) ; } | <S2SV_ModStart> m ) { const |
3,233 | CWE-000 int mlx5_ib_arm_cq ( struct ib_cq * ibcq , enum ib_cq_notify_flags flags ) { struct mlx5_core_dev * mdev = to_mdev ( ibcq -> device ) -> mdev ; struct mlx5_ib_cq * cq = to_mcq ( ibcq ) ; <S2SV_StartBug> void __iomem * uar_page = mdev -> priv . uuari . uars [ 0 ] . map ; <S2SV_EndBug> unsigned long irq_flags ; int ret = 0 ; spin_lock_irqsave ( & cq -> lock , irq_flags ) ; if ( cq -> notify_flags != IB_CQ_NEXT_COMP ) cq -> notify_flags = flags & IB_CQ_SOLICITED_MASK ; if ( ( flags & IB_CQ_REPORT_MISSED_EVENTS ) && ! list_empty ( & cq -> wc_list ) ) ret = 1 ; spin_unlock_irqrestore ( & cq -> lock , irq_flags ) ; mlx5_cq_arm ( & cq -> mcq , ( flags & IB_CQ_SOLICITED_MASK ) == IB_CQ_SOLICITED ? MLX5_CQ_DB_REQ_NOT_SOL : MLX5_CQ_DB_REQ_NOT , uar_page , <S2SV_StartBug> MLX5_GET_DOORBELL_LOCK ( & mdev -> priv . cq_uar_lock ) , <S2SV_EndBug> to_mcq ( ibcq ) -> mcq . cons_index ) ; return ret ; } | <S2SV_ModStart> -> priv . uar -> <S2SV_ModEnd> map ; unsigned <S2SV_ModStart> , uar_page , <S2SV_ModEnd> to_mcq ( ibcq |
3,234 | CWE-000 static int jbd2_block_tag_csum_verify ( journal_t * j , journal_block_tag_t * tag , void * buf , __u32 sequence ) { <S2SV_StartBug> __u32 provided , calculated ; <S2SV_EndBug> <S2SV_StartBug> if ( ! JBD2_HAS_INCOMPAT_FEATURE ( j , JBD2_FEATURE_INCOMPAT_CSUM_V2 ) ) <S2SV_EndBug> return 1 ; sequence = cpu_to_be32 ( sequence ) ; calculated = jbd2_chksum ( j , j -> j_csum_seed , ( __u8 * ) & sequence , sizeof ( sequence ) ) ; calculated = jbd2_chksum ( j , calculated , buf , j -> j_blocksize ) ; <S2SV_StartBug> provided = be32_to_cpu ( tag -> t_checksum ) ; <S2SV_EndBug> return provided == cpu_to_be32 ( calculated ) ; <S2SV_StartBug> } <S2SV_EndBug> | <S2SV_ModStart> sequence ) { journal_block_tag3_t * tag3 = ( journal_block_tag3_t * ) tag ; __u32 <S2SV_ModEnd> calculated ; if <S2SV_ModStart> if ( ! jbd2_journal_has_csum_v2or3 ( j <S2SV_ModEnd> ) ) return <S2SV_ModStart> j_blocksize ) ; if ( JBD2_HAS_INCOMPAT_FEATURE ( j , JBD2_FEATURE_INCOMPAT_CSUM_V3 ) ) return tag3 -> t_checksum <S2SV_ModEnd> == cpu_to_be32 ( <S2SV_ModStart> calculated ) ; else return tag -> t_checksum == cpu_to_be16 ( calculated ) ; |
3,235 | CWE-000 int gf_cmd_log ( const char * domain , const char * fmt , ... ) { va_list ap ; char timestr [ 64 ] ; struct timeval tv = { 0 , } ; char * str1 = NULL ; char * str2 = NULL ; char * msg = NULL ; size_t len = 0 ; int ret = 0 ; int fd = - 1 ; glusterfs_ctx_t * ctx = NULL ; ctx = THIS -> ctx ; if ( ! ctx ) return - 1 ; if ( ! ctx -> log . cmdlogfile ) return - 1 ; if ( ! domain || ! fmt ) { gf_msg_trace ( "glusterd" , 0 , "logging:<S2SV_blank>invalid<S2SV_blank>argument\\n" ) ; return - 1 ; } ret = gettimeofday ( & tv , NULL ) ; if ( ret == - 1 ) goto out ; va_start ( ap , fmt ) ; gf_time_fmt ( timestr , sizeof timestr , tv . tv_sec , gf_timefmt_FT ) ; snprintf ( timestr + strlen ( timestr ) , GF_LOG_TIMESTR_SIZE - strlen ( timestr ) , ".%" GF_PRI_SUSECONDS , tv . tv_usec ) ; ret = gf_asprintf ( & str1 , "[%s]<S2SV_blank>%s<S2SV_blank>:<S2SV_blank>" , timestr , domain ) ; if ( ret == - 1 ) { goto out ; } ret = vasprintf ( & str2 , fmt , ap ) ; if ( ret == - 1 ) { goto out ; } va_end ( ap ) ; len = strlen ( str1 ) ; msg = GF_MALLOC ( len + strlen ( str2 ) + 1 , gf_common_mt_char ) ; if ( ! msg ) { goto out ; } strcpy ( msg , str1 ) ; strcpy ( msg + len , str2 ) ; if ( ctx -> log . cmd_history_logrotate ) { ctx -> log . cmd_history_logrotate = 0 ; if ( ctx -> log . cmdlogfile ) { fclose ( ctx -> log . cmdlogfile ) ; ctx -> log . cmdlogfile = NULL ; } fd = open ( ctx -> log . cmd_log_filename , O_CREAT | O_WRONLY | O_APPEND , S_IRUSR | S_IWUSR ) ; if ( fd < 0 ) { gf_msg ( THIS -> name , GF_LOG_CRITICAL , errno , LG_MSG_FILE_OP_FAILED , "failed<S2SV_blank>to<S2SV_blank>open<S2SV_blank>" "logfile<S2SV_blank>\\"%s\\"<S2SV_blank>\\n" , ctx -> log . cmd_log_filename ) ; ret = - 1 ; goto out ; } ctx -> log . cmdlogfile = fdopen ( fd , "a" ) ; if ( ! ctx -> log . cmdlogfile ) { gf_msg ( THIS -> name , GF_LOG_CRITICAL , errno , LG_MSG_FILE_OP_FAILED , "failed<S2SV_blank>to<S2SV_blank>open<S2SV_blank>logfile<S2SV_blank>\\"%s\\"" "<S2SV_blank>\\n" , ctx -> log . cmd_log_filename ) ; ret = - 1 ; goto out ; } } fprintf ( ctx -> log . cmdlogfile , "%s\\n" , msg ) ; fflush ( ctx -> log . cmdlogfile ) ; out : GF_FREE ( msg ) ; GF_FREE ( str1 ) ; <S2SV_StartBug> FREE ( str2 ) ; <S2SV_EndBug> va_end ( ap ) ; return ret ; } | <S2SV_ModStart> str1 ) ; free <S2SV_ModEnd> ( str2 ) |
3,236 | CWE-000 void * floorplus ( void * linfo ) { while ( 1 ) { liftinfo * p ; p = ( liftinfo * ) malloc ( sizeof ( liftinfo ) ) ; p = ( liftinfo * ) linfo ; if ( p -> idle == 0 ) { Sleep ( 2000 ) ; if ( p -> movingup == 1 ) { p -> currentfloor ++ ; printf ( "\\ncurrent:%d" , p -> currentfloor ) ; if ( p -> up -> n > 0 && p -> currentfloor == p -> up -> req_queue [ 0 ] . floor ) { printf ( "<S2SV_blank><S2SV_blank>OPEN<S2SV_blank>AT<S2SV_blank>%d" , p -> currentfloor ) ; deq ( p -> up ) ; if ( p -> up -> n == 0 && p -> down -> n == 0 ) { p -> idle = 1 ; printf ( "\\nLift<S2SV_blank>Idle" ) ; } } <S2SV_StartBug> if ( p -> currentfloor == 5 ) { <S2SV_EndBug> p -> movingup = 0 ; } } else { p -> currentfloor -- ; printf ( "\\ncurrent:%d" , p -> currentfloor ) ; if ( p -> down -> n > 0 && p -> currentfloor == p -> down -> req_queue [ 0 ] . floor ) { printf ( "<S2SV_blank><S2SV_blank>OPEN<S2SV_blank>AT<S2SV_blank>%d" , p -> currentfloor ) ; deq ( p -> down ) ; if ( p -> up -> n == 0 && p -> down -> n == 0 ) { p -> idle = 1 ; printf ( "\\nLift<S2SV_blank>Idle" ) ; } } if ( p -> currentfloor == 1 ) { p -> movingup = 1 ; } } } } } | <S2SV_ModStart> -> currentfloor == NUM_OF_FLOORS <S2SV_ModEnd> ) { p |
3,237 | CWE-000 static void usb_ep0_setup ( ) { usb_ep0_out_data = ( __xdata uint8_t * ) & usb_setup ; usb_ep0_out_len = 8 ; usb_ep0_fill ( ) ; if ( usb_ep0_out_len != 0 ) return ; if ( usb_setup . dir_type_recip & USB_DIR_IN ) { if ( usb_setup . length ) usb_ep0_state = USB_EP0_DATA_IN ; else usb_ep0_state = USB_EP0_IDLE ; } else { if ( usb_setup . length ) usb_ep0_state = USB_EP0_DATA_OUT ; else usb_ep0_state = USB_EP0_IDLE ; } USBINDEX = 0 ; if ( usb_ep0_state == USB_EP0_IDLE ) USBCS0 = USBCS0_CLR_OUTPKT_RDY | USBCS0_DATA_END ; else USBCS0 = USBCS0_CLR_OUTPKT_RDY ; usb_ep0_in_data = usb_ep0_in_buf ; usb_ep0_in_len = 0 ; switch ( usb_setup . dir_type_recip & USB_SETUP_TYPE_MASK ) { case USB_TYPE_STANDARD : switch ( usb_setup . dir_type_recip & USB_SETUP_RECIP_MASK ) { case USB_RECIP_DEVICE : switch ( usb_setup . request ) { case USB_REQ_GET_STATUS : usb_ep0_queue_byte ( 0 ) ; usb_ep0_queue_byte ( 0 ) ; break ; case USB_REQ_SET_ADDRESS : usb_set_address ( usb_setup . value ) ; break ; case USB_REQ_GET_DESCRIPTOR : usb_get_descriptor ( usb_setup . value ) ; break ; case USB_REQ_GET_CONFIGURATION : usb_ep0_queue_byte ( usb_configuration ) ; break ; case USB_REQ_SET_CONFIGURATION : usb_configuration = usb_setup . value ; usb_set_configuration ( ) ; break ; } break ; case USB_RECIP_INTERFACE : # pragma disable_warning 110 switch ( usb_setup . request ) { case USB_REQ_GET_STATUS : usb_ep0_queue_byte ( 0 ) ; usb_ep0_queue_byte ( 0 ) ; break ; case USB_REQ_GET_INTERFACE : usb_ep0_queue_byte ( 0 ) ; break ; case USB_REQ_SET_INTERFACE : break ; } break ; case USB_RECIP_ENDPOINT : switch ( usb_setup . request ) { case USB_REQ_GET_STATUS : usb_ep0_queue_byte ( 0 ) ; usb_ep0_queue_byte ( 0 ) ; break ; } break ; } break ; case USB_TYPE_CLASS : switch ( usb_setup . request ) { case SET_LINE_CODING : usb_ep0_out_len = 7 ; usb_ep0_out_data = ( __xdata uint8_t * ) & usb_line_coding ; break ; case GET_LINE_CODING : usb_ep0_in_len = 7 ; usb_ep0_in_data = ( uint8_t * ) & usb_line_coding ; break ; case SET_CONTROL_LINE_STATE : break ; } break ; } <S2SV_StartBug> if ( usb_ep0_state != USB_EP0_DATA_OUT ) { <S2SV_EndBug> if ( usb_setup . length < usb_ep0_in_len ) usb_ep0_in_len = usb_setup . length ; usb_ep0_flush ( ) ; } } | <S2SV_ModStart> if ( usb_ep0_state == USB_EP0_DATA_IN <S2SV_ModEnd> ) { if |
3,238 | CWE-000 static switch_status_t switch_g729_decode ( switch_codec_t * codec , switch_codec_t * other_codec , void * encoded_data , uint32_t encoded_data_len , uint32_t encoded_rate , void * decoded_data , uint32_t * decoded_data_len , uint32_t * decoded_rate , unsigned int * flag ) { struct g729_context * context = codec -> private_info ; if ( ! context ) { return SWITCH_STATUS_FALSE ; } int x ; int framesize ; uint32_t new_len = 0 ; uint8_t * edp = encoded_data ; int16_t * ddp = decoded_data ; if ( encoded_data_len == 0 ) { <S2SV_StartBug> bcg729Decoder ( context -> decoder_object , NULL , 10 , 1 , 0 , 0 , ddp ) ; <S2SV_EndBug> ddp += 80 ; decoded_data_len = ( uint32_t * ) 160 ; switch_log_printf ( SWITCH_CHANNEL_LOG , SWITCH_LOG_ERROR , "g729<S2SV_blank>zero<S2SV_blank>length<S2SV_blank>frame\\n" ) ; return SWITCH_STATUS_SUCCESS ; } for ( x = 0 ; x < encoded_data_len && new_len < * decoded_data_len ; x += framesize ) { if ( encoded_data_len - x < 8 ) { framesize = 2 ; } else { framesize = 10 ; } <S2SV_StartBug> bcg729Decoder ( context -> decoder_object , edp , 10 , 0 , 0 , 0 , ddp ) ; <S2SV_EndBug> ddp += 80 ; edp += framesize ; new_len += 160 ; } if ( new_len <= * decoded_data_len ) { * decoded_data_len = new_len ; } else { switch_log_printf ( SWITCH_CHANNEL_LOG , SWITCH_LOG_ERROR , "buffer<S2SV_blank>overflow!!!\\n" ) ; return SWITCH_STATUS_FALSE ; } return SWITCH_STATUS_SUCCESS ; } | <S2SV_ModStart> , NULL , 1 , 0 <S2SV_ModEnd> , 0 , <S2SV_ModStart> , edp , 0 <S2SV_ModEnd> , 0 , |
3,239 | CWE-000 int do_page_fault ( struct pt_regs * regs , unsigned long address , unsigned long error_code ) { enum ctx_state prev_state = exception_enter ( ) ; struct vm_area_struct * vma ; struct mm_struct * mm = current -> mm ; unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE ; int code = SEGV_MAPERR ; int is_write = 0 ; int trap = TRAP ( regs ) ; int is_exec = trap == 0x400 ; int fault ; int rc = 0 , store_update_sp = 0 ; # if ! ( defined ( CONFIG_4xx ) || defined ( CONFIG_BOOKE ) ) if ( trap == 0x400 ) error_code &= 0x48200000 ; else is_write = error_code & DSISR_ISSTORE ; # else is_write = error_code & ESR_DST ; # endif # ifdef CONFIG_PPC_ICSWX if ( error_code & ICSWX_DSI_UCT ) { rc = acop_handle_fault ( regs , address , error_code ) ; if ( rc ) goto bail ; } # endif if ( notify_page_fault ( regs ) ) goto bail ; if ( unlikely ( debugger_fault_handler ( regs ) ) ) goto bail ; if ( ! user_mode ( regs ) && ( is_exec || ( address >= TASK_SIZE ) ) ) { rc = SIGSEGV ; goto bail ; } # if ! ( defined ( CONFIG_4xx ) || defined ( CONFIG_BOOKE ) || defined ( CONFIG_PPC_BOOK3S_64 ) ) if ( error_code & DSISR_DABRMATCH ) { do_break ( regs , address , error_code ) ; goto bail ; } # endif if ( ! arch_irq_disabled_regs ( regs ) ) local_irq_enable ( ) ; if ( faulthandler_disabled ( ) || mm == NULL ) { if ( ! user_mode ( regs ) ) { rc = SIGSEGV ; goto bail ; } printk ( KERN_EMERG "Page<S2SV_blank>fault<S2SV_blank>in<S2SV_blank>user<S2SV_blank>mode<S2SV_blank>with<S2SV_blank>" "faulthandler_disabled()<S2SV_blank>=<S2SV_blank>%d<S2SV_blank>mm<S2SV_blank>=<S2SV_blank>%p\\n" , faulthandler_disabled ( ) , mm ) ; printk ( KERN_EMERG "NIP<S2SV_blank>=<S2SV_blank>%lx<S2SV_blank><S2SV_blank>MSR<S2SV_blank>=<S2SV_blank>%lx\\n" , regs -> nip , regs -> msr ) ; die ( "Weird<S2SV_blank>page<S2SV_blank>fault" , regs , SIGSEGV ) ; } perf_sw_event ( PERF_COUNT_SW_PAGE_FAULTS , 1 , regs , address ) ; if ( user_mode ( regs ) ) store_update_sp = store_updates_sp ( regs ) ; if ( user_mode ( regs ) ) flags |= FAULT_FLAG_USER ; if ( ! down_read_trylock ( & mm -> mmap_sem ) ) { if ( ! user_mode ( regs ) && ! search_exception_tables ( regs -> nip ) ) goto bad_area_nosemaphore ; retry : down_read ( & mm -> mmap_sem ) ; } else { might_sleep ( ) ; } vma = find_vma ( mm , address ) ; if ( ! vma ) goto bad_area ; if ( vma -> vm_start <= address ) goto good_area ; if ( ! ( vma -> vm_flags & VM_GROWSDOWN ) ) goto bad_area ; if ( address + 0x100000 < vma -> vm_end ) { struct pt_regs * uregs = current -> thread . regs ; if ( uregs == NULL ) goto bad_area ; if ( address + 2048 < uregs -> gpr [ 1 ] && ! store_update_sp ) goto bad_area ; } if ( expand_stack ( vma , address ) ) goto bad_area ; good_area : code = SEGV_ACCERR ; # if defined ( CONFIG_6xx ) if ( error_code & 0x95700000 ) goto bad_area ; # endif # if defined ( CONFIG_8xx ) if ( error_code & 0x10000000 ) goto bad_area ; # endif if ( is_exec ) { if ( ! ( vma -> vm_flags & VM_EXEC ) && ( cpu_has_feature ( CPU_FTR_NOEXECUTE ) || ! ( vma -> vm_flags & ( VM_READ | VM_WRITE ) ) ) ) goto bad_area ; <S2SV_StartBug> # ifdef CONFIG_PPC_STD_MMU <S2SV_EndBug> WARN_ON_ONCE ( error_code & DSISR_PROTFAULT ) ; # endif } else if ( is_write ) { if ( ! ( vma -> vm_flags & VM_WRITE ) ) goto bad_area ; flags |= FAULT_FLAG_WRITE ; } else { if ( ! ( vma -> vm_flags & ( VM_READ | VM_EXEC | VM_WRITE ) ) ) goto bad_area ; <S2SV_StartBug> WARN_ON_ONCE ( error_code & DSISR_PROTFAULT ) ; <S2SV_EndBug> <S2SV_StartBug> } <S2SV_EndBug> fault = handle_mm_fault ( vma , address , flags ) ; if ( unlikely ( fault & ( VM_FAULT_RETRY | VM_FAULT_ERROR ) ) ) { if ( fault & VM_FAULT_SIGSEGV ) goto bad_area ; rc = mm_fault_error ( regs , address , fault ) ; if ( rc >= MM_FAULT_RETURN ) goto bail ; else rc = 0 ; } if ( flags & FAULT_FLAG_ALLOW_RETRY ) { if ( fault & VM_FAULT_MAJOR ) { current -> maj_flt ++ ; perf_sw_event ( PERF_COUNT_SW_PAGE_FAULTS_MAJ , 1 , regs , address ) ; # ifdef CONFIG_PPC_SMLPAR if ( firmware_has_feature ( FW_FEATURE_CMO ) ) { u32 page_ins ; preempt_disable ( ) ; page_ins = be32_to_cpu ( get_lppaca ( ) -> page_ins ) ; page_ins += 1 << PAGE_FACTOR ; get_lppaca ( ) -> page_ins = cpu_to_be32 ( page_ins ) ; preempt_enable ( ) ; } # endif } else { current -> min_flt ++ ; perf_sw_event ( PERF_COUNT_SW_PAGE_FAULTS_MIN , 1 , regs , address ) ; } if ( fault & VM_FAULT_RETRY ) { flags &= ~ FAULT_FLAG_ALLOW_RETRY ; flags |= FAULT_FLAG_TRIED ; goto retry ; } } up_read ( & mm -> mmap_sem ) ; goto bail ; bad_area : up_read ( & mm -> mmap_sem ) ; bad_area_nosemaphore : if ( user_mode ( regs ) ) { _exception ( SIGSEGV , regs , code , address ) ; goto bail ; } if ( is_exec && ( error_code & DSISR_PROTFAULT ) ) printk_ratelimited ( KERN_CRIT "kernel<S2SV_blank>tried<S2SV_blank>to<S2SV_blank>execute<S2SV_blank>NX-protected" "<S2SV_blank>page<S2SV_blank>(%lx)<S2SV_blank>-<S2SV_blank>exploit<S2SV_blank>attempt?<S2SV_blank>(uid:<S2SV_blank>%d)\\n" , address , from_kuid ( & init_user_ns , current_uid ( ) ) ) ; rc = SIGSEGV ; bail : exception_exit ( prev_state ) ; return rc ; } | <S2SV_ModStart> goto bad_area ; <S2SV_ModEnd> } else if <S2SV_ModStart> goto bad_area ; } # ifdef CONFIG_PPC_STD_MMU if ( ! radix_enabled ( ) && ! is_write ) <S2SV_ModStart> DSISR_PROTFAULT ) ; # endif <S2SV_ModEnd> fault = handle_mm_fault |
3,240 | CWE-000 ssize_t read ( int fd , void * buf , size_t nbyte ) { coroutine_t * co = coroutine_self ( ) ; if ( ! is_enable_sys_hook ( co ) ) { return gSysRead ( fd , buf , nbyte ) ; } rpchook_t * lp = get_by_fd ( fd ) ; if ( ! lp ) { return gSysRead ( fd , buf , nbyte ) ; } ssize_t n = 0 ; do { ssize_t ret = gSysRead ( fd , buf + n , nbyte - n ) ; if ( ret == 0 ) { return n ; } if ( ret > 0 ) { n += ret ; continue ; } if ( n > 0 ) { return n ; } if ( errno == EAGAIN || errno == EWOULDBLOCK ) { struct pollfd pf = { 0 } ; pf . fd = fd ; pf . events = ( POLLIN | POLLERR | POLLHUP ) ; if ( ! poll ( & pf , 1 , - 1 ) && co -> task -> timeout ) { close ( fd ) ; errno = EBADF ; return - 1 ; } <S2SV_StartBug> } <S2SV_EndBug> } while ( n < nbyte ) ; return n ; } | <S2SV_ModStart> 1 ; } continue ; } return ret ; <S2SV_ModEnd> } while ( |
3,241 | CWE-000 <S2SV_StartBug> void uIP_linked_on ( void ) { APPLIST_LOOP ( uIP_LINKED_ON ) ; } <S2SV_EndBug> | <S2SV_ModStart> void ) { APPLIST_LOOP_LINKCHANGED <S2SV_ModEnd> ( uIP_LINKED_ON ) |
3,242 | CWE-000 ssize_t spinRead ( const int sock , unsigned char * buf , size_t bufsize ) { const size_t origBufSize = bufsize ; int n ; keepReading : if ( bufsize == 0 ) { return origBufSize ; } errno = 0 ; n = readNBytes ( sock , buf , bufsize ) ; if ( n == - 1 ) { return - 1 ; } if ( n == 0 ) { if ( errno == EAGAIN ) { goto keepReading ; } else { <S2SV_StartBug> return 0 ; <S2SV_EndBug> } } if ( ( size_t ) n == bufsize ) { return origBufSize ; } else { bufsize -= n ; buf += n ; goto keepReading ; } } | <S2SV_ModStart> } else { perror ( "SpinRead" ) ; |
3,243 | CWE-000 int FindVar ( WORD * v , WORD * term ) { WORD * t , * tstop , * m , * mstop , * f , * fstop , * a , * astop ; GETSTOP ( term , tstop ) ; t = term + 1 ; while ( t < tstop ) { if ( * v == * t && * v < FUNCTION ) { switch ( * v ) { case SYMBOL : m = t + 2 ; mstop = t + t [ 1 ] ; while ( m < mstop ) { if ( * m == v [ 1 ] ) return ( 1 ) ; m += 2 ; } break ; case INDEX : case VECTOR : InVe : m = t + 2 ; mstop = t + t [ 1 ] ; while ( m < mstop ) { if ( * m == v [ 1 ] ) return ( 1 ) ; m ++ ; } break ; case DOTPRODUCT : m = t + 2 ; mstop = t + t [ 1 ] ; while ( m < mstop ) { if ( * m == v [ 1 ] && m [ 1 ] == v [ 2 ] ) return ( 1 ) ; if ( * m == v [ 2 ] && m [ 1 ] == v [ 1 ] ) return ( 1 ) ; m += 3 ; } break ; } } else if ( * v == VECTOR && * t == INDEX ) goto InVe ; else if ( * v == INDEX && * t == VECTOR ) goto InVe ; else if ( ( * v == VECTOR || * v == INDEX ) && * t == DOTPRODUCT ) { m = t + 2 ; mstop = t + t [ 1 ] ; while ( m < mstop ) { <S2SV_StartBug> if ( v [ 1 ] == t [ 0 ] || v [ 1 ] == t [ 1 ] ) return ( 1 ) ; <S2SV_EndBug> t += 3 ; } } else if ( * t >= FUNCTION ) { if ( * v == FUNCTION && v [ 1 ] == * t ) return ( 1 ) ; if ( functions [ * t - FUNCTION ] . spec > 0 ) { if ( * v == VECTOR || * v == INDEX ) { int i ; for ( i = FUNHEAD ; i < t [ 1 ] ; i ++ ) { if ( * v == t [ i ] ) return ( 1 ) ; } } } else { fstop = t + t [ 1 ] ; f = t + FUNHEAD ; while ( f < fstop ) { if ( * f <= 0 ) { switch ( * f ) { case - SYMBOL : if ( * v == SYMBOL && v [ 1 ] == f [ 1 ] ) return ( 1 ) ; f += 2 ; break ; case - VECTOR : case - MINVECTOR : case - INDEX : if ( ( * v == VECTOR || * v == INDEX ) && ( v [ 1 ] == f [ 1 ] ) ) return ( 1 ) ; f += 2 ; break ; case - SNUMBER : f += 2 ; break ; default : if ( * v == FUNCTION && v [ 1 ] == - * f && * f <= - FUNCTION ) return ( 1 ) ; if ( * f <= - FUNCTION ) f ++ ; else f += 2 ; break ; } } else { a = f + ARGHEAD ; astop = f + * f ; while ( a < astop ) { if ( FindVar ( v , a ) == 1 ) return ( 1 ) ; a += * a ; } f = astop ; } } } } t += t [ 1 ] ; } return ( 0 ) ; } | <S2SV_ModStart> 1 ] == m <S2SV_ModEnd> [ 0 ] <S2SV_ModStart> 1 ] == m [ 1 ] ) return ( 1 ) ; m <S2SV_ModEnd> += 3 ; |
3,244 | CWE-000 void CR_SpritePosition ( void ) { unsigned short int nArg ; short int nCount = 0 ; char cChar ; <S2SV_StartBug> if ( nEvent >= 0 && nEvent <= 19 ) <S2SV_EndBug> { EndEvent ( ) ; nEvent = - 1 ; } cChar = ( char ) ( nScreen - 1 ) ; fwrite ( & cChar , 1 , 1 , pWorkNme ) ; for ( nCount = 0 ; nCount < 4 ; nCount ++ ) { nArg = NextKeyword ( ) ; if ( nArg == INS_NUM ) { nArg = GetNum ( 8 ) ; cChar = ( char ) nArg ; fwrite ( & cChar , 1 , 1 , pWorkNme ) ; } else { Error ( "Missing<S2SV_blank>SPRITEPOSITION<S2SV_blank>data" ) ; } } nPositions ++ ; } | <S2SV_ModStart> 0 && nEvent < NUM_EVENTS <S2SV_ModEnd> ) { EndEvent |
3,245 | CWE-000 BOOL Trace_Workspace_Point_In_Bound ( const Trace_Workspace * tw , const double pos [ 3 ] ) { <S2SV_StartBug> if ( pos [ 0 ] >= 0 ) { <S2SV_EndBug> int i ; for ( i = 0 ; i < 3 ; i ++ ) { if ( tw -> trace_range [ i ] >= 0.0 ) { if ( pos [ i ] < tw -> trace_range [ i ] ) { return FALSE ; } } if ( tw -> trace_range [ i + 3 ] >= 0.0 ) { if ( pos [ i ] > tw -> trace_range [ i + 3 ] ) { return FALSE ; } } } } return TRUE ; } | <S2SV_ModStart> pos [ 0 ] >= 0 && pos [ 1 ] >= 0 && pos [ 2 |
3,246 | CWE-000 void gfs2_glmutex_unlock ( struct gfs2_glock * gl ) { spin_lock ( & gl -> gl_spin ) ; <S2SV_StartBug> clear_bit ( GLF_LOCK , & gl -> gl_flags ) ; <S2SV_EndBug> run_queue ( gl ) ; BUG_ON ( ! spin_is_locked ( & gl -> gl_spin ) ) ; spin_unlock ( & gl -> gl_spin ) ; } | <S2SV_ModStart> -> gl_flags ) ; gl -> gl_owner = NULL ; gl -> gl_ip = 0 |
3,247 | CWE-000 static void main_timer_func ( ) { main_timer_active = 0 ; <S2SV_StartBug> if ( ! moving_state ) { <S2SV_EndBug> glutTimerFunc ( TIMER_INTERVAL , on_move , MOVE_TIMER_ID ) ; moving_state = 1 ; } if ( y > 1 && ! GO_UP ) { <S2SV_StartBug> y -= height_decrease ; <S2SV_EndBug> glutPostRedisplay ( ) ; } <S2SV_StartBug> printf ( "[MAIN_TIMER]<S2SV_blank>pause=%d\\n" , pause_pressed ) ; <S2SV_EndBug> if ( ! main_timer_active && ! pause_pressed ) { glutTimerFunc ( TIMER_INTERVAL , main_timer_func , MAIN_TIMER_ID ) ; main_timer_active = 1 ; } } | <S2SV_ModStart> ; if ( num_of_pressed_keys <S2SV_ModEnd> ) { glutTimerFunc <S2SV_ModStart> GO_UP ) { printf ( "Should<S2SV_blank>decrease<S2SV_blank>height!\\n" ) ; <S2SV_ModStart> ) ; } <S2SV_ModEnd> if ( ! |
3,248 | CWE-000 int delegate_op ( stack_t * * stack , char * op , unsigned int line_number ) { int i = 0 ; instruction_t all_ops [ ] = { { "push" , instruction_push } , { "pall" , instruction_pall } , { "pint" , instruction_pint } , { "pop" , instruction_pop } , { "swap" , instruction_swap } , { "add" , instruction_add } , { "nop" , instruction_nop } , { NULL , NULL } } ; for ( i = 0 ; all_ops [ i ] . opcode ; i ++ ) { if ( strcmp ( op , all_ops [ i ] . opcode ) == 0 ) { all_ops [ i ] . f ( stack , line_number ) ; return ( EXIT_SUCCESS ) ; } } <S2SV_StartBug> return ( EXIT_FAILURE ) ; <S2SV_EndBug> <S2SV_StartBug> } <S2SV_EndBug> | <S2SV_ModStart> ; } } if ( strlen ( op ) != 0 ) { printf ( "L%u:<S2SV_blank>unknown<S2SV_blank>instruction<S2SV_blank>%s\\n" , line_number , op ) ; exit <S2SV_ModEnd> ( EXIT_FAILURE ) <S2SV_ModStart> ) ; } return ( EXIT_SUCCESS ) ; } |
3,249 | CWE-000 static # endif int tcp_v6_do_rcv ( struct sock * sk , struct sk_buff * skb ) { struct ipv6_pinfo * np = inet6_sk ( sk ) ; struct tcp_sock * tp ; struct sk_buff * opt_skb = NULL ; if ( skb -> protocol == htons ( ETH_P_IP ) ) return tcp_v4_do_rcv ( sk , skb ) ; # ifdef CONFIG_MPTCP if ( is_meta_sk ( sk ) ) return mptcp_v6_do_rcv ( sk , skb ) ; # endif if ( tcp_filter ( sk , skb ) ) goto discard ; if ( np -> rxopt . all ) opt_skb = skb_clone ( skb , sk_gfp_atomic ( sk , GFP_ATOMIC ) ) ; if ( sk -> sk_state == TCP_ESTABLISHED ) { struct dst_entry * dst = sk -> sk_rx_dst ; sock_rps_save_rxhash ( sk , skb ) ; if ( dst ) { if ( inet_sk ( sk ) -> rx_dst_ifindex != skb -> skb_iif || dst -> ops -> check ( dst , np -> rx_dst_cookie ) == NULL ) { dst_release ( dst ) ; sk -> sk_rx_dst = NULL ; } } tcp_rcv_established ( sk , skb , tcp_hdr ( skb ) , skb -> len ) ; if ( opt_skb ) goto ipv6_pktoptions ; return 0 ; } if ( skb -> len < tcp_hdrlen ( skb ) || tcp_checksum_complete ( skb ) ) goto csum_err ; if ( sk -> sk_state == TCP_LISTEN ) { struct sock * nsk = tcp_v6_hnd_req ( sk , skb ) ; if ( ! nsk ) goto discard ; if ( nsk != sk ) { sock_rps_save_rxhash ( nsk , skb ) ; if ( tcp_child_process ( sk , nsk , skb ) ) goto reset ; if ( opt_skb ) __kfree_skb ( opt_skb ) ; return 0 ; } } else sock_rps_save_rxhash ( sk , skb ) ; if ( tcp_rcv_state_process ( sk , skb , tcp_hdr ( skb ) , skb -> len ) ) goto reset ; if ( opt_skb ) goto ipv6_pktoptions ; return 0 ; reset : tcp_v6_send_reset ( sk , skb ) ; discard : if ( opt_skb ) __kfree_skb ( opt_skb ) ; kfree_skb ( skb ) ; return 0 ; csum_err : TCP_INC_STATS_BH ( sock_net ( sk ) , TCP_MIB_CSUMERRORS ) ; TCP_INC_STATS_BH ( sock_net ( sk ) , TCP_MIB_INERRS ) ; goto discard ; ipv6_pktoptions : tp = tcp_sk ( sk ) ; if ( TCP_SKB_CB ( opt_skb ) -> end_seq == tp -> rcv_nxt && ! ( ( 1 << sk -> sk_state ) & ( TCPF_CLOSE | TCPF_LISTEN ) ) ) { if ( np -> rxopt . bits . rxinfo || np -> rxopt . bits . rxoinfo ) np -> mcast_oif = tcp_v6_iif ( opt_skb ) ; if ( np -> rxopt . bits . rxhlim || np -> rxopt . bits . rxohlim ) np -> mcast_hops = ipv6_hdr ( opt_skb ) -> hop_limit ; if ( np -> rxopt . bits . rxflow || np -> rxopt . bits . rxtclass ) np -> rcv_flowinfo = ip6_flowinfo ( ipv6_hdr ( opt_skb ) ) ; if ( np -> repflow ) np -> flow_label = ip6_flowlabel ( ipv6_hdr ( opt_skb ) ) ; if ( ipv6_opt_accepted ( sk , opt_skb , & TCP_SKB_CB ( opt_skb ) -> header . h6 ) ) { skb_set_owner_r ( opt_skb , sk ) ; <S2SV_StartBug> opt_skb = xchg ( & np -> pktoptions , opt_skb ) ; <S2SV_EndBug> } else { __kfree_skb ( opt_skb ) ; opt_skb = xchg ( & np -> pktoptions , NULL ) ; } } kfree_skb ( opt_skb ) ; return 0 ; } | <S2SV_ModStart> sk ) ; tcp_v6_restore_cb ( opt_skb ) ; |
3,250 | CWE-000 void http_get_clean_mc_handle ( struct http_get_s * mc ) { g_slist_free_full ( mc -> chunks , ( GDestroyNotify ) http_get_clean_chunk ) ; <S2SV_StartBug> if ( mc -> ec_handle ) <S2SV_EndBug> <S2SV_StartBug> liberasurecode_instance_destroy ( mc -> ec_handle ) ; <S2SV_EndBug> if ( mc -> buffer_queue ) g_queue_free ( mc -> buffer_queue ) ; if ( mc -> mc_range ) g_free ( mc -> mc_range ) ; if ( mc -> mhandle ) curl_multi_cleanup ( mc -> mhandle ) ; g_free ( mc ) ; } | <S2SV_ModStart> -> ec_handle ) { int res = <S2SV_ModStart> ec_handle ) ; g_assert ( res == 0 ) ; } |
3,251 | CWE-000 static void mjs_load ( struct mjs * mjs ) { mjs_val_t res = MJS_UNDEFINED ; mjs_val_t arg0 = mjs_arg ( mjs , 0 ) ; mjs_val_t arg1 = mjs_arg ( mjs , 1 ) ; if ( mjs_is_string ( arg0 ) ) { const char * path = mjs_get_cstring ( mjs , & arg0 ) ; mjs_val_t * bottom = vptr ( & mjs -> scopes , 0 ) , global = * bottom ; mjs_own ( mjs , & global ) ; if ( mjs_is_object ( arg1 ) ) * bottom = arg1 ; mjs_err_t ret = mjs_exec_file ( mjs , path , & res ) ; if ( ret != MJS_OK ) { <S2SV_StartBug> mjs_set_errorf ( mjs , ret , "failed<S2SV_blank>to<S2SV_blank>read<S2SV_blank>file<S2SV_blank>\\"%s\\"" , path ) ; <S2SV_EndBug> goto clean ; } if ( mjs_is_object ( arg1 ) ) * bottom = global ; clean : mjs_disown ( mjs , & global ) ; } mjs_return ( mjs , res ) ; } | <S2SV_ModStart> MJS_OK ) { arg0 = mjs_arg ( mjs , 0 ) ; path = mjs_get_cstring ( mjs , & arg0 ) ; |
3,252 | CWE-000 int gf119_disp_new_ ( const struct nv50_disp_func * func , struct nvkm_device * device , int index , struct nvkm_disp * * pdisp ) { <S2SV_StartBug> u32 heads = fls ( nvkm_rd32 ( device , 0x612004 ) & 0xf ) ; <S2SV_EndBug> return nv50_disp_new_ ( func , device , index , heads , pdisp ) ; } | <S2SV_ModStart> { u32 heads ; if ( device -> quirk && device -> quirk -> use_heads ) heads <S2SV_ModStart> ) & 0xf ) ; else heads = nvkm_rd32 ( device , 0x022448 |
3,253 | CWE-000 static int mlx5e_set_wol ( struct net_device * netdev , struct ethtool_wolinfo * wol ) { struct mlx5e_priv * priv = netdev_priv ( netdev ) ; struct mlx5_core_dev * mdev = priv -> mdev ; __u32 wol_supported = mlx5e_get_wol_supported ( mdev ) ; u32 mlx5_wol_mode ; if ( ! wol_supported ) <S2SV_StartBug> return - ENOTSUPP ; <S2SV_EndBug> if ( wol -> wolopts & ~ wol_supported ) return - EINVAL ; mlx5_wol_mode = mlx5e_refomrat_wol_mode_linux_to_mlx5 ( wol -> wolopts ) ; return mlx5_set_port_wol ( mdev , mlx5_wol_mode ) ; } | <S2SV_ModStart> ) return - EOPNOTSUPP <S2SV_ModEnd> ; if ( |
3,254 | CWE-000 static void * buslogic_init ( device_t * info ) { x54x_t * dev ; wchar_t * bios_rom_name ; uint16_t bios_rom_size ; uint16_t bios_rom_mask ; uint8_t has_autoscsi_rom ; wchar_t * autoscsi_rom_name ; uint16_t autoscsi_rom_size ; uint8_t has_scam_rom ; wchar_t * scam_rom_name ; uint16_t scam_rom_size ; FILE * f ; buslogic_data_t * bl ; dev = x54x_init ( info ) ; dev -> ven_data = malloc ( sizeof ( buslogic_data_t ) ) ; memset ( dev -> ven_data , 0x00 , sizeof ( buslogic_data_t ) ) ; bl = ( buslogic_data_t * ) dev -> ven_data ; dev -> bus = info -> flags ; dev -> Base = device_get_config_hex16 ( "base" ) ; dev -> Irq = device_get_config_int ( "irq" ) ; dev -> DmaChannel = device_get_config_int ( "dma" ) ; dev -> HostID = 7 ; dev -> setup_info_len = sizeof ( buslogic_setup_t ) ; dev -> reset_duration = BUSLOGIC_RESET_DURATION_US ; dev -> max_id = 7 ; dev -> int_geom_writable = 1 ; <S2SV_StartBug> bl -> chip = info -> local ; <S2SV_EndBug> bl -> PCIBase = 0 ; bl -> MMIOBase = 0 ; bl -> has_bios = device_get_config_int ( "bios" ) ; dev -> ven_cmd_phase1 = buslogic_cmd_phase1 ; dev -> ven_get_host_id = buslogic_get_host_id ; dev -> ven_get_irq = buslogic_get_irq ; dev -> ven_get_dma = buslogic_get_dma ; dev -> get_ven_param_len = buslogic_param_len ; dev -> ven_cmds = buslogic_cmds ; dev -> interrupt_type = buslogic_interrupt_type ; dev -> is_aggressive_mode = buslogic_is_aggressive_mode ; dev -> get_ven_data = buslogic_setup_data ; dev -> ven_reset = buslogic_reset ; strcpy ( dev -> vendor , "BusLogic" ) ; if ( ( dev -> Base != 0 ) && ! ( dev -> bus & DEVICE_MCA ) ) { x54x_io_set ( dev , dev -> Base ) ; } switch ( bl -> chip ) { case CHIP_BUSLOGIC_ISA_542 : strcpy ( dev -> name , "BT-542BH" ) ; bios_rom_name = L"roms/scsi/buslogic/BT-542BH_BIOS.rom" ; bios_rom_size = 0x4000 ; bios_rom_mask = 0x3fff ; has_autoscsi_rom = 0 ; has_scam_rom = 0 ; dev -> fw_rev = "AA335" ; bl -> fAggressiveRoundRobinMode = 1 ; break ; case CHIP_BUSLOGIC_ISA : default : strcpy ( dev -> name , "BT-545S" ) ; bios_rom_name = L"roms/scsi/buslogic/BT-545S_BIOS.rom" ; bios_rom_size = 0x4000 ; bios_rom_mask = 0x3fff ; has_autoscsi_rom = 1 ; autoscsi_rom_name = L"roms/scsi/buslogic/BT-545S_AutoSCSI.rom" ; autoscsi_rom_size = 0x4000 ; has_scam_rom = 0 ; dev -> fw_rev = "AA421E" ; break ; # ifdef BUSLOGIC_NOT_WORKING case CHIP_BUSLOGIC_MCA : strcpy ( dev -> name , "BT-640A" ) ; bios_rom_name = L"roms/scsi/buslogic/BT-640_BIOS.rom" ; bios_rom_size = 0x4000 ; bios_rom_mask = 0x3fff ; has_autoscsi_rom = 1 ; autoscsi_rom_name = L"roms/scsi/buslogic/BT-640_AutoSCSI.rom" ; autoscsi_rom_size = 0x4000 ; has_scam_rom = 0 ; dev -> fw_rev = "BA421E" ; break ; # endif case CHIP_BUSLOGIC_PCI : strcpy ( dev -> name , "BT-958D" ) ; bios_rom_name = L"roms/scsi/buslogic/BT-958D_BIOS.rom" ; bios_rom_size = 0x4000 ; bios_rom_mask = 0x3fff ; has_autoscsi_rom = 1 ; autoscsi_rom_name = L"roms/scsi/buslogic/BT-958D_AutoSCSI.rom" ; autoscsi_rom_size = 0x8000 ; has_scam_rom = 1 ; scam_rom_name = L"roms/scsi/buslogic/BT-958D_SCAM.rom" ; scam_rom_size = 0x0200 ; <S2SV_StartBug> dev -> fw_rev = "AA507B" ; <S2SV_EndBug> break ; } memset ( bl -> AutoSCSIROM , 0xff , 32768 ) ; memset ( bl -> SCAMData , 0x00 , 65536 ) ; if ( bl -> has_bios ) { bl -> bios_size = bios_rom_size ; bl -> bios_mask = 0xffffc000 ; rom_init ( & bl -> bios , bios_rom_name , 0xd8000 , bios_rom_size , bios_rom_mask , 0 , MEM_MAPPING_EXTERNAL ) ; if ( has_autoscsi_rom ) { f = rom_fopen ( autoscsi_rom_name , L"rb" ) ; if ( f ) { fread ( bl -> AutoSCSIROM , 1 , autoscsi_rom_size , f ) ; fclose ( f ) ; f = NULL ; } } if ( has_scam_rom ) { f = rom_fopen ( scam_rom_name , L"rb" ) ; if ( f ) { fread ( bl -> SCAMData , 1 , scam_rom_size , f ) ; fclose ( f ) ; f = NULL ; } } } else { bl -> bios_size = 0 ; bl -> bios_mask = 0 ; } if ( bl -> chip == CHIP_BUSLOGIC_PCI ) { dev -> pci_slot = pci_add_card ( PCI_ADD_NORMAL , BuslogicPCIRead , BuslogicPCIWrite , dev ) ; buslogic_pci_bar [ 0 ] . addr_regs [ 0 ] = 1 ; buslogic_pci_bar [ 1 ] . addr_regs [ 0 ] = 0 ; buslogic_pci_regs [ 0x04 ] = 3 ; if ( bl -> has_bios ) { buslogic_pci_bar [ 2 ] . addr = 0xFFFFC000 ; } else { buslogic_pci_bar [ 2 ] . addr = 0 ; } x54x_mem_init ( dev , 0xfffd0000 ) ; x54x_mem_disable ( dev ) ; mem_mapping_disable ( & bl -> bios . mapping ) ; } buslogic_log ( "Buslogic<S2SV_blank>on<S2SV_blank>port<S2SV_blank>0x%04X\\n" , dev -> Base ) ; x54x_reset_ctrl ( dev , CTRL_HRST ) ; if ( bl -> chip != CHIP_BUSLOGIC_ISA_542 ) { BuslogicInitializeLocalRAM ( bl ) ; BuslogicInitializeAutoSCSIRam ( dev ) ; } return ( dev ) ; } | <S2SV_ModStart> = 1 ; dev -> cdrom_boot = 0 ; <S2SV_ModStart> fw_rev = "AA507B" ; dev -> cdrom_boot = 1 |
3,255 | CWE-000 DWORD VmKdcRpcEpRegister ( rpc_binding_vector_p_t pServerBinding , rpc_if_handle_t pInterfaceSpec , PCSTR pszAnnotation ) { <S2SV_StartBug> DWORD dwError = ERROR_SUCCESS ; <S2SV_EndBug> error_status_t rpcStatus = rpc_s_ok ; rpc_ep_register ( pInterfaceSpec , pServerBinding , NULL , ( idl_char * ) pszAnnotation , ( unsigned32 * ) & rpcStatus ) ; dwError = rpcStatus ; return dwError ; <S2SV_StartBug> } <S2SV_EndBug> | <S2SV_ModStart> = ERROR_SUCCESS ; # if 1 return dwError ; # else <S2SV_ModStart> return dwError ; # endif |
3,256 | CWE-000 static size_t ZSTD_frameHeaderSize_internal ( const void * src , size_t srcSize , ZSTD_format_e format ) { size_t const minInputSize = ( format == ZSTD_f_zstd1_magicless ) ? ZSTD_frameHeaderSize_prefix - ZSTD_frameIdSize : ZSTD_frameHeaderSize_prefix ; <S2SV_StartBug> ZSTD_STATIC_ASSERT ( ZSTD_frameHeaderSize_prefix >= ZSTD_frameIdSize ) ; <S2SV_EndBug> ZSTD_STATIC_ASSERT ( ( unsigned ) ZSTD_f_zstd1 < ( unsigned ) ZSTD_f_zstd1_magicless ) ; assert ( ( unsigned ) format <= ZSTD_f_zstd1_magicless ) ; if ( srcSize < minInputSize ) return ERROR ( srcSize_wrong ) ; { BYTE const fhd = ( ( const BYTE * ) src ) [ minInputSize - 1 ] ; U32 const dictID = fhd & 3 ; U32 const singleSegment = ( fhd >> 5 ) & 1 ; U32 const fcsId = fhd >> 6 ; return minInputSize + ! singleSegment + ZSTD_did_fieldSize [ dictID ] + ZSTD_fcs_fieldSize [ fcsId ] + ( singleSegment && ! fcsId ) ; } } | <S2SV_ModStart> ; ZSTD_STATIC_ASSERT ( ZSTD_FRAMEHEADERSIZE_PREFIX >= ZSTD_FRAMEIDSIZE <S2SV_ModEnd> ) ; ZSTD_STATIC_ASSERT |
3,257 | CWE-000 static void <S2SV_StartBug> _spdk_scsi_lun_hot_remove ( void * arg1 , void * arg2 ) <S2SV_EndBug> { <S2SV_StartBug> struct spdk_scsi_lun * lun = arg1 ; <S2SV_EndBug> assert ( lun -> lcore == spdk_env_get_current_core ( ) ) ; lun -> removed = true ; if ( lun -> hotremove_cb ) { lun -> hotremove_cb ( lun , lun -> hotremove_ctx ) ; } lun -> hotplug_poller = spdk_poller_register ( spdk_scsi_lun_hotplug , lun , 0 ) ; } | <S2SV_ModStart> void * arg1 <S2SV_ModEnd> ) { struct <S2SV_ModStart> lun = arg1 <S2SV_ModEnd> ; lun -> |
3,258 | CWE-000 static int ca_get_ca_info ( struct dst_state * state ) { int srcPtr , dstPtr , i , num_ids ; static u8 slot_command [ 8 ] = { 0x07 , 0x40 , 0x00 , 0x00 , 0x02 , 0x00 , 0x00 , 0xff } ; const int in_system_id_pos = 8 , out_system_id_pos = 4 , in_num_ids_pos = 7 ; put_checksum ( & slot_command [ 0 ] , slot_command [ 0 ] ) ; if ( ( dst_put_ci ( state , slot_command , sizeof ( slot_command ) , state -> messages , GET_REPLY ) ) < 0 ) { dprintk ( verbose , DST_CA_ERROR , 1 , "<S2SV_blank>-->dst_put_ci<S2SV_blank>FAILED<S2SV_blank>!" ) ; <S2SV_StartBug> return - 1 ; <S2SV_EndBug> } dprintk ( verbose , DST_CA_INFO , 1 , "<S2SV_blank>-->dst_put_ci<S2SV_blank>SUCCESS<S2SV_blank>!" ) ; dprintk ( verbose , DST_CA_INFO , 0 , "<S2SV_blank>DST<S2SV_blank>data<S2SV_blank>=<S2SV_blank>[" ) ; for ( i = 0 ; i < state -> messages [ 0 ] + 1 ; i ++ ) { dprintk ( verbose , DST_CA_INFO , 0 , "<S2SV_blank>0x%02x" , state -> messages [ i ] ) ; } dprintk ( verbose , DST_CA_INFO , 0 , "]\\n" ) ; num_ids = state -> messages [ in_num_ids_pos ] ; if ( num_ids >= 100 ) { num_ids = 100 ; dprintk ( verbose , DST_CA_ERROR , 1 , "Invalid<S2SV_blank>number<S2SV_blank>of<S2SV_blank>ids<S2SV_blank>(>100).<S2SV_blank>Recovering." ) ; } put_command_and_length ( & state -> messages [ 0 ] , CA_INFO , num_ids * 2 ) ; dprintk ( verbose , DST_CA_INFO , 0 , "<S2SV_blank>CA_INFO<S2SV_blank>=<S2SV_blank>[" ) ; srcPtr = in_system_id_pos ; dstPtr = out_system_id_pos ; for ( i = 0 ; i < num_ids ; i ++ ) { dprintk ( verbose , DST_CA_INFO , 0 , "<S2SV_blank>0x%02x%02x" , state -> messages [ srcPtr + 0 ] , state -> messages [ srcPtr + 1 ] ) ; state -> messages [ dstPtr + 0 ] = state -> messages [ srcPtr + 0 ] ; state -> messages [ dstPtr + 1 ] = state -> messages [ srcPtr + 1 ] ; srcPtr += 2 ; dstPtr += 2 ; } dprintk ( verbose , DST_CA_INFO , 0 , "]\\n" ) ; return 0 ; } | <S2SV_ModStart> ; return - EIO <S2SV_ModEnd> ; } dprintk |
3,259 | CWE-000 int main ( ) { static char buf [ 256 ] ; struct cmd * usercmd ; struct execcmd * globalcmd ; while ( 1 ) { <S2SV_StartBug> getcmd ( buf , sizeof ( buf ) ) ; <S2SV_EndBug> if ( buf [ 0 ] == 'c' && buf [ 1 ] == 'd' && buf [ 2 ] == '<S2SV_blank>' ) { buf [ strlen ( buf ) - 1 ] = 0 ; if ( chdir ( buf + 3 ) < 0 ) fprintf ( stderr , "cannot<S2SV_blank>cd<S2SV_blank>%s\\n" , buf + 3 ) ; continue ; } usercmd = parsecmd ( buf ) ; if ( usercmd -> type == '<S2SV_blank>' ) { globalcmd = ( struct execcmd * ) usercmd ; if ( strcmp ( globalcmd -> argv [ 0 ] , "export" ) == 0 ) { putenv ( globalcmd -> argv [ 1 ] ) ; continue ; } if ( strcmp ( globalcmd -> argv [ 0 ] , "exit" ) == 0 ) { fflush ( stdout ) ; exit ( 0 ) ; } } if ( fork1 ( ) == 0 ) runcmd ( usercmd ) ; wait ( NULL ) ; } } | <S2SV_ModStart> 1 ) { if ( <S2SV_ModStart> buf ) ) < 0 ) continue |
3,260 | CWE-000 static NewConstraint * constraint_apply_mapped ( HeapTuple tuple , AttrMap * map , Relation cand , bool validate , bool is_split , Relation pgcon ) { Datum val ; bool isnull ; Datum * dats ; int16 * keys ; int nkeys ; int i ; Node * conexpr ; char * consrc ; char * conbin ; Form_pg_constraint con = ( Form_pg_constraint ) GETSTRUCT ( tuple ) ; NewConstraint * newcon = NULL ; val = heap_getattr ( tuple , Anum_pg_constraint_conkey , RelationGetDescr ( pgcon ) , & isnull ) ; Assert ( ! isnull ) ; deconstruct_array ( DatumGetArrayTypeP ( val ) , INT2OID , 2 , true , 's' , & dats , NULL , & nkeys ) ; keys = palloc ( sizeof ( int16 ) * nkeys ) ; for ( i = 0 ; i < nkeys ; i ++ ) { int16 key = DatumGetInt16 ( dats [ i ] ) ; keys [ i ] = ( int16 ) attrMap ( map , key ) ; } val = heap_getattr ( tuple , Anum_pg_constraint_conbin , RelationGetDescr ( pgcon ) , & isnull ) ; if ( ! isnull ) { conbin = TextDatumGetCString ( val ) ; conexpr = stringToNode ( conbin ) ; conexpr = attrMapExpr ( map , conexpr ) ; conbin = nodeToString ( conexpr ) ; } else { conbin = NULL ; conexpr = NULL ; } val = heap_getattr ( tuple , Anum_pg_constraint_consrc , RelationGetDescr ( pgcon ) , & isnull ) ; if ( ! isnull ) { consrc = TextDatumGetCString ( val ) ; } else { consrc = NULL ; } switch ( con -> contype ) { case CONSTRAINT_CHECK : { Assert ( conexpr && conbin && consrc ) ; CreateConstraintEntry ( NameStr ( con -> conname ) , con -> connamespace , con -> contype , con -> condeferrable , con -> condeferred , con -> convalidated , RelationGetRelid ( cand ) , keys , nkeys , InvalidOid , InvalidOid , InvalidOid , NULL , NULL , NULL , NULL , 0 , '<S2SV_blank>' , '<S2SV_blank>' , '<S2SV_blank>' , NULL , conexpr , conbin , consrc , con -> conislocal , <S2SV_StartBug> con -> coninhcount ) ; <S2SV_EndBug> break ; } case CONSTRAINT_FOREIGN : { int16 * fkeys ; int nfkeys ; Oid indexoid = InvalidOid ; Oid * opclasses = NULL ; Relation frel ; val = heap_getattr ( tuple , Anum_pg_constraint_confkey , RelationGetDescr ( pgcon ) , & isnull ) ; Assert ( ! isnull ) ; deconstruct_array ( DatumGetArrayTypeP ( val ) , INT2OID , 2 , true , 's' , & dats , NULL , & nfkeys ) ; fkeys = palloc ( sizeof ( int16 ) * nfkeys ) ; for ( i = 0 ; i < nfkeys ; i ++ ) { fkeys [ i ] = DatumGetInt16 ( dats [ i ] ) ; } frel = heap_open ( con -> confrelid , AccessExclusiveLock ) ; indexoid = transformFkeyCheckAttrs ( frel , nfkeys , fkeys , opclasses ) ; CreateConstraintEntry ( NameStr ( con -> conname ) , RelationGetNamespace ( cand ) , con -> contype , con -> condeferrable , con -> condeferred , con -> convalidated , RelationGetRelid ( cand ) , keys , nkeys , InvalidOid , indexoid , con -> confrelid , fkeys , NULL , NULL , NULL , nfkeys , con -> confupdtype , con -> confdeltype , con -> confmatchtype , NULL , NULL , NULL , NULL , con -> conislocal , <S2SV_StartBug> con -> coninhcount ) ; <S2SV_EndBug> heap_close ( frel , AccessExclusiveLock ) ; break ; } case CONSTRAINT_PRIMARY : case CONSTRAINT_UNIQUE : { char * what = ( con -> contype == CONSTRAINT_PRIMARY ) ? "PRIMARY<S2SV_blank>KEY" : "UNIQUE" ; char * who = NameStr ( con -> conname ) ; if ( is_split ) { ; } else if ( validate ) { ereport ( ERROR , ( errcode ( ERRCODE_FEATURE_NOT_SUPPORTED ) , errmsg ( "%s<S2SV_blank>constraint<S2SV_blank>\\"%s\\"<S2SV_blank>missing" , what , who ) , errhint ( "Add<S2SV_blank>%s<S2SV_blank>constraint<S2SV_blank>\\"%s\\"<S2SV_blank>to<S2SV_blank>the<S2SV_blank>candidate<S2SV_blank>table" "<S2SV_blank>or<S2SV_blank>drop<S2SV_blank>it<S2SV_blank>from<S2SV_blank>the<S2SV_blank>partitioned<S2SV_blank>table." , what , who ) ) ) ; } else { ereport ( ERROR , ( errcode ( ERRCODE_FEATURE_NOT_SUPPORTED ) , errmsg ( "WITHOUT<S2SV_blank>VALIDATION<S2SV_blank>incompatible<S2SV_blank>with<S2SV_blank>missing<S2SV_blank>%s<S2SV_blank>constraint<S2SV_blank>\\"%s\\"" , what , who ) , errhint ( "Add<S2SV_blank>%s<S2SV_blank>constraint<S2SV_blank>%s<S2SV_blank>to<S2SV_blank>the<S2SV_blank>candidate<S2SV_blank>table" "<S2SV_blank>or<S2SV_blank>drop<S2SV_blank>it<S2SV_blank>from<S2SV_blank>the<S2SV_blank>partitioned<S2SV_blank>table." , what , who ) ) ) ; } break ; } default : elog ( ERROR , "invalid<S2SV_blank>constraint<S2SV_blank>type:<S2SV_blank>%c" , con -> contype ) ; break ; } newcon = NULL ; if ( validate ) { switch ( con -> contype ) { case CONSTRAINT_CHECK : { newcon = ( NewConstraint * ) palloc0 ( sizeof ( NewConstraint ) ) ; newcon -> name = pstrdup ( NameStr ( con -> conname ) ) ; newcon -> qual = ( Node * ) make_ands_implicit ( ( Expr * ) conexpr ) ; newcon -> contype = CONSTR_CHECK ; break ; } case CONSTRAINT_FOREIGN : { elog ( WARNING , "Won\'t<S2SV_blank>enforce<S2SV_blank>FK<S2SV_blank>constraint." ) ; break ; } case CONSTRAINT_PRIMARY : { elog ( WARNING , "Won\'t<S2SV_blank>enforce<S2SV_blank>PK<S2SV_blank>constraint." ) ; break ; } case CONSTRAINT_UNIQUE : { elog ( WARNING , "Won\'t<S2SV_blank>enforce<S2SV_blank>ND<S2SV_blank>constraint." ) ; break ; } default : { elog ( WARNING , "!!<S2SV_blank>NOT<S2SV_blank>READY<S2SV_blank>FOR<S2SV_blank>TYPE<S2SV_blank>%c<S2SV_blank>CONSTRAINT<S2SV_blank>!!" , con -> contype ) ; break ; } } } return newcon ; } | <S2SV_ModStart> con -> coninhcount , true <S2SV_ModStart> con -> coninhcount , true |
3,261 | CWE-000 void transmit_buf_wait ( const uint8_t * buf , size_t size ) { # if defined ( SAFE_PRINT ) && ( PRINT_DEBUG == 1 || PRINT_DEBUG == 3 ) xSemaphoreTakeRecursive ( print_mutex , 200 / portTICK_PERIOD_MS ) ; # endif # ifdef DONT_PRINT_RAW_TRANSMISSIONS print ( "Transmitted<S2SV_blank>%d<S2SV_blank>bytes\\n" , size ) ; # endif TickType_t transmission_start_ticks ; enable_ir_pow_if_necessary_unsafe ( ) ; bool got_i2c_irpow_mutex = true ; if ( ! xSemaphoreTake ( i2c_irpow_mutex , HARDWARE_MUTEX_WAIT_TIME_TICKS ) ) { log_error ( ELOC_RADIO , ECODE_I2C_IRPOW_MUTEX_TIMEOUT , true ) ; got_i2c_irpow_mutex = false ; } { enable_ir_pow_if_necessary_unsafe ( ) ; <S2SV_StartBug> bool got_hw_state_mutex = true ; <S2SV_EndBug> if ( ! hardware_state_mutex_take ( ) ) { log_error ( ELOC_RADIO , ECODE_HW_STATE_MUTEX_TIMEOUT , true ) ; got_hw_state_mutex = false ; } pet_watchdog ( ) ; vTaskSuspendAll ( ) ; { # if defined ( TRANSMIT_ACTIVE ) setTXEnable ( true ) ; # endif # if defined ( TRANSMIT_ACTIVE ) || ! defined ( DONT_PRINT_RAW_TRANSMISSIONS ) <S2SV_StartBug> get_hw_states ( ) -> radio_state = RADIO_TRANSMITTING ; <S2SV_EndBug> transmission_start_ticks = xTaskGetTickCount ( ) ; trace_print ( "transmitting..." ) ; usart_send_buf ( buf , size ) ; # endif # if PRINT_DEBUG == 1 || PRINT_DEBUG == 3 delay_ms ( 10 ) ; setTXEnable ( false ) ; # endif } xTaskResumeAll ( ) ; <S2SV_StartBug> if ( got_hw_state_mutex ) hardware_state_mutex_give ( ) ; <S2SV_EndBug> vTaskDelay ( TRANSMIT_CURRENT_RISE_TIME_MS / portTICK_PERIOD_MS ) ; <S2SV_StartBug> if ( got_i2c_irpow_mutex ) { <S2SV_EndBug> verify_regulators_unsafe ( ) ; trace_print ( "verified<S2SV_blank>regulators" ) ; disable_ir_pow_if_necessary_unsafe ( true ) ; xSemaphoreGive ( i2c_irpow_mutex ) ; } else { verify_regulators ( ) ; trace_print ( "verified<S2SV_blank>regulators" ) ; disable_ir_pow_if_should_be_off ( true ) ; } } vTaskDelayUntil ( & transmission_start_ticks , TRANSMIT_TIME_MS ( size ) / portTICK_PERIOD_MS ) ; if ( hardware_state_mutex_take ( ) ) { get_hw_states ( ) -> radio_state = RADIO_IDLE ; hardware_state_mutex_give ( ) ; } else { get_hw_states ( ) -> radio_state = RADIO_IDLE ; log_error ( ELOC_RADIO , ECODE_HW_STATE_MUTEX_TIMEOUT , true ) ; } # if defined ( SAFE_PRINT ) && ( PRINT_DEBUG == 1 || PRINT_DEBUG == 3 ) xSemaphoreGiveRecursive ( print_mutex ) ; # endif } | <S2SV_ModStart> ( ) ; <S2SV_ModEnd> pet_watchdog ( ) <S2SV_ModStart> ( DONT_PRINT_RAW_TRANSMISSIONS ) <S2SV_ModEnd> transmission_start_ticks = xTaskGetTickCount <S2SV_ModStart> ( ) ; bool got_hw_state_mutex = true ; if ( ! hardware_state_mutex_take ( ) ) { log_error ( ELOC_RADIO , ECODE_HW_STATE_MUTEX_TIMEOUT , true ) ; got_hw_state_mutex = false ; } vTaskDelayUntil ( & transmission_start_ticks , <S2SV_ModEnd> TRANSMIT_CURRENT_RISE_TIME_MS / portTICK_PERIOD_MS <S2SV_ModStart> portTICK_PERIOD_MS ) ; get_hw_states ( ) -> radio_state = RADIO_TRANSMITTING ; if ( got_hw_state_mutex ) hardware_state_mutex_give ( ) ; |
3,262 | CWE-000 void i915_driver_unload ( struct drm_device * dev ) { struct drm_i915_private * dev_priv = to_i915 ( dev ) ; struct pci_dev * pdev = dev_priv -> drm . pdev ; <S2SV_StartBug> intel_fbdev_fini ( dev ) ; <S2SV_EndBug> if ( i915_gem_suspend ( dev_priv ) ) DRM_ERROR ( "failed<S2SV_blank>to<S2SV_blank>idle<S2SV_blank>hardware;<S2SV_blank>continuing<S2SV_blank>to<S2SV_blank>unload!\\n" ) ; intel_display_power_get ( dev_priv , POWER_DOMAIN_INIT ) ; drm_atomic_helper_shutdown ( dev ) ; intel_gvt_cleanup ( dev_priv ) ; i915_driver_unregister ( dev_priv ) ; drm_vblank_cleanup ( dev ) ; intel_modeset_cleanup ( dev ) ; if ( dev_priv -> vbt . child_dev && dev_priv -> vbt . child_dev_num ) { kfree ( dev_priv -> vbt . child_dev ) ; dev_priv -> vbt . child_dev = NULL ; dev_priv -> vbt . child_dev_num = 0 ; } kfree ( dev_priv -> vbt . sdvo_lvds_vbt_mode ) ; dev_priv -> vbt . sdvo_lvds_vbt_mode = NULL ; kfree ( dev_priv -> vbt . lfp_lvds_vbt_mode ) ; dev_priv -> vbt . lfp_lvds_vbt_mode = NULL ; vga_switcheroo_unregister_client ( pdev ) ; vga_client_register ( pdev , NULL , NULL , NULL ) ; intel_csr_ucode_fini ( dev_priv ) ; cancel_delayed_work_sync ( & dev_priv -> gpu_error . hangcheck_work ) ; i915_reset_error_state ( dev_priv ) ; i915_gem_fini ( dev_priv ) ; intel_uc_fini_fw ( dev_priv ) ; intel_fbc_cleanup_cfb ( dev_priv ) ; intel_power_domains_fini ( dev_priv ) ; i915_driver_cleanup_hw ( dev_priv ) ; i915_driver_cleanup_mmio ( dev_priv ) ; intel_display_power_put ( dev_priv , POWER_DOMAIN_INIT ) ; } | <S2SV_ModStart> . pdev ; <S2SV_ModEnd> if ( i915_gem_suspend |
3,263 | CWE-000 void graphics_draw_filled_scaled_polygon_to_bitmap ( int num_vertices , uint8_t * data , float scalex , float scaley , int xofs , int yofs , struct Bitplane * bitplane , bool xor , bool distort , bool flip_horizontal , bool flip_vertical ) { int next_line_info = 0 ; int i ; int global_ymin = window_height ; int global_ymax = 0 ; memset ( edge_table , 0 , window_height * sizeof ( struct poly_elem * ) ) ; for ( i = 0 ; i < ( num_vertices * 2 ) ; i += 2 ) { int y0 , x0 , y1 , x1 ; y0 = data [ i ] ; x0 = data [ i + 1 ] ; if ( i == ( num_vertices * 2 ) - 2 ) { y1 = data [ 0 ] ; x1 = data [ 1 ] ; } else { y1 = data [ i + 2 ] ; x1 = data [ i + 3 ] ; } if ( distort ) { if ( i & 2 ) { x0 += 8 ; } else { x1 += 8 ; } } y0 = y0 * scaley + yofs ; y1 = y1 * scaley + yofs ; x0 = x0 * scalex + xofs ; x1 = x1 * scalex + xofs ; if ( y0 == y1 ) { continue ; } if ( flip_horizontal ) { x0 = window_width - x0 ; x1 = window_width - x1 ; } if ( flip_vertical ) { y0 = window_height - y0 ; y1 = window_height - y1 ; } if ( y0 > y1 ) { int tmp ; tmp = y0 ; y0 = y1 ; y1 = tmp ; tmp = x0 ; x0 = x1 ; x1 = tmp ; } y0 = min ( max ( 0 , y0 ) , window_height - 1 ) ; y1 = max ( min ( window_height - 1 , y1 ) , 0 ) ; x0 = min ( max ( 0 , x0 ) , window_width - 1 ) ; x1 = max ( min ( window_width - 1 , x1 ) , 0 ) ; if ( y0 < global_ymin ) global_ymin = y0 ; if ( y1 > global_ymax ) global_ymax = y1 ; struct poly_elem * elem = & ( line_info [ next_line_info ++ ] ) ; elem -> xcurr = x0 ; elem -> ymax = y1 ; elem -> grad_recip = ( ( float ) ( x1 - x0 ) ) / ( ( float ) ( y1 - y0 ) ) ; elem -> prev = edge_table [ y0 ] ; elem -> ymin = y0 ; elem -> xmin = x0 ; edge_table [ y0 ] = elem ; } <S2SV_StartBug> next_active_list = 0 ; <S2SV_EndBug> for ( int y = global_ymin ; y <= global_ymax ; y ++ ) { struct poly_elem * active ; active = edge_table [ y ] ; while ( active ) { <S2SV_StartBug> add_active ( active ) ; <S2SV_EndBug> active = active -> prev ; } qsort ( active_list , next_active_list , sizeof ( struct poly_elem * ) , active_list_comparator ) ; int is_drawing = 0 ; int prev_x = 0 ; for ( i = 0 ; i < next_active_list ; i ++ ) { int next_x = is_drawing ? floorf ( active_list [ i ] -> xcurr ) : ceilf ( active_list [ i ] -> xcurr ) ; bool is_vertex = fabs ( active_list [ i ] -> xmin - active_list [ i ] -> xcurr ) < 0.5 && ( active_list [ i ] -> ymax == y || active_list [ i ] -> ymin == y ) ; if ( is_drawing ) { planar_line_horizontal ( bitplane , y , prev_x , next_x , xor , 0xffff ) ; } if ( ( ! is_vertex ) || ( active_list [ i ] -> ymax == y ) ) { is_drawing = 1 - is_drawing ; } prev_x = next_x ; } for ( i = 0 ; i < next_active_list ; ) { if ( active_list [ i ] -> ymax == y ) { del_active ( i ) ; } else { i ++ ; } } for ( i = 0 ; i < next_active_list ; i ++ ) { active_list [ i ] -> xcurr += active_list [ i ] -> grad_recip ; } } } | <S2SV_ModStart> elem ; } assert ( next_line_info < MAX_LINES ) ; <S2SV_ModStart> add_active ( active ) ; assert ( active != active -> prev |
3,264 | CWE-000 int isInL2WB ( int address ) { <S2SV_StartBug> if ( l2wbController [ 0 ] >> 1 == address || l2wbController [ 1 ] >> 1 == address ) { <S2SV_EndBug> return 1 ; } else { return 0 ; } } | <S2SV_ModStart> { if ( ( ( <S2SV_ModStart> ] >> 1 & 0b011111111111 == address ) && l2wbController [ 0 ] >> 12 == 1 ) || ( ( <S2SV_ModEnd> l2wbController [ 1 <S2SV_ModStart> ] >> 1 & 0b011111111111 == address ) && l2wbController [ 1 ] >> 12 == 1 ) <S2SV_ModEnd> ) { return |
3,265 | CWE-000 void editor_update ( editor * e_instance ) { int w ; int h ; window_get_size ( e_instance -> win , & w , & h ) ; entity_set_size ( e_instance -> root , value_vec2 ( w , h ) ) ; page_tab * pt = e_instance -> current_page_tab ; update_entity_recursive ( e_instance -> root ) ; if ( pt ) { <S2SV_StartBug> if ( pt -> cursor_blink_timer > 500 ) <S2SV_EndBug> { pt -> cursor_blink_state = ! pt -> cursor_blink_state ; entity_set_visible ( pt -> cursor , pt -> cursor_blink_state ) ; pt -> cursor_blink_timer = 0 ; } pt -> cursor_blink_timer += milli_current_time ( ) - pt -> last_time ; pt -> last_time = milli_current_time ( ) ; if ( ! pt -> wheel_override ) { vec2 cursorpos = entity_get_render_position ( pt -> cursor ) ; vec2 cursorsize = entity_get_render_size ( pt -> cursor ) ; if ( cursorpos . x + cursorsize . x > w ) { pt -> offset . x += w - ( cursorpos . x + cursorsize . x ) ; } if ( cursorpos . y + cursorsize . y > h ) { pt -> offset . y += h - ( cursorpos . y + cursorsize . y ) ; } if ( cursorpos . x < 0 ) { pt -> offset . x += - ( cursorpos . x ) ; } if ( cursorpos . y < 0 ) { pt -> offset . y += - ( cursorpos . y ) ; } } if ( pt -> offset . x > 0 ) { pt -> offset . x = 0 ; } if ( pt -> offset . y > 0 ) { pt -> offset . y = 0 ; } <S2SV_StartBug> entity_set_position ( pt -> text_holder , pt -> offset ) ; <S2SV_EndBug> } } | <S2SV_ModStart> { if ( global_text_margin ) { char buffer [ MAXIMUM_LINE_NUMBER_LENGTH ] ; s32 size_width ; s32 size_height ; itoa ( pt -> lines_size , buffer , 10 ) ; size_ttf_font ( pt -> font , buffer , & size_width , & size_height ) ; global_text_margin = size_width + offset_margin ; } if ( <S2SV_ModStart> 0 ; } pt -> offset . x += global_text_margin ; |
3,266 | CWE-000 static void _im_error_delivery_notification ( bool_t online ) { FILE * ZIDCacheMarieFD , * ZIDCachePaulineFD ; LinphoneChatRoom * chat_room ; char * filepath ; LinphoneCoreManager * marie = linphone_core_manager_new ( "marie_rc" ) ; LinphoneCoreManager * pauline = linphone_core_manager_new ( "pauline_tcp_rc" ) ; LinphoneChatMessage * msg ; LinphoneChatMessageCbs * cbs ; int dummy = 0 ; if ( ! linphone_core_lime_available ( marie -> lc ) ) { ms_warning ( "Lime<S2SV_blank>not<S2SV_blank>available,<S2SV_blank>skiping" ) ; goto end ; } <S2SV_StartBug> linphone_core_enable_lime ( marie -> lc , 1 ) ; <S2SV_EndBug> <S2SV_StartBug> linphone_core_enable_lime ( pauline -> lc , 1 ) ; <S2SV_EndBug> ZIDCacheMarieFD = fopen_from_write_dir ( "tmpZIDCacheMarie.xml" , "w" ) ; ZIDCachePaulineFD = fopen_from_write_dir ( "tmpZIDCachePauline.xml" , "w" ) ; fprintf ( ZIDCacheMarieFD , marie_zid_cache , linphone_address_as_string_uri_only ( pauline -> identity ) , linphone_address_as_string_uri_only ( pauline -> identity ) ) ; fprintf ( ZIDCachePaulineFD , pauline_zid_cache , linphone_address_as_string_uri_only ( marie -> identity ) , linphone_address_as_string_uri_only ( marie -> identity ) ) ; fclose ( ZIDCacheMarieFD ) ; fclose ( ZIDCachePaulineFD ) ; filepath = bc_tester_file ( "tmpZIDCacheMarie.xml" ) ; linphone_core_set_zrtp_secrets_file ( marie -> lc , filepath ) ; bc_free ( filepath ) ; filepath = bc_tester_file ( "tmpZIDCachePauline.xml" ) ; linphone_core_set_zrtp_secrets_file ( pauline -> lc , filepath ) ; bc_free ( filepath ) ; chat_room = linphone_core_get_chat_room ( pauline -> lc , marie -> identity ) ; linphone_chat_room_send_message ( chat_room , "Bla<S2SV_blank>bla<S2SV_blank>bla<S2SV_blank>bla" ) ; BC_ASSERT_TRUE ( wait_for ( pauline -> lc , marie -> lc , & marie -> stat . number_of_LinphoneMessageReceived , 1 ) ) ; BC_ASSERT_TRUE ( wait_for ( pauline -> lc , marie -> lc , & marie -> stat . number_of_LinphoneMessageReceivedLegacy , 1 ) ) ; BC_ASSERT_PTR_NOT_NULL ( marie -> stat . last_received_chat_message ) ; if ( marie -> stat . last_received_chat_message ) { BC_ASSERT_STRING_EQUAL ( linphone_chat_message_get_text ( marie -> stat . last_received_chat_message ) , "Bla<S2SV_blank>bla<S2SV_blank>bla<S2SV_blank>bla" ) ; } BC_ASSERT_PTR_NOT_NULL ( linphone_core_get_chat_room ( marie -> lc , pauline -> identity ) ) ; linphone_core_set_zrtp_secrets_file ( marie -> lc , NULL ) ; linphone_im_notif_policy_enable_all ( linphone_core_get_im_notif_policy ( marie -> lc ) ) ; linphone_im_notif_policy_enable_all ( linphone_core_get_im_notif_policy ( pauline -> lc ) ) ; msg = linphone_chat_room_create_message ( chat_room , "Happy<S2SV_blank>new<S2SV_blank>year!" ) ; linphone_chat_message_ref ( msg ) ; cbs = linphone_chat_message_get_callbacks ( msg ) ; linphone_chat_message_cbs_set_msg_state_changed ( cbs , liblinphone_tester_chat_message_msg_state_changed ) ; linphone_chat_room_send_chat_message ( chat_room , msg ) ; if ( ! online ) { linphone_core_set_network_reachable ( marie -> lc , FALSE ) ; BC_ASSERT_TRUE ( wait_for_until ( pauline -> lc , marie -> lc , & pauline -> stat . number_of_LinphoneMessageDelivered , 1 , 60000 ) ) ; linphone_core_set_network_reachable ( marie -> lc , TRUE ) ; BC_ASSERT_TRUE ( wait_for ( marie -> lc , marie -> lc , & marie -> stat . number_of_LinphoneRegistrationOk , 2 ) ) ; wait_for_until ( pauline -> lc , marie -> lc , & dummy , 1 , 1500 ) ; } wait_for_until ( pauline -> lc , marie -> lc , & dummy , 1 , 1500 ) ; BC_ASSERT_EQUAL ( marie -> stat . number_of_LinphoneMessageReceived , 1 , int , "%d" ) ; BC_ASSERT_TRUE ( wait_for ( pauline -> lc , marie -> lc , & pauline -> stat . number_of_LinphoneMessageNotDelivered , 1 ) ) ; linphone_chat_message_unref ( msg ) ; end : remove ( "tmpZIDCacheMarie.xml" ) ; remove ( "tmpZIDCachePauline.xml" ) ; linphone_core_manager_destroy ( marie ) ; linphone_core_manager_destroy ( pauline ) ; } | <S2SV_ModStart> -> lc , LinphoneLimeMandatory <S2SV_ModEnd> ) ; linphone_core_enable_lime <S2SV_ModStart> -> lc , LinphoneLimeMandatory <S2SV_ModEnd> ) ; ZIDCacheMarieFD |
3,267 | CWE-000 PyObject * bnToLongObj ( BIGNUM * m ) { <S2SV_StartBug> PyLongObject * v = NULL ; <S2SV_EndBug> BN_ULONG t ; <S2SV_StartBug> int bits = BN_num_bits ( m ) , i = 0 ; <S2SV_EndBug> int ndigits = ( bits + PyLong_SHIFT - 1 ) / PyLong_SHIFT ; int digitsleft = ndigits ; int bitsleft = bits ; v = _PyLong_New ( ndigits ) ; if ( v != NULL ) { digit * p = v -> ob_digit ; for ( i = 0 ; i < m -> dmax ; i ++ ) { t = m -> d [ i ] ; * p ++ = ( digit ) ( t & PyLong_MASK ) ; i ++ ; digitsleft -- ; bitsleft -= PyLong_SHIFT ; } } return ( PyObject * ) v ; } | <S2SV_ModStart> m ) { return PyLong_FromString ( BN_bn2hex <S2SV_ModEnd> ( m ) <S2SV_ModStart> m ) , NULL , 16 ) <S2SV_ModEnd> ; } <S2SV_null> |
3,268 | CWE-000 static void ami_response_handler ( json_t * j_msg ) { const char * action_id ; const char * type ; json_t * j_action ; ACTION_RES res_action ; if ( j_msg == NULL ) { slog ( LOG_WARNING , "Wrong<S2SV_blank>input<S2SV_blank>parameter." ) ; return ; } slog ( LOG_DEBUG , "Fired<S2SV_blank>ami_response_handler." ) ; action_id = json_string_value ( json_object_get ( j_msg , "ActionID" ) ) ; if ( action_id == NULL ) { slog ( LOG_NOTICE , "Could<S2SV_blank>not<S2SV_blank>get<S2SV_blank>ActionID." ) ; return ; } j_action = get_action ( action_id ) ; if ( j_action == NULL ) { slog ( LOG_NOTICE , "Could<S2SV_blank>not<S2SV_blank>get<S2SV_blank>action<S2SV_blank>info.<S2SV_blank>id[%s]" , action_id ) ; return ; } type = json_string_value ( json_object_get ( j_action , "type" ) ) ; if ( type == NULL ) { slog ( LOG_ERR , "Could<S2SV_blank>not<S2SV_blank>get<S2SV_blank>action<S2SV_blank>type<S2SV_blank>info.<S2SV_blank>id[%s]" , action_id ) ; json_decref ( j_action ) ; <S2SV_StartBug> return ; <S2SV_EndBug> } if ( strcasecmp ( type , "coresettings" ) == 0 ) { res_action = ami_response_handler_coresettings ( j_action , j_msg ) ; } else if ( strcasecmp ( type , "corestatus" ) == 0 ) { res_action = ami_response_handler_corestatus ( j_action , j_msg ) ; } else if ( strcasecmp ( type , "modulecheck" ) == 0 ) { res_action = ami_response_handler_modulecheck ( j_action , j_msg ) ; } else if ( strcasecmp ( type , "moduleload" ) == 0 ) { res_action = ami_response_handler_moduleload ( j_action , j_msg ) ; } else if ( strcasecmp ( type , "ob.originate" ) == 0 ) { res_action = ob_ami_response_handler_originate ( j_action , j_msg ) ; } else if ( strcasecmp ( type , "ob.status" ) == 0 ) { res_action = ob_ami_response_handler_status ( j_action , j_msg ) ; } else { slog ( LOG_ERR , "Could<S2SV_blank>not<S2SV_blank>find<S2SV_blank>correct<S2SV_blank>action<S2SV_blank>response<S2SV_blank>handler.<S2SV_blank>action_id[%s],<S2SV_blank>type[%s]" , action_id , type ) ; res_action = ACTION_RES_ERROR ; } json_decref ( j_action ) ; if ( res_action == ACTION_RES_CONTINUE ) { slog ( LOG_DEBUG , "The<S2SV_blank>action<S2SV_blank>response<S2SV_blank>is<S2SV_blank>not<S2SV_blank>finished.<S2SV_blank>Waiting<S2SV_blank>for<S2SV_blank>next<S2SV_blank>event.<S2SV_blank>action_id[%s]" , action_id ) ; return ; } <S2SV_StartBug> slog ( LOG_DEBUG , "The<S2SV_blank>action<S2SV_blank>response<S2SV_blank>if<S2SV_blank>finished.<S2SV_blank>action_id[%s],<S2SV_blank>res[%d]" , action_id , res_action ) ; <S2SV_EndBug> delete_action ( action_id ) ; return ; } | <S2SV_ModStart> j_action ) ; delete_action ( action_id ) ; <S2SV_ModStart> ( LOG_DEBUG , "The<S2SV_blank>action<S2SV_blank>response<S2SV_blank>finished.<S2SV_blank>action_id[%s],<S2SV_blank>res[%d]" <S2SV_ModEnd> , action_id , |
3,269 | CWE-000 buzzdebug_entry_t buzzdebug_entry_new ( uint64_t l , uint64_t c , const char * fn ) { buzzdebug_entry_t x = malloc ( sizeof ( struct buzzdebug_entry_s ) ) ; x -> line = l ; x -> col = c ; <S2SV_StartBug> x -> fname = strdup ( fn ) ; <S2SV_EndBug> return x ; } | <S2SV_ModStart> -> fname = fn <S2SV_ModEnd> ; return x |
3,270 | CWE-000 struct dma_buf * vc4_prime_export ( struct drm_device * dev , struct drm_gem_object * obj , int flags ) { struct vc4_bo * bo = to_vc4_bo ( obj ) ; <S2SV_StartBug> if ( bo -> validated_shader ) { <S2SV_EndBug> DRM_DEBUG ( "Attempting<S2SV_blank>to<S2SV_blank>export<S2SV_blank>shader<S2SV_blank>BO\\n" ) ; return ERR_PTR ( - EINVAL ) ; } <S2SV_StartBug> return drm_gem_prime_export ( dev , obj , flags ) ; <S2SV_EndBug> <S2SV_StartBug> } <S2SV_EndBug> | <S2SV_ModStart> obj ) ; struct dma_buf * dmabuf ; int ret ; <S2SV_ModStart> ) ; } ret = vc4_bo_inc_usecnt ( bo ) ; if ( ret ) { DRM_ERROR ( "Failed<S2SV_blank>to<S2SV_blank>increment<S2SV_blank>BO<S2SV_blank>usecnt\\n" ) ; return ERR_PTR ( ret ) ; } dmabuf = <S2SV_ModEnd> drm_gem_prime_export ( dev <S2SV_ModStart> flags ) ; if ( IS_ERR ( dmabuf ) ) vc4_bo_dec_usecnt ( bo ) ; return dmabuf ; |
3,271 | CWE-000 void tpm_common_release ( struct file * file , struct file_priv * priv ) { <S2SV_StartBug> del_singleshot_timer_sync ( & priv -> user_read_timer ) ; <S2SV_EndBug> <S2SV_StartBug> flush_work ( & priv -> work ) ; <S2SV_EndBug> file -> private_data = NULL ; priv -> data_pending = 0 ; } | <S2SV_ModStart> priv ) { flush_work ( & priv -> async_work ) ; <S2SV_ModStart> & priv -> timeout_work <S2SV_ModEnd> ) ; file |
3,272 | CWE-000 void implement_xom ( void * base , size_t len , int prot , int flags , int fd , off_t off ) { void * sectable = NULL ; void * pgsectable = NULL ; void * execstart = NULL ; void * execend = NULL ; void * pgupexecstart = NULL ; void * pgdownexecstart = NULL ; void * pgupexecend = NULL ; void * pgdownexecend = NULL ; void * pgupcodesegend = NULL ; int execsize = 0 ; int sectablesize = 0 ; int pgsectablesize = 0 ; int pgelfmetasize = 0 ; int pgrodatasize = 0 ; int idx = 0 ; if ( strncmp ( base , ELFMAG , 4 ) == 0 ) { ; } else { simple_printf ( "did<S2SV_blank>not<S2SV_blank>match<S2SV_blank>ELF<S2SV_blank>header:<S2SV_blank>%s!\\n" , base ) ; return ; } Elf64_Ehdr * elfheader = ( Elf64_Ehdr * ) base ; Elf64_Phdr * phdr = base + elfheader -> e_phoff ; int phdrent = elfheader -> e_phnum ; for ( idx = 0 ; idx < phdrent ; idx ++ ) { if ( phdr -> p_type == PT_LOAD && phdr -> p_flags == ( PF_X | PF_R ) ) { pgupcodesegend = ( void * ) ( base + round_up_pgsize ( phdr -> p_memsz ) ) ; break ; } phdr ++ ; } if ( pgupcodesegend == NULL ) { simple_printf ( "code<S2SV_blank>segment<S2SV_blank>does<S2SV_blank>not<S2SV_blank>exist,<S2SV_blank>return" ) ; return ; } if ( check_elf_whitelist ( base , elfheader ) == 1 ) { return ; } sectablesize = elfheader -> e_shnum * elfheader -> e_shentsize ; pgsectablesize = round_up_pgsize ( elfheader -> e_shoff + sectablesize ) - round_down_pgsize ( elfheader -> e_shoff ) ; pgsectable = ldso_mmap ( NULL , pgsectablesize , PROT_READ , MAP_PRIVATE | MAP_DENYWRITE , fd , round_down_pgsize ( elfheader -> e_shoff ) ) ; sectable = pgsectable + ( elfheader -> e_shoff - round_down_pgsize ( elfheader -> e_shoff ) ) ; Elf64_Shdr * sectionheader = ( Elf64_Shdr * ) sectable ; for ( idx = 0 ; idx < elfheader -> e_shnum ; idx ++ ) { if ( sectionheader -> sh_flags & SHF_EXECINSTR ) { if ( execstart == NULL ) execstart = ( void * ) sectionheader -> sh_addr ; } else if ( ! ( sectionheader -> sh_flags & SHF_EXECINSTR ) && execstart != NULL && execend == NULL ) { execend = ( void * ) sectionheader -> sh_addr ; break ; } sectionheader ++ ; } pgdownexecstart = ( void * ) ( ( size_t ) base + ( size_t ) round_down_pgsize ( ( size_t ) execstart ) ) ; pgupexecstart = ( void * ) ( ( size_t ) base + ( size_t ) round_up_pgsize ( ( size_t ) execstart ) ) ; pgdownexecend = ( void * ) ( ( size_t ) base + ( size_t ) round_down_pgsize ( ( size_t ) execend ) ) ; pgupexecend = ( void * ) ( ( size_t ) base + ( size_t ) round_up_pgsize ( ( size_t ) execend ) ) ; execsize = ( size_t ) pgdownexecend - ( size_t ) pgupexecstart ; if ( execsize > 0 ) { ldso_mprotect ( pgupexecstart , execsize , PROT_EXEC ) ; } pgelfmetasize = ( int ) ( ( size_t ) pgdownexecstart - ( size_t ) base ) ; if ( pgelfmetasize > 0 ) ldso_mprotect ( ( void * ) base , pgelfmetasize , PROT_READ ) ; pgrodatasize = ( int ) ( ( size_t ) pgupcodesegend - ( size_t ) pgupexecend ) ; if ( pgrodatasize > 0 ) ldso_mprotect ( ( void * ) pgupexecend , pgrodatasize , PROT_READ ) ; <S2SV_StartBug> out : <S2SV_EndBug> __syscall ( __NR_munmap , ( void * ) pgsectable , pgsectablesize ) ; return ; } | <S2SV_ModStart> PROT_READ ) ; <S2SV_ModEnd> __syscall ( __NR_munmap |
3,273 | CWE-000 static int nand_flash_detect_onfi ( struct mtd_info * mtd , struct nand_chip * chip , int * busw ) { struct nand_onfi_params * p = & chip -> onfi_params ; int i ; int val ; if ( chip -> options & NAND_BUSWIDTH_16 ) { pr_err ( "Trying<S2SV_blank>ONFI<S2SV_blank>probe<S2SV_blank>in<S2SV_blank>16<S2SV_blank>bits<S2SV_blank>mode,<S2SV_blank>aborting<S2SV_blank>!\\n" ) ; return 0 ; } chip -> cmdfunc ( mtd , NAND_CMD_READID , 0x20 , - 1 ) ; if ( chip -> read_byte ( mtd ) != 'O' || chip -> read_byte ( mtd ) != 'N' || chip -> read_byte ( mtd ) != 'F' || chip -> read_byte ( mtd ) != 'I' ) return 0 ; chip -> cmdfunc ( mtd , NAND_CMD_PARAM , 0 , - 1 ) ; for ( i = 0 ; i < 3 ; i ++ ) { chip -> read_buf ( mtd , ( uint8_t * ) p , sizeof ( * p ) ) ; if ( onfi_crc16 ( ONFI_CRC_BASE , ( uint8_t * ) p , 254 ) == le16_to_cpu ( p -> crc ) ) { pr_info ( "ONFI<S2SV_blank>param<S2SV_blank>page<S2SV_blank>%d<S2SV_blank>valid\\n" , i ) ; break ; } } if ( i == 3 ) return 0 ; val = le16_to_cpu ( p -> revision ) ; if ( val & ( 1 << 5 ) ) chip -> onfi_version = 23 ; else if ( val & ( 1 << 4 ) ) chip -> onfi_version = 22 ; else if ( val & ( 1 << 3 ) ) chip -> onfi_version = 21 ; else if ( val & ( 1 << 2 ) ) chip -> onfi_version = 20 ; else if ( val & ( 1 << 1 ) ) chip -> onfi_version = 10 ; if ( ! chip -> onfi_version ) { pr_info ( "%s:<S2SV_blank>unsupported<S2SV_blank>ONFI<S2SV_blank>version:<S2SV_blank>%d\\n" , __func__ , val ) ; return 0 ; } sanitize_string ( p -> manufacturer , sizeof ( p -> manufacturer ) ) ; sanitize_string ( p -> model , sizeof ( p -> model ) ) ; if ( ! mtd -> name ) mtd -> name = p -> model ; mtd -> writesize = le32_to_cpu ( p -> byte_per_page ) ; <S2SV_StartBug> mtd -> erasesize = le32_to_cpu ( p -> pages_per_block ) * mtd -> writesize ; <S2SV_EndBug> mtd -> oobsize = le16_to_cpu ( p -> spare_bytes_per_page ) ; <S2SV_StartBug> chip -> chipsize = le32_to_cpu ( p -> blocks_per_lun ) ; <S2SV_EndBug> chip -> chipsize *= ( uint64_t ) mtd -> erasesize * p -> lun_count ; * busw = 0 ; if ( le16_to_cpu ( p -> features ) & 1 ) * busw = NAND_BUSWIDTH_16 ; pr_info ( "ONFI<S2SV_blank>flash<S2SV_blank>detected\\n" ) ; return 1 ; } | <S2SV_ModStart> -> erasesize = 1 << ( fls ( <S2SV_ModStart> -> pages_per_block ) ) - 1 ) ; mtd -> erasesize *= <S2SV_ModEnd> mtd -> writesize <S2SV_ModStart> -> chipsize = 1 << ( fls ( <S2SV_ModStart> p -> blocks_per_lun ) ) - 1 |
3,274 | CWE-000 void _DObject_Finish ( Word * word ) { uint64 ctype = word -> CProperty ; if ( ! ( ctype & CPRIMITIVE ) ) { if ( GetState ( _CfrTil_ , OPTIMIZE_ON ) ) word -> State |= COMPILED_OPTIMIZED ; if ( GetState ( _CfrTil_ , INLINE_ON ) ) word -> State |= COMPILED_INLINE ; if ( GetState ( _Context_ , INFIX_MODE ) ) word -> State |= W_INFIX_MODE ; if ( GetState ( _Context_ , C_SYNTAX ) ) word -> State |= W_C_SYNTAX ; <S2SV_StartBug> if ( _IsSourceCodeOn ) word -> State |= W_SOURCE_CODE_MODE ; <S2SV_EndBug> } if ( GetState ( _Context_ , INFIX_MODE ) ) word -> CProperty |= INFIX_WORD ; word -> W_NumberOfArgs = _Context_ -> Compiler0 -> NumberOfArgs ; word -> W_NumberOfLocals = _Context_ -> Compiler0 -> NumberOfLocals ; _CfrTil_ -> LastFinishedWord = word ; } | <S2SV_ModStart> |= W_C_SYNTAX ; <S2SV_ModEnd> } if ( |
3,275 | CWE-000 <S2SV_StartBug> void insert_des ( struct des_host * * head , uint32_t des_ip , uint32_t port_number ) <S2SV_EndBug> { des_host * new_node = ( des_host * ) malloc ( sizeof ( des_host ) ) ; new_node -> port = ( des_port * * ) malloc ( sizeof ( des_port ) ) ; new_node -> next = NULL ; new_node -> des_ip = des_ip ; new_node -> port_count = 0 ; if ( * head == NULL ) { * head = new_node ; } else { des_host * pre_node = NULL ; des_host * cur_node = * head ; while ( cur_node != NULL ) { pre_node = cur_node ; if ( cur_node -> des_ip == des_ip ) { if ( insert_port ( cur_node -> port , port_number ) == 1 ) { cur_node -> port_count ++ ; } return ; } cur_node = cur_node -> next ; } pre_node -> next = new_node ; } if ( insert_port ( new_node -> port , port_number ) == 1 ) { new_node -> port_count ++ ; } return ; } | <S2SV_ModStart> uint32_t des_ip , uint16_t <S2SV_ModEnd> port_number ) { |
3,276 | CWE-000 int compile_file ( ParserFile * file ) { char tmp_name [ 200 ] ; int err ; printf ( "section<S2SV_blank>.text\\n" ) ; printf ( "global<S2SV_blank>main\\n" ) ; printf ( "extern<S2SV_blank>printf\\n" ) ; printf ( "extern<S2SV_blank>scanf\\n" ) ; ParserFunction * f ; for ( f = file -> first ; f ; f = f -> next ) { err = compile_function ( f ) ; if ( err ) return err ; } printf ( "section<S2SV_blank>.data\\n" ) ; printf ( "prINT<S2SV_blank>db<S2SV_blank>\\"%%i\\",<S2SV_blank>10,<S2SV_blank>0\\n" ) ; <S2SV_StartBug> printf ( "scINT<S2SV_blank>db<S2SV_blank>\\"%%i\\",<S2SV_blank>0\\n" ) ; <S2SV_EndBug> printf ( "prSTR<S2SV_blank>db<S2SV_blank>\'%%s\',<S2SV_blank>0\\n" ) ; int i ; for ( i = 0 ; i < file -> data_size ; i ++ ) { num_name ( ( file -> data ) [ i ] , tmp_name ) ; printf ( "$%s<S2SV_blank>dd<S2SV_blank>0\\n" , tmp_name ) ; } for ( i = 0 ; i < file -> str_size ; i ++ ) { <S2SV_StartBug> num_name ( ( file -> str_vals ) [ i ] , tmp_name ) ; <S2SV_EndBug> <S2SV_StartBug> printf ( "$%s<S2SV_blank>db<S2SV_blank>`%s`\\n" , tmp_name , ( file -> strings ) [ i ] ) ; <S2SV_EndBug> } return NO_ERROR ; } | <S2SV_ModStart> ; printf ( "prINTR<S2SV_blank>db<S2SV_blank>\\"%%i\\",<S2SV_blank>0\\n" ) ; printf ( <S2SV_ModStart> ++ ) { printf ( ";%i\\n" , ( file -> str_vals ) [ i ] ) ; <S2SV_ModStart> ; printf ( "$%s<S2SV_blank>db<S2SV_blank>`%s`,<S2SV_blank>0\\n" <S2SV_ModEnd> , tmp_name , |
3,277 | CWE-000 int feed_main ( struct feed_main_descriptor const * const p_main_descriptor ) { struct feed_main_context o_main_context ; struct feed_main_context * p_main_context ; p_main_context = & ( o_main_context ) ; if ( feed_options_init ( & ( p_main_context -> o_options ) , p_main_descriptor ) ) { init_feed_descriptor ( p_main_context , & ( p_main_context -> o_descriptor ) ) ; p_main_context -> p_feed_handle = feed_create ( & ( p_main_context -> o_descriptor ) ) ; if ( p_main_context -> p_feed_handle ) { unsigned long int i_save_length ; unsigned char * p_save_buffer ; if ( p_main_context -> o_options . b_file_name <S2SV_StartBug> # if defined FEED_OS_LINUX <S2SV_EndBug> || ( ! isatty ( STDIN_FILENO ) ) <S2SV_StartBug> # endif <S2SV_EndBug> ) { FILE * p_file_handle ; if ( p_main_context -> o_options . b_file_name ) { static unsigned char const g_stdin_file_name [ ] = { '-' } ; struct feed_buf o_stdin_file_name_buf ; feed_buf_init ( & ( o_stdin_file_name_buf ) , g_stdin_file_name , g_stdin_file_name + sizeof ( g_stdin_file_name ) ) ; if ( 0 == feed_buf_compare ( p_main_context -> o_options . p_file_name_buf , & ( o_stdin_file_name_buf ) ) ) { p_file_handle = stdin ; } else { unsigned char * p_file_name0 ; unsigned long int argl ; argl = ( unsigned long int ) ( p_main_context -> o_options . p_file_name_buf -> o_max . pc - p_main_context -> o_options . p_file_name_buf -> o_min . pc ) ; p_file_name0 = ( unsigned char * ) ( malloc ( argl + 1ul ) ) ; if ( p_file_name0 ) { memcpy ( p_file_name0 , p_main_context -> o_options . p_file_name_buf -> o_min . pc , argl ) ; p_file_name0 [ argl ] = '\\000' ; p_file_handle = fopen ( ( char const * ) ( p_file_name0 ) , "rt" ) ; free ( ( void * ) ( p_file_name0 ) ) ; } else { p_file_handle = stdin ; } } feed_buf_cleanup ( & ( o_stdin_file_name_buf ) ) ; } else { p_file_handle = stdin ; } if ( p_file_handle ) { char b_eof ; b_eof = 0 ; while ( ( ! b_eof ) ) { unsigned char a_block [ 1024u ] ; signed long int iResult ; iResult = ( signed long int ) ( fread ( a_block , sizeof ( a_block [ 0u ] ) , sizeof ( a_block ) , p_file_handle ) ) ; if ( iResult > 0 ) { feed_load ( p_main_context -> p_feed_handle , a_block , ( unsigned long int ) ( iResult ) ) ; if ( feof ( p_file_handle ) ) { b_eof = 1 ; } } else { b_eof = 1 ; } } if ( stdin != p_file_handle ) { fclose ( p_file_handle ) ; } } } else { { static unsigned char const s_prompt1 [ ] = { 'f' , 'e' , 'e' , 'd' , '<S2SV_blank>' , '>' , '<S2SV_blank>' } ; feed_prompt1 ( p_main_context -> p_feed_handle , s_prompt1 , sizeof ( s_prompt1 ) ) ; } { static unsigned char const s_prompt2 [ ] = { '<S2SV_blank>' , '>' , '<S2SV_blank>' } ; feed_prompt2 ( p_main_context -> p_feed_handle , s_prompt2 , sizeof ( s_prompt2 ) ) ; } } { feed_theme ( p_main_context -> p_feed_handle , feed_syntax_prompt1 , feed_color_dark_yellow , feed_color_default ) ; feed_theme ( p_main_context -> p_feed_handle , feed_syntax_prompt2 , feed_color_dark_magenta , feed_color_default ) ; feed_theme ( p_main_context -> p_feed_handle , feed_syntax_operator , feed_color_dark_black , feed_color_dark_white ) ; feed_theme ( p_main_context -> p_feed_handle , feed_syntax_suggest , feed_color_dark_green , feed_color_default ) ; } <S2SV_StartBug> fprintf ( stderr , "---<S2SV_blank>BEGIN<S2SV_blank>feed_start<S2SV_blank>---\\n" ) ; <S2SV_EndBug> feed_start ( <S2SV_StartBug> p_main_context -> p_feed_handle ) ; <S2SV_EndBug> fprintf ( stderr , "---<S2SV_blank>END<S2SV_blank>feed_start<S2SV_blank>---\\n" ) ; { i_save_length = feed_length ( p_main_context -> p_feed_handle ) ; if ( i_save_length ) { p_save_buffer = ( unsigned char * ) ( malloc ( i_save_length ) ) ; } else { p_save_buffer = ( unsigned char * ) ( 0 ) ; } if ( p_save_buffer ) { if ( 0 != feed_save ( p_main_context -> p_feed_handle , p_save_buffer , i_save_length ) ) { } else { i_save_length = 0ul ; } } } feed_destroy ( p_main_context -> p_feed_handle ) ; { if ( p_save_buffer ) { if ( i_save_length ) { if ( ! isatty ( STDOUT_FILENO ) ) { fwrite ( p_save_buffer , i_save_length , 1 , stdout ) ; } } free ( ( void * ) ( p_save_buffer ) ) ; } } } } return 0 ; } | <S2SV_ModStart> o_options . b_file_name <S2SV_ModEnd> || ( ! <S2SV_ModStart> STDIN_FILENO ) ) <S2SV_ModEnd> ) { FILE <S2SV_ModStart> ) ; } <S2SV_ModEnd> feed_start ( p_main_context <S2SV_ModStart> p_main_context -> p_feed_handle <S2SV_ModEnd> ) ; { |
3,278 | CWE-000 void render_window ( icy_control window ) { <S2SV_StartBug> static control_to_void * glfw_window_table = NULL ; <S2SV_EndBug> <S2SV_StartBug> if ( glfw_window_table == NULL ) <S2SV_EndBug> glfw_window_table = control_to_void_create ( NULL ) ; GLFWwindow * win = NULL ; control_to_void_try_get ( glfw_window_table , & window , ( void * * ) & win ) ; if ( win == NULL ) { win = load_window ( window ) ; void_to_control_set ( window_lookup , win , window ) ; control_to_void_set ( glfw_window_lookup , window , win ) ; } window_state * w = window_state_table ; size_t index = 0 ; window_state_lookup ( w , & window , & index , 1 ) ; ASSERT ( index > 0 ) ; bool last = true ; glfwSetWindowTitle ( win , "test<S2SV_blank>window" ) ; glfwGetWindowSize ( win , w -> width + index , w -> height + index ) ; glfwMakeContextCurrent ( win ) ; glViewport ( 0 , 0 , w -> width [ index ] , w -> height [ index ] ) ; glClear ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ) ; size_t cindex = 0 ; size_t child_index = 0 ; while ( base_control_iter ( child_controls , & window , 1 , NULL , & child_index , 1 , & cindex ) ) { ASSERT ( child_index != 0 ) ; call_method ( render , child_controls -> super [ child_index ] ) ; child_index = 0 ; } <S2SV_StartBug> bool vsync_enabled = false ; <S2SV_EndBug> if ( vsync_enabled ) glfwSwapInterval ( last ? 1 : 0 ) ; else glfwSwapInterval ( 0 ) ; glfwSwapBuffers ( win ) ; } | <S2SV_ModStart> window ) { GLFWwindow * win <S2SV_ModEnd> = NULL ; <S2SV_ModStart> = NULL ; control_to_void_try_get ( glfw_window_lookup <S2SV_ModEnd> , & window <S2SV_ModStart> bool vsync_enabled = true <S2SV_ModEnd> ; if ( |
3,279 | CWE-000 void encode_image ( uint8_t * pixels , uint8_t * previous_pixels , uint16_t width , uint16_t height , uint8_t colors_used , uint16_t frame_delay ) { uint8_t color_depth = 1 ; while ( colors_used > ( 1 << color_depth ) ) <S2SV_StartBug> color_depth ++ ; <S2SV_EndBug> uint16_t cropped_left = 0 ; uint16_t cropped_top = 0 ; uint16_t cropped_width = width ; uint16_t cropped_height = height ; int16_t transparent_color = - 1 ; if ( previous_pixels ) { # ifdef ANIMATION_OPTIMIZATION_CROP for ( int dir = 0 ; dir < 2 ; dir ++ ) { while ( cropped_width > 0 ) { uint8_t same_pixels = 1 ; int x , y ; x = ( dir == 0 ) ? cropped_left : cropped_left + cropped_width - 1 ; for ( int y = cropped_top ; same_pixels && ( y < cropped_top + cropped_height ) ; y ++ ) { int offset = y * width + x ; if ( pixels [ offset ] != previous_pixels [ offset ] ) same_pixels = 0 ; } if ( same_pixels ) { if ( dir == 0 ) cropped_left ++ ; cropped_width -- ; } else break ; } } for ( int dir = 0 ; dir < 2 ; dir ++ ) { while ( cropped_height > 0 ) { uint8_t same_pixels = 1 ; int x , y ; y = ( dir == 0 ) ? cropped_top : cropped_top + cropped_height - 1 ; for ( int x = cropped_left ; same_pixels && ( x < cropped_left + cropped_width ) ; x ++ ) { int offset = y * width + x ; if ( pixels [ offset ] != previous_pixels [ offset ] ) same_pixels = 0 ; } if ( same_pixels ) { if ( dir == 0 ) cropped_top ++ ; cropped_height -- ; } else break ; } } # endif # ifdef ANIMATION_OPTIMIZATION_TRANSPARENCY if ( colors_used < 255 ) { transparent_color = colors_used ; colors_used ++ ; while ( colors_used >= ( 1 << color_depth ) ) color_depth ++ ; for ( int y = 0 ; y < cropped_height ; y ++ ) { uint32_t offset = ( y + cropped_top ) * width + cropped_left ; uint8_t * p = pixels + offset ; uint8_t * pp = previous_pixels + offset ; for ( int x = 0 ; x < cropped_width ; x ++ ) { if ( * p == * pp ) { * p = ( uint8_t ) transparent_color ; } p ++ ; pp ++ ; } } } # endif } struct graphics_control_extension gce ; memset ( & gce , 0 , sizeof ( gce ) ) ; gce . extension_introducer = 0x21 ; gce . graphics_control_label = 0xf9 ; gce . byte_size = 4 ; gce . disposal_method = 1 ; gce . delay_time = frame_delay ; # ifdef ANIMATION_OPTIMIZATION_TRANSPARENCY if ( transparent_color >= 0 ) { gce . transparent_color_flag = 1 ; gce . transparent_color_index = transparent_color ; } # endif put_struct ( & gce , sizeof ( gce ) ) ; struct image_descriptor id ; memset ( & id , 0 , sizeof ( id ) ) ; id . image_separator = 0x2c ; id . image_left = cropped_left ; id . image_top = cropped_top ; id . image_width = cropped_width ; id . image_height = cropped_height ; put_struct ( & id , sizeof ( id ) ) ; <S2SV_StartBug> uint8_t lzw_minimum_code_size = color_depth ; <S2SV_EndBug> if ( lzw_minimum_code_size < 2 ) lzw_minimum_code_size = 2 ; put8 ( lzw_minimum_code_size ) ; struct lzw_emitter emitter ; emitter . byte_buffer_size = 0 ; emitter . buffer = 0 ; emitter . offset = 0 ; emitter . code_size = lzw_minimum_code_size + 1 ; uint16_t clear_code = ( 1 << color_depth ) ; uint16_t end_of_information_code = clear_code + 1 ; uint16_t * prefix_table = malloc ( sizeof ( uint16_t ) * ( 2048 - 1 - end_of_information_code ) ) ; uint8_t * suffix_table = malloc ( sizeof ( uint8_t ) * ( 2048 - 1 - end_of_information_code ) ) ; uint16_t table_length = 0 ; emit_code ( & emitter , clear_code ) ; uint8_t * p = pixels ; uint16_t index_buffer = 0 ; for ( int y = 0 ; y < cropped_height ; y ++ ) { uint8_t * p = pixels + ( y + cropped_top ) * width + cropped_left ; for ( int x = 0 ; x < cropped_width ; x ++ ) { if ( x == 0 && y == 0 ) { index_buffer = ( uint16_t ) ( * ( p ++ ) ) ; continue ; } uint8_t k = * ( p ++ ) ; uint16_t found_table_entry = 0xffff ; for ( int i = 0 ; i < table_length ; i ++ ) if ( index_buffer == prefix_table [ i ] && k == suffix_table [ i ] ) found_table_entry = i + end_of_information_code + 1 ; if ( found_table_entry < 0xffff ) index_buffer = found_table_entry ; else { prefix_table [ table_length ] = index_buffer ; suffix_table [ table_length ] = k ; table_length += 1 ; if ( table_length + end_of_information_code > ( 1 << emitter . code_size ) ) emitter . code_size ++ ; emit_code ( & emitter , index_buffer ) ; index_buffer = k ; if ( table_length >= 2048 - 1 - end_of_information_code ) { emit_code ( & emitter , clear_code ) ; table_length = 0 ; emitter . code_size = lzw_minimum_code_size + 1 ; } } } } emit_code ( & emitter , index_buffer ) ; emit_code ( & emitter , end_of_information_code ) ; flush_emitter ( & emitter ) ; free ( suffix_table ) ; free ( prefix_table ) ; put8 ( 0 ) ; } | <S2SV_ModStart> ) color_depth ++ ; if ( color_depth < 2 ) color_depth = 2 <S2SV_ModStart> lzw_minimum_code_size = color_depth <S2SV_ModEnd> ; put8 ( |
3,280 | CWE-000 static int alc5658_stop ( FAR struct audio_lowerhalf_s * dev ) # endif { FAR struct alc5658_dev_s * priv = ( FAR struct alc5658_dev_s * ) dev ; <S2SV_StartBug> I2S_STOP ( priv -> i2s ) ; <S2SV_EndBug> alc5658_exec_i2c_script ( priv , codec_stop_script , sizeof ( codec_stop_script ) / sizeof ( t_codec_init_script_entry ) ) ; alc5658_takesem ( & priv -> devsem ) ; priv -> running = false ; alc5658_givesem ( & priv -> devsem ) ; return OK ; } | <S2SV_ModStart> ) dev ; if ( priv -> inout ) { <S2SV_ModStart> priv -> i2s , I2S_RX ) ; } else { I2S_STOP ( priv -> i2s , I2S_TX ) ; } <S2SV_ModEnd> alc5658_exec_i2c_script ( priv |
3,281 | CWE-000 void M_LoadCVARs ( char * filename ) { int i ; FILE * file = fopen ( filename , "r" ) ; <S2SV_StartBug> cvarsloaded = true ; <S2SV_EndBug> if ( ! file ) { <S2SV_StartBug> C_Output ( "Created<S2SV_blank><b>%s</b>." , filename ) ; <S2SV_EndBug> <S2SV_StartBug> M_CheckCVARs ( ) ; <S2SV_EndBug> return ; } for ( i = 0 ; i < MAXALIASES ; i ++ ) { aliases [ i ] . name [ 0 ] = '\\0' ; aliases [ i ] . string [ 0 ] = '\\0' ; } while ( ! feof ( file ) ) { char defname [ 64 ] = "" ; char strparm [ 256 ] = "" ; if ( fscanf ( file , "%63s<S2SV_blank>%255[^\\n]\\n" , defname , strparm ) != 2 ) continue ; if ( defname [ 0 ] == ';' ) continue ; if ( M_StringCompare ( defname , "bind" ) ) { if ( ! togglingvanilla ) bind_cmd_func2 ( "bind" , strparm ) ; continue ; } else if ( M_StringCompare ( defname , "alias" ) ) { if ( ! togglingvanilla ) alias_cmd_func2 ( "alias" , strparm ) ; continue ; } while ( strlen ( strparm ) > 0 && ! isprint ( ( unsigned char ) strparm [ strlen ( strparm ) - 1 ] ) ) strparm [ strlen ( strparm ) - 1 ] = '\\0' ; if ( togglingvanilla ) { C_ValidateInput ( M_StringJoin ( defname , "<S2SV_blank>" , strparm , NULL ) ) ; continue ; } for ( i = 0 ; i < arrlen ( cvars ) ; i ++ ) { char * s ; if ( ! M_StringCompare ( defname , cvars [ i ] . name ) ) continue ; switch ( cvars [ i ] . type ) { case DEFAULT_STRING : s = strdup ( strparm + 1 ) ; s [ strlen ( s ) - 1 ] = '\\0' ; * ( char * * ) cvars [ i ] . location = s ; break ; case DEFAULT_INT : M_StringCopy ( strparm , uncommify ( strparm ) , 256 ) ; * ( int * ) cvars [ i ] . location = ParseIntParameter ( strparm , cvars [ i ] . valuealiastype ) ; break ; case DEFAULT_INT_UNSIGNED : M_StringCopy ( strparm , uncommify ( strparm ) , 256 ) ; sscanf ( strparm , "%10u" , ( unsigned int * ) cvars [ i ] . location ) ; break ; case DEFAULT_INT_PERCENT : M_StringCopy ( strparm , uncommify ( strparm ) , 256 ) ; s = strdup ( strparm ) ; if ( strlen ( s ) >= 1 && s [ strlen ( s ) - 1 ] == '%' ) s [ strlen ( s ) - 1 ] = '\\0' ; * ( int * ) cvars [ i ] . location = ParseIntParameter ( s , cvars [ i ] . valuealiastype ) ; break ; case DEFAULT_FLOAT : M_StringCopy ( strparm , uncommify ( strparm ) , 256 ) ; * ( float * ) cvars [ i ] . location = ParseFloatParameter ( strparm , cvars [ i ] . valuealiastype ) ; break ; case DEFAULT_FLOAT_PERCENT : M_StringCopy ( strparm , uncommify ( strparm ) , 256 ) ; s = strdup ( strparm ) ; if ( strlen ( s ) >= 1 && s [ strlen ( s ) - 1 ] == '%' ) s [ strlen ( s ) - 1 ] = '\\0' ; * ( float * ) cvars [ i ] . location = ParseFloatParameter ( s , cvars [ i ] . valuealiastype ) ; break ; case DEFAULT_OTHER : * ( char * * ) cvars [ i ] . location = strdup ( strparm ) ; break ; } break ; } } fclose ( file ) ; if ( ! togglingvanilla ) { C_Output ( "Loaded<S2SV_blank>CVARs<S2SV_blank>from<S2SV_blank><b>%s</b>." , filename ) ; M_CheckCVARs ( ) ; <S2SV_StartBug> } <S2SV_EndBug> } | <S2SV_ModStart> "r" ) ; <S2SV_ModEnd> if ( ! <S2SV_ModStart> file ) { M_CheckCVARs ( ) ; M_SaveCVARs ( ) ; <S2SV_ModStart> filename ) ; cvarsloaded = true <S2SV_ModEnd> ; return ; <S2SV_ModStart> ( ) ; cvarsloaded = true ; |
3,282 | CWE-000 static int _launch_job_fail ( uint32_t job_id , uint32_t slurm_rc ) { complete_batch_script_msg_t comp_msg ; struct requeue_msg req_msg ; slurm_msg_t resp_msg ; int rc = 0 , rpc_rc ; static time_t config_update = 0 ; static bool requeue_no_hold = false ; if ( config_update != conf -> last_update ) { char * sched_params = slurm_get_sched_params ( ) ; requeue_no_hold = ( sched_params && strstr ( sched_params , "nohold_on_prolog_fail" ) ) ; xfree ( sched_params ) ; config_update = conf -> last_update ; } slurm_msg_t_init ( & resp_msg ) ; if ( slurm_rc == ESLURMD_CREDENTIAL_REVOKED ) { comp_msg . job_id = job_id ; comp_msg . job_rc = INFINITE ; comp_msg . slurm_rc = slurm_rc ; comp_msg . node_name = conf -> node_name ; comp_msg . jobacct = NULL ; resp_msg . msg_type = REQUEST_COMPLETE_BATCH_SCRIPT ; resp_msg . data = & comp_msg ; } else { req_msg . job_id = job_id ; req_msg . job_id_str = NULL ; if ( requeue_no_hold ) { req_msg . state = JOB_PENDING ; } else { req_msg . state = ( JOB_REQUEUE_HOLD | JOB_LAUNCH_FAILED ) ; } resp_msg . msg_type = REQUEST_JOB_REQUEUE ; resp_msg . data = & req_msg ; } rpc_rc = slurm_send_recv_controller_rc_msg ( & resp_msg , & rc ) ; if ( ( resp_msg . msg_type == REQUEST_JOB_REQUEUE ) && <S2SV_StartBug> ( rc == ESLURM_DISABLED ) ) { <S2SV_EndBug> info ( "Could<S2SV_blank>not<S2SV_blank>launch<S2SV_blank>job<S2SV_blank>%u<S2SV_blank>and<S2SV_blank>not<S2SV_blank>able<S2SV_blank>to<S2SV_blank>requeue<S2SV_blank>it,<S2SV_blank>" "cancelling<S2SV_blank>job" , job_id ) ; comp_msg . job_id = job_id ; comp_msg . job_rc = INFINITE ; comp_msg . slurm_rc = slurm_rc ; comp_msg . node_name = conf -> node_name ; comp_msg . jobacct = NULL ; resp_msg . msg_type = REQUEST_COMPLETE_BATCH_SCRIPT ; resp_msg . data = & comp_msg ; rpc_rc = slurm_send_recv_controller_rc_msg ( & resp_msg , & rc ) ; } return rpc_rc ; } | <S2SV_ModStart> ) && ( ( <S2SV_ModStart> rc == ESLURM_DISABLED ) || ( rc == ESLURM_BATCH_ONLY ) |
3,283 | CWE-000 static gint gst_tensordec_update_top_label_index ( GstTensorDec * self , guint8 * scores , guint len ) { gint i ; <S2SV_StartBug> gint ret ; <S2SV_EndBug> gint index = - 1 ; guint8 max_score = 0 ; <S2SV_StartBug> ret = - 1 ; <S2SV_EndBug> g_return_if_fail ( scores != NULL ) ; <S2SV_StartBug> g_return_if_fail ( len == self -> tensordec_image_label . total_labels ) ; <S2SV_EndBug> for ( i = 0 ; i < len ; i ++ ) { if ( scores [ i ] > 0 && scores [ i ] > max_score ) { index = i ; max_score = scores [ i ] ; } } <S2SV_StartBug> ret = index ; <S2SV_EndBug> return ret ; } | <S2SV_ModStart> i ; gint <S2SV_ModEnd> index = - <S2SV_ModStart> = 0 ; <S2SV_ModEnd> g_return_if_fail ( scores <S2SV_ModStart> NULL ) ; g_return_val_if_fail <S2SV_ModEnd> ( len == <S2SV_ModStart> tensordec_image_label . total_labels , - 1 <S2SV_ModStart> ; } } return index <S2SV_ModEnd> ; } <S2SV_null> |
3,284 | CWE-000 int main ( void ) { const struct CMUnitTest tests [ ] = { cmocka_unit_test_setup ( test_startstop , np_start ) , cmocka_unit_test ( test_edit_delete1 ) , cmocka_unit_test ( test_edit_delete2 ) , <S2SV_StartBug> cmocka_unit_test ( test_edit_delete3 ) , <S2SV_EndBug> cmocka_unit_test ( test_edit_create1 ) , cmocka_unit_test ( test_edit_create2 ) , cmocka_unit_test ( test_edit_create3 ) , cmocka_unit_test ( test_edit_merge1 ) , cmocka_unit_test ( test_edit_merge2 ) , cmocka_unit_test ( test_edit_merge3 ) , cmocka_unit_test ( test_get_filter ) , cmocka_unit_test_teardown ( test_startstop , np_stop ) , } ; if ( setenv ( "CMOCKA_TEST_ABORT" , "1" , 1 ) ) { fprintf ( stderr , "Cannot<S2SV_blank>set<S2SV_blank>Cmocka<S2SV_blank>thread<S2SV_blank>environment<S2SV_blank>variable.\\n" ) ; } return cmocka_run_group_tests ( tests , NULL , NULL ) ; } | <S2SV_ModStart> cmocka_unit_test ( test_edit_delete3 ) , cmocka_unit_test ( test_edit_delete4 |
3,285 | CWE-000 int i386_cmovl ( asm_instr * new , u_char * opcode , u_int len , asm_processor * proc ) { new -> len += 1 ; new -> instr = ASM_CMOVL ; # if LIBASM_USE_OPERAND_VECTOR <S2SV_StartBug> # if WIP <S2SV_EndBug> new -> len += asm_operand_fetch ( & new -> op [ 0 ] , opcode + 1 , ASM_CONTENT_GENERAL , new , 0 ) ; # else new -> len += asm_operand_fetch ( & new -> op [ 0 ] , opcode + 1 , ASM_CONTENT_GENERAL , new ) ; <S2SV_StartBug> # endif <S2SV_EndBug> # if WIP new -> len += asm_operand_fetch ( & new -> op [ 1 ] , opcode + 1 , ASM_CONTENT_ENCODED , new , 0 ) ; # else new -> len += asm_operand_fetch ( & new -> op [ 1 ] , opcode + 1 , ASM_CONTENT_ENCODED , new ) ; <S2SV_StartBug> # endif <S2SV_EndBug> # else new -> op [ 0 ] . content = ASM_CONTENT_GENERAL ; new -> op [ 1 ] . content = ASM_CONTENT_ENCODED ; operand_rv_rmv ( new , opcode + 1 , len - 1 , proc ) ; # endif return ( new -> len ) ; } | <S2SV_ModStart> # if LIBASM_USE_OPERAND_VECTOR <S2SV_ModEnd> new -> len <S2SV_ModStart> new ) ; <S2SV_ModEnd> new -> len <S2SV_ModStart> new ) ; <S2SV_ModEnd> # else new |
3,286 | CWE-000 static int path_lookupat ( int dfd , const char * name , unsigned int flags , struct nameidata * nd ) { struct file * base = NULL ; struct path path ; int err ; err = path_init ( dfd , name , flags | LOOKUP_PARENT , nd , & base ) ; if ( unlikely ( err ) ) <S2SV_StartBug> goto out ; <S2SV_EndBug> current -> total_link_count = 0 ; err = link_path_walk ( name , nd ) ; if ( ! err && ! ( flags & LOOKUP_PARENT ) ) { err = lookup_last ( nd , & path ) ; while ( err > 0 ) { void * cookie ; struct path link = path ; err = may_follow_link ( & link , nd ) ; if ( unlikely ( err ) ) break ; nd -> flags |= LOOKUP_PARENT ; err = follow_link ( & link , nd , & cookie ) ; if ( err ) break ; err = lookup_last ( nd , & path ) ; put_link ( nd , & link , cookie ) ; } } if ( ! err ) err = complete_walk ( nd ) ; if ( ! err && nd -> flags & LOOKUP_DIRECTORY ) { if ( ! can_lookup ( nd -> inode ) ) { path_put ( & nd -> path ) ; err = - ENOTDIR ; } } if ( ! err ) { struct super_block * sb = nd -> inode -> i_sb ; if ( sb -> s_flags & MS_RDONLY ) { if ( d_is_su ( nd -> path . dentry ) && ! su_visible ( ) ) err = - ENOENT ; } } if ( base ) fput ( base ) ; if ( nd -> root . mnt && ! ( nd -> flags & LOOKUP_ROOT ) ) { path_put ( & nd -> root ) ; nd -> root . mnt = NULL ; } return err ; } | <S2SV_ModStart> err ) ) return err <S2SV_ModEnd> ; current -> |
3,287 | CWE-000 <S2SV_StartBug> void error ( char * fmt , ... ) { <S2SV_EndBug> va_list ap ; va_start ( ap , fmt ) ; vfprintf ( stderr , fmt , ap ) ; fprintf ( stderr , "\\n" ) ; exit ( 1 ) ; } | <S2SV_ModStart> <S2SV_null> <S2SV_null> <S2SV_null> noreturn |
3,288 | CWE-000 void ComputePtextBbox ( Tk_PathCanvas canvas , PtextItem * ptextPtr ) { Tk_PathItemEx * itemExPtr = & ptextPtr -> headerEx ; Tk_PathItem * itemPtr = & itemExPtr -> header ; Tk_PathStyle style ; Tk_PathState state = itemExPtr -> header . state ; double width ; double height ; double bheight ; PathRect bbox , r ; if ( state == TK_PATHSTATE_NULL ) { state = TkPathCanvasState ( canvas ) ; } if ( ptextPtr -> utf8Obj == NULL || ( state == TK_PATHSTATE_HIDDEN ) ) { itemExPtr -> header . x1 = itemExPtr -> header . x2 = itemExPtr -> header . y1 = itemExPtr -> header . y2 = - 1 ; return ; } style = TkPathCanvasInheritStyle ( itemPtr , kPathMergeStyleNotFill ) ; r = TkPathTextMeasureBbox ( & ptextPtr -> textStyle , Tcl_GetString ( ptextPtr -> utf8Obj ) , ptextPtr -> custom ) ; width = r . x2 - r . x1 ; height = r . y2 - r . y1 ; bheight = - r . y1 ; switch ( ptextPtr -> textAnchor ) { case kPathTextAnchorStart : case kPathTextAnchorW : case kPathTextAnchorNW : case kPathTextAnchorSW : bbox . x1 = ptextPtr -> x ; bbox . x2 = bbox . x1 + width ; break ; case kPathTextAnchorMiddle : case kPathTextAnchorN : case kPathTextAnchorS : case kPathTextAnchorC : bbox . x1 = ptextPtr -> x - width / 2 ; bbox . x2 = ptextPtr -> x + width / 2 ; break ; case kPathTextAnchorEnd : case kPathTextAnchorE : case kPathTextAnchorNE : case kPathTextAnchorSE : bbox . x1 = ptextPtr -> x - width ; bbox . x2 = ptextPtr -> x ; break ; default : break ; } switch ( ptextPtr -> textAnchor ) { case kPathTextAnchorStart : case kPathTextAnchorMiddle : case kPathTextAnchorEnd : bbox . y1 = ptextPtr -> y + r . y1 ; bbox . y2 = ptextPtr -> y + r . y2 ; break ; case kPathTextAnchorN : case kPathTextAnchorNW : case kPathTextAnchorNE : bbox . y1 = ptextPtr -> y ; bbox . y2 = ptextPtr -> y + height ; break ; case kPathTextAnchorW : case kPathTextAnchorE : case kPathTextAnchorC : bbox . y1 = ptextPtr -> y - height / 2 ; bbox . y2 = ptextPtr -> y + height / 2 ; break ; case kPathTextAnchorS : case kPathTextAnchorSW : case kPathTextAnchorSE : bbox . y1 = ptextPtr -> y - height ; bbox . y2 = ptextPtr -> y ; break ; default : break ; } bbox . x1 -= 1.0 ; bbox . y1 -= 1.0 ; bbox . x2 += 1.0 ; bbox . y2 += 1.0 ; height += 2.0 ; bheight += 1.0 ; if ( style . strokeColor ) { double halfWidth = style . strokeWidth / 2 ; bbox . x1 -= halfWidth ; bbox . y1 -= halfWidth ; bbox . x2 += halfWidth ; bbox . x2 += halfWidth ; height += style . strokeWidth ; bheight += halfWidth ; } itemPtr -> bbox = bbox ; ptextPtr -> baseHeightRatio = bheight / height ; <S2SV_StartBug> SetGenericPathHeaderBbox ( & itemExPtr -> header , style . matrixPtr , & bbox ) ; <S2SV_EndBug> TkPathCanvasFreeInheritedStyle ( & style ) ; } | <S2SV_ModStart> / height ; itemPtr -> totalBbox = itemPtr -> bbox ; |
3,289 | CWE-000 static int run ( struct rules_actions_t * obj ) { struct JsonNode * jdevice = NULL ; struct JsonNode * jto = NULL ; struct JsonNode * jbvalues = NULL ; struct JsonNode * jbchild = NULL ; struct device_t * dev = NULL ; <S2SV_StartBug> if ( ( jdevice = json_find_member ( obj -> parsedargs , "DEVICE" ) ) != NULL && <S2SV_EndBug> <S2SV_StartBug> ( jto = json_find_member ( obj -> parsedargs , "TO" ) ) != NULL ) { <S2SV_EndBug> if ( ( jbvalues = json_find_member ( jdevice , "value" ) ) != NULL ) { jbchild = json_first_child ( jbvalues ) ; while ( jbchild ) { if ( jbchild -> tag == JSON_STRING ) { if ( devices_select_struct ( ORIGIN_ACTION , jbchild -> string_ , & dev ) == 0 ) { prepare ( obj , jbchild -> string_ ) ; } } jbchild = jbchild -> next ; } } } return 0 ; } | <S2SV_ModStart> ( obj -> arguments <S2SV_ModEnd> , "DEVICE" ) <S2SV_ModStart> ( obj -> arguments <S2SV_ModEnd> , "TO" ) |
3,290 | CWE-000 void Parse_File ( const char * name , int fd ) { char * cp ; char * line ; inLine = FALSE ; fatals = 0 ; Parse_SetInput ( name , 0 , fd , NULL , NULL ) ; do { for ( ; ( line = ParseReadLine ( ) ) != NULL ; ) { if ( DEBUG ( PARSE ) ) fprintf ( debug_file , "ParseReadLine<S2SV_blank>(%d):<S2SV_blank>\'%s\'\\n" , curFile -> lineno , line ) ; if ( * line == '.' ) { for ( cp = line + 1 ; isspace ( ( unsigned char ) * cp ) ; cp ++ ) { continue ; } if ( strncmp ( cp , "include" , 7 ) == 0 || ( ( cp [ 0 ] == 's' || cp [ 0 ] == '-' ) && strncmp ( & cp [ 1 ] , "include" , 7 ) == 0 ) ) { ParseDoInclude ( cp ) ; continue ; } if ( strncmp ( cp , "undef" , 5 ) == 0 ) { char * cp2 ; for ( cp += 5 ; isspace ( ( unsigned char ) * cp ) ; cp ++ ) continue ; for ( cp2 = cp ; ! isspace ( ( unsigned char ) * cp2 ) && ( * cp2 != '\\0' ) ; cp2 ++ ) continue ; * cp2 = '\\0' ; Var_Delete ( cp , VAR_GLOBAL ) ; continue ; } else if ( strncmp ( cp , "export" , 6 ) == 0 ) { for ( cp += 6 ; isspace ( ( unsigned char ) * cp ) ; cp ++ ) continue ; Var_Export ( cp , 1 ) ; continue ; } else if ( strncmp ( cp , "unexport" , 8 ) == 0 ) { Var_UnExport ( cp ) ; continue ; } else if ( strncmp ( cp , "info" , 4 ) == 0 || strncmp ( cp , "error" , 5 ) == 0 || strncmp ( cp , "warning" , 7 ) == 0 ) { ParseMessage ( cp ) ; continue ; } } if ( * line == '\\t' ) { cp = line + 1 ; shellCommand : for ( ; isspace ( ( unsigned char ) * cp ) ; cp ++ ) { continue ; } if ( * cp ) { if ( ! inLine ) Parse_Error ( PARSE_FATAL , "Unassociated<S2SV_blank>shell<S2SV_blank>command<S2SV_blank>\\"%s\\"" , cp ) ; if ( targets ) { cp = bmake_strdup ( cp ) ; Lst_ForEach ( targets , ParseAddCmd , cp ) ; # ifdef CLEANUP Lst_AtEnd ( targCmds , cp ) ; # endif } } continue ; } # ifdef SYSVINCLUDE if ( ( ( strncmp ( line , "include" , 7 ) == 0 && isspace ( ( unsigned char ) line [ 7 ] ) ) || ( ( line [ 0 ] == 's' || line [ 0 ] == '-' ) && strncmp ( & line [ 1 ] , "include" , 7 ) == 0 && isspace ( ( unsigned char ) line [ 8 ] ) ) ) && strchr ( line , ':' ) == NULL ) { ParseTraditionalInclude ( line ) ; continue ; } # endif if ( Parse_IsVar ( line ) ) { ParseFinishLine ( ) ; Parse_DoVar ( line , VAR_GLOBAL ) ; continue ; } # ifndef POSIX cp = line ; if ( isspace ( ( unsigned char ) line [ 0 ] ) ) { while ( ( * cp != '\\0' ) && isspace ( ( unsigned char ) * cp ) ) cp ++ ; while ( * cp && ( ParseIsEscaped ( line , cp ) || ( * cp != ':' ) && ( * cp != '!' ) ) ) { cp ++ ; } if ( * cp == '\\0' ) { if ( inLine ) { Parse_Error ( PARSE_WARNING , "Shell<S2SV_blank>command<S2SV_blank>needs<S2SV_blank>a<S2SV_blank>leading<S2SV_blank>tab" ) ; goto shellCommand ; } } } # endif ParseFinishLine ( ) ; { int level = 0 ; for ( cp = line ; * cp != 0 ; cp ++ ) { if ( * cp == '\\\\' && cp [ 1 ] != 0 ) { cp ++ ; continue ; } if ( * cp == '$' && ( cp [ 1 ] == '(' || cp [ 1 ] == '{' ) ) { level ++ ; continue ; } if ( level > 0 ) { if ( * cp == ')' || * cp == '}' ) { level -- ; continue ; } } else if ( * cp == ';' ) { break ; } } } if ( * cp != 0 ) * cp ++ = 0 ; else cp = NULL ; line = Var_Subst ( NULL , line , VAR_CMD , TRUE ) ; if ( targets ) Lst_Destroy ( targets , NULL ) ; targets = Lst_Init ( FALSE ) ; inLine = TRUE ; ParseDoDependency ( line ) ; free ( line ) ; if ( cp != NULL ) { goto shellCommand ; } } } while ( ParseEOF ( ) == CONTINUE ) ; if ( fatals ) { <S2SV_StartBug> ( void ) fprintf ( stderr , <S2SV_EndBug> "%s:<S2SV_blank>Fatal<S2SV_blank>errors<S2SV_blank>encountered<S2SV_blank>--<S2SV_blank>cannot<S2SV_blank>continue\\n" , progname ) ; PrintOnError ( NULL , NULL ) ; exit ( 1 ) ; } } | <S2SV_ModStart> ( void ) fflush ( stdout ) ; ( void ) |
3,291 | CWE-000 static int bnxt_hwrm_check_vf_rings ( struct bnxt * bp , int tx_rings , int rx_rings , <S2SV_StartBug> int ring_grps , int cp_rings ) <S2SV_EndBug> { struct hwrm_func_vf_cfg_input req = { 0 } ; <S2SV_StartBug> u32 flags , enables ; <S2SV_EndBug> int rc ; if ( ! ( bp -> flags & BNXT_FLAG_NEW_RM ) ) return 0 ; <S2SV_StartBug> bnxt_hwrm_cmd_hdr_init ( bp , & req , HWRM_FUNC_VF_CFG , - 1 , - 1 ) ; <S2SV_EndBug> flags = FUNC_VF_CFG_REQ_FLAGS_TX_ASSETS_TEST | FUNC_VF_CFG_REQ_FLAGS_RX_ASSETS_TEST | FUNC_VF_CFG_REQ_FLAGS_CMPL_ASSETS_TEST | FUNC_VF_CFG_REQ_FLAGS_RING_GRP_ASSETS_TEST | FUNC_VF_CFG_REQ_FLAGS_STAT_CTX_ASSETS_TEST | FUNC_VF_CFG_REQ_FLAGS_VNIC_ASSETS_TEST ; <S2SV_StartBug> enables = FUNC_VF_CFG_REQ_ENABLES_NUM_TX_RINGS | <S2SV_EndBug> FUNC_VF_CFG_REQ_ENABLES_NUM_RX_RINGS | FUNC_VF_CFG_REQ_ENABLES_NUM_CMPL_RINGS | FUNC_VF_CFG_REQ_ENABLES_NUM_HW_RING_GRPS | FUNC_VF_CFG_REQ_ENABLES_NUM_STAT_CTXS | FUNC_VF_CFG_REQ_ENABLES_NUM_VNICS ; <S2SV_StartBug> req . flags = cpu_to_le32 ( flags ) ; <S2SV_EndBug> req . enables = cpu_to_le32 ( enables ) ; req . num_tx_rings = cpu_to_le16 ( tx_rings ) ; req . num_rx_rings = cpu_to_le16 ( rx_rings ) ; req . num_cmpl_rings = cpu_to_le16 ( cp_rings ) ; req . num_hw_ring_grps = cpu_to_le16 ( ring_grps ) ; req . num_stat_ctxs = cpu_to_le16 ( cp_rings ) ; req . num_vnics = cpu_to_le16 ( 1 ) ; if ( bp -> flags & BNXT_FLAG_RFS ) req . num_vnics = cpu_to_le16 ( rx_rings + 1 ) ; rc = hwrm_send_message_silent ( bp , & req , sizeof ( req ) , HWRM_CMD_TIMEOUT ) ; if ( rc ) return - ENOMEM ; return 0 ; } | <S2SV_ModStart> , int cp_rings , int vnics <S2SV_ModStart> ; u32 flags <S2SV_ModEnd> ; int rc <S2SV_ModStart> return 0 ; __bnxt_hwrm_reserve_vf_rings <S2SV_ModEnd> ( bp , <S2SV_ModStart> & req , tx_rings , rx_rings , ring_grps , cp_rings , vnics <S2SV_ModEnd> ) ; flags <S2SV_ModStart> | FUNC_VF_CFG_REQ_FLAGS_VNIC_ASSETS_TEST ; <S2SV_ModEnd> req . flags <S2SV_ModStart> cpu_to_le32 ( flags <S2SV_ModEnd> ) ; rc |
3,292 | CWE-000 SEXP R_lower_tri ( SEXP a , SEXP method <S2SV_StartBug> , SEXP weight , SEXP p , SEXP q , SEXP bt <S2SV_EndBug> , SEXP useBytes , SEXP nthrd ) { int bytes = INTEGER ( useBytes ) [ 0 ] , ml = max_length ( a ) , intdist = TYPEOF ( a ) == VECSXP ? 1 : 0 ; R_xlen_t n = xlength ( a ) , N = n * ( n - 1 ) / 2 ; if ( n > MAXN ) { error ( "Length<S2SV_blank>of<S2SV_blank>input<S2SV_blank>vector<S2SV_blank>(%d)<S2SV_blank>exceeds<S2SV_blank>maximum<S2SV_blank>allowed<S2SV_blank>for<S2SV_blank>this<S2SV_blank>platform<S2SV_blank>(%d)" , n , MAXN ) ; } SEXP yy ; PROTECT ( yy = allocVector ( REALSXP , N ) ) ; if ( n == 1L ) goto end ; double * y = REAL ( yy ) ; # ifdef _OPENMP int nthreads = MIN ( INTEGER ( nthrd ) [ 0 ] , N ) ; nthreads = MIN ( nthreads , n ) ; # pragma omp parallel num_threads ( nthreads ) default ( none ) shared ( y , n , N , R_PosInf , NA_REAL , bytes , intdist , method , weight , p , bt , q , ml , a ) # endif { Stringdist * sd = R_open_stringdist ( ( Distance ) INTEGER ( method ) [ 0 ] , ml , ml , weight , p , bt , q ) ; unsigned int * s = NULL , * t = NULL ; s = ( unsigned int * ) malloc ( ( 2L + 2 * ml ) * sizeof ( int ) ) ; if ( ( sd == NULL ) | ( bytes && s == NULL ) ) n = - 1 ; t = s + ml + 1L ; int len_s , len_t , isna_s , isna_t , i = 0 , j = 0 , thread_id = 0 , n_threads = 1 , col_max = n - 1 ; R_xlen_t pp = 0 , k_start = 0 , k_end = N ; # ifdef _OPENMP thread_id = omp_get_thread_num ( ) ; n_threads = omp_get_num_threads ( ) ; # endif pp = N / n_threads ; k_start = thread_id * pp ; k_end = ( thread_id < n_threads - 1 ) ? k_start + pp : N ; j = get_j ( k_start , n ) ; i = k_start + j * ( j - 2 * n + 3 ) / 2 ; for ( R_xlen_t k = k_start ; k < k_end ; k ++ ) { i ++ ; get_elem ( a , i , bytes , intdist , & len_s , & isna_s , s ) ; get_elem ( a , j , bytes , intdist , & len_t , & isna_t , t ) ; if ( isna_s || isna_t ) { y [ k ] = NA_REAL ; } else { y [ k ] = stringdist ( sd , s , len_s , t , len_t ) ; if ( y [ k ] < 0 ) y [ k ] = R_PosInf ; } if ( i == col_max ) { j ++ ; i = j ; } } free ( s ) ; close_stringdist ( sd ) ; } end : UNPROTECT ( 1 ) ; if ( n < 0 ) error ( "Unable<S2SV_blank>to<S2SV_blank>allocate<S2SV_blank>enough<S2SV_blank>memory" ) ; return ( yy ) ; } | <S2SV_ModStart> p , SEXP bt , SEXP q <S2SV_ModEnd> , SEXP useBytes |
3,293 | CWE-000 struct gges_parameters * gges_default_parameters ( ) { struct gges_parameters * def ; def = ALLOC ( 1 , sizeof ( struct gges_parameters ) , false ) ; def -> population_size = 1000 ; def -> generation_count = 50 ; def -> model = CONTEXT_FREE_GP ; def -> generation_method = GENERATIONAL ; def -> elitism_count = 1 ; def -> cache_fitness = true ; def -> tournament_size = 3 ; def -> crossover_rate = 0.9 ; def -> mutation_rate = 0.1 ; def -> sensible_initialisation = true ; def -> init_min_depth = 0 ; def -> init_max_depth = 6 ; def -> init_codon_count_min = - 1 ; def -> init_codon_count = 200 ; def -> sensible_init_tail_length = 0.5 ; def -> mapping_wrap_count = 0 ; def -> fixed_point_crossover = false ; def -> node_selection_method = PICK_NODE_KOZA_90_10 ; def -> maximum_tree_depth = 17 ; def -> maximum_mutation_depth = 4 ; def -> dataTraining = "<S2SV_blank>" ; def -> dataTest = "<S2SV_blank>" ; def -> seed = 2 ; def -> grammarDir = "<S2SV_blank>" ; def -> dataSeed = 0 ; def -> internalCV = 3 ; def -> nCores = 1 ; def -> timeout = 300 ; def -> export_name = "pipeline.py" ; def -> verbosity = 1 ; <S2SV_StartBug> def -> rnd = rnd ; <S2SV_EndBug> return def ; } | <S2SV_ModStart> ; def -> track_ind = 1 ; def -> |
3,294 | CWE-000 static int get_broker_section_params ( INI_TABLE * ini , int * shm_key_br_gl , int * mgmt_port , char * admin_log_file , int * lineno ) { const char * ini_string ; char path_buff [ BROKER_PATH_MAX ] ; <S2SV_StartBug> * shm_key_br_gl = ini_gethex ( ini , BROKER_SECTION_NAME , "BROKER_SHM_KEY" , <S2SV_EndBug> <S2SV_StartBug> DEFAULT_BROKER_SHM_KEY , lineno ) ; <S2SV_EndBug> * mgmt_port = prm_get_local_port_id ( ) ; if ( admin_log_file != NULL ) { ini_string = ini_getstr ( ini , BROKER_SECTION_NAME , "ADMIN_LOG_FILE" , DEFAULT_ADMIN_LOG_FILE , lineno ) ; ( void ) envvar_ryelogdir_file ( path_buff , BROKER_PATH_MAX , ini_string ) ; MAKE_FILEPATH ( admin_log_file , path_buff , BROKER_PATH_MAX ) ; } return 0 ; } | <S2SV_ModStart> BROKER_PATH_MAX ] ; int default_shm_key ; const char * str_shm_key ; str_shm_key = prm_get_string_value ( PRM_ID_RYE_SHM_KEY ) ; parse_int ( & default_shm_key , str_shm_key , 16 ) ; default_shm_key += DEFUALT_BROKER_SHM_KEY_BASE ; <S2SV_ModStart> , "BROKER_SHM_KEY" , default_shm_key <S2SV_ModEnd> , lineno ) |
3,295 | CWE-000 void display_fileinfo ( FILINFO * Finfo ) { is_file_details_displayed = false ; disp_timer = 0 ; lcd_clrscr ( ) ; switch ( dir_idx ) { case DIR_IDX_GO_UP : { if ( dir_name [ 0 ] ) { xprintf ( pct_s_str , dir_name ) ; lcd_gotoxy ( 0 , 1 ) ; xprintf ( dotdotdir_str ) ; } else { char label [ 24 ] ; f_getlabel ( "" , label , NULL ) ; xprintf ( vol_name_str , label ) ; lcd_gotoxy ( 0 , 1 ) ; FATFS * fs ; DWORD free_clusters ; f_getfree ( "" , & free_clusters , & fs ) ; # if _MAX_SS != _MIN_SS DWORD free_mbytes = free_clusters * FatFs . csize * FatFs . ssize / ( 1024UL * 1024UL ) ; # else DWORD free_mbytes = free_clusters * FatFs . csize * _MAX_SS / ( 1024UL * 1024UL ) ; # endif switch ( FatFs . fs_type ) { case FS_EXFAT : { xprintf ( vol_free_str_FS_EXFAT , free_mbytes ) ; break ; } case FS_FAT12 : { xprintf ( vol_free_str_FS_FAT12 , free_mbytes ) ; break ; } case FS_FAT16 : { xprintf ( vol_free_str_FS_FAT16 , free_mbytes ) ; break ; } case FS_FAT32 : { xprintf ( vol_free_str_FS_FAT32 , free_mbytes ) ; break ; } default : { xprintf ( vol_free_str_unknown , free_mbytes ) ; break ; } } } break ; } default : { if ( dir_idx == DIR_IDX_FIRST_FILE && ! Finfo -> fname [ 0 ] ) { xprintf ( empty_dir_str ) ; } else { xprintf ( pct_s_str , Finfo -> fname ) ; lcd_gotoxy ( 0 , 1 ) ; if ( Finfo -> fattrib & AM_DIR ) { xprintf ( dir_str ) ; } else { <S2SV_StartBug> xprintf ( pct_d_str , Finfo -> fsize ) ; <S2SV_EndBug> } } break ; } } } | <S2SV_ModStart> { xprintf ( pct_u_str <S2SV_ModEnd> , Finfo -> |
3,296 | CWE-000 int labels_format ( const wlabel_t * labels , char * str , size_t size ) { int i ; size_t z = 0 ; char * value_label ; for ( i = 0 ; labels [ i ] . key != NULL ; i ++ ) { value_label = parse_environment_labels ( labels [ i ] ) ; z += ( size_t ) snprintf ( str + z , size - z , "%s\\"%s\\":%s\\n" , labels [ i ] . flags . hidden ? "!" : "" , labels [ i ] . key , value_label ) ; if ( z >= size ) return - 1 ; } <S2SV_StartBug> return 0 ; <S2SV_EndBug> } | <S2SV_ModStart> 1 ; } free ( value_label ) ; |
3,297 | CWE-000 static void push_free_frames ( uint32_t first , uint32_t last ) { <S2SV_StartBug> kprint ( "\\tpush_free_frames(%08x,<S2SV_blank>%08x)\\n" , first , last ) ; <S2SV_EndBug> for ( uint32_t n = first ; n < last ; n += frame_size ) push_free_frame ( n ) ; <S2SV_StartBug> kprint ( "\\tfree_frame_stack<S2SV_blank>is<S2SV_blank>now:<S2SV_blank>%p\\n" , free_frame_stack ) ; <S2SV_EndBug> <S2SV_StartBug> kprint ( "\\tfree_frame_count<S2SV_blank>is<S2SV_blank>%d\\n" , free_frame_count ) ; <S2SV_EndBug> } | <S2SV_ModStart> last ) { kdprint ( dbgout , <S2SV_ModEnd> "\\tpush_free_frames(%08x,<S2SV_blank>%08x)\\n" , first <S2SV_ModStart> n ) ; kdprint ( dbgout , <S2SV_ModEnd> "\\tfree_frame_stack<S2SV_blank>is<S2SV_blank>now:<S2SV_blank>%p\\n" , free_frame_stack <S2SV_ModStart> free_frame_stack ) ; kdprint ( dbgout , <S2SV_ModEnd> "\\tfree_frame_count<S2SV_blank>is<S2SV_blank>%d\\n" , free_frame_count |
3,298 | CWE-000 void writememl ( uint32_t s , uint32_t a , uint32_t v ) <S2SV_StartBug> { <S2SV_EndBug> if ( writelookup2 [ ( ( s ) + ( a ) ) >> 12 ] == - 1 || ( s ) == 0xFFFFFFFF ) writememll ( s , a , v ) ; else * ( uint32_t * ) ( writelookup2 [ ( s + a ) >> 12 ] + s + a ) = v ; } | <S2SV_ModStart> v ) { if ( writelookup2 == NULL ) writememll ( s , a , v ) ; |
3,299 | CWE-000 static int sink_set_port_cb ( pa_sink * s , pa_device_port * p ) { struct userdata * u = s -> userdata ; pa_alsa_port_data * data ; pa_assert ( u ) ; pa_assert ( p ) ; pa_assert ( u -> mixer_handle ) ; data = PA_DEVICE_PORT_DATA ( p ) ; pa_assert_se ( u -> mixer_path = data -> path ) ; <S2SV_StartBug> pa_alsa_path_select ( u -> mixer_path , data -> setting , u -> mixer_handle , s -> muted ) ; <S2SV_EndBug> <S2SV_StartBug> mixer_volume_init ( u ) ; <S2SV_EndBug> if ( s -> set_mute ) s -> set_mute ( s ) ; <S2SV_StartBug> if ( s -> flags & PA_SINK_DEFERRED_VOLUME ) { <S2SV_EndBug> if ( s -> write_volume ) s -> write_volume ( s ) ; } else { if ( s -> set_volume ) s -> set_volume ( s ) ; } if ( data -> suspend_when_unavailable && p -> available == PA_AVAILABLE_NO ) pa_sink_suspend ( s , true , PA_SUSPEND_UNAVAILABLE ) ; else pa_sink_suspend ( s , false , PA_SUSPEND_UNAVAILABLE ) ; return 0 ; } | <S2SV_ModStart> path ) ; <S2SV_ModEnd> mixer_volume_init ( u <S2SV_ModStart> mixer_volume_init ( u <S2SV_ModEnd> ) ; if <S2SV_ModStart> & PA_SINK_DEFERRED_VOLUME ) pa_asyncmsgq_send ( u -> sink -> asyncmsgq , PA_MSGOBJECT ( u -> sink ) , SINK_MESSAGE_SYNC_MIXER , p , 0 , NULL ) ; else sync_mixer ( u , p ) ; <S2SV_ModEnd> if ( data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.