From 68d9bc9c35bb65375430c1861514a72fd7d7549a Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 5 Apr 2024 14:45:05 +0200 Subject: [PATCH] agent: Fix error handling of READKEY. * agent/command.c (cmd_readkey): Jump to leave on reading error. -- Fixes-commit: d7a3c455c5e29b19b66772f86dda925064e34896 --- agent/command.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/agent/command.c b/agent/command.c index 2fd9a85d4..b152a5ea4 100644 --- a/agent/command.c +++ b/agent/command.c @@ -1458,7 +1458,9 @@ cmd_readkey (assuan_context_t ctx, char *line) goto leave; rc = agent_public_key_from_file (ctrl, grip, &s_pkey); - if (!rc) + if (rc) + goto leave; + else { if (opt_format_ssh) {