mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: Fix GH-16630: UAF in lexer with encoding translation and heredocs
This commit is contained in:
commit
e00d684420
2 changed files with 20 additions and 1 deletions
19
Zend/tests/gh16630.phpt
Normal file
19
Zend/tests/gh16630.phpt
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
--TEST--
|
||||||
|
GH-16630 (UAF in lexer with encoding translation and heredocs)
|
||||||
|
--EXTENSIONS--
|
||||||
|
mbstring
|
||||||
|
--INI--
|
||||||
|
zend.multibyte=On
|
||||||
|
zend.script_encoding=ISO-8859-1
|
||||||
|
internal_encoding=EUC-JP
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
$data3 = <<<CODE
|
||||||
|
heredoc
|
||||||
|
text
|
||||||
|
CODE;
|
||||||
|
echo $data3;
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
heredoc
|
||||||
|
text
|
|
@ -275,7 +275,7 @@ ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state)
|
||||||
CG(zend_lineno) = lex_state->lineno;
|
CG(zend_lineno) = lex_state->lineno;
|
||||||
zend_restore_compiled_filename(lex_state->filename);
|
zend_restore_compiled_filename(lex_state->filename);
|
||||||
|
|
||||||
if (SCNG(script_filtered)) {
|
if (SCNG(script_filtered) && SCNG(script_filtered) != lex_state->script_filtered) {
|
||||||
efree(SCNG(script_filtered));
|
efree(SCNG(script_filtered));
|
||||||
SCNG(script_filtered) = NULL;
|
SCNG(script_filtered) = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue