mirror of
https://github.com/php/php-src.git
synced 2026-04-27 10:16:41 +02:00
reallocarray using proper inline facility to check overflow on windows. (#9300)
This commit is contained in:
+1
-3
@@ -26,9 +26,7 @@ PHPAPI void* php_reallocarray(void *p, size_t nmb, size_t siz)
|
||||
#ifndef _WIN32
|
||||
if (__builtin_mul_overflow(nmb, siz, &r)) {
|
||||
#else
|
||||
|
||||
r = siz * nmb;
|
||||
if (siz != 0 && r / siz != nmb) {
|
||||
if (SizeTMult(nmb, siz, &r) != S_OK) {
|
||||
#endif
|
||||
// EOVERFLOW may have been, arguably, more appropriate
|
||||
// but this is what other implementations set
|
||||
|
||||
Reference in New Issue
Block a user