diff options
author | Anders Broman <anders.broman@ericsson.com> | 2012-04-12 05:36:26 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2012-04-12 05:36:26 +0000 |
commit | 5d101caa89e28875c5d2eeb2b353cbb8e2155336 (patch) | |
tree | 640caf1df163f31160481eb06a0be854912647bf /epan | |
parent | 8cdb90bd44c3dcc0386100974c56e5595315edac (diff) |
From Martin Kaiser: CID 525 is about tvb_new_octet_aligned(). datalen can be negative or 0 when ep_alloc0(datalen) is called. If this happens, it's because of a dissector not checking the bit_offset, I think a DISSECTOR_ASSERT() is ok for fixing this. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7068
svn path=/trunk/; revision=42032
Diffstat (limited to 'epan')
-rw-r--r-- | epan/tvbuff.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c index 1aa0b84147..c6b9d694ce 100644 --- a/epan/tvbuff.c +++ b/epan/tvbuff.c @@ -319,6 +319,7 @@ tvb_new_octet_aligned(tvbuff_t *tvb, guint32 bit_offset, gint32 no_of_bits) return tvb_new_subset(tvb, byte_offset, datalen, -1); } + DISSECTOR_ASSERT(datalen>0); buf = ep_alloc0(datalen); /* if at least one trailing byte is available, we must use the content |