nus-yam/ex-repair huggingface dataset:
Buggy code:
 static inline void header_put_be_short ( SF_PRIVATE * psf, int x ) <START_BUG> { if ( psf -> headindex < SIGNED_SIZEOF ( psf -> header ) - 2 ) <END_BUG>  { psf -> header [ psf -> headindex ++ ] = ( x >> 8 ) ; <START_BUG> <END_BUG> psf -> header [ psf -> headindex ++ ] = x ;  <START_BUG> } ; <END_BUG> }

Fix:
<S2SV_ModStart> x ) { <S2SV_ModEnd> psf -> header <S2SV_ModStart> psf -> header. ptr [ <S2SV_ModEnd> psf -> header <S2SV_ModStart> psf -> header. indx <S2SV_ModEnd> ++ ] = <S2SV_ModStart> psf -> header. ptr <S2SV_ModStart> [ psf -> header. indx <S2SV_ModEnd> ++ ] = <S2SV_ModStart> x ; } <S2SV_ModEnd> <S2SV_null> <S2SV_null> <S2SV_null>
Buggy code:
 int vp8_receive_raw_frame ( VP8_COMP * cpi, unsigned int frame_flags, YV12_BUFFER_CONFIG * sd, int64_t time_stamp, int64_t end_time ) { <START_BUG> # if HAVE_NEON <END_BUG> int64_t store_reg [ 8 ] ; # if CONFIG_RUNTIME_CPU_DETECT VP8_COMMON * cm = & cpi -> common ; # endif # endif struct vpx_usec_timer timer ; int res = 0 ;  # if HAVE_NEON <START_BUG> # if CONFIG_RUNTIME_CPU_DETECT if ( cm -> cpu_caps & HAS_NEON ) # endif { vp8_push_neon ( store_reg ) ; } # endif vpx_usec_timer_start ( & timer ) ; if ( sd -> y_width!= cpi -> oxcf. Width || sd -> y_height!= cpi -> oxcf. Height ) { assert ( cpi -> oxcf. lag_in_frames < 2 ) ; dealloc_raw_frame_buffers ( cpi ) ; alloc_raw_frame_buffers ( cpi ) ; } if ( vp8_lookahead_push ( cpi -> lookahead, sd, time_stamp, end_time, frame_flags, cpi -> active_map_enabled? cpi -> active_map : NULL ) ) res = - 1 ; vpx_usec_timer_mark ( & timer ) ; cpi -> time_receive_data += vpx_usec_timer_elapsed ( & timer ) ; <END_BUG> # if HAVE_NEON  # if CONFIG_RUNTIME_CPU_DETECT if ( cm -> cpu_caps & HAS_NEON ) # endif { vp8_pop_neon ( store_reg ) ; } # endif return res ; }

Fix:
<S2SV_ModStart> end_time ) { <S2SV_ModEnd> struct vpx_usec_timer timer <S2SV_ModStart> = 0 ; <S2SV_ModEnd> vpx_usec_timer_start ( & <S2SV_ModStart> timer ) ; <S2SV_ModEnd> return res ;
Buggy code:
 ret_t cherokee_validator_ldap_check ( cherokee_validator_ldap_t * ldap, cherokee_connection_t * conn ) { int re ; ret_t ret ; size_t size ; char * dn ; LDAPMessage * message ; LDAPMessage * first ; char * attrs [ ] = { LDAP_NO_ATTRS, NULL } ; cherokee_validator_ldap_props_t * props = VAL_LDAP_PROP ( ldap ) ; if ( ( conn -> validator == NULL ) || <START_BUG> cherokee_buffer_is_empty ( & conn -> validator -> user ) ) <END_BUG> return ret_error ; size = cherokee_buffer_cnt_cspn ( & conn -> validator -> user, 0, "*()" ) ; if ( size!= conn -> validator -> user. len ) return ret_error ; ret = init_filter ( ldap, props, conn ) ; if ( ret!= ret_ok ) return ret ; re = ldap_search_s ( ldap -> conn, props -> basedn. buf, LDAP_SCOPE_SUBTREE, ldap -> filter. buf, attrs, 0, & message ) ; if ( re!= LDAP_SUCCESS ) { LOG_ERROR ( CHEROKEE_ERROR_VALIDATOR_LDAP_SEARCH, props -> filter. buf? props -> filter. buf : "" ) ; return ret_error ; } TRACE ( ENTRIES, "subtree   search   (%s):   done\\n", ldap -> filter. buf? ldap -> filter. buf : "" ) ; re = ldap_count_entries ( ldap -> conn, message ) ; if ( re!= 1 ) { ldap_msgfree ( message ) ; return ret_not_found ; } first = ldap_first_entry ( ldap -> conn, message ) ; if ( first == NULL ) { ldap_msgfree ( message ) ; return ret_not_found ; } dn = ldap_get_dn ( ldap -> conn, first ) ; if ( dn == NULL ) { ldap_msgfree ( message ) ; return ret_error ; } ldap_msgfree ( message ) ; ret = validate_dn ( props, dn, conn -> validator -> passwd. buf ) ; if ( ret!= ret_ok ) return ret ; re = ldap_unbind_s ( ldap -> conn ) ; if ( re!= LDAP_SUCCESS )

Fix:
<S2SV_ModStart> -> user ) || cherokee_buffer_is_empty ( & conn -> validator -> passwd )
Buggy code:
 <START_BUG> void vp9_fht16x16_c ( const int16_t * input, int16_t * output, <END_BUG> int stride, int tx_type ) { if ( tx_type == DCT_DCT ) {  vp9_fdct16x16_c ( input, output, stride ) ; <START_BUG> } else { <END_BUG> int16_t out [ 256 ] ;  <START_BUG> int16_t * outptr = & out [ 0 ] ; <END_BUG> int i, j ;  int16_t temp_in [ 16 ], temp_out [ 16 ] ; <START_BUG> const transform_2d ht = FHT_16 [ tx_type ] ; for ( i = 0 ; i < 16 ; ++ i ) { for ( j = 0 ; j < 16 ; ++ j ) temp_in [ j ] = input [ j * stride + i ] * 4 ; ht. cols ( temp_in, temp_out ) ; for ( j = 0 ; j < 16 ; ++ j ) <END_BUG> outptr [ j * 16 + i ] = ( temp_out [ j ] + 1 + ( temp_out [ j ] < 0 ) ) >> 2 ;  } for ( i = 0 ; i < 16 ; ++ i ) { for ( j = 0 ; j < 16 ; ++ j ) temp_in [ j ] = out [ j + i * 16 ] ; ht. rows ( temp_in, temp_out ) ; for ( j = 0 ; j < 16 ; ++ j ) output [ j + i * 16 ] = temp_out [ j ] ; } } }

Fix:
<S2SV_ModStart> * input, tran_low_t <S2SV_ModEnd> * output, <S2SV_ModStart> DCT_DCT ) { vpx_fdct16x16_c <S2SV_ModEnd> ( input, <S2SV_ModStart> } else { tran_low_t <S2SV_ModEnd> out [ 256 <S2SV_ModStart> 256 ] ; <S2SV_ModEnd> int i, <S2SV_ModStart>, j ; tran_low_t <S2SV_ModEnd> temp_in [ 16 <S2SV_ModStart> ++ j ) out <S2SV_ModEnd> [ j *
Buggy code:
 NOEXPORT int init_section ( int eof, SERVICE_OPTIONS * * section_ptr ) { char * errstr ; # ifndef USE_WIN32 ( * section_ptr ) -> option. log_stderr = new_global_options. option. log_stderr ; # endif if ( * section_ptr == & new_service_options ) { <START_BUG> errstr = parse_global_option ( CMD_INITIALIZE, NULL, NULL ) ; <END_BUG> if ( errstr ) { s_log ( LOG_ERR, "Global   options:   %s", errstr ) ; return 1 ; } } if ( * section_ptr!= & new_service_options || eof ) {  if ( * section_ptr == & new_service_options ) <START_BUG> s_log ( LOG_INFO, "Initializing   inetd   mode   configuration" ) ; else s_log ( LOG_INFO, "Initializing   service   [%s]", ( * section_ptr ) -> servname ) ; errstr = parse_service_option ( CMD_INITIALIZE, section_ptr, NULL, NULL ) ; if ( errstr ) { if ( * section_ptr == & new_service_options ) s_log ( LOG_ERR, "Inetd   mode:   %s", errstr ) ; else s_log ( LOG_ERR, "Service   [%s]:   %s", ( * section_ptr ) -> servname, errstr ) ; return 1 ; } } return 0 ; }<END_BUG>

Fix:
<S2SV_ModStart> ( CMD_INITIALIZE, & new_global_options, <S2SV_ModStart> eof ) { <S2SV_ModEnd> errstr = parse_service_option