]> granicus.if.org Git - php/commitdiff
Fix the following nasty bug:
authorStanislav Malyshev <stas@php.net>
Mon, 3 Jan 2005 10:01:03 +0000 (10:01 +0000)
committerStanislav Malyshev <stas@php.net>
Mon, 3 Jan 2005 10:01:03 +0000 (10:01 +0000)
- if compile bails out from the middle of compiling, current_buffer is not restored
- if current_buffer is not null, yy_switch_to_buffer will do: *yy_c_buf_p = yy_hold_char; on
the next request
- which would lead to memory corruption on next request

Zend/zend_language_scanner.l

index 19c35332a5436ec431328b305a2ab1a57c578584..fdaae01d5e1d8bfb178657ac9acdc22d99152cd7 100644 (file)
@@ -129,6 +129,7 @@ void startup_scanner(TSRMLS_D)
        RESET_DOC_COMMENT();
        SCNG(yy_start_stack_ptr) = 0;
        SCNG(yy_start_stack_depth) = 0;
+       SCNG(current_buffer) = NULL;
 #ifdef ZEND_MULTIBYTE
        SCNG(script_org) = NULL;
        SCNG(script_org_size) = 0;