Don't allow allocating zero bytes.
authorStefan Walter <stefw@src.gnome.org>
Fri, 13 Feb 2009 18:32:41 +0000 (18:32 +0000)
committerStefan Walter <stefw@src.gnome.org>
Fri, 13 Feb 2009 18:32:41 +0000 (18:32 +0000)
svn path=/trunk/; revision=1564

egg/egg-secure-memory.c

index eb8a498..d2d18d7 100644 (file)
@@ -790,6 +790,10 @@ egg_secure_alloc_full (size_t length, int flags)
                return NULL;
        }
 
+       /* Can't allocate zero bytes */
+       if (length == 0)
+               return NULL;
+
        DO_LOCK ();
 
                for (block = all_blocks; block; block = block->next) {