Add missing HTML tag in www_body in s_server.c
authorXiaoyin Liu <xiaoyinl@users.noreply.github.com>
Sat, 5 Aug 2017 06:31:04 +0000 (02:31 -0400)
committerRich Salz <rsalz@openssl.org>
Wed, 9 Aug 2017 15:30:55 +0000 (11:30 -0400)
In the generated HTML document, the `<pre>` tag is not closed. This patch also has a trivial code-style improvement, unrelated to the bug fix.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4088)

apps/s_server.c

index 2ff58b67f9c99ebcac984b978e3ddc8e6fcf9276..0ee5519f966d900858efb5fc3210079e3b90d5c2 100644 (file)
@@ -3113,9 +3113,10 @@ static int www_body(int s, int stype, int prot, unsigned char *context)
                 PEM_write_bio_X509(io, peer);
                 X509_free(peer);
                 peer = NULL;
-            } else
+            } else {
                 BIO_puts(io, "no client certificate available\n");
-            BIO_puts(io, "</BODY></HTML>\r\n\r\n");
+            }
+            BIO_puts(io, "</pre></BODY></HTML>\r\n\r\n");
             break;
         } else if ((www == 2 || www == 3)
                    && (strncmp("GET /", buf, 5) == 0)) {