libc: zero-initialize anonymous memory from 'mmap()'

Fixes #3854
This commit is contained in:
Christian Prochaska 2020-08-20 16:15:24 +02:00 committed by Norman Feske
parent 7c1a4522d6
commit 2f55ffdf20

View File

@ -422,6 +422,7 @@ __SYS_(void *, mmap, (void *addr, ::size_t length,
errno = ENOMEM;
return MAP_FAILED;
}
::memset(start, 0, align_addr(length, PAGE_SHIFT));
mmap_registry()->insert(start, length, 0);
return start;
}