[php-src] PR #22309: Fix zend_string leak on case-variant duplicate setcookie() options
| From: | iliaal | Date: | Sun, 14 Jun 2026 17:12:48 +0000 |
| Subject: | [php-src] PR #22309: Fix zend_string leak on case-variant duplicate setcookie() options | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36424@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22309
Author: iliaal
php_head_parse_cookie_options_array() matches option keys case insensitively, but array keys are
case sensitive, so an option given twice differing only in case ('path' and
'Path') fetched the second string over the first without releasing it, leaking a
zend_string per call. Release any value already stored before fetching the next one.
```php
setcookie('n', 'v', ['path' => '/a', 'Path'
=> '/b']); // leaks one zend_string; same for domain/Domain, samesite/SameSite
```