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 <a.broman58@gmail.com>
This commit is contained in:
Alexis La Goutte 2014-05-01 14:25:33 +02:00 committed by Anders Broman
parent 601dc7313b
commit 583a47c06e
1 changed files with 2 additions and 2 deletions

View File

@ -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)");
}