]> granicus.if.org Git - apache/commitdiff
mod_alias: Enforce sanity in args to Redirect
authorNick Kew <niq@apache.org>
Wed, 27 May 2009 00:58:41 +0000 (00:58 +0000)
committerNick Kew <niq@apache.org>
Wed, 27 May 2009 00:58:41 +0000 (00:58 +0000)
PR 44729

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

CHANGES
modules/mappers/mod_alias.c

diff --git a/CHANGES b/CHANGES
index 657b0ad0e62aeea879cba9d404bcb774960ef5c2..3c38f5367c8f4e7e414b2f67ab7194f722fc2883 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,9 @@ Changes with Apache 2.3.3
      mod_proxy_ajp: Avoid delivering content from a previous request which
      failed to send a request body. PR 46949 [Ruediger Pluem]
 
+  *) mod_alias: check sanity in Redirect arguments.
+     PR 44729 [Sönke Tesch <st kino-fahrplan.de>]
+
   *) mod_proxy_http: fix Host: header for literal IPv6 addresses.
      PR 47177 [Carlos Garcia Braschi <cgbraschi gmail.com>]
 
index bde1703de7d01892d9e2b12404ba7a8c6209ed57..79079863fea0fb217599af31422432ac3c5d03e1 100644 (file)
@@ -180,16 +180,21 @@ static const char *add_redirect_internal(cmd_parms *cmd,
     const char *f = arg2;
     const char *url = arg3;
 
-    if (!strcasecmp(arg1, "gone"))
-        status = HTTP_GONE;
-    else if (!strcasecmp(arg1, "permanent"))
-        status = HTTP_MOVED_PERMANENTLY;
-    else if (!strcasecmp(arg1, "temp"))
-        status = HTTP_MOVED_TEMPORARILY;
-    else if (!strcasecmp(arg1, "seeother"))
-        status = HTTP_SEE_OTHER;
-    else if (apr_isdigit(*arg1))
-        status = atoi(arg1);
+    if (arg3 != NULL) {
+        if (!strcasecmp(arg1, "gone"))
+            status = HTTP_GONE;
+        else if (!strcasecmp(arg1, "permanent"))
+            status = HTTP_MOVED_PERMANENTLY;
+        else if (!strcasecmp(arg1, "temp"))
+            status = HTTP_MOVED_TEMPORARILY;
+        else if (!strcasecmp(arg1, "seeother"))
+            status = HTTP_SEE_OTHER;
+        else if (apr_isdigit(*arg1))
+            status = atoi(arg1);
+        else {
+            return "Redirect: invalid first argument (of three)";
+        }
+    }
     else {
         f = arg1;
         url = arg2;