diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2017-12-10 22:17:04 +0100 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-12-11 02:03:22 +0000 |
commit | 7d383637865e2f1f0de7a8921261f406f42af4bf (patch) | |
tree | c97363fee9b228da3be637f023f7cc96ea6b2026 | |
parent | 91548948bbe2bba844a65c62975dada05dd4c03e (diff) |
NTP: fix parsing of multiple comma separated identifiers
Bug: 14268
Change-Id: Id1d6040052d34d3f8bdfe49d20f4f3f8efbe001b
Reviewed-on: https://code.wireshark.org/review/24755
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r-- | epan/dissectors/packet-ntp.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/epan/dissectors/packet-ntp.c b/epan/dissectors/packet-ntp.c index 3ecfe1901b..d7bcb0c364 100644 --- a/epan/dissectors/packet-ntp.c +++ b/epan/dissectors/packet-ntp.c @@ -1238,7 +1238,7 @@ static void init_parser(void) { /* specify what counts as character */ - tvbparse_wanted_t *want_identifier = tvbparse_chars(-1, 1, 0, + tvbparse_wanted_t *want_identifier_str = tvbparse_chars(-1, 1, 0, "abcdefghijklmnopqrstuvwxyz-_ABCDEFGHIJKLMNOPQRSTUVWXYZ.0123456789", NULL, NULL, NULL); /* this is the equal sign used in assignments */ tvbparse_wanted_t *want_equalsign = tvbparse_char(-1, "=", NULL, NULL, NULL); @@ -1250,9 +1250,14 @@ init_parser(void) NULL); tvbparse_wanted_t *want_comma = tvbparse_until(-1, NULL, NULL, NULL, tvbparse_char(-1, ",", NULL, NULL, NULL), TP_UNTIL_SPEND); + /* the following specifies an identifier */ + tvbparse_wanted_t *want_identifier = tvbparse_set_seq(-1, NULL, NULL, NULL, + want_identifier_str, + tvbparse_some(-1, 0, 1, NULL, NULL, NULL, want_comma), + NULL); /* the following specifies an assignment of the form identifier=value */ tvbparse_wanted_t *want_assignment = tvbparse_set_seq(-1, NULL, NULL, NULL, - want_identifier, + want_identifier_str, want_equalsign, tvbparse_some(-1, 0, 1, NULL, NULL, NULL, want_value), tvbparse_some(-1, 0, 1, NULL, NULL, NULL, want_comma), |