Don't treat the packet length as unsigned.
authorGuy Harris <guy@alum.mit.edu>
Sun, 1 May 2016 23:02:40 +0000 (16:02 -0700)
committerGuy Harris <guy@alum.mit.edu>
Sun, 1 May 2016 23:03:20 +0000 (23:03 +0000)
commit29c78db2a80a93653f32e4fd2f00b9b550432c43
treea4abf78ebbb72f7c5017aeac1f2b1926ca2966bc
parent2cb5985bf47bdc8bea78d28483ed224abdd33dc6
Don't treat the packet length as unsigned.

The scanf family of functions are as annoyingly bad at handling unsigned
numbers as strtoul() is - both of them are perfectly willing to accept a
value beginning with a negative sign as an unsigned value.  When using
strtoul(), you can compensate for this by explicitly checking for a '-'
as the first character of the string, but you can't do that with
sscanf().

So revert to having pkt_len be signed, and scanning it with %d, but
check for a negative value and fail if we see a negative value.

Change-Id: I6450d468504e942df72342176a0e145e5ac3db5f
Reviewed-on: https://code.wireshark.org/review/15216
Reviewed-by: Guy Harris <guy@alum.mit.edu>
wiretap/dbs-etherwatch.c