Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/libexec/httpd/bozohttpd.c,v rcsdiff: /ftp/cvs/cvsroot/src/libexec/httpd/bozohttpd.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.32 retrieving revision 1.32.2.1 diff -u -p -r1.32 -r1.32.2.1 --- src/libexec/httpd/bozohttpd.c 2012/07/19 09:53:06 1.32 +++ src/libexec/httpd/bozohttpd.c 2013/06/23 06:28:49 1.32.2.1 @@ -1,4 +1,4 @@ -/* $NetBSD: bozohttpd.c,v 1.32 2012/07/19 09:53:06 mrg Exp $ */ +/* $NetBSD: bozohttpd.c,v 1.32.2.1 2013/06/23 06:28:49 tls Exp $ */ /* $eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $ */ @@ -871,7 +871,7 @@ escape_rfc3986(bozohttpd_t *httpd, const return buf; } - for (s = url, d = buf; *s;) { + for (len = 0, s = url, d = buf; *s;) { if (*s & 0x80) goto encode_it; switch (*s) { @@ -893,13 +893,16 @@ escape_rfc3986(bozohttpd_t *httpd, const case ',': case ';': case '=': + case '%': encode_it: snprintf(d, 4, "%%%2X", *s++); d += 3; len += 3; + break; default: *d++ = *s++; len++; + break; } } buf[len] = 0;