From abfb9d9e2d0e9e98cafcfc7172264ac9e8708d14 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Fri, 13 May 2016 19:21:32 -0400 Subject: [PATCH] [mod_ssi] add PCRE_* options to constrain regex --- src/mod_ssi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod_ssi.c b/src/mod_ssi.c index 8ff8ad8f..6dd4f9f6 100644 --- a/src/mod_ssi.c +++ b/src/mod_ssi.c @@ -141,7 +141,7 @@ SETDEFAULTS_FUNC(mod_ssi_set_defaults) { #ifdef HAVE_PCRE_H /* allow 2 params */ - if (NULL == (p->ssi_regex = pcre_compile("^$", 0, &errptr, &erroff, NULL))) { + if (NULL == (p->ssi_regex = pcre_compile("^$", PCRE_ANCHORED|PCRE_DOLLAR_ENDONLY|PCRE_DOTALL|PCRE_UTF8, &errptr, &erroff, NULL))) { log_error_write(srv, __FILE__, __LINE__, "sds", "ssi: pcre ", erroff, errptr); @@ -1071,7 +1071,7 @@ static void mod_ssi_parse_ssi_stmt(server *srv, connection *con, plugin_data *p, #define N 10 int ovec[N * 3]; - int n = pcre_exec(p->ssi_regex, NULL, s, len, 0, 0, ovec, sizeof(ovec)/sizeof(*ovec)); + int n = pcre_exec(p->ssi_regex, NULL, s, len, 0, PCRE_ANCHORED, ovec, sizeof(ovec)/sizeof(*ovec)); if (n > 0) { const char **l; pcre_get_substring_list(s, ovec, n, &l);