aboutsummaryrefslogtreecommitdiffstats
path: root/agent/command-ssh.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2018-10-24 18:11:33 +0000
committerWerner Koch <[email protected]>2018-10-24 18:30:17 +0000
commit147e59b7815daafb32b570a96f1d1925d0f37008 (patch)
treea2cbffd62fc252f70c5fd732c3d046444ef76cbb /agent/command-ssh.c
parenttools: Fix FILE memory leak in gpg-connect-agent. (diff)
downloadgnupg-147e59b7815daafb32b570a96f1d1925d0f37008.tar.gz
gnupg-147e59b7815daafb32b570a96f1d1925d0f37008.zip
ssh: Fix possible infinite loop in case of an read error.
* agent/command-ssh.c (ssh_handler_add_identity): Handle other errors than EOF. -- GnuPG-bug-id: 4221 Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 7385e1babf6eef586c79ad23f8e541aaf608c4e5)
Diffstat (limited to 'agent/command-ssh.c')
-rw-r--r--agent/command-ssh.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/agent/command-ssh.c b/agent/command-ssh.c
index 20dc3febe..9255830bf 100644
--- a/agent/command-ssh.c
+++ b/agent/command-ssh.c
@@ -3244,9 +3244,10 @@ ssh_handler_add_identity (ctrl_t ctrl, estream_t request, estream_t response)
while (1)
{
err = stream_read_byte (request, &b);
- if (gpg_err_code (err) == GPG_ERR_EOF)
- {
- err = 0;
+ if (err)
+ {
+ if (gpg_err_code (err) == GPG_ERR_EOF)
+ err = 0;
break;
}