You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FixGH-23725: use-after-free when __toString() frees a frameless argument
Frameless calls pass the caller's operand zvals straight to the handler
without taking a reference, so an argument freed by a __toString() that the
handler itself triggers leaves it reading freed memory. Take a reference on
array and array-or-string arguments in the Z_FLF_PARAM_ARRAY* macros and
release it at flf_clean, so a destructive write from userland separates the
array instead. The handle is kept in a local because the operand may be a
reference slot that userland overwrites. This covers in_array(),
preg_replace(), str_replace(), strtr() and implode(); the per-function guards
from 8ce7f7f stay, since implode/1 parses its argument without the macros
and php_implode() is public API. Z_FLF_PARAM_STR still reads its string
directly on the fast path, so GH-21639 stays open.
FixesGH-23725
0 commit comments