aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-sndcp.c
diff options
context:
space:
mode:
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2006-03-08 09:43:06 +0000
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2006-03-08 09:43:06 +0000
commitc1a4068524fceefb9b0bc3c90e464bf9affc43a1 (patch)
tree81f6075eaff603b8ff2a7cf8b01b6ff0c7b64ba1 /epan/dissectors/packet-sndcp.c
parent86f8805e759b40730045484eaecd414b78fe7665 (diff)
coverity bug 73
dont call fragment_add when len is -1 (or really really large if seen as a guint32) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17518 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-sndcp.c')
-rw-r--r--epan/dissectors/packet-sndcp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/epan/dissectors/packet-sndcp.c b/epan/dissectors/packet-sndcp.c
index 468eb30309..2da84ea2b1 100644
--- a/epan/dissectors/packet-sndcp.c
+++ b/epan/dissectors/packet-sndcp.c
@@ -195,7 +195,7 @@ dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint8 addr_field, comp_field, npdu_field1, nsapi, dcomp=0, pcomp=0;
guint16 offset=0, npdu=0, segment=0, npdu_field2;
tvbuff_t *next_tvb, *npdu_tvb;
- guint32 len;
+ gint len;
gboolean first, more_frags, unack;
/* Set up structures needed to add the protocol subtree and manage it
@@ -324,6 +324,10 @@ dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gboolean save_fragmented = pinfo->fragmented;
len = tvb_length_remaining(tvb, offset);
+ if(len<=0){
+ return;
+ }
+
pinfo->fragmented = TRUE;
if (unack)