strcpy_url: only %-encode values >= 0x80

OSS-Fuzz detected

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

Broke in dd7521bcc1
This commit is contained in:
Daniel Stenberg 2018-04-25 07:56:01 +02:00
parent ba67f7d65a
commit 3c630f9b0a
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View 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;
}