]> granicus.if.org Git - apache/commitdiff
"Iterate" directives: Report an error if no arguments are provided.
authorJeff Trawick <trawick@apache.org>
Thu, 11 Oct 2012 17:11:31 +0000 (17:11 +0000)
committerJeff Trawick <trawick@apache.org>
Thu, 11 Oct 2012 17:11:31 +0000 (17:11 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1397172 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
server/config.c

diff --git a/CHANGES b/CHANGES
index 86bb45cf07bf9097941b9c653c3c50cc580e651e..1bb89e74a2546a5818086bb3511173c10a824432 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) "Iterate" directives: Report an error if no arguments are provided.
+     [Jeff Trawick]
+
   *) htpasswd, htdbm: Optionally read passwords from stdin, as more
      secure alternative to -b.  PR 40243. [Adomas Paltanavicius <adomas
      paltanavicius gmail com>, Stefan Fritsch]
index a9adddd75fb263321147793d642ff3619cf194b7..ffc66948700a4704d0c73b8e729b5a58a060ce35 100644 (file)
@@ -980,12 +980,20 @@ static const char *invoke_cmd(const command_rec *cmd, cmd_parms *parms,
         return cmd->AP_TAKE3(parms, mconfig, w, w2, w3);
 
     case ITERATE:
-        while (*(w = ap_getword_conf(parms->pool, &args)) != '\0') {
+        w = ap_getword_conf(parms->pool, &args);
+        
+        if (*w == '\0')
+            return apr_pstrcat(parms->pool, cmd->name,
+                               " requires at least one argument",
+                               cmd->errmsg ? ", " : NULL, cmd->errmsg, NULL);
 
+        while (*w != '\0') {
             errmsg = cmd->AP_TAKE1(parms, mconfig, w);
 
             if (errmsg && strcmp(errmsg, DECLINE_CMD) != 0)
                 return errmsg;
+
+            w = ap_getword_conf(parms->pool, &args);
         }
 
         return errmsg;