From: Robert Swiecki Date: Mon, 18 May 2015 23:08:02 +0000 (-0400) Subject: Don't add write errors into bytecounts X-Git-Tag: OpenSSL_1_1_0-pre1~1121 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=00d565cfbe90fab3b157e644caca4eb4a2ebec79;p=openssl Don't add write errors into bytecounts Signed-off-by: Rich Salz Reviewed-by: Matt Caswell --- diff --git a/apps/s_server.c b/apps/s_server.c index 61d13f3e0a..e46376db4c 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -2290,8 +2290,10 @@ static int sv_body(char *hostname, int s, int stype, unsigned char *context) ret = 1; goto err; } - l += k; - i -= k; + if (k > 0) { + l += k; + i -= k; + } if (i <= 0) break; }