2005-01-23 Joerg Wunsch * libc/stdlib/realloc.c: Do not mess with "nx" pointers for the current entry as it is not really of struct __freelist. Fixes savannah bug #11684. Index: NEWS =================================================================== RCS file: /cvsroot/avr-libc/avr-libc/NEWS,v retrieving revision 1.43 diff -u -u -r1.43 NEWS --- NEWS 18 Jan 2005 16:22:04 -0000 1.43 +++ NEWS 23 Jan 2005 21:10:53 -0000 @@ -7,9 +7,10 @@ [#4101] setjmp/longjmp destroy changes in global registers. [#11479] Add missing pin definitions for iotn16.h. [#11486] Put the port bit defintions back in for mega16. [#11505] Remove doxygen comment about the deprecated inp/outp items. [#11510] Abstract the change enable bit in wdt.h for mega32. [#11522] Rewrite wdt_disable() to match datasheet algorithm. + [#11684] realloc overwrites first to bytes of memory block when shrinking * Extend stdio and pmstring APIs: Index: libc/stdlib/realloc.c =================================================================== RCS file: /cvsroot/avr-libc/avr-libc/libc/stdlib/realloc.c,v retrieving revision 1.2 diff -u -u -r1.2 realloc.c --- libc/stdlib/realloc.c 29 Oct 2004 16:26:47 -0000 1.2 +++ libc/stdlib/realloc.c 23 Jan 2005 21:10:55 -0000 @@ -72,9 +72,7 @@ len > fp1->sz - sizeof(struct __freelist)) return ptr; fp2->sz = fp1->sz - len - sizeof(size_t); - fp2->nx = fp1->nx; fp1->sz = len; - fp1->nx = fp2; free(&(fp2->nx)); return ptr; }