]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
VG_(memset) cannot handle NULL pointers and needs to be guarded.
authorFlorian Krohm <florian@eich-krohm.de>
Mon, 16 Sep 2013 21:46:31 +0000 (21:46 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Mon, 16 Sep 2013 21:46:31 +0000 (21:46 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13556

coregrind/m_mallocfree.c

index 69666bf0eb1a97c4357ffd84daf8fb018c2a4e91..8cd324c563c954b04571589d434f7d0effae2654 100644 (file)
@@ -2200,7 +2200,8 @@ void* VG_(arena_calloc) ( ArenaId aid, const HChar* cc,
 
    p = VG_(arena_malloc) ( aid, cc, size );
 
-   VG_(memset)(p, 0, size);
+   if (p != NULL)
+     VG_(memset)(p, 0, size);
 
    return p;
 }