]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix segfault on "cancel jobid=" command
authorEric Bollengier <eric@eb.homelinux.org>
Tue, 1 Jun 2010 20:50:17 +0000 (22:50 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 2 Aug 2010 14:53:51 +0000 (16:53 +0200)
bacula/src/dird/ua_cmds.c

index 37d0d9e439af2ead157c043649659c9c4c620279..c30b7f789a170d11c9716f1e2a5c7f350565fe59 100644 (file)
@@ -458,10 +458,10 @@ static int cancel_cmd(UAContext *ua, const char *cmd)
    for (i=1; i<ua->argc; i++) {
       if (strcasecmp(ua->argk[i], NT_("jobid")) == 0) {
          uint32_t JobId;
-         if (!ua->argv[i]) {
+         JobId = str_to_int64(ua->argv[i]);
+         if (!JobId) {
             break;
          }
-         JobId = str_to_int64(ua->argv[i]);
          if (!(jcr=get_jcr_by_id(JobId))) {
             ua->error_msg(_("JobId %s is not running. Use Job name to cancel inactive jobs.\n"),  ua->argv[i]);
             return 1;