From b7a5fec8b04edb505f51c207ae50b6777c2c55b2 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 2 Jan 2023 01:49:59 +0100 Subject: hurd: Make dl-sysdep __sbrk check __vm_allocate call The caller won't be able to progress, but better crash than use random addr. --- sysdeps/mach/hurd/dl-sysdep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sysdeps/mach') 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; } -- cgit 1.4.1