From f997e456b9bd43af275aab90c727a52287467e98 Mon Sep 17 00:00:00 2001 From: Dan Campbell Date: Thu, 4 Apr 2019 15:15:33 -0600 Subject: [PATCH] s_client starttls: fix handling of multiline reply Fixes #8645 Reviewed-by: Paul Dale Reviewed-by: Matthias St. Pierre Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/8654) --- apps/s_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/s_client.c b/apps/s_client.c index bb4f0aab16..282d137b58 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -2277,7 +2277,7 @@ int s_client_main(int argc, char **argv) do { mbuf_len = BIO_gets(fbio, mbuf, BUFSIZZ); } - while (mbuf_len > 3 && mbuf[3] == '-'); + while (mbuf_len > 3 && (!isdigit(mbuf[0]) || !isdigit(mbuf[1]) || !isdigit(mbuf[2]) || mbuf[3] != ' ')); (void)BIO_flush(fbio); BIO_pop(fbio); BIO_free(fbio); -- 2.25.1