forked from osmocom/wireshark
assert() doesn't throw an exception, it just immediately crashes the
app, and DISSECTOR_ASSERT() throws an exception, but claims the problem is a dissector bug, not a malformed packet. Presumably the error in question is the result of a malformed packet, so throw ReportedBoundsError to indicate that (it's not really the *right* exception, but the right exception doesn't exist). svn path=/trunk/; revision=30776
This commit is contained in:
parent
134e77034e
commit
c9b5bc30d0
|
@ -215,7 +215,8 @@ tvbuff_t *new_octet_aligned_subset_bits(tvbuff_t *tvb, guint32 boffset, asn1_ctx
|
|||
* We check now to ensure we don't cause g_malloc() to abort because
|
||||
* we asked for entirely too much memory.
|
||||
*/
|
||||
assert(new_length <= check_length);
|
||||
if (new_length > check_length)
|
||||
THROW(ReportedBoundsError); /* indicate that the packet is malformed */
|
||||
tvb_ensure_bytes_exist(tvb, offset, check_length);
|
||||
buf = g_malloc(new_length);
|
||||
|
||||
|
|
Loading…
Reference in New Issue