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
1 changed files with 4 additions and 3 deletions

View File

@ -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;
}