Unverified Commit d530e92f authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

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
parent e97679a3
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -67,7 +67,7 @@ static void voutf(struct GlobalConfig *config,
        (void)fwrite(ptr, cut + 1, 1, config->errors);
        (void)fwrite(ptr, cut + 1, 1, config->errors);
        fputs("\n", config->errors);
        fputs("\n", config->errors);
        ptr += cut + 1; /* skip the space too */
        ptr += cut + 1; /* skip the space too */
        len -= cut;
        len -= cut + 1;
      }
      }
      else {
      else {
        fputs(ptr, config->errors);
        fputs(ptr, config->errors);