[php-src] Issue #9128: pestr(n)dup() is not infallible

From: Date: Mon, 25 Jul 2022 15:58:35 +0000
Subject: [php-src] Issue #9128: pestr(n)dup() is not infallible
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-242014@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/9128 Author: cmb69 ### Description In case persistent allocation is requested, neither pestrdup() nor pestrndup() are infallible. They are defined as https://github.com/php/php-src/blob/a05a6c555dc19ebf9902157e6989ed9d73c042e0/Zend/zend_alloc.h#L204-L205 However, neither strdup(3) nor zend_strndup() are infallible: https://github.com/php/php-src/blob/a05a6c555dc19ebf9902157e6989ed9d73c042e0/Zend/zend_alloc.c#L2671-L2673 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 *

« previous php.bugs (#242014) next »