From: Paul Eggert Date: Sun, 25 Apr 2021 01:17:45 +0000 (-0700) Subject: Fix messed-up previous patch X-Git-Tag: v1.0~2915 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ffdf094f83481d04c58fc36fc7a32ba440f365c7;p=thirdparty%2Fgnulib.git Fix messed-up previous patch --- diff --git a/ChangeLog b/ChangeLog index f91f2e3df6..3a21db4f48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,8 @@ PTRDIFF_MAX. * lib/xalloc-oversized.h: Adjust comment to match. + xmalloca, etc.: fix some xalloc-oversized issues + * lib/malloca.h (nmalloca): * lib/xmalloca.h (xnmalloca): Convert S to ptrdiff_t to avoid arithmetic overflow if N and S are both narrower than ptrdiff_t. * lib/xalloc-oversized.h (xalloc_oversized): diff --git a/lib/malloca.h b/lib/malloca.h index f9b30880d0..a255e3f04b 100644 --- a/lib/malloca.h +++ b/lib/malloca.h @@ -79,7 +79,7 @@ extern void freea (void *p); on the stack. S must be positive and N must be nonnegative. The array must be freed using freea() before the function returns. */ #define nmalloca(n, s) \ - (xalloc_oversized (n, s) ? NULL : malloca ((n) * (ptrdiff_t) (s))) + (xalloc_oversized (n, s) ? NULL : malloca ((n) * (size_t) (s))) #ifdef __cplusplus