lix/tests/unit/libstore
Lulu 51a5025913 Avoid calling memcpy when len == 0 in filetransfer.cc
There was a bug report about a potential call to `memcpy` with a null
pointer which is not reproducible:
#492

This occurred in `src/libstore/filetransfer.cc` in `InnerSource::read`.

To ensure that this doesn't happen, an early return is added before
calling `memcpy` if the length of the data to be copied is 0.

This change also adds a test that ensures that when `InnerSource::read`
is called with an empty file, it throws an `EndOfFile` exception.

Change-Id: Ia18149bee9a3488576c864f28475a3a0c9eadfbb
2024-10-08 01:26:30 +02:00
..
data
common-protocol.cc refactor: make HashType and Base enum classes for type safety 2024-08-08 14:53:17 -07:00
derivation.cc tree-wide: shuffle headers around for about 30s compile time 2024-08-28 09:55:05 -07:00
derived-path.cc
downstream-placeholder.cc
filetransfer.cc Avoid calling memcpy when len == 0 in filetransfer.cc 2024-10-08 01:26:30 +02:00
machines.cc
nar-info-disk-cache.cc
outputs-spec.cc
path.cc
protocol.hh tree-wide: shuffle headers around for about 30s compile time 2024-08-28 09:55:05 -07:00
references.cc
serve-protocol.cc refactor: make HashType and Base enum classes for type safety 2024-08-08 14:53:17 -07:00
worker-protocol.cc refactor: make HashType and Base enum classes for type safety 2024-08-08 14:53:17 -07:00