summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ask-password-api.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ask-password-api.c b/src/ask-password-api.c
index da967ab7a1..384cfc8f80 100644
--- a/src/ask-password-api.c
+++ b/src/ask-password-api.c
@@ -481,7 +481,13 @@ int ask_password_agent(
if (passphrase[0] == '+') {
char **l;
- if (!(l = strv_parse_nulstr(passphrase+1, n-1))) {
+ if (n == 1)
+ l = strv_new("", NULL);
+ else
+ l = strv_parse_nulstr(passphrase+1, n-1);
+ /* An empty message refers to the empty password */
+
+ if (!l) {
r = -ENOMEM;
goto finish;
}