[php-src] PR #20998: openssl: Fix checks on BIO_get_mem_ptr()
| From: | ndossche | Date: | Wed, 21 Jan 2026 20:47:52 +0000 |
| Subject: | [php-src] PR #20998: openssl: Fix checks on BIO_get_mem_ptr() | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-34629@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/20998
Author: ndossche
If the call fails, then the pointer remains uninitialized, and this triggers undefined behaviour or
the reading of a dangling pointer. In my own tests this came out as a UAF. However, it seems not
exploitable by an attacker as failure should be not controllable.
It's worth pointing out that OpenSSL checks the return value in its own code that calls this
function as well [1].
[1] https://github.com/openssl/openssl/blob/b2ecef451ccede07366023da4553f113f6e4fe71/apps/lib/apps.c#L3307-L3311
This was found by a hybrid static-dynamic analyser that looks for inconsistent handling of error
checks in bindings.