From 583a47c06e2a27676a7b2e49af2ee89ea0f360c5 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Thu, 1 May 2014 14:25:33 +0200 Subject: Fix Dereference of null pointer found by Clang analyzer packet-teamspeak2.c:456:21: warning: Access to field 'fragmented' results in a dereference of a null pointer (loaded from variable 'frag') Change-Id: Ie253991f8d664c4594254bcd4569883614aafe2f Reviewed-on: https://code.wireshark.org/review/1455 Reviewed-by: Anders Broman --- epan/dissectors/packet-teamspeak2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epan/dissectors/packet-teamspeak2.c b/epan/dissectors/packet-teamspeak2.c index c739524a02..45674d6544 100644 --- a/epan/dissectors/packet-teamspeak2.c +++ b/epan/dissectors/packet-teamspeak2.c @@ -453,7 +453,7 @@ static void ts2_standard_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree * next_tvb = tvb_new_subset_remaining(tvb, 24); /* If we have a full packet now dissect it */ - if((new_tvb || !frag->fragmented) && !frag->outoforder) + if((new_tvb || (frag && !frag->fragmented)) && !frag->outoforder) { switch(type) { @@ -493,7 +493,7 @@ static void ts2_standard_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree * } } /* The packet is out of order, update the cinfo and ignore the packet */ - if(frag->outoforder) + if(frag && frag->outoforder) col_append_str(pinfo->cinfo, COL_INFO, " (Out Of Order, ignored)"); } -- cgit v1.2.1