diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2018-08-17 13:02:53 +0200 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2018-08-17 14:52:28 +0000 |
commit | fd75f915e3f16b00feaef5d045a2d70174873a23 (patch) | |
tree | 88eaef1128f56d50cfdfebde9cc0c335af43c99c /epan/dissectors/packet-syslog.c | |
parent | 3a99475d0a8b8669a84ce5c7fc70a519a3476d10 (diff) |
Syslog: skip timestamp field if not present
Bug: 15063
Change-Id: I08ca03be495ee172e0995fc949e0ba06c49b0dae
Reviewed-on: https://code.wireshark.org/review/29177
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-syslog.c')
-rw-r--r-- | epan/dissectors/packet-syslog.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/epan/dissectors/packet-syslog.c b/epan/dissectors/packet-syslog.c index 11a1e47b11..6b7d74d453 100644 --- a/epan/dissectors/packet-syslog.c +++ b/epan/dissectors/packet-syslog.c @@ -239,8 +239,11 @@ dissect_syslog_message(proto_tree* tree, tvbuff_t* tvb, guint offset) end_offset = tvb_find_guint8(tvb, offset, -1, ' '); if (end_offset == -1) return; - proto_tree_add_time_item(tree, hf_syslog_timestamp, tvb, offset, end_offset - offset, ENC_ISO_8601_DATE_TIME, - NULL, NULL, NULL); + if ((guint)end_offset != offset) { + /* do not call proto_tree_add_time_item with a length of 0 */ + proto_tree_add_time_item(tree, hf_syslog_timestamp, tvb, offset, end_offset - offset, ENC_ISO_8601_DATE_TIME, + NULL, NULL, NULL); + } offset = end_offset + 1; if (!dissect_syslog_info(tree, tvb, &offset, hf_syslog_hostname)) |