]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Check if char **jobid parameter is NULL before to modify it in bvfs_parse_arg_version()
authorAlain Spineux <alain@baculasystems.com>
Fri, 19 Feb 2021 09:58:22 +0000 (10:58 +0100)
committerEric Bollengier <eric@baculasystems.com>
Fri, 30 Apr 2021 08:26:43 +0000 (10:26 +0200)
- 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

bacula/src/dird/ua_dotcmds.c

index 3d23c254c25f09c7cac37f65f425979311c3abb5..86bc7c81d52eef482c4e93440e0aae697dc16225 100644 (file)
@@ -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) {