diff --git a/src/home/homectl.c b/src/home/homectl.c index d9321a2bd93..5c454f7414a 100644 --- a/src/home/homectl.c +++ b/src/home/homectl.c @@ -1243,6 +1243,8 @@ static int acquire_new_password( if (r < 0) return log_error_errno(r, "Failed to acquire password: %m"); + assert(!strv_isempty(first)); + question = mfree(question); if (asprintf(&question, "Please enter new password for user %s (repeat):", user_name) < 0) return log_oom(); diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index a9e211f246a..6a3901000e4 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -3077,6 +3077,7 @@ int dissected_image_decrypt_interactively( if (r < 0) return log_error_errno(r, "Failed to query for passphrase: %m"); + assert(!strv_isempty(z)); passphrase = z[0]; } } diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c index 31b284b5025..4e62b84ee53 100644 --- a/src/tty-ask-password-agent/tty-ask-password-agent.c +++ b/src/tty-ask-password-agent/tty-ask-password-agent.c @@ -265,9 +265,7 @@ static int process_one_password_file(const char *filename) { return log_error_errno(r, "Failed to query password: %m"); } - if (strv_isempty(passwords)) - return -ECANCELED; - + assert(!strv_isempty(passwords)); r = send_passwords(socket_name, passwords); if (r < 0) return log_error_errno(r, "Failed to send: %m");