aboutsummaryrefslogtreecommitdiffstats
path: root/epan/ftypes/ftype-ipv4.c
diff options
context:
space:
mode:
authorJoão Valverde <j@v6e.pt>2021-11-23 21:20:34 +0000
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-11-24 08:40:20 +0000
commit943c2820093a0c1f366938f7dd090a13f63e10a5 (patch)
tree985ebd0d50eec0adb2e5fb2ade0620513cc9ef17 /epan/ftypes/ftype-ipv4.c
parent18d7afa71130824df04a8aed913370c5a66e50dc (diff)
dfilter: Parse character constants in lexer
Invalid character constants should be handled in the lexical scanner. Todo: See if some code could be shared to parse double quoted strings. It also fixes some unintuitive type coercions to string. Character constants should be treated as characters, or maybe integers, or maybe even throw an invalid comparison error, but coverting to a literal string or byte array is surprising and not particularly useful: '\xFF' -> "'\xFF'" (equals) '\xFF' -> "FF" (contains) Before: Filter: http.request.method contains "\x63" Constants: 00000 PUT_FVALUE "c" <FT_STRING> -> reg#1 (...) Filter: http.request.method contains '\x63' Constants: 00000 PUT_FVALUE "63" <FT_STRING> -> reg#1 (...) Filter: http.request.method == "\x63" Constants: 00000 PUT_FVALUE "c" <FT_STRING> -> reg#1 (...) Filter: http.request.method == '\x63' Constants: 00000 PUT_FVALUE "'\\x63'" <FT_STRING> -> reg#1 (...) After: Filter: http.request.method contains '\x63' Constants: 00000 PUT_FVALUE "c" <FT_STRING> -> reg#1 (...) Filter: http.request.method == '\x63' Constants: 00000 PUT_FVALUE "c" <FT_STRING> -> reg#1 (...)
Diffstat (limited to 'epan/ftypes/ftype-ipv4.c')
-rw-r--r--epan/ftypes/ftype-ipv4.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/epan/ftypes/ftype-ipv4.c b/epan/ftypes/ftype-ipv4.c
index 10d893ee5e..9d51bf6c33 100644
--- a/epan/ftypes/ftype-ipv4.c
+++ b/epan/ftypes/ftype-ipv4.c
@@ -155,6 +155,7 @@ ftype_register_ipv4(void)
NULL, /* free_value */
val_from_unparsed, /* val_from_unparsed */
NULL, /* val_from_string */
+ NULL, /* val_from_charconst */
val_to_repr, /* val_to_string_repr */
{ .set_value_uinteger = set_uinteger }, /* union set_value */