Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP2:Update
slurm
U_07-Use-safe_unpack32.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File U_07-Use-safe_unpack32.patch of Package slurm
From: Tim Wickberg <tim@schedmd.com> Date: Tue Nov 28 17:38:50 2023 -0700 Subject: [PATCH 7/28]Use safe_unpack32(). Patch-mainline: Upstream Git-repo: https://github.com/SchedMD/slurm Git-commit: 8260ccb2bda6cf9fac0bb41cc11432feaab15892 References: bsc#1218046, bsc#1218050, bsc#1218051, bsc#1218053 Signed-off-by: Egbert Eich <eich@suse.de> Initialize *valp to NULL to avoid potentially calling xfree() against an uninitialized *valp value now that the first unpack can jump to unpack_error. Signed-off-by: Egbert Eich <eich@suse.com> --- src/common/pack.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/common/pack.c b/src/common/pack.c index 480ad7c020..b250ceff6e 100644 --- a/src/common/pack.c +++ b/src/common/pack.c @@ -515,8 +515,8 @@ void pack16_array(uint16_t * valp, uint32_t size_val, Buf buffer) */ int unpack16_array(uint16_t ** valp, uint32_t * size_val, Buf buffer) { - if (unpack32(size_val, buffer)) - return SLURM_ERROR; + *valp = NULL; + safe_unpack32(size_val, buffer); if ((*size_val) > MAX_ARRAY_LEN_MEDIUM) return SLURM_ERROR; @@ -551,8 +551,8 @@ void pack32_array(uint32_t * valp, uint32_t size_val, Buf buffer) */ int unpack32_array(uint32_t ** valp, uint32_t * size_val, Buf buffer) { - if (unpack32(size_val, buffer)) - return SLURM_ERROR; + *valp = NULL; + safe_unpack32(size_val, buffer); if ((*size_val) > MAX_ARRAY_LEN_LARGE) return SLURM_ERROR; @@ -603,8 +603,8 @@ void pack64_array_as_32(uint64_t * valp, uint32_t size_val, Buf buffer) */ int unpack64_array(uint64_t ** valp, uint32_t * size_val, Buf buffer) { - if (unpack32(size_val, buffer)) - return SLURM_ERROR; + *valp = NULL; + safe_unpack32(size_val, buffer); if ((*size_val) > MAX_ARRAY_LEN_MEDIUM) return SLURM_ERROR; @@ -655,8 +655,8 @@ void packdouble_array(double *valp, uint32_t size_val, Buf buffer) int unpackdouble_array(double **valp, uint32_t* size_val, Buf buffer) { - if (unpack32(size_val, buffer)) - return SLURM_ERROR; + *valp = NULL; + safe_unpack32(size_val, buffer); if ((*size_val) > MAX_ARRAY_LEN_SMALL) return SLURM_ERROR; @@ -685,8 +685,8 @@ void packlongdouble_array(long double *valp, uint32_t size_val, Buf buffer) int unpacklongdouble_array(long double **valp, uint32_t* size_val, Buf buffer) { - if (unpack32(size_val, buffer)) - return SLURM_ERROR; + *valp = NULL; + safe_unpack32(size_val, buffer); if ((*size_val) > MAX_ARRAY_LEN_SMALL) return SLURM_ERROR;
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