summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-ber.c
diff options
context:
space:
mode:
authorJaap Keuter <jaap.keuter@xs4all.nl>2006-03-07 15:22:57 +0000
committerJaap Keuter <jaap.keuter@xs4all.nl>2006-03-07 15:22:57 +0000
commit3b2760d2df092062591a85b8c618bfca097346a3 (patch)
treed1996b24ce2908c5f2dc1711153245116a0b0560 /epan/dissectors/packet-ber.c
parent1816f28559194058c53ea3410dec91d2aa2ec864 (diff)
downloadwireshark-3b2760d2df092062591a85b8c618bfca097346a3.tar.gz
Catch negative return value, leading to near infinite loop.
Filed as coverity bug 136. svn path=/trunk/; revision=17498
Diffstat (limited to 'epan/dissectors/packet-ber.c')
-rw-r--r--epan/dissectors/packet-ber.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c
index f4aad370e7..bd60e6ae0f 100644
--- a/epan/dissectors/packet-ber.c
+++ b/epan/dissectors/packet-ber.c
@@ -829,7 +829,8 @@ printf("INTEGERnew dissect_ber_integer(%s) entered implicit_tag:%d \n",name,impl
offset=dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag);
offset=dissect_ber_length(pinfo, tree, tvb, offset, &len, NULL);
} else {
- len=tvb_length_remaining(tvb, offset);
+ gint32 remaining=tvb_length_remaining(tvb, offset);
+ len=remaining>0 ? remaining : 0;
}
/* we cant handle integers > 64 bits */