From 2f025ae954d4f08ab8e47e293f1ed7543f5edb40 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 25 Aug 2004 23:46:46 +0000 Subject: Mike Frysinger writes: this was sent earlier in a different form: http://www.uclibc.org/lists/uclibc/2004-January/008136.html find attached a smaller version ... perhaps adding a fprintf to stderr before calling abort would be nice like in the glibc patch, but whatever glibc has since adopted a similar fix for their malloc (third hunk, line 1970) http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/malloc/malloc.c.diff?r1=1.121&r2=1.122&cvsroot=glibc&f=h -mike --- libc/stdlib/malloc-standard/malloc.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libc/stdlib') diff --git a/libc/stdlib/malloc-standard/malloc.h b/libc/stdlib/malloc-standard/malloc.h index 174dc01bd..fbc14924e 100644 --- a/libc/stdlib/malloc-standard/malloc.h +++ b/libc/stdlib/malloc-standard/malloc.h @@ -20,6 +20,7 @@ #include #include #include +#include #ifdef __UCLIBC_HAS_THREADS__ @@ -645,6 +646,8 @@ typedef struct malloc_chunk* mbinptr; #define unlink(P, BK, FD) { \ FD = P->fd; \ BK = P->bk; \ + if (FD->bk != P || BK->fd != P) \ + abort(); \ FD->bk = BK; \ BK->fd = FD; \ } -- cgit v1.2.3