httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r106879 - /httpd/httpd/trunk/CHANGES /httpd/httpd/trunk/server/core.c
Date Mon, 29 Nov 2004 04:15:25 GMT
Author: pquerna
Date: Sun Nov 28 20:15:24 2004
New Revision: 106879

URL: http://svn.apache.org/viewcvs?view=rev&rev=106879
Log:
* server/core.c: Give an error instead of silently going on when a section is missing an argument.

PR: 25460
Submitted By: Geoffrey Young

Modified:
   httpd/httpd/trunk/CHANGES
   httpd/httpd/trunk/server/core.c

Modified: httpd/httpd/trunk/CHANGES
Url: http://svn.apache.org/viewcvs/httpd/httpd/trunk/CHANGES?view=diff&rev=106879&p1=httpd/httpd/trunk/CHANGES&r1=106878&p2=httpd/httpd/trunk/CHANGES&r2=106879
==============================================================================
--- httpd/httpd/trunk/CHANGES	(original)
+++ httpd/httpd/trunk/CHANGES	Sun Nov 28 20:15:24 2004
@@ -2,6 +2,10 @@
 
   [Remove entries to the current 2.0 section below, when backported]
 
+  *) core: Error out on sections that are missing an argument instead of
+     silently consuming the section. PR 25460.
+     [Geoffrey Young, Paul Querna]
+
   *) mod_cache/mod_mem_cache/mod_disk_cache: Move out of experimental.
 
   *) Upgraded PCRE to version 5.0. [Brian Pane]

Modified: httpd/httpd/trunk/server/core.c
Url: http://svn.apache.org/viewcvs/httpd/httpd/trunk/server/core.c?view=diff&rev=106879&p1=httpd/httpd/trunk/server/core.c&r1=106878&p2=httpd/httpd/trunk/server/core.c&r2=106879
==============================================================================
--- httpd/httpd/trunk/server/core.c	(original)
+++ httpd/httpd/trunk/server/core.c	Sun Nov 28 20:15:24 2004
@@ -1662,6 +1662,15 @@
                        "> directive missing closing '>'", NULL);
 }
 
+/*
+ * Report a missing args in '<Foo >' syntax error.
+ */
+static char *missing_container_arg(cmd_parms *cmd)
+{
+    return apr_pstrcat(cmd->pool, cmd->cmd->name,
+                       "> directive requires additional arguments", NULL);
+}
+
 AP_CORE_DECLARE_NONSTD(const char *) ap_limit_section(cmd_parms *cmd,
                                                       void *dummy,
                                                       const char *arg)
@@ -1683,6 +1692,10 @@
 
     limited_methods = apr_pstrndup(cmd->pool, arg, endp - arg);
 
+    if (!limited_methods[0]) {
+        return missing_container_arg(cmd);
+    }
+
     while (limited_methods[0]) {
         char *method = ap_getword_conf(cmd->pool, &limited_methods);
         int methnum;
@@ -1750,6 +1763,10 @@
 
     arg = apr_pstrndup(cmd->pool, arg, endp - arg);
 
+    if (!arg[0]) {
+        return missing_container_arg(cmd);
+    }
+
     if (!arg) {
         if (thiscmd->cmd_data)
             return "<DirectoryMatch > block must specify a path";
@@ -1850,6 +1867,10 @@
 
     arg = apr_pstrndup(cmd->pool, arg, endp - arg);
 
+    if (!arg[0]) {
+        return missing_container_arg(cmd);
+    }
+
     cmd->path = ap_getword_conf(cmd->pool, &arg);
     cmd->override = OR_ALL|ACCESS_CONF;
 
@@ -1915,6 +1936,10 @@
 
     arg = apr_pstrndup(cmd->pool, arg, endp - arg);
 
+    if (!arg[0]) {
+        return missing_container_arg(cmd);
+    }
+
     cmd->path = ap_getword_conf(cmd->pool, &arg);
     /* Only if not an .htaccess file */
     if (!old_path) {
@@ -1986,6 +2011,10 @@
         arg++;
     }
 
+    if (!arg[0]) {
+        return missing_container_arg(cmd);
+    }
+
     found = ap_find_linked_module(arg);
 
     /* search prelinked stuff */
@@ -2059,6 +2088,10 @@
         arg++;
     }
 
+    if (!arg[0]) {
+        return missing_container_arg(cmd);
+    }
+
     defined = ap_exists_config_define(arg);
     if ((!not && defined) || (not && !defined)) {
         ap_directive_t *parent = NULL;
@@ -2096,6 +2129,10 @@
     }
 
     arg = apr_pstrndup(cmd->pool, arg, endp - arg);
+
+    if (!arg[0]) {
+        return missing_container_arg(cmd);
+    }
 
     /* FIXME: There's another feature waiting to happen here -- since you
         can now put multiple addresses/names on a single <VirtualHost>

Mime
View raw message