From: Bob Weinand Date: Sun, 5 Jul 2015 00:00:38 +0000 (+0200) Subject: Fix use after free with opcache (interned strings) X-Git-Tag: php-7.0.0beta1~12^2~53 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=56b6e0dd14e376bc1131c5afb037419910daabf8;p=php Fix use after free with opcache (interned strings) --- diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index eb1a318ea5..2d41f3fda6 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;