1
0
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:
David CARLIER
2022-08-12 12:08:03 +01:00
committed by GitHub
parent c809a213f2
commit 393577ced9
+1 -3
View File
@@ -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