1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +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:
Andreas Schwab
2021-05-17 14:00:19 +02:00
parent f4605e611a
commit c6b6b4f2c7
2 changed files with 5 additions and 2 deletions

View File

@ -321,7 +321,10 @@ realloc_check (void *oldmem, size_t bytes, const void *caller)
const INTERNAL_SIZE_T oldsize = chunksize (oldp);
if (!checked_request2size (rb, &chnb))
goto invert;
{
__set_errno (ENOMEM);
goto invert;
}
__libc_lock_lock (main_arena.mutex);