mirror of
https://github.com/nmap/nmap.git
synced 2026-06-29 20:55:29 +00:00
Tighten limits on PCRE matches
This commit is contained in:
parent
b150def88c
commit
0916eb02b3
1 changed files with 3 additions and 3 deletions
|
|
@ -457,13 +457,13 @@ void ServiceProbeMatch::InitMatch(const char *matchtext, int lineno) {
|
|||
}
|
||||
// Set some limits to avoid evil match cases.
|
||||
// These are flexible; if they cause problems, increase them.
|
||||
pcre2_set_match_limit(match_context, 100000);
|
||||
pcre2_set_match_limit(match_context, 50000);
|
||||
#ifdef pcre2_set_depth_limit
|
||||
// Changed name in PCRE2 10.30. PCRE2 uses macro definitions for function
|
||||
// names, so we don't have to add this to configure.ac.
|
||||
pcre2_set_depth_limit(match_context, 10000);
|
||||
pcre2_set_depth_limit(match_context, 1000);
|
||||
#else
|
||||
pcre2_set_recursion_limit(match_context, 10000);
|
||||
pcre2_set_recursion_limit(match_context, 1000);
|
||||
#endif
|
||||
#ifdef pcre2_set_heap_limit
|
||||
pcre2_set_heap_limit(match_context, 10); // units = kibibytes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue