Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP3:Update
slurm
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
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: 0451140c6094116d1b7abcfa8a33bd6b13c5b12e 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 2fa3285cb9..a9ab41c579 100644 --- a/src/common/pack.c +++ b/src/common/pack.c @@ -861,6 +861,7 @@ extern void packmem(void *valp, uint32_t size_val, buf_t *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) { @@ -873,8 +874,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: @@ -892,6 +892,7 @@ unpack_error: */ 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) { @@ -906,8 +907,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: @@ -925,6 +925,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) { @@ -943,8 +944,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: @@ -967,6 +967,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) { @@ -1003,8 +1004,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