gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r36384 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r36384 - gnunet/src/util
Date: Mon, 28 Sep 2015 22:45:45 +0200

Author: dold
Date: 2015-09-28 22:45:45 +0200 (Mon, 28 Sep 2015)
New Revision: 36384

Modified:
   gnunet/src/util/common_allocation.c
Log:
fix undefined behavior in GNUNET_array_grow


Modified: gnunet/src/util/common_allocation.c
===================================================================
--- gnunet/src/util/common_allocation.c 2015-09-28 17:41:03 UTC (rev 36383)
+++ gnunet/src/util/common_allocation.c 2015-09-28 20:45:45 UTC (rev 36384)
@@ -370,7 +370,8 @@
     memset (tmp, 0, size);      /* client code should not rely on this, 
though... */
     if (*oldCount > newCount)
       *oldCount = newCount;     /* shrink is also allowed! */
-    memcpy (tmp, *old, elementSize * (*oldCount));
+    if (NULL != *old)
+      memcpy (tmp, *old, elementSize * (*oldCount));
   }
 
   if (*old != NULL)




reply via email to

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