From: Dmitry Stogov Date: Wed, 14 Mar 2018 06:14:16 +0000 (+0300) Subject: Merge branch 'PHP-7.1' into PHP-7.2 X-Git-Tag: php-7.2.5RC1~48 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2db6d8e41538e602fffd99ca3ea8fd2749bb9b31;p=php Merge branch 'PHP-7.1' into PHP-7.2 * PHP-7.1: Fixed use-after-free --- 2db6d8e41538e602fffd99ca3ea8fd2749bb9b31 diff --cc ext/opcache/zend_persist.c index c57f80224b,ebcf43ed13..006398980a --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@@ -867,7 -860,16 +860,16 @@@ zend_persistent_script *zend_accel_scri if (key && *key) { *key = zend_accel_memdup(*key, key_length + 1); } + + script->corrupted = 0; + ZCG(current_persistent_script) = script; + + if (!for_shm) { + /* script is not going to be saved in SHM */ + script->corrupted = 1; + } + - zend_accel_store_string(script->script.filename); + zend_accel_store_interned_string(script->script.filename); #ifdef __SSE2__ /* Align to 64-byte boundary */