From: Dan Campbell Date: Thu, 4 Apr 2019 21:15:33 +0000 (-0600) Subject: s_client starttls: fix handling of multiline reply X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f997e456b9bd43af275aab90c727a52287467e98;p=openssl 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) --- 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);