Skip to content

Commit 16b2fc4

Browse files
committed
Merge branch 'PHP-8.4'
* PHP-8.4: Reset global pointers to prevent use-after-free
2 parents bc2d02e + 6fda0a5 commit 16b2fc4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ext/opcache/jit/zend_jit.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3864,6 +3864,14 @@ void zend_jit_shutdown(void)
38643864
#else
38653865
zend_jit_trace_free_caches(&jit_globals);
38663866
#endif
3867+
3868+
/* Reset global pointers to prevent use-after-free in `zend_jit_status()`
3869+
* after gracefully restarting Apache with mod_php, see:
3870+
* https://github.com/php/php-src/pull/19212 */
3871+
dasm_ptr = NULL;
3872+
dasm_buf = NULL;
3873+
dasm_end = NULL;
3874+
dasm_size = 0;
38673875
}
38683876

38693877
static void zend_jit_reset_counters(void)

0 commit comments

Comments
 (0)