diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2018-09-18 10:23:45 +0200 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2018-09-18 11:14:30 +0000 |
commit | 2ab87102bb9aec5a5986aaeb5ee2bf0319454d1a (patch) | |
tree | 8d25be96e00aa0dc8480cfcdd534ab53bbd2e734 /plugins | |
parent | 4184963dae88ade6c32a3985f74a27c93740fe04 (diff) |
TRANSUM: fix crash with current top of tree
ssl filters were renamed to tls.
Also protect against not found fields to avoid a crash in the future.
Change-Id: I181a252557b8261fa134b1331c31096a6205635f
Reviewed-on: https://code.wireshark.org/review/29715
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/epan/transum/packet-transum.c | 8 | ||||
-rw-r--r-- | plugins/epan/transum/packet-transum.h | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/plugins/epan/transum/packet-transum.c b/plugins/epan/transum/packet-transum.c index 0fdb8fb4cc..c2a72cfc9e 100644 --- a/plugins/epan/transum/packet-transum.c +++ b/plugins/epan/transum/packet-transum.c @@ -18,6 +18,7 @@ #include <epan/proto.h> #include <epan/packet.h> #include <epan/prefs.h> +#include <wsutil/ws_printf.h> #include "packet-transum.h" #include "preferences.h" #include "extractors.h" @@ -59,7 +60,7 @@ HF_OF_INTEREST_INFO hf_of_interest[HF_INTEREST_END_OF_LIST] = { { -1, "udp.stream" }, { -1, "udp.length" }, - { -1, "ssl.record.content_type" }, + { -1, "tls.record.content_type" }, { -1, "tds.type" }, { -1, "tds.length" }, @@ -768,7 +769,10 @@ static void init_globals(void) GArray *wanted_fields = g_array_sized_new(FALSE, FALSE, (guint)sizeof(int), HF_INTEREST_END_OF_LIST); for (int i = 0; i < HF_INTEREST_END_OF_LIST; i++) { - g_array_append_val(wanted_fields, hf_of_interest[i].hf); + if (hf_of_interest[i].hf != -1) + g_array_append_val(wanted_fields, hf_of_interest[i].hf); + else + ws_g_warning("TRANSUM: unknown field %s", hf_of_interest[i].proto_name); } set_postdissector_wanted_hfids(transum_handle, wanted_fields); diff --git a/plugins/epan/transum/packet-transum.h b/plugins/epan/transum/packet-transum.h index daa17dba87..e8e81bf01f 100644 --- a/plugins/epan/transum/packet-transum.h +++ b/plugins/epan/transum/packet-transum.h @@ -92,7 +92,7 @@ typedef struct _PKT_INFO guint16 dstport; /* tcp.dstport or udp.dstport*/ guint16 len; /* tcp.len or udp.len */ - guint8 ssl_content_type; /*ssl.record.content_type */ + guint8 ssl_content_type; /*tls.record.content_type */ guint8 tds_type; /*tds.type */ guint16 tds_length; /* tds.length */ |