Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP4
slurm.32299
U_18-Initialize-valp-up-front.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File U_18-Initialize-valp-up-front.patch of Package slurm.32299
From: Tim Wickberg <tim@schedmd.com> Date: Wed Nov 29 15:29:20 2023 -0700 Subject: [PATCH 18/28]Initialize *valp up front. Patch-mainline: Upstream Git-repo: https://github.com/SchedMD/slurm Git-commit: 5ce6fd0fda26b4268621baa343d0fb192d283223 References: bsc#1218046, bsc#1218050, bsc#1218051, bsc#1218053 Signed-off-by: Egbert Eich <eich@suse.de> --- src/common/pack.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/common/pack.c b/src/common/pack.c index cc27ab5b14..3e27f9dc79 100644 --- a/src/common/pack.c +++ b/src/common/pack.c @@ -851,6 +851,7 @@ void packmem(char *valp, uint32_t size_val, Buf buffer) */ int unpackmem_ptr(char **valp, uint32_t * size_valp, Buf buffer) { + *valp = NULL; safe_unpack32(size_valp, buffer); if (*size_valp > MAX_ARRAY_LEN_LARGE) { @@ -863,8 +864,7 @@ int unpackmem_ptr(char **valp, uint32_t * size_valp, Buf buffer) return SLURM_ERROR; *valp = &buffer->head[buffer->processed]; buffer->processed += *size_valp; - } else - *valp = NULL; + } return SLURM_SUCCESS; unpack_error: @@ -917,6 +917,7 @@ int unpackmem(char *valp, uint32_t * size_valp, Buf buffer) */ int unpackmem_xmalloc(char **valp, uint32_t * size_valp, Buf buffer) { + *valp = NULL; safe_unpack32(size_valp, buffer); if (*size_valp > MAX_ARRAY_LEN_LARGE) { @@ -931,8 +932,7 @@ int unpackmem_xmalloc(char **valp, uint32_t * size_valp, Buf buffer) memcpy(*valp, &buffer->head[buffer->processed], *size_valp); buffer->processed += *size_valp; - } else - *valp = NULL; + } return SLURM_SUCCESS; unpack_error: @@ -950,6 +950,7 @@ unpack_error: */ int unpackmem_malloc(char **valp, uint32_t * size_valp, Buf buffer) { + *valp = NULL; safe_unpack32(size_valp, buffer); if (*size_valp > MAX_PACK_MEM_LEN) { @@ -968,8 +969,7 @@ int unpackmem_malloc(char **valp, uint32_t * size_valp, Buf buffer) memcpy(*valp, &buffer->head[buffer->processed], *size_valp); buffer->processed += *size_valp; - } else - *valp = NULL; + } return SLURM_SUCCESS; unpack_error: @@ -992,6 +992,7 @@ unpack_error: */ int unpackstr_xmalloc_escaped(char **valp, uint32_t *size_valp, Buf buffer) { + *valp = NULL; safe_unpack32(size_valp, buffer); if (*size_valp > MAX_PACK_MEM_LEN) { @@ -1028,8 +1029,7 @@ int unpackstr_xmalloc_escaped(char **valp, uint32_t *size_valp, Buf buffer) /* add the original value since that is what we processed */ buffer->processed += cnt; - } else - *valp = NULL; + } return SLURM_SUCCESS; unpack_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