mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Reset MBREX(search_re) in RSHUTDOWN
This is going to cause a segfault if reused in the next request. To illustrate the issue, run these two scripts in sequence with the built-in server: // script1.php mb_ereg_search_init('foobar'); mb_ereg_search('foo'); // script2.php var_dump(mb_ereg_search_init("foobar")); var_dump(mb_ereg_search_pos());
This commit is contained in:
parent
392ad206a4
commit
560ff9725e
1 changed files with 1 additions and 0 deletions
|
@ -149,6 +149,7 @@ PHP_RSHUTDOWN_FUNCTION(mb_regex)
|
|||
ZVAL_UNDEF(&MBREX(search_str));
|
||||
}
|
||||
MBREX(search_pos) = 0;
|
||||
MBREX(search_re) = NULL;
|
||||
|
||||
if (MBREX(search_regs) != NULL) {
|
||||
onig_region_free(MBREX(search_regs), 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue