aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJoão Valverde <j@v6e.pt>2021-10-28 00:38:38 +0100
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-10-28 16:26:36 +0000
commitc6b68b3ee2a742fc0b5ffb78c19bc27fb9e92527 (patch)
treefd387a14a81135e7901630b2cf89e4ba7423518c /test
parent9c2f3b0dc6ebde14801884a324919571344edbb5 (diff)
dfilter: Need to check validity of LHS of "matches" expression
Fixes #17690, a crash on a failed assertion.
Diffstat (limited to 'test')
-rw-r--r--test/suite_dfilter/group_range_method.py4
-rw-r--r--test/suite_dfilter/group_syntax.py4
2 files changed, 6 insertions, 2 deletions
diff --git a/test/suite_dfilter/group_range_method.py b/test/suite_dfilter/group_range_method.py
index c3068a6ea0..646e65a0e2 100644
--- a/test/suite_dfilter/group_range_method.py
+++ b/test/suite_dfilter/group_range_method.py
@@ -37,11 +37,11 @@ class case_range(unittest.TestCase):
def test_slice_string_1(self, checkDFilterFail):
dfilter = "frame == \"00\"[1]"
- checkDFilterFail(dfilter, "Range is not supported for entity 00 of type STRING")
+ checkDFilterFail(dfilter, "Range is not supported for entity \"00\" of type STRING")
def test_slice_unparsed_1(self, checkDFilterFail):
dfilter = "a == b[1]"
- checkDFilterFail(dfilter, "Range is not supported for entity b of type UNPARSED")
+ checkDFilterFail(dfilter, "Range is not supported for entity \"b\" of type UNPARSED")
def test_slice_func_1(self, checkDFilterSucceed):
dfilter = "string(ipx.src.node)[3:2] == \"cc:dd\""
diff --git a/test/suite_dfilter/group_syntax.py b/test/suite_dfilter/group_syntax.py
index 0c218b0986..04e2718ccf 100644
--- a/test/suite_dfilter/group_syntax.py
+++ b/test/suite_dfilter/group_syntax.py
@@ -47,6 +47,10 @@ class case_syntax(unittest.TestCase):
dfilter = r'http.host matches r"update\.microsoft\.c.."'
checkDFilterCount(dfilter, 1)
+ def test_matches_5(self, checkDFilterFail):
+ dfilter = '"a" matches "b"'
+ checkDFilterFail(dfilter, "not a valid operand for matches")
+
def test_equal_1(self, checkDFilterCount):
dfilter = 'ip.addr == 10.0.0.5'
checkDFilterCount(dfilter, 1)