summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2023-01-02 01:49:59 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-01-02 11:36:11 +0100
commitb7a5fec8b04edb505f51c207ae50b6777c2c55b2 (patch)
tree2445f4ad338b7bad5ddeb1f3140c92064c80dbe6 /sysdeps
parentcba62c231c0ba67b5cc6f3beb07571f316f9deeb (diff)
downloadglibc-b7a5fec8b04edb505f51c207ae50b6777c2c55b2.tar.gz
glibc-b7a5fec8b04edb505f51c207ae50b6777c2c55b2.tar.xz
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')
-rw-r--r--sysdeps/mach/hurd/dl-sysdep.c3
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;
 }