com php-src: Fix use after free with opcache (interned strings): Zend/zend_compile.c
| From: | Bob Weinand | Date: | Sun, 05 Jul 2015 00:00:52 +0000 |
| Subject: | com php-src: Fix use after free with opcache (interned strings): Zend/zend_compile.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-87746@lists.php.net to get a copy of this message | ||
Commit: 56b6e0dd14e376bc1131c5afb037419910daabf8
Author: Bob Weinand <bobwei9@hotmail.com> Sun, 5 Jul 2015 02:00:38 +0200
Parents: 12b79fcb05dc264a9d0c50b52b31d41b21157e7d
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=56b6e0dd14e376bc1131c5afb037419910daabf8
Log:
Fix use after free with opcache (interned strings)
Changed paths:
M Zend/zend_compile.c
Diff:
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index eb1a318..2d41f3f 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -5074,7 +5074,8 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
name = zend_new_interned_string(name);
lcname = zend_new_interned_string(lcname);
} else {
- lcname = name = zend_generate_anon_class_name(decl->lex_pos);
+ name = zend_generate_anon_class_name(decl->lex_pos);
+ lcname = zend_string_copy(name); /* this normally is an interned string, except with opcache. We
need a proper copy here or opcache will fail with use after free. */
}
ce->type = ZEND_USER_CLASS;