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:
lix-project/lix#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 Delete old ValidPathInfo test, fix UnkeyedValidPathInfo 2024-06-16 19:13:51 -07:00
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 derived-path: refuse built derived path with a non-derivation base 2024-05-17 02:16:15 +02:00
downstream-placeholder.cc Move tests to separate directories, and document 2023-12-01 13:05:03 -05:00
filetransfer.cc Avoid calling memcpy when len == 0 in filetransfer.cc 2024-10-08 01:26:30 +02:00
machines.cc util.{hh,cc}: Split out strings.{hh,cc} 2024-05-29 11:01:34 +02:00
nar-info-disk-cache.cc Move tests to separate directories, and document 2023-12-01 13:05:03 -05:00
outputs-spec.cc Fix various clang-tidy lints 2024-03-29 20:26:38 -07:00
path.cc Disallow store path names that are . or .. (plus opt. -) 2024-05-02 19:34:38 +02:00
protocol.hh tree-wide: shuffle headers around for about 30s compile time 2024-08-28 09:55:05 -07:00
references.cc Move tests to separate directories, and document 2023-12-01 13:05:03 -05:00
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