Don't treat the packet length as unsigned.
authorGuy Harris <guy@alum.mit.edu>
Sun, 1 May 2016 23:13:31 +0000 (16:13 -0700)
committerGuy Harris <guy@alum.mit.edu>
Sun, 1 May 2016 23:14:25 +0000 (23:14 +0000)
commit11edc83b98a61e890d7bb01855389d40e984ea82
treef147c8ed27fa92ab78e2d7745ae6b4cb27aa8753
parent29c78db2a80a93653f32e4fd2f00b9b550432c43
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.

Bug: 12396
Change-Id: I54fe8f61f42c32b5ef33da633ece51bbcda8c95f
Reviewed-on: https://code.wireshark.org/review/15220
Reviewed-by: Guy Harris <guy@alum.mit.edu>
wiretap/netscreen.c