[Remove entries to the current 2.0 section below, when backported]
+ *) Fix <Limit> and <LimitExcept> parsing to require a closing '>'
+ in the initial container. PR 25414.
+ [Geoffrey Young <geoff apache.org>]
+
*) Fix memory leak in handling of request bodies during reverse
proxy operations. PR 24991. [Larry Toppi <larry.toppi citrix.com>]
return NULL;
}
+/*
+ * Report a missing-'>' syntax error.
+ */
+static char *unclosed_directive(cmd_parms *cmd)
+{
+ return apr_pstrcat(cmd->pool, cmd->cmd->name,
+ "> directive missing closing '>'", NULL);
+}
+
AP_CORE_DECLARE_NONSTD(const char *) ap_limit_section(cmd_parms *cmd,
void *dummy,
const char *arg)
{
- const char *limited_methods = ap_getword(cmd->pool, &arg, '>');
+ const char *endp = ap_strrchr_c(arg, '>');
+ const char *limited_methods;
void *tog = cmd->cmd->cmd_data;
apr_int64_t limited = 0;
const char *errmsg;
return err;
}
+ if (endp == NULL) {
+ return unclosed_directive(cmd);
+ }
+
+ limited_methods = apr_pstrndup(cmd->pool, arg, endp - arg);
+
while (limited_methods[0]) {
char *method = ap_getword_conf(cmd->pool, &limited_methods);
int methnum;
#define USE_ICASE 0
#endif
-/*
- * Report a missing-'>' syntax error.
- */
-static char *unclosed_directive(cmd_parms *cmd)
-{
- return apr_pstrcat(cmd->pool, cmd->cmd->name,
- "> directive missing closing '>'", NULL);
-}
-
static const char *dirsection(cmd_parms *cmd, void *mconfig, const char *arg)
{
const char *errmsg;