Commit 418685e5 authored by Jim Jagielski's avatar Jim Jagielski
Browse files

Merge r1796446 from trunk:

PR61124: ap_parse_form_data() EBCDIC fix

URL-decoding doesn't work on EBCDIC.

Submitted By: Hank Ibell <hwibell gmail.com>



Submitted by: covener
Reviewed by: covener, rjung, ylavic


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1796849 13f79535-47bb-0310-9956-ffa450edef68
parent 268490f7
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2,6 +2,9 @@

Changes with Apache 2.4.26

  *) core: ap_parse_form_data() URL-decoding doesn't work on EBCDIC
     platforms. PR61124. [Hank Ibell <hwibell gmail.com>]

  *) ab: enable option processing for setting a custom HTTP method also for
     non-SSL builds.  [Rainer Jung]

+0 −5
Original line number Diff line number Diff line
@@ -120,11 +120,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
  [ start all new proposals below, under PATCHES PROPOSED. ]

  *) core: ap_parse_form_data() doesn't work on EBCDIC systems. PR61124.
     trunk patch: http://svn.apache.org/r1796446
     2.4.x patch: svn merge -c 1796446 ^/httpd/httpd/trunk .
     +1: covener, rjung, ylavic

  *) mod_rewrite: allow users to workaround the over-agressive backreference
                  escaping by selecting the characters to escape
     mod_rewrite: add BNP flag (backrefnoplus)
+4 −22
Original line number Diff line number Diff line
@@ -2666,8 +2666,7 @@ AP_DECLARE(int) ap_parse_form_data(request_rec *r, ap_filter_t *f,
    ap_form_pair_t *pair = NULL;
    apr_array_header_t *pairs = apr_array_make(r->pool, 4, sizeof(ap_form_pair_t));

    char hi = 0;
    char low = 0;
    char escaped_char[2];

    *ptr = pairs;

@@ -2734,30 +2733,13 @@ AP_DECLARE(int) ap_parse_form_data(request_rec *r, ap_filter_t *f,
                    continue;
                }
                if (FORM_PERCENTA == percent) {
                    if (c >= 'a') {
                        hi = c - 'a' + 10;
                    }
                    else if (c >= 'A') {
                        hi = c - 'A' + 10;
                    }
                    else if (c >= '0') {
                        hi = c - '0';
                    }
                    hi = hi << 4;
                    escaped_char[0] = c;
                    percent = FORM_PERCENTB;
                    continue;
                }
                if (FORM_PERCENTB == percent) {
                    if (c >= 'a') {
                        low = c - 'a' + 10;
                    }
                    else if (c >= 'A') {
                        low = c - 'A' + 10;
                    }
                    else if (c >= '0') {
                        low = c - '0';
                    }
                    c = low | hi;
                    escaped_char[1] = c;
                    c = x2c(escaped_char);
                    percent = FORM_NORMAL;
                }
                switch (state) {