diff --git a/configure.in b/configure.in index 564160014f..2c1e479916 100644 --- a/configure.in +++ b/configure.in @@ -199,11 +199,11 @@ AC_INIT(configure.in) fi AC_TRY_COMPILE([ #include ], - [ int eo; eo |= PCRE_EXTRA_MATCH_LIMIT_RECURSION; ], + [ int eo = 0; eo |= PCRE_EXTRA_MATCH_LIMIT_RECURSION; ], [ pcre_match_limit_recursion_available=yes ], [:] ) if test "$pcre_match_limit_recursion_available" != "yes"; then - CFLAGS="${CFLAGS} -DMISSING_PCRE_MATCH_RLIMIT" + CFLAGS="${CFLAGS} -DNO_PCRE_MATCH_RLIMIT" echo echo " Warning! pcre extra opt PCRE_EXTRA_MATCH_LIMIT_RECURSION not found" echo " This could lead to potential DoS please upgrade to pcre >= 6.5" diff --git a/src/detect-pcre.c b/src/detect-pcre.c index 5724902d2b..748809bfe8 100644 --- a/src/detect-pcre.c +++ b/src/detect-pcre.c @@ -358,21 +358,21 @@ DetectPcreData *DetectPcreParse (char *regexstr) pd->sd->match_limit = pcre_match_limit; pd->sd->flags |= PCRE_EXTRA_MATCH_LIMIT; } -#ifndef MISSING_PCRE_MATCH_RLIMIT +#ifndef NO_PCRE_MATCH_RLIMIT if(pcre_match_limit_recursion >= -1) { pd->sd->match_limit_recursion = pcre_match_limit_recursion; pd->sd->flags |= PCRE_EXTRA_MATCH_LIMIT_RECURSION; } -#endif /* MISSING_PCRE_MATCH_RLIMIT */ +#endif /* NO_PCRE_MATCH_RLIMIT */ } else { pd->sd->match_limit = MATCH_LIMIT_DEFAULT; pd->sd->flags |= PCRE_EXTRA_MATCH_LIMIT; -#ifndef MISSING_PCRE_MATCH_RLIMIT +#ifndef NO_PCRE_MATCH_RLIMIT pd->sd->match_limit_recursion = MATCH_LIMIT_DEFAULT; pd->sd->flags |= PCRE_EXTRA_MATCH_LIMIT_RECURSION; -#endif /* MISSING_PCRE_MATCH_RLIMIT */ +#endif /* NO_PCRE_MATCH_RLIMIT */ } }