httpd-apreq-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r157310 - httpd/apreq/branches/multi-env-unstable/library/util.c
Date Sun, 13 Mar 2005 04:27:48 GMT
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;
                 }



Mime
View raw message