Author: joes
Date: Sat Mar 12 20:27:46 2005
New Revision: 157310
URL: http://svn.apache.org/viewcvs?view=rev&rev=157310
Log:
Fix the goofy error-detection logic in url_decode.
Modified:
httpd/apreq/branches/multi-env-unstable/library/util.c
Modified: httpd/apreq/branches/multi-env-unstable/library/util.c
URL:
http://svn.apache.org/viewcvs/httpd/apreq/branches/multi-env-unstable/library/util.c?view=diff&r1=157309&r2=157310
==============================================================================
--- httpd/apreq/branches/multi-env-unstable/library/util.c (original)
+++ httpd/apreq/branches/multi-env-unstable/library/util.c Sat Mar 12 20:27:46
2005
@@ -220,7 +220,11 @@
else {
*dlen = d - start;
*slen = s - src;
- if (s + 5 < end || (s + 2 < end && s[1] != 'u' && s[1] !=
'U')) {
+ if (s + 5 < end
+ || (s + 2 < end && !apr_isxdigit(s[2]))
+ || (s + 1 < end && !apr_isxdigit(s[1])
+ && s[1] != 'u' && s[1] != 'U'))
+ {
*d = 0;
return APREQ_ERROR_BADSEQ;
}