]> The Tcpdump Group git mirrors - tcpdump/commit
Handle very large -f files by rejecting them. tcpdump-4.9
authorGuy Harris <[email protected]>
Wed, 30 Sep 2020 18:37:30 +0000 (11:37 -0700)
committerDenis Ovsienko <[email protected]>
Thu, 10 Feb 2022 00:32:40 +0000 (00:32 +0000)
commit8ab211a7ec728bb0ad8c766c8eeb12deb0a13b86
tree6d6d3477140767f5621571fedfb41ec1fc4f58a6
parentedeba67b9c01eacde50120e1a152dc67c9562fb2
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.

(cherry picked from commit faf8fb70af3a013e5d662b8283dec742fd6b1a77)
netdissect-stdinc.h
tcpdump.c