Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP4
slurm.32296
U_16-Use-try_xmalloc-on-user-specified-buffer-s...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File U_16-Use-try_xmalloc-on-user-specified-buffer-sizes.patch of Package slurm.32296
From: Tim Wickberg <tim@schedmd.com> Date: Wed Nov 29 14:34:06 2023 -0700 Subject: [PATCH 16/28]Use try_xmalloc() on user-specified buffer sizes. Patch-mainline: Upstream Git-repo: https://github.com/SchedMD/slurm Git-commit: 1602f00da24e25a348bdb4acbc2e0a54a55bd4bf References: bsc#1218046, bsc#1218050, bsc#1218051, bsc#1218053 Signed-off-by: Egbert Eich <eich@suse.de> --- src/common/slurm_protocol_api.c | 2 +- src/common/slurm_protocol_socket.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/slurm_protocol_api.c b/src/common/slurm_protocol_api.c index a727f7e94b..a41f984108 100644 --- a/src/common/slurm_protocol_api.c +++ b/src/common/slurm_protocol_api.c @@ -2017,7 +2017,7 @@ extern int slurm_unpack_addr_array(slurm_addr_t **addr_array_ptr, slurm_addr_t *addr_array = NULL; safe_unpack32(size_val, buffer); - addr_array = xcalloc(*size_val, sizeof(slurm_addr_t)); + safe_xcalloc(addr_array, *size_val, sizeof(slurm_addr_t)); for (int i = 0; i < *size_val; i++) { if (slurm_unpack_addr_no_alloc(&addr_array[i], buffer)) diff --git a/src/common/slurm_protocol_socket.c b/src/common/slurm_protocol_socket.c index 9143e53ca8..7823b71c3f 100644 --- a/src/common/slurm_protocol_socket.c +++ b/src/common/slurm_protocol_socket.c @@ -149,7 +149,8 @@ extern ssize_t slurm_msg_recvfrom_timeout(int fd, char **pbuf, size_t *lenp, /* * Allocate memory on heap for message */ - *pbuf = xmalloc_nz(msglen); + if (!(*pbuf = try_xmalloc(msglen))) + slurm_seterrno_ret(ENOMEM); if (slurm_recv_timeout(fd, *pbuf, msglen, 0, tmout) != msglen) { xfree(*pbuf);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor