]> granicus.if.org Git - php/commitdiff
MFH:
authorStanislav Malyshev <stas@php.net>
Mon, 3 Jan 2005 10:02:36 +0000 (10:02 +0000)
committerStanislav Malyshev <stas@php.net>
Mon, 3 Jan 2005 10:02:36 +0000 (10:02 +0000)
Fix the following nasty bug:
- 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 0cb8cd2f6d77d1f40060f652f1ddc5e52645bded..a9c814f717848a36c8558cf4f68e034e3fab123d 100644 (file)
@@ -128,6 +128,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;