Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.5:Update
slurm.32296
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.32296
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: c2e812c5998a7a637382c906a37bda75c782d2d3 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 f4afc37051..2099778fab 100644 --- a/src/common/pack.c +++ b/src/common/pack.c @@ -870,11 +870,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; @@ -904,11 +905,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; @@ -939,11 +941,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