diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2016-01-31 12:04:09 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-02-02 05:28:45 +0000 |
commit | 90d63e37ba6ec7ddfed339abeee864af15b3e313 (patch) | |
tree | d86b6881d42f55e7acbd654908314828fd9f8788 /epan/dissectors/packet-frame.c | |
parent | 130ea46be57607fe793a9c060153dd9e5b702cd1 (diff) |
frame: Fix Dereference of null pointer found by Clang analyzer
Change-Id: I37323975c1fa4ba5c08afb73d72159c7c36fdb9a
Reviewed-on: https://code.wireshark.org/review/13623
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-frame.c')
-rw-r--r-- | epan/dissectors/packet-frame.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/dissectors/packet-frame.c b/epan/dissectors/packet-frame.c index 06216aa0e6..1e71cf9eaa 100644 --- a/epan/dissectors/packet-frame.c +++ b/epan/dissectors/packet-frame.c @@ -186,6 +186,8 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* tree=parent_tree; + DISSECTOR_ASSERT(fr_data); + switch (pinfo->phdr->rec_type) { case REC_TYPE_PACKET: @@ -254,7 +256,7 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* break; } - if (fr_data && fr_data->pkt_comment) { + if (fr_data->pkt_comment) { item = proto_tree_add_item(tree, proto_pkt_comment, tvb, 0, 0, ENC_NA); comments_tree = proto_item_add_subtree(item, ett_comments); comment_item = proto_tree_add_string_format(comments_tree, hf_comments_text, tvb, 0, 0, @@ -507,9 +509,7 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* { int file_type_subtype = WTAP_FILE_TYPE_SUBTYPE_UNKNOWN; - if (fr_data) { - file_type_subtype = fr_data->file_type_subtype; - } + file_type_subtype = fr_data->file_type_subtype; if (!dissector_try_uint(wtap_fts_rec_dissector_table, file_type_subtype, tvb, pinfo, parent_tree)) { |