From: Alain Spineux Date: Fri, 19 Feb 2021 09:58:22 +0000 (+0100) Subject: Check if char **jobid parameter is NULL before to modify it in bvfs_parse_arg_version() X-Git-Tag: Release-11.0.3~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a00ab807a3f4d5294330d822b9946b802b4740bc;p=thirdparty%2Fbacula.git Check if char **jobid parameter is NULL before to modify it in bvfs_parse_arg_version() - it looks like the function can handle a NULL parameter, som lines above and below does the check, it looks right to do it everywhere before to modify jobid --- diff --git a/bacula/src/dird/ua_dotcmds.c b/bacula/src/dird/ua_dotcmds.c index 3d23c254c..86bc7c81d 100644 --- a/bacula/src/dird/ua_dotcmds.c +++ b/bacula/src/dird/ua_dotcmds.c @@ -629,7 +629,9 @@ static bool bvfs_parse_arg(UAContext *ua, /* Store the jobid after the ua->cmd, a bit kluggy */ int len = strlen(ua->cmd); ua->cmd = check_pool_memory_size(ua->cmd, len + 1 + 50); - *jobid = edit_uint64(jr.JobId, ua->cmd + len + 1); + if (jobid) { + *jobid = edit_uint64(jr.JobId, ua->cmd + len + 1); + } } if (strcasecmp(ua->argk[i], NT_("limit")) == 0) {