diff options
author | morriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-01-03 17:37:41 +0000 |
---|---|---|
committer | morriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-01-03 17:37:41 +0000 |
commit | 543627c89604fb647deda4334c4bfdc58bfbbbbd (patch) | |
tree | 1a357ee6cf2a6b0c82cf9ddca0c5cb59ed9c5575 /epan/dissectors/packet-ber.c | |
parent | c16e7f29b1dc299e0eaac9c0b485f22317b67f0a (diff) |
Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5537 :
Don't go modifying the bitstring if its length is 0 (meaning that there is only
the NULL terminator).
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35342 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-ber.c')
-rw-r--r-- | epan/dissectors/packet-ber.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c index bbb0f55b2e..07c6396dbd 100644 --- a/epan/dissectors/packet-ber.c +++ b/epan/dissectors/packet-ber.c @@ -4422,7 +4422,7 @@ int dissect_ber_constrained_bitstring(gboolean implicit_tag, asn1_ctx_t *actx, p bitstring = tvb_get_ephemeral_string(tvb, offset, len); while (nb->p_id) { - if(nb->bit < (8*len-pad)) { + if(len > 0 && nb->bit < (8*len-pad)) { val = tvb_get_guint8(tvb, offset + nb->bit/8); bitstring[(nb->bit/8)] &= ~(0x80 >> (nb->bit%8)); val &= 0x80 >> (nb->bit%8); |