We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4b517a9 + e00d684 commit dd4fc9aCopy full SHA for dd4fc9a
Zend/tests/gh16630.phpt
@@ -0,0 +1,19 @@
1
+--TEST--
2
+GH-16630 (UAF in lexer with encoding translation and heredocs)
3
+--EXTENSIONS--
4
+mbstring
5
+--INI--
6
+zend.multibyte=On
7
+zend.script_encoding=ISO-8859-1
8
+internal_encoding=EUC-JP
9
+--FILE--
10
+<?php
11
+$data3 = <<<CODE
12
+heredoc
13
+text
14
+CODE;
15
+echo $data3;
16
+?>
17
+--EXPECT--
18
19
Zend/zend_language_scanner.l
@@ -275,7 +275,7 @@ ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state)
275
CG(zend_lineno) = lex_state->lineno;
276
zend_restore_compiled_filename(lex_state->filename);
277
278
- if (SCNG(script_filtered)) {
+ if (SCNG(script_filtered) && SCNG(script_filtered) != lex_state->script_filtered) {
279
efree(SCNG(script_filtered));
280
SCNG(script_filtered) = NULL;
281
}
0 commit comments