mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 16:57:06 +00:00
Fix expr_match bug
This commit is contained in:
parent
f3f9ca7a8b
commit
e47b742669
2 changed files with 2 additions and 1 deletions
|
|
@ -371,7 +371,7 @@ bool expr_match(const char *val, size_t vlen, const char *expr, size_t explen, b
|
|||
}
|
||||
goto next_expr;
|
||||
} else {
|
||||
q1 = strchr_p(p, p_end, '-');
|
||||
q1 = strchr_p(p, q ? q : p_end, '-');
|
||||
if (q1 != NULL) {
|
||||
size_t sublen1 = q1 - p;
|
||||
if ((vlen > sublen1)
|
||||
|
|
|
|||
|
|
@ -152,6 +152,7 @@ const struct expr_test tests[] = {
|
|||
{"M[500|5B4]ST11NW[7-9]", "M5B4ST11NW79", false},
|
||||
{"M[500|5B4]ST11NW[7-9]", "M500ST11NWA", false},
|
||||
{"M[500|5B4]ST11NW[7-9]", "M5B40ST11NW9", false},
|
||||
{"A|20-22", "A", true},
|
||||
{"", "", true}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue