1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-05-30 22:08:02 +02:00

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 <wk@gnupg.org>
(cherry picked from commit 7385e1babf)
This commit is contained in:
Werner Koch 2018-10-24 20:11:33 +02:00
parent f1561e5196
commit 147e59b781
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -3244,9 +3244,10 @@ ssh_handler_add_identity (ctrl_t ctrl, estream_t request, estream_t response)
while (1) while (1)
{ {
err = stream_read_byte (request, &b); err = stream_read_byte (request, &b);
if (gpg_err_code (err) == GPG_ERR_EOF) if (err)
{ {
err = 0; if (gpg_err_code (err) == GPG_ERR_EOF)
err = 0;
break; break;
} }