]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
Fix messed-up previous patch
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 25 Apr 2021 01:17:45 +0000 (18:17 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 25 Apr 2021 01:18:23 +0000 (18:18 -0700)
ChangeLog
lib/malloca.h

index f91f2e3df697d0a81c6c996e33417e496f523e6f..3a21db4f48b1ecf3b47295ab697e8ac7926425a2 100644 (file)
--- 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):
index f9b30880d0dcc1a5ab64aabbfb5c3c5777d65b97..a255e3f04bf94d76ed8fbce2388358f10c695797 100644 (file)
@@ -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