]> granicus.if.org Git - php/commit
Don't leak memory if wrong resource type is passed to proc_open
authorAlex Dowad <alexinbeijing@gmail.com>
Sat, 9 May 2020 16:16:45 +0000 (18:16 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 14 May 2020 08:25:37 +0000 (10:25 +0200)
commitb983580dd78cbc7e4f0ddb56671f8b4b6631fb3e
tree44db8bbbb639aea776601ca555a55ad384c257f0
parenta84cd96e865db795edc72b2799eac5c3c67aadfe
Don't leak memory if wrong resource type is passed to proc_open

proc_open can accept stream resources in the descriptorspec, like this:

    proc_open("command", array(0 => $resource), $pipes);

Previously, if a resource which was *not* of type "stream" was passed, proc_open would
return without freeing dynamically allocated memory. It's fixed now.
ext/standard/proc_open.c
ext/standard/tests/file/proc_open_with_wrong_resource_type.phpt [new file with mode: 0644]