1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

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
This commit is contained in:
Daniel Stenberg 2018-10-28 01:33:23 +02:00
parent e97679a360
commit d530e92f59
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -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);