Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP2:Update
slurm
U_21-Use-unpack_error-label-instead-on-error.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File U_21-Use-unpack_error-label-instead-on-error.patch of Package slurm
From: Tim Wickberg <tim@schedmd.com> Date: Wed Nov 29 15:40:53 2023 -0700 Subject: [PATCH 21/28]Use unpack_error label instead on error. Patch-mainline: Upstream Git-repo: https://github.com/SchedMD/slurm Git-commit: 42c06f1759d0233167fb5805b9f1daed4d447718 References: bsc#1218046, bsc#1218050, bsc#1218051, bsc#1218053 Signed-off-by: Egbert Eich <eich@suse.de> Signed-off-by: Egbert Eich <eich@suse.com> --- src/common/pack.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/common/pack.c b/src/common/pack.c index fd6d2fdaa9..c0f9fc2a4b 100644 --- a/src/common/pack.c +++ b/src/common/pack.c @@ -860,11 +860,12 @@ int unpackmem_ptr(char **valp, uint32_t * size_valp, Buf buffer) if (*size_valp > MAX_ARRAY_LEN_LARGE) { error("%s: Buffer to be unpacked is too large (%u > %u)", __func__, *size_valp, MAX_ARRAY_LEN_LARGE); - return SLURM_ERROR; + goto unpack_error; } if (remaining_buf(buffer) < *size_valp) - return SLURM_ERROR; + goto unpack_error; + *valp = &buffer->head[buffer->processed]; buffer->processed += *size_valp; @@ -929,11 +930,12 @@ int unpackmem_xmalloc(char **valp, uint32_t * size_valp, Buf buffer) if (*size_valp > MAX_ARRAY_LEN_LARGE) { error("%s: Buffer to be unpacked is too large (%u > %u)", __func__, *size_valp, MAX_ARRAY_LEN_LARGE); - return SLURM_ERROR; + goto unpack_error; } if (remaining_buf(buffer) < *size_valp) - return SLURM_ERROR; + goto unpack_error; + *valp = xmalloc_nz(*size_valp); memcpy(*valp, &buffer->head[buffer->processed], *size_valp); buffer->processed += *size_valp; @@ -964,11 +966,12 @@ int unpackmem_malloc(char **valp, uint32_t * size_valp, Buf buffer) if (*size_valp > MAX_PACK_MEM_LEN) { error("%s: Buffer to be unpacked is too large (%u > %u)", __func__, *size_valp, MAX_ARRAY_LEN_SMALL); - return SLURM_ERROR; + goto unpack_error; } if (remaining_buf(buffer) < *size_valp) - return SLURM_ERROR; + goto unpack_error; + *valp = malloc(*size_valp); if (*valp == NULL) { log_oom(__FILE__, __LINE__, __func__);
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