summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-10-28 01:33:23 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-10-30 07:47:25 +0100
commitd530e92f59ae9bb2d47066c3c460b25d2ffeb211 (patch)
tree767e0736317861afdde4217a475642033a830913
parente97679a360dda4ea6188b09a145f73a2a84acedd (diff)
downloadgnurl-d530e92f59ae9bb2d47066c3c460b25d2ffeb211.tar.gz
gnurl-d530e92f59ae9bb2d47066c3c460b25d2ffeb211.tar.bz2
gnurl-d530e92f59ae9bb2d47066c3c460b25d2ffeb211.zip
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
-rw-r--r--src/tool_msgs.c2
1 files changed, 1 insertions, 1 deletions
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);