diff options
author | João Valverde <j@v6e.pt> | 2022-06-18 10:43:24 +0100 |
---|---|---|
committer | A Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2022-06-21 15:10:08 +0000 |
commit | 47348ae598127aa8bd46d5c650c6f1f77eef2bc4 (patch) | |
tree | 1179e3c8534e96408d0e54412b8554e8ec835e98 /test | |
parent | d372ed34830e69dc15c3533d4ef65873e3404f3c (diff) |
dfilter: Add support for literal strings with null bytes
Before:
Filter: frame matches "abc\x00def"
dftest: \x00 (NUL byte) cannot be used with a regular string.
frame matches "abc\x00def"
^~~~
Filter: _ws.ftypes.string == "a string with a \0 byte"
dftest: \0 (NUL byte) cannot be used with a regular string.
_ws.ftypes.string == "a string with a \0 byte"
^~
After:
Filter: frame matches "abc\x00def"
Syntax tree:
0 TEST_MATCHES:
1 FIELD(frame)
1 PCRE(abc\0def)
Instructions:
00000 READ_TREE frame -> reg#0
00001 IF_FALSE_GOTO 3
00002 ANY_MATCHES reg#0 matches abc\0def
00003 RETURN
Filter: _ws.ftypes.string == "a string with a \0 byte"
Syntax tree:
0 TEST_ANY_EQ:
1 FIELD(_ws.ftypes.string)
1 FVALUE("a string with a \0 byte" <FT_STRING>)
Instructions:
00000 READ_TREE _ws.ftypes.string -> reg#0
00001 IF_FALSE_GOTO 3
00002 ANY_EQ reg#0 == "a string with a \0 byte" <FT_STRING>
00003 RETURN
Fixes issue #16156.
Diffstat (limited to 'test')
-rw-r--r-- | test/suite_dfilter/group_membership.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/suite_dfilter/group_membership.py b/test/suite_dfilter/group_membership.py index e3d1f37711..0b5392183a 100644 --- a/test/suite_dfilter/group_membership.py +++ b/test/suite_dfilter/group_membership.py @@ -86,7 +86,7 @@ class case_membership(unittest.TestCase): def test_membership_11_bad_rhs_string(self, checkDFilterFail): dfilter = 'frame.number in {1, "foo"}' - error = '"foo" cannot be converted to Unsigned integer, 4 bytes.' + error = 'Unsigned integer (4 bytes) cannot be converted from a string' checkDFilterFail(dfilter, error) def test_membership_12_value_string(self, checkDFilterCount): |