]> The Tcpdump Group git mirrors - tcpdump/commit
Handle very large -f files by rejecting them.
authorGuy Harris <[email protected]>
Wed, 30 Sep 2020 18:37:30 +0000 (11:37 -0700)
committerGuy Harris <[email protected]>
Wed, 30 Sep 2020 18:37:30 +0000 (11:37 -0700)
commitfaf8fb70af3a013e5d662b8283dec742fd6b1a77
tree7d4a7dcb376537bee8973c3ad7233bb2925c1366
parent7810dd37c23ea1d304dd90235ba1c145b49c473f
Handle very large -f files by rejecting them.

_read(), on Windows, has a 32-bit size argument and a 32-bit return
value, so reject -f files that have more than 2^31-1 characters.

Add some #defines so that, on Windows, we use _fstati64 to get the size
of that file, to handle large files.

Don't assume that our definition for ssize_t is the same size as size_t;
by the time we want to print the return value of the read, we know it'll
fit into an int, so just cast it to int and print it with %d.
netdissect-stdinc.h
tcpdump.c