diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-01-02 01:49:59 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-01-02 11:36:11 +0100 |
commit | b7a5fec8b04edb505f51c207ae50b6777c2c55b2 (patch) | |
tree | 2445f4ad338b7bad5ddeb1f3140c92064c80dbe6 /sysdeps/mach | |
parent | cba62c231c0ba67b5cc6f3beb07571f316f9deeb (diff) | |
download | glibc-b7a5fec8b04edb505f51c207ae50b6777c2c55b2.tar glibc-b7a5fec8b04edb505f51c207ae50b6777c2c55b2.tar.gz glibc-b7a5fec8b04edb505f51c207ae50b6777c2c55b2.tar.bz2 glibc-b7a5fec8b04edb505f51c207ae50b6777c2c55b2.zip |
hurd: Make dl-sysdep __sbrk check __vm_allocate call
The caller won't be able to progress, but better crash than use random
addr.
Diffstat (limited to 'sysdeps/mach')
-rw-r--r-- | sysdeps/mach/hurd/dl-sysdep.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c index 2f022ee90c..84fe966efe 100644 --- a/sysdeps/mach/hurd/dl-sysdep.c +++ b/sysdeps/mach/hurd/dl-sysdep.c @@ -699,7 +699,8 @@ void *weak_function __sbrk (intptr_t increment) { vm_address_t addr; - __vm_allocate (__mach_task_self (), &addr, increment, 1); + if (__vm_allocate (__mach_task_self (), &addr, increment, 1)) + return NULL; return (void *) addr; } |