From: Eric Bollengier Date: Tue, 1 Jun 2010 20:50:17 +0000 (+0200) Subject: Fix segfault on "cancel jobid=" command X-Git-Tag: Release-5.2.1~1315 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=80c08f55bc0d6a7d6a3170488b63769b37ee47e2;p=bacula%2Fbacula Fix segfault on "cancel jobid=" command --- diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index 37d0d9e439..c30b7f789a 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -458,10 +458,10 @@ static int cancel_cmd(UAContext *ua, const char *cmd) for (i=1; iargc; 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;