linux-yocto/tools/include/nolibc
Brennan Xavier McManus 5996b2b2da tools/nolibc/stdlib: fix memory error in realloc()
commit 791f464114 upstream.

Pass user_p_len to memcpy() instead of heap->len to prevent realloc()
from copying an extra sizeof(heap) bytes from beyond the allocated
region.

Signed-off-by: Brennan Xavier McManus <bxmcmanus@gmail.com>
Cc: stable@vger.kernel.org
Reviewed-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
Fixes: 0e0ff63840 ("tools/nolibc/stdlib: Implement `malloc()`, `calloc()`, `realloc()` and `free()`")
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-06-12 11:02:56 +02:00
..
arch-aarch64.h
arch-arm.h
arch-i386.h
arch-mips.h
arch-riscv.h
arch-x86_64.h
arch.h
ctype.h
errno.h
Makefile
nolibc.h
signal.h
std.h
stdio.h
stdlib.h
string.h
sys.h
time.h
types.h
unistd.h