Fix out-of-bounds error in http_uri_canonify().
@@ -455,11 +455,12 @@ http_uri_canonify(char *path)
c += http_hexval(tmp[2]);
*dst++ = c;
tmp += 3;
- }
+ } else {
// garbage in, garbage out
*dst++ = c;
tmp++;
}
+ }
*dst = '\0';
return ((strlen(path) != 0) ? path : "/");
