gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated: fix #6189


From: gnunet
Subject: [gnunet] branch master updated: fix #6189
Date: Tue, 21 Apr 2020 13:38:09 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 3776e3a77 fix #6189
3776e3a77 is described below

commit 3776e3a77bff3f3d7091e91aac2e1b6b3425b28d
Author: Christian Grothoff <address@hidden>
AuthorDate: Tue Apr 21 13:33:25 2020 +0200

    fix #6189
---
 src/include/gnunet_common.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h
index 9e7c77786..fcc510ec9 100644
--- a/src/include/gnunet_common.h
+++ b/src/include/gnunet_common.h
@@ -1209,7 +1209,10 @@ GNUNET_is_zero_ (const void *a,
  * @param n number of elements in the array
  * @param type name of the struct or union, i.e. pass 'struct Foo'.
  */
-#define GNUNET_new_array(n, type) (type *) GNUNET_malloc ((n) * sizeof(type))
+#define GNUNET_new_array(n, type) ({ \
+    GNUNET_assert (SIZE_MAX / sizeof (type) >= n); \
+    (type *) GNUNET_malloc ((n) * sizeof(type));   \
+  })
 
 /**
  * @ingroup memory

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]