From: Ruediger Pluem Date: Wed, 10 Sep 2008 08:00:58 +0000 (+0000) Subject: * Allow empty substitute patterns (to remove data from the stream), but X-Git-Tag: 2.3.0~309 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=507473fb6dcd4e25363d7a785f3bcf43288ff472;p=apache * Allow empty substitute patterns (to remove data from the stream), but disallow empty search patterns. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@693727 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/filters/mod_substitute.c b/modules/filters/mod_substitute.c index ebe860d66b..84415c759a 100644 --- a/modules/filters/mod_substitute.c +++ b/modules/filters/mod_substitute.c @@ -507,21 +507,25 @@ static const char *set_pattern(cmd_parms *cmd, void *cfg, const char *line) if (delim) from = ++ourline; if (from) { - while (*++ourline && *ourline != delim); + if (*ourline != delim) { + while (*++ourline && *ourline != delim); + } if (*ourline) { *ourline = '\0'; to = ++ourline; } } if (to) { - while (*++ourline && *ourline != delim); + if (*ourline != delim) { + while (*++ourline && *ourline != delim); + } if (*ourline) { *ourline = '\0'; flags = ++ourline; } } - if (!delim || !from || !to) { + if (!delim || !from || !*from || !to) { return "Bad Substitute format, must be a complete s/// pattern"; }