Răsfoiți Sursa

Be more strict with the glibc style malloc implementation. Return NULL
when folks do a malloc(0) using malloc-930716.

Eric Andersen 24 ani în urmă
părinte
comite
3272f0e747
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      libc/stdlib/malloc-930716/malloc.c

+ 2 - 2
libc/stdlib/malloc-930716/malloc.c

@@ -127,8 +127,8 @@ malloc (size_t size)
     if (!initialized && !initialize())
     if (!initialized && !initialize())
 	return NULL;
 	return NULL;
 
 
-    /* Some programs will call malloc (0). We let them pass. */
-#if 0
+#if 1
+    /* Some programs will call malloc (0).  Lets be strict and return NULL */
     if (size == 0)
     if (size == 0)
 	return NULL;
 	return NULL;
 #endif
 #endif