From a0d50ea7fa2f7c9a8de19cf0dadcb0e0bfa024b8 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 1 Jun 2010 22:50:17 +0200 Subject: [PATCH] Fix segfault on "cancel jobid=" command --- bacula/src/dird/ua_cmds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index 829382f54d..91a43188b1 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; -- 2.39.5