]> granicus.if.org Git - curl/commitdiff
strcpy_url: only %-encode values >= 0x80
authorDaniel Stenberg <daniel@haxx.se>
Wed, 25 Apr 2018 05:56:01 +0000 (07:56 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 25 Apr 2018 05:56:01 +0000 (07:56 +0200)
OSS-Fuzz detected

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8000

Broke in dd7521bcc1b7

lib/transfer.c

index c586c727df11d92c04c4500c4b66f6f2ec43bbc0..9712a7f7ecf38c0351dd3a8632c592050d73a9cd 100644 (file)
@@ -1519,7 +1519,7 @@ static void strcpy_url(char *output, const char *url, bool relative)
       left = FALSE;
       /* fall through */
     default:
-      if(!ISPRINT(*iptr)) {
+      if(*iptr >= 0x80) {
         snprintf(optr, 4, "%%%02x", *iptr);
         optr += 3;
       }