From: Rich Salz Date: Sat, 25 Apr 2015 20:06:19 +0000 (-0400) Subject: Quote HTML entities in s_server output X-Git-Tag: OpenSSL_1_1_0-pre1~1277 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f92beb98de0c8fdbf18f29642264258cc2ff05e7;p=oweals%2Fopenssl.git Quote HTML entities in s_server output Reviewed-by: Richard Levitte --- diff --git a/apps/s_server.c b/apps/s_server.c index 3644381ece..88309a6b9c 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -2723,7 +2723,22 @@ static int www_body(char *hostname, int s, int stype, unsigned char *context) /* BIO_puts(io,SSLeay_version(SSLEAY_VERSION));*/ BIO_puts(io, "\n"); for (i = 0; i < local_argc; i++) { - BIO_puts(io, local_argv[i]); + const char *myp; + for (myp = local_argv[i]; *myp; myp++) + switch (*myp) { + case '<': + BIO_puts(io, "<"); + break; + case '>': + BIO_puts(io, ">"); + break; + case '&': + BIO_puts(io, "&"); + break; + default: + BIO_write(io, myp, 1); + break; + } BIO_write(io, " ", 1); } BIO_puts(io, "\n");