From 507473fb6dcd4e25363d7a785f3bcf43288ff472 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Wed, 10 Sep 2008 08:00:58 +0000 Subject: [PATCH] * 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 --- modules/filters/mod_substitute.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/filters/mod_substitute.c b/modules/filters/mod_substitute.c index ebe860d66bf..84415c759a0 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"; } -- 2.47.2