-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Description
Description
In case persistent allocation is requested, neither pestrdup() nor pestrndup() are infallible. They are defined as
Lines 204 to 205 in a05a6c5
| #define pestrdup(s, persistent) ((persistent)?strdup(s):estrdup(s)) | |
| #define pestrndup(s, length, persistent) ((persistent)?zend_strndup((s),(length)):estrndup((s),(length))) |
However, neither strdup(3) nor zend_strndup() are infallible:
Lines 2671 to 2673 in a05a6c5
| if (UNEXPECTED(p == NULL)) { | |
| return p; | |
| } |
This is, of course, not a problem per se, but it would mean that all calls to these functions would need to be guarded by NULL checks.
PHP Version
PHP-8.0
Operating System
any