aboutsummaryrefslogtreecommitdiffstats
path: root/ui/tap-sctp-analysis.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@zing.org>2014-03-02 12:11:37 -0800
committerGerald Combs <gerald@wireshark.org>2014-03-02 20:12:33 +0000
commit0f2014bf21aaff82a2d40e5a1eab080854c48ce9 (patch)
tree95f5c2b59dbb06e958fec0b998731f43b412059c /ui/tap-sctp-analysis.c
parent26e06356f8998c87ba9443655598e79930b13d6a (diff)
Scan-build didn't like the fixes in g79ef36a5f.
Change-Id: I1083136f9e4fb38b55e9b9c2fec74ddec35f198e Reviewed-on: https://code.wireshark.org/review/452 Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/tap-sctp-analysis.c')
-rw-r--r--ui/tap-sctp-analysis.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/ui/tap-sctp-analysis.c b/ui/tap-sctp-analysis.c
index d4ee71a15e..d820777178 100644
--- a/ui/tap-sctp-analysis.c
+++ b/ui/tap-sctp-analysis.c
@@ -949,10 +949,10 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v
datachunk = TRUE;
if (((tvb_get_guint8(sctp_info->tvb[chunk_number],0)) == SCTP_FORWARD_TSN_CHUNK_ID))
forwardchunk = TRUE;
- if (datachunk || forwardchunk)
+ if ((datachunk || forwardchunk) && tsn != NULL)
{
tsnumber = tvb_get_ntohl((sctp_info->tvb)[chunk_number], DATA_CHUNK_TSN_OFFSET);
- if (tsn && tsn->first_tsn == 0)
+ if (tsn->first_tsn == 0)
tsn->first_tsn = tsnumber;
if (datachunk)
{
@@ -1080,12 +1080,13 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v
info->n_array_tsn2++;
}
}
- else if ((tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_SACK_CHUNK_ID) ||
- (tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_NR_SACK_CHUNK_ID))
+ else if (((tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_SACK_CHUNK_ID) ||
+ (tvb_get_guint8(sctp_info->tvb[chunk_number],0) == SCTP_NR_SACK_CHUNK_ID)) &&
+ sack != NULL)
{
tsnumber = tvb_get_ntohl((sctp_info->tvb)[chunk_number], SACK_CHUNK_CUMULATIVE_TSN_ACK_OFFSET);
length = tvb_get_ntohs(sctp_info->tvb[chunk_number], CHUNK_LENGTH_OFFSET);
- if (sack && sack->first_tsn == 0)
+ if (sack->first_tsn == 0)
sack->first_tsn = tsnumber;
t_s_n = (guint8 *)g_malloc(length);
tvb_memcpy(sctp_info->tvb[chunk_number], (guint8 *)(t_s_n),0, length);