From 0f32102684bdc17aeac454cbb89f7dc0f72b46f3 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Thu, 25 Oct 2018 16:18:08 -0700 Subject: [PATCH] Restrict characters to those supported by semvar_bash --- scripts/increment-cargo-version.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/increment-cargo-version.sh b/scripts/increment-cargo-version.sh index 6c5872130..0f4ce527f 100755 --- a/scripts/increment-cargo-version.sh +++ b/scripts/increment-cargo-version.sh @@ -58,8 +58,13 @@ major) minor) MINOR=$((MINOR+ 1)) ;; --[A-Za-z0-9]*$) - SPECIAL="$1" +-*) + if [[ $1 =~ ^-[A-Za-z0-9]*$ ]]; then + SPECIAL="$1" + else + echo "Error: Unsupported characters found in $1" + exit 1 + fi ;; *) echo "Error: unknown argument: $1"