summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorEric Covener <covener@apache.org>2017-05-27 20:16:14 +0000
committerEric Covener <covener@apache.org>2017-05-27 20:16:14 +0000
commit0adfe54ed6b62da75d044975d6c9e09f5a2601be (patch)
treea683c597a8a6a890221215fd2f02a88b4e9844f9 /server
parenta18fe492da57182e72667808c964a2b87cf15c92 (diff)
downloadhttpd-0adfe54ed6b62da75d044975d6c9e09f5a2601be.tar.gz
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> (CTR for EBCDIC fix) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1796447 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r--server/util.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/server/util.c b/server/util.c
index fba34bde1a..6667ac2e46 100644
--- a/server/util.c
+++ b/server/util.c
@@ -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) {