]> granicus.if.org Git - apache/commitdiff
followup to r1734125: null check for r->args
authorEric Covener <covener@apache.org>
Wed, 9 Mar 2016 18:23:23 +0000 (18:23 +0000)
committerEric Covener <covener@apache.org>
Wed, 9 Mar 2016 18:23:23 +0000 (18:23 +0000)
before cleaning up some QSA cases.

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

modules/mappers/mod_rewrite.c

index 549b5a4f251774b13e943d2ba28179d0d15f6b1c..44ad8c6ae57343d530e502b5f22a763a33144f90 100644 (file)
@@ -790,12 +790,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,