mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Missing ENOMEM in realloc_check wrapper (bug 27870)
When MALLOC_CHECK_ is non-zero, the realloc hook missed to set errno to ENOMEM when called with too big size. Run the test tst-malloc-too-large also with MALLOC_CHECK_=3 to catch that.
This commit is contained in:
@ -72,7 +72,7 @@ test-srcs = tst-mtrace
|
|||||||
# with MALLOC_CHECK_=3 because they expect a specific failure.
|
# with MALLOC_CHECK_=3 because they expect a specific failure.
|
||||||
tests-exclude-mcheck = tst-mcheck tst-malloc-usable \
|
tests-exclude-mcheck = tst-mcheck tst-malloc-usable \
|
||||||
tst-interpose-nothread tst-interpose-static-nothread \
|
tst-interpose-nothread tst-interpose-static-nothread \
|
||||||
tst-interpose-static-thread tst-malloc-too-large \
|
tst-interpose-static-thread \
|
||||||
tst-mxfast tst-safe-linking
|
tst-mxfast tst-safe-linking
|
||||||
|
|
||||||
# Run all tests with MALLOC_CHECK_=3
|
# Run all tests with MALLOC_CHECK_=3
|
||||||
|
@ -321,7 +321,10 @@ realloc_check (void *oldmem, size_t bytes, const void *caller)
|
|||||||
const INTERNAL_SIZE_T oldsize = chunksize (oldp);
|
const INTERNAL_SIZE_T oldsize = chunksize (oldp);
|
||||||
|
|
||||||
if (!checked_request2size (rb, &chnb))
|
if (!checked_request2size (rb, &chnb))
|
||||||
goto invert;
|
{
|
||||||
|
__set_errno (ENOMEM);
|
||||||
|
goto invert;
|
||||||
|
}
|
||||||
|
|
||||||
__libc_lock_lock (main_arena.mutex);
|
__libc_lock_lock (main_arena.mutex);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user