1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 00:11:17 +02:00
nix/tests/unit
Sergei Zimmerman e863e6ab83 fix(libstore-tests): remove use-after-free bug for StringSource
Unfortunately `StringSource` class is very easy was very easy to misuse
because the ctor took a plain `std::string_view` which has a bad habit
of being implicitly convertible from an rvalue `std::string`. This lead
to unintentional use-after-free bugs.

This patch makes `StringSource` much harder to misuse by disabling the ctor
from a `std::string &&` (but `const std::string &` is ok).

Fix affected tests from libstore-tests.
Reformat those tests with clangd's range formatting since the diff is tiny
and it seems appropriate.

(cherry picked from commit 5bc8957c73)
2025-01-10 10:08:26 +00:00
..
libexpr Ensure error messages don't leak private key 2024-09-24 06:39:03 +02:00
libexpr-support Deduplicate our many package.nix a bit (#11175) 2024-07-25 03:12:39 +00:00
libfetchers Split tarball-specific logic from GitFileSystemObjectSink 2024-07-29 14:26:25 +02:00
libflake Deduplicate our many package.nix a bit (#11175) 2024-07-25 03:12:39 +00:00
libstore fix(libstore-tests): remove use-after-free bug for StringSource 2025-01-10 10:08:26 +00:00
libstore-support Deduplicate our many package.nix a bit (#11175) 2024-07-25 03:12:39 +00:00
libutil Filter OSC 8 correctly 2025-01-07 05:33:19 +00:00
libutil-support Deduplicate our many package.nix a bit (#11175) 2024-07-25 03:12:39 +00:00