--enable-gccprofile sets -pg flag detect presence of pcre recursion

remotes/origin/master-1.0.x
William Metcalf 17 years ago committed by Victor Julien
parent db2d483d11
commit 5bde121754

@ -158,6 +158,17 @@ AC_INIT(configure.in)
CFLAGS="${CFLAGS} ${SECCFLAGS}"
LDFLAGS="${LDFLAGS} ${SECLDFLAGS}"
fi
#enable profile generation
AC_ARG_ENABLE(gccprofile,
[ --enable-gccprofile Enable gcc profile info i.e -pg flag is set],
[ enable_gccprofile=yes
])
if test "$enable_gccprofile" = "yes"; then
CFLAGS="${CFLAGS} -pg"
fi
#libpcre
AC_ARG_WITH(libpcre_includes,
[ --with-libpcre-includes=DIR libpcre include directory],
@ -187,6 +198,20 @@ AC_INIT(configure.in)
exit 1
fi
AC_TRY_COMPILE([ #include <pcre.h> ],
[ int eo; 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"
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"
echo " Continuing for now...."
echo " from www.pcre.org."
echo
fi
#libyaml
AC_ARG_WITH(libyaml_includes,
[ --with-libyaml-includes=DIR libyaml include directory],

@ -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
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 */
}
else {
pd->sd->match_limit = MATCH_LIMIT_DEFAULT;
pd->sd->flags |= PCRE_EXTRA_MATCH_LIMIT;
#ifndef MISSING_PCRE_MATCH_RLIMIT
pd->sd->match_limit_recursion = MATCH_LIMIT_DEFAULT;
pd->sd->flags |= PCRE_EXTRA_MATCH_LIMIT_RECURSION;
#endif /* MISSING_PCRE_MATCH_RLIMIT */
}
}

Loading…
Cancel
Save