[php-src] PR #12634: Fix GH-12621: browscap segmentation fault when configured in the vhost
| From: | nielsdos | Date: | Wed, 08 Nov 2023 19:25:29 +0000 |
| Subject: | [php-src] PR #12634: Fix GH-12621: browscap segmentation fault when configured in the vhost | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-24128@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/12634
Author: nielsdos
The temporary HashTable has a destructor that releases the string held by the entry's value.
However, browscap_intern_str(_ci) only incremented the refcount for the reference created by the
return value. As the HashTable is only used during parsing, we don't need to manage the
reference count of the value anyway, so get rid of the destructor.
Although the original bug report is for Apache, it is easily triggerable in fpm too, so use that for
the test.
This is triggerable in two cases:
- When using php_admin_value to set the ini at the activation stage
- When running out of space for the opcache-interned strings
Targeting 8.2 because 8.1 is no longer open for bugfixes, right?