about summary refs log tree commit diff
path: root/malloc
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-08-19 20:24:45 +0000
committerUlrich Drepper <drepper@redhat.com>2003-08-19 20:24:45 +0000
commit5dfe677810a3550bc2cff4d4046261c7572fbae0 (patch)
treeb4e1e39f06f2f5c8e48d55eef6b24e6441001d92 /malloc
parent9a3a9dd8d9e03875f865a22de5296274cc18c10e (diff)
downloadglibc-5dfe677810a3550bc2cff4d4046261c7572fbae0.tar.gz
glibc-5dfe677810a3550bc2cff4d4046261c7572fbae0.tar.xz
glibc-5dfe677810a3550bc2cff4d4046261c7572fbae0.zip
Update.
	* stdio-common/test-vfprintf.c (main): Don't write temporary file
	into source directory.
Diffstat (limited to 'malloc')
-rw-r--r--malloc/malloc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 55e2cbc0cd..8cc9e454dc 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -4135,8 +4135,14 @@ _int_free(mstate av, Void_t* mem)
        allocator never wrapps around at the end of the address space.
        Therefore we can exclude some size values which might appear
        here by accident or by "design" from some intruder.  */
-    if ((uintptr_t) p > (uintptr_t) -size)
-      return;
+    if (__builtin_expect ((uintptr_t) p > (uintptr_t) -size, 0))
+      {
+	if (check_action & 1)
+	  fprintf (stderr, "free(): invalid pointer %p!\n", mem);
+	if (check_action & 2)
+	  abort ();
+	return;
+      }
 
     check_inuse_chunk(av, p);