Skip to content

Commit 393577c

Browse files
authored
reallocarray using proper inline facility to check overflow on windows. (#9300)
1 parent c809a21 commit 393577c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

main/reallocarray.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ PHPAPI void* php_reallocarray(void *p, size_t nmb, size_t siz)
2626
#ifndef _WIN32
2727
if (__builtin_mul_overflow(nmb, siz, &r)) {
2828
#else
29-
30-
r = siz * nmb;
31-
if (siz != 0 && r / siz != nmb) {
29+
if (SizeTMult(nmb, siz, &r) != S_OK) {
3230
#endif
3331
// EOVERFLOW may have been, arguably, more appropriate
3432
// but this is what other implementations set

0 commit comments

Comments
 (0)