From: Daniel Stenberg Date: Sat, 27 Oct 2018 23:33:23 +0000 (+0200) Subject: voutf: fix bad arethmetic when outputting warnings to stderr X-Git-Tag: curl-7_62_0~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d530e92f59ae9bb2d47066c3c460b25d2ffeb211;p=curl voutf: fix bad arethmetic when outputting warnings to stderr CVE-2018-16842 Reported-by: Brian Carpenter Bug: https://curl.haxx.se/docs/CVE-2018-16842.html --- diff --git a/src/tool_msgs.c b/src/tool_msgs.c index 832ed8147..f5e1df25f 100644 --- a/src/tool_msgs.c +++ b/src/tool_msgs.c @@ -67,7 +67,7 @@ static void voutf(struct GlobalConfig *config, (void)fwrite(ptr, cut + 1, 1, config->errors); fputs("\n", config->errors); ptr += cut + 1; /* skip the space too */ - len -= cut; + len -= cut + 1; } else { fputs(ptr, config->errors);