1
0
Fork 0
mirror of git://sourceware.org/git/glibc.git synced 2025-03-06 20:58:33 +01:00

malloc: Fix transposed arguments in sysmalloc_mmap_fallback call

git commit 0849eed45d ("malloc: Move MORECORE fallback mmap to
sysmalloc_mmap_fallback") moved a block of code from sysmalloc to a
new helper function sysmalloc_mmap_fallback(), but 'pagesize' is used
for the 'minsize' argument and 'MMAP_AS_MORECORE_SIZE' for the
'pagesize' argument.

Fixes: 0849eed45d ("malloc: Move MORECORE fallback mmap to sysmalloc_mmap_fallback")
Signed-off-by: Robert Morell <rmorell@nvidia.com>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
This commit is contained in:
Robert Morell 2023-03-07 10:14:45 -03:00 committed by Adhemerval Zanella
parent 0b7bf0e0a4
commit 6a734e62f1

View file

@ -2725,8 +2725,8 @@ sysmalloc (INTERNAL_SIZE_T nb, mstate av)
mp_.hp_flags, av); mp_.hp_flags, av);
#endif #endif
if (mbrk == MAP_FAILED) if (mbrk == MAP_FAILED)
mbrk = sysmalloc_mmap_fallback (&size, nb, old_size, pagesize, mbrk = sysmalloc_mmap_fallback (&size, nb, old_size, MMAP_AS_MORECORE_SIZE,
MMAP_AS_MORECORE_SIZE, 0, av); pagesize, 0, av);
if (mbrk != MAP_FAILED) if (mbrk != MAP_FAILED)
{ {
/* We do not need, and cannot use, another sbrk call to find end */ /* We do not need, and cannot use, another sbrk call to find end */