[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd, commited 5/7] hurd: Make dl-sysdep __sbrk check __vm_allocate cal
From: |
Samuel Thibault |
Subject: |
[hurd, commited 5/7] hurd: Make dl-sysdep __sbrk check __vm_allocate call |
Date: |
Mon, 2 Jan 2023 11:09:36 +0100 |
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(-)
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;
}
--
2.39.0
- [hurd,commited 0/7] hurd: fixes, Samuel Thibault, 2023/01/02
- [hurd,commited 1/7] htl: Check error returned by __getrlimit, Samuel Thibault, 2023/01/02
- [hurd,commited 2/7] hurd _S_msg_add_auth: Initialize new arrays to 0, Samuel Thibault, 2023/01/02
- [hurd, commited 4/7] htl: Drop duplicate check in __pthread_stack_alloc, Samuel Thibault, 2023/01/02
- [hurd, commited 5/7] hurd: Make dl-sysdep __sbrk check __vm_allocate call,
Samuel Thibault <=
- [hurd,commited 6/7] hurd fcntl: Make LOCKED macro more robust, Samuel Thibault, 2023/01/02
- [hurd, commited 3/7] hurd hurdstartup: Initialize remaining fields of hurd_startup_data, Samuel Thibault, 2023/01/02
- [hurd,commited 7/7] hurd getcwd: Fix memory leak on error, Samuel Thibault, 2023/01/02