fileio: fix truncated read handling in read_virtual_file()
authorLennart Poettering <lennart@poettering.net>
Thu, 16 Sep 2021 10:20:09 +0000 (12:20 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 16 Sep 2021 10:23:25 +0000 (12:23 +0200)
commit00bd9a4a82ed57bc0c7f158da4564fc1eab808b4
tree59dfc058383279c2876f076fcb55a482894a0c79
parentf782eee68aea996c68b8cfeba5f288dae7fc876f
fileio: fix truncated read handling in read_virtual_file()

We mishandled the case where the size we read from the file actually
matched the maximum size fully. In that case we cannot really make a
determination whether the file was fully read or only partially. In that
case let's do another loop, so that we operate with a buffer, and
we can detect the EOF (which will be signalled to us via a short read).
src/basic/fileio.c