Bug #72828
| From: | Christoph M. Becker | Date: | Sat, 13 Aug 2016 12:42:02 +0000 |
| Subject: | Bug #72828 | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-95113@lists.php.net to get a copy of this message | ||
Hi Nikita!
You have commented on <https://bugs.php.net/bug.php?id=72828>:
| Unless the allocations explicitly use the system allocator (i.e. do
| not use emalloc and variants), do NOT introduce NULL checks.
Can you please elaborate, why that shouldn't be done.
Actually, the allocations use safe_emalloc() and emalloc(),
respectively[1]. However, the only client of the function does
explicitly check for a NULL return[2], which can only happen, if
safe_emalloc() fails. So if no NULL checks should be done, this one
should be removed as well.
[1]
<https://github.com/php/php-src/blob/php-5.6.24/ext/standard/string.c#L2926-L2927>
[2]
<https://github.com/php/php-src/blob/php-5.6.24/ext/standard/string.c#L3133-L3134>
--
Christoph M. Becker