Commit 6485f77dda1 for php

commit 6485f77dda1108e6e94d38101abd19016082cb5e
Merge: 8b7552a053e 2531e5e9384
Author: Jakub Zelenka <bukka@php.net>
Date:   Sun Nov 29 21:47:13 2026 +0100

    Merge branch 'PHP-8.5' into PHP-8.6

    * PHP-8.5:
      Fix use-after-free when proc_open() pipe is closed from its user filter

    # Conflicts:
    #       NEWS
    #       ext/standard/proc_open.c

diff --cc NEWS
index 70376b2d44f,3d3454c2409..644225199c0
--- a/NEWS
+++ b/NEWS
@@@ -316,10 -286,8 +316,12 @@@ PH
      value is expected. (Jorg Sowa)
    . Fixed getimagesize() reporting wrapped dimensions for XBM images with
      out-of-range width or height. (Ilia Alshanetsky)
 +  . Fixed JIT freeing the previous include_path returned by set_include_path()
 +    while it is still in use. (Ilia Alshanetsky)
 +  . Fixed bug GH-25746 (array_column() crashes with JIT when the result for an
 +    empty array is modified). (Tomasz Kowalczyk)
+   . Fixed bug GH-25281 (Use-after-free when proc_open() pipe is closed from
+     its user filter). (Jakub Zelenka)

  - Streams:
    . Fixed in-place URL decoding of interned strings in the HTTP and FTP
diff --cc ext/standard/proc_open.c
index 99c11dc7c62,d95138be4b4..63a55b8407b
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@@ -307,8 -322,8 +320,8 @@@ static void proc_open_rsrc_dtor(zend_re
  	}
  	CloseHandle(proc->childHandle);

 -#elif HAVE_SYS_WAIT_H
 +#elif defined(HAVE_SYS_WAIT_H)
- 	if (!FG(pclose_wait)) {
+ 	if (!FG(pclose_wait) || pipe_kept_open) {
  		waitpid_options = WNOHANG;
  	}
  	do {