]> git.ipfire.org Git - thirdparty/ccache.git/commit
fix: Fix reading of files larger than 2^31 bytes
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 10 Feb 2024 08:54:19 +0000 (09:54 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 11 Feb 2024 10:58:28 +0000 (11:58 +0100)
commita251091f796a2b67d07ad5b0fa60d1fbc8b5cbff
tree9cfc63099691e1aec0e414c0dc15fac5aed63064
parent066a475e812b8a043439c14fd489a8480994f4da
fix: Fix reading of files larger than 2^31 bytes

For some kernels read(2) makes a short read for counts larger than 2^31,
even for files on 64-bit architectures. Other kernels seem to not like
large counts at all, returning a failure.

Fix this by limiting the read buffer to a smaller value. This also
removes a short read optimization which should have been removed in
cff3bf417420ea88fe53e7267ae2a356898ae326.
src/util/file.cpp