]> granicus.if.org Git - apache/commitdiff
Correct T_HTTP_TOKEN_STOP per RFC2068 (2.2) - RFC7230 (3.2.6),
authorWilliam A. Rowe Jr <wrowe@apache.org>
Fri, 29 Jul 2016 15:35:56 +0000 (15:35 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Fri, 29 Jul 2016 15:35:56 +0000 (15:35 +0000)
which has always defined 'token' as CHAR or VCHAR - visible USASCII only.

NUL char is also a stop, end of parsing.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1754538 13f79535-47bb-0310-9956-ffa450edef68

server/gen_test_char.c

index d5b8d3f34503a6adc6204c18140effeab0572cfe..c0d0903d6958526c9836098d6cf262bd085a72c0 100644 (file)
@@ -115,8 +115,13 @@ int main(int argc, char *argv[])
             flags |= T_ESCAPE_URLENCODED;
         }
 
-        /* these are the "tspecials" (RFC2068) or "separators" (RFC2616) */
-        if (c && (apr_iscntrl(c) || strchr(" \t()<>@,;:\\\"/[]?={}", c))) {
+        /* Stop for any non-'token' character, including ctrls, obs-text,
+         * and "tspecials" (RFC2068) a.k.a. "separators" (RFC2616)
+         * XXX: With luck, isascii behaves sensibly on EBCDIC platforms
+         *      and insists on chars that correspond to ASCII equivilants
+         */
+        if (apr_iscntrl(c) || strchr(" \t()<>@,;:\\\"/[]?={}", c))
+                           || !apr_isascii(c)) {
             flags |= T_HTTP_TOKEN_STOP;
         }