]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.1' into PHP-7.2
authorDmitry Stogov <dmitry@zend.com>
Wed, 14 Mar 2018 06:14:16 +0000 (09:14 +0300)
committerDmitry Stogov <dmitry@zend.com>
Wed, 14 Mar 2018 06:14:16 +0000 (09:14 +0300)
* PHP-7.1:
  Fixed use-after-free

1  2 
ext/opcache/zend_persist.c

index c57f80224ba4e8b9695431d8cfc44d491eba9dfa,ebcf43ed131a4e56f4ec2b314a3aedd789a57d6f..006398980a7b1566fd0676c8729af03f2e677c81
@@@ -867,7 -860,16 +860,16 @@@ zend_persistent_script *zend_accel_scri
        if (key && *key) {
                *key = zend_accel_memdup(*key, key_length + 1);
        }
 -      zend_accel_store_string(script->script.filename);
+       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_interned_string(script->script.filename);
  
  #ifdef __SSE2__
        /* Align to 64-byte boundary */