From: Yann Ylavic Date: Thu, 10 Mar 2016 12:34:43 +0000 (+0000) Subject: Merge r1734294 from trunk: X-Git-Tag: 2.4.19~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=490a9353e19dd7b98656ee9125bb4ad083dc50fc;p=thirdparty%2Fapache%2Fhttpd.git Merge r1734294 from trunk: followup to r1734125: null check for r->args before cleaning up some QSA cases. Submitted by: covener Reviewed by: covener, rpluem, ylavic Backported by: ylavic git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1734397 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index 57009d99122..197d2cae572 100644 --- a/STATUS +++ b/STATUS @@ -112,10 +112,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - *) mod_rewrite: bug in recently backported r1734125. - trunk patch: http://svn.apache.org/r1734294. - 2.4.x patch: trunk works - +1 covener, rpluem, ylavic PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 5d3cffeb946..1cf110be6c2 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -762,12 +762,15 @@ static void splitout_queryargs(request_rec *r, int qsappend, int qsdiscard, r->args = apr_pstrdup(r->pool, q); } - len = strlen(r->args); - if (!len) { - r->args = NULL; - } - else if (r->args[len-1] == '&') { - r->args[len-1] = '\0'; + if (r->args) { + len = strlen(r->args); + + if (!len) { + r->args = NULL; + } + else if (r->args[len-1] == '&') { + r->args[len-1] = '\0'; + } } rewritelog((r, 3, NULL, "split uri=%s -> uri=%s, args=%s", olduri,