From be3c71fa81e6d35a1fae0612a8b7b4b613d7d2f6 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Tue, 30 Jul 2013 15:24:48 -0400 Subject: avoid injecting code into the format string Now that die() properly forwards arguments to error(), we can expect that the first arg is a format string and not the entirety of the output. Signed-off-by: Dave Reisner Signed-off-by: Pierre Schmitz --- archrelease.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'archrelease.in') diff --git a/archrelease.in b/archrelease.in index 2e742c2..6f52dbc 100644 --- a/archrelease.in +++ b/archrelease.in @@ -8,8 +8,8 @@ FORCE= while getopts ':f' flag; do case $flag in f) FORCE=1 ;; - :) die "Option requires an argument -- '$OPTARG'" ;; - \?) die "Invalid option -- '$OPTARG'" ;; + :) die "Option requires an argument -- '%s'" "$OPTARG" ;; + \?) die "Invalid option -- '%s'" "$OPTARG" ;; esac done shift $(( OPTIND - 1 )) @@ -23,7 +23,7 @@ fi if [[ -z $FORCE ]]; then for tag in "$@"; do if ! in_array "$tag" "${_tags[@]}"; then - die 'archrelease: Invalid tag: "'$tag'" (use -f to force release)' + die "archrelease: Invalid tag: '%s' (use -f to force release)" "$tag" fi done fi -- cgit v1.2.3-70-g09d2