mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Fix expr_match bug
This commit is contained in:
@@ -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}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user