mirror of
https://github.com/nmap/nmap.git
synced 2026-07-11 02:34:55 +00:00
Refuse patterns that match the empty string
This commit is contained in:
parent
3cb27110dc
commit
713f8091ba
1 changed files with 6 additions and 0 deletions
|
|
@ -435,6 +435,12 @@ void ServiceProbeMatch::InitMatch(const char *matchtext, int lineno) {
|
|||
if (regex_compiled == NULL)
|
||||
fatal("%s: illegal regexp on line %d of nmap-service-probes (at regexp offset %ld): %d\n", __func__, lineno, pcre2_erroffset, pcre2_errcode);
|
||||
|
||||
uint32_t value = 0;
|
||||
pcre2_errcode = pcre2_pattern_info(regex_compiled, PCRE2_INFO_MATCHEMPTY, &value);
|
||||
if (pcre2_errcode == 0 && value != 0)
|
||||
fatal("%s: parse error on line %d of nmap-service-probes: pattern matches zero-length string", __func__, lineno);
|
||||
|
||||
|
||||
// creates a new match data block for holding the result of a match
|
||||
match_data = pcre2_match_data_create_from_pattern(
|
||||
regex_compiled,NULL
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue