]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Check tag format in bconsole tag command
authorEric Bollengier <eric@baculasystems.com>
Fri, 9 Oct 2020 11:05:44 +0000 (13:05 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:02:57 +0000 (09:02 +0100)
bacula/src/dird/ua_cmds.c

index 7d59e88fd0bebb68c1efd48acf456f38b7da29b3..0f225dfb7d253beb496904d37baec4b7865cd14b 100644 (file)
@@ -1728,7 +1728,7 @@ int tag_cmd(UAContext *ua, const char *cmd)
          if (!get_cmd(ua, _("Enter the Tag value: "), false)) {
             return false;
          }
-         if (strlen(ua->cmd) > sizeof(t.Name)-1) {
+         if (strlen(ua->cmd) > sizeof(t.Name)-1 || !is_name_valid(ua->cmd, NULL, "#")) {
             ua->error_msg(_("Invalid tag\n"));
             return false;
          }