summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2017-07-20 21:22:31 +0200
committerRichard Levitte <levitte@openssl.org>2017-07-20 23:26:42 +0200
commit56d909863dcff26e82ebb06d185668f00287f67b (patch)
treeb86d040d80447d26e1c84e1a751b1aae13b64bd0 /apps
parente3d1a4e56572c71db5f297a50b8aa97bd7b39d3a (diff)
Fix apps/s_client.c's XMPP client
When an error occurs during the starttls handskake, s_client gets stuck looping around zero bytes reads, because the server won't sent anything more after its error tag. Shutting down on the first zero byte read fixes this. Fixes #3980 Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3981)
Diffstat (limited to 'apps')
-rw-r--r--apps/s_client.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/s_client.c b/apps/s_client.c
index 85c1b6b579..dc467994f8 100644
--- a/apps/s_client.c
+++ b/apps/s_client.c
@@ -1667,6 +1667,8 @@ int MAIN(int argc, char **argv)
if (strstr(mbuf, "/stream:features>"))
goto shut;
seen = BIO_read(sbio, mbuf, BUFSIZZ);
+ if (seen <= 0)
+ goto shut;
mbuf[seen] = 0;
}
BIO_printf(sbio,