From: Samuel Thibault Date: Mon, 2 Jan 2023 00:49:59 +0000 (+0100) Subject: hurd: Make dl-sysdep __sbrk check __vm_allocate call X-Git-Tag: glibc-2.37~53 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b7a5fec8b04edb505f51c207ae50b6777c2c55b2;p=thirdparty%2Fglibc.git hurd: Make dl-sysdep __sbrk check __vm_allocate call The caller won't be able to progress, but better crash than use random addr. --- diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c index 2f022ee90c8..84fe966efe2 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; }