Add a routine to check whether all bytes implied by a 64-bit length exist.
authorGuy Harris <guy@alum.mit.edu>
Sat, 2 Aug 2014 18:32:42 +0000 (11:32 -0700)
committerGuy Harris <guy@alum.mit.edu>
Sat, 2 Aug 2014 18:33:11 +0000 (18:33 +0000)
commitf4d24216bea6c955e39b08ff8155f6cdd4a1183f
tree38974fbf10cdb9e008484e5235fe9b8063513522
parentd8880874f25de6f3cbf711b75291ad601195f1f7
Add a routine to check whether all bytes implied by a 64-bit length exist.

This lets us blow up with oversized 64-bit length values, before casting
them to the 31-bit lengths we can actually handle in Wireshark, rather
than blindly casting them with weird results.

Use that in the MySQL dissector, and, if we get past the test, cast the
lengths to int to squelch warnings.

Change-Id: I3a5e9bd0027fa4ddcb9622f77952dba8f6b23c27
Reviewed-on: https://code.wireshark.org/review/3362
Reviewed-by: Guy Harris <guy@alum.mit.edu>
epan/dissectors/packet-mysql.c
epan/tvbuff.c
epan/tvbuff.h