From 5bc781bd38ea4141e5e3b9110bf28214773cf1a3 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 20 Sep 2012 18:13:25 +0200 Subject: Quit if pwgen returns nothing. Reported-by: Brian Mattern --- src/password-store.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/password-store.sh b/src/password-store.sh index 5075bb8..9923907 100755 --- a/src/password-store.sh +++ b/src/password-store.sh @@ -312,6 +312,7 @@ case "$command" in [[ $force -eq 0 && -e $passfile ]] && yesno "An entry already exists for $path. Overwrite it?" pass="$(pwgen -s $symbols $length 1)" + [[ -n $pass ]] || exit 1 $GPG -e -r "$ID" -o "$passfile" $GPG_OPTS <<<"$pass" git_add_file "$passfile" "Added generated password for $path to store." -- cgit v1.2.3