snix/third_party/nix/src/libstore
Griffin Smith 8d24a975f1 fix(tvix): Use copy constructor to add strings to protos
Passing a string directly to add_paths like this causes the proto class
to take ownership over the string, meaning when it is destructed it
will *explicitly* free the string. When the string's actual owner (the
derivation struct) then goes out of scope it'll get freed again, causing
a double-free. This fixes that to instead use the copy constructor to
assign to a pointer to a new path, and covers the whole to_proto method
with a rapidcheck test.

Fixes: b/64
Change-Id: I84235bed9104ff430a0acf686d4a96f1e2e9a897
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2106
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
2020-11-19 00:29:42 +00:00
..
builtins style(tvix): Add missing braces in expressions 2020-08-21 03:55:56 +00:00
binary-cache-store.cc refactor(tvix): Make static strings constexpr string_views 2020-09-14 21:38:30 +00:00
binary-cache-store.hh refactor(3p/nix): Anchor local includes at src/ 2020-05-27 21:56:34 +01:00
build.cc refactor(tvix): Make static strings constexpr string_views 2020-09-14 21:38:30 +00:00
builtins.hh refactor(3p/nix): Anchor local includes at src/ 2020-05-27 21:56:34 +01:00
CMakeLists.txt feat(3p/nix): add MockBinaryCacheStore 2020-08-05 04:11:57 +00:00
crypto.cc chore(3p/nix): apply google-readability-casting 2020-08-08 22:16:02 +00:00
crypto.hh refactor(3p/nix): Anchor local includes at src/ 2020-05-27 21:56:34 +01:00
derivations.cc fix(tvix): Use copy constructor to add strings to protos 2020-11-19 00:29:42 +00:00
derivations.hh style(tvix): Replace remaining typedefs with using statements 2020-08-21 03:55:56 +00:00
download.cc refactor(tvix/libutil): Mark single-argument constructors explicit 2020-08-23 11:58:44 +00:00
download.hh refactor(3p/nix): Anchor local includes at src/ 2020-05-27 21:56:34 +01:00
export-import.cc refactor(3p/nix): Anchor local includes at src/ 2020-05-27 21:56:34 +01:00
fs-accessor.hh refactor(3p/nix): Anchor local includes at src/ 2020-05-27 21:56:34 +01:00
gc.cc refactor(tvix): Make static strings constexpr string_views 2020-09-14 21:38:30 +00:00
globals.cc refactor(tvix): getEnv(): Return std::optional 2020-09-01 02:21:53 +00:00
globals.hh revert(tvix): "Disable sandboxing by default until its time comes" 2020-09-06 21:12:11 +00:00
http-binary-cache-store.cc refactor(tvix/libutil): Mark single-argument constructors explicit 2020-08-23 11:58:44 +00:00
legacy-ssh-store.cc refactor(tvix): Make static strings constexpr string_views 2020-09-14 21:38:30 +00:00
local-binary-cache-store.cc refactor(3p/nix): Anchor local includes at src/ 2020-05-27 21:56:34 +01:00
local-fs-store.cc chore(3p/nix): apply google-readability-casting 2020-08-08 22:16:02 +00:00
local-store.cc refactor(tvix/libutil): Mark single-argument constructors explicit 2020-08-23 11:58:44 +00:00
local-store.hh refactor(tvix): getEnv(): Return std::optional 2020-09-01 02:21:53 +00:00
machines.cc fix(3p/nix): Use SkipEmpty in all calls to absl::StrSplit 2020-08-06 20:50:47 +00:00
machines.hh refactor(3p/nix): Anchor local includes at src/ 2020-05-27 21:56:34 +01:00
misc.cc refactor(tvix/libutil): Mark single-argument constructors explicit 2020-08-23 11:58:44 +00:00
mock-binary-cache-store.cc feat(3p/nix): add MockBinaryCacheStore 2020-08-05 04:11:57 +00:00
mock-binary-cache-store.hh feat(3p/nix): add MockBinaryCacheStore 2020-08-05 04:11:57 +00:00
nar-accessor.cc chore(3p/nix): apply google-readability-casting 2020-08-08 22:16:02 +00:00
nar-accessor.hh refactor(3p/nix): Anchor local includes at src/ 2020-05-27 21:56:34 +01:00
nar-info-disk-cache.cc chore(3p/nix): apply google-readability-casting 2020-08-08 22:16:02 +00:00
nar-info-disk-cache.hh fix(3p/nix): Fix all remaining compiler warnings 2020-07-19 22:00:59 +00:00
nar-info.cc fix(3p/nix): Use SkipEmpty in all calls to absl::StrSplit 2020-08-06 20:50:47 +00:00
nar-info.hh refactor(3p/nix): Anchor local includes at src/ 2020-05-27 21:56:34 +01:00
nix-store.pc.in feat(3p/nix): install pkgconfig files for libexpr, libmain and libstore 2020-06-21 20:42:28 +00:00
optimise-store.cc fix(3p/nix): revert "apply all clang-tidy fixes" 2020-08-01 22:45:15 +00:00
parsed-derivations.cc fix(3p/nix): Use SkipEmpty in all calls to absl::StrSplit 2020-08-06 20:50:47 +00:00
parsed-derivations.hh refactor(3p/nix): Anchor local includes at src/ 2020-05-27 21:56:34 +01:00
pathlocks.cc refactor(tvix/libutil): Mark single-argument constructors explicit 2020-08-23 11:58:44 +00:00
pathlocks.hh refactor(3p/nix): Anchor local includes at src/ 2020-05-27 21:56:34 +01:00
profiles.cc fix(3p/nix): revert "apply all clang-tidy fixes" 2020-08-01 22:45:15 +00:00
profiles.hh refactor(3p/nix): Anchor local includes at src/ 2020-05-27 21:56:34 +01:00
references.cc refactor(tvix): Convert refLength to constexpr 2020-09-10 17:03:45 +00:00
references.hh refactor(3p/nix): Anchor local includes at src/ 2020-05-27 21:56:34 +01:00
remote-fs-accessor.cc refactor(tvix/libutil): Mark single-argument constructors explicit 2020-08-23 11:58:44 +00:00
remote-fs-accessor.hh refactor(3p/nix): Anchor local includes at src/ 2020-05-27 21:56:34 +01:00
remote-store.cc style(tvix): Move a comment to fix a formatting issue 2020-08-21 00:37:16 +00:00
remote-store.hh chore(tvix): Thread a std::ostream through Store::buildPaths 2020-08-20 11:48:40 +00:00
rpc-store.cc fix(tvix): Use mutable field for assigning proto fields 2020-11-19 00:29:42 +00:00
rpc-store.hh chore(tvix): Thread a std::ostream through Store::buildPaths 2020-08-20 11:48:40 +00:00
s3-binary-cache-store.cc refactor(3p/nix): Anchor local includes at src/ 2020-05-27 21:56:34 +01:00
s3-binary-cache-store.hh refactor(3p/nix): Anchor local includes at src/ 2020-05-27 21:56:34 +01:00
s3.hh refactor(3p/nix): Anchor local includes at src/ 2020-05-27 21:56:34 +01:00
sandbox-defaults.sb Add 'third_party/nix/' from commit 'be66c7a6b24e3c3c6157fd37b86c7203d14acf10' 2020-05-17 15:52:38 +01:00
sandbox-minimal.sb Add 'third_party/nix/' from commit 'be66c7a6b24e3c3c6157fd37b86c7203d14acf10' 2020-05-17 15:52:38 +01:00
sandbox-network.sb Add 'third_party/nix/' from commit 'be66c7a6b24e3c3c6157fd37b86c7203d14acf10' 2020-05-17 15:52:38 +01:00
schema.sql Add 'third_party/nix/' from commit 'be66c7a6b24e3c3c6157fd37b86c7203d14acf10' 2020-05-17 15:52:38 +01:00
serve-protocol.hh style(tvix): Replace remaining typedefs with using statements 2020-08-21 03:55:56 +00:00
sqlite.cc chore(3p/nix): apply google-readability-casting 2020-08-08 22:16:02 +00:00
sqlite.hh refactor(3p/nix): Anchor local includes at src/ 2020-05-27 21:56:34 +01:00
ssh-store.cc refactor(tvix): Make static strings constexpr string_views 2020-09-14 21:38:30 +00:00
ssh.cc refactor(tvix): getEnv(): Return std::optional 2020-09-01 02:21:53 +00:00
ssh.hh refactor(3p/nix): Anchor local includes at src/ 2020-05-27 21:56:34 +01:00
store-api.cc refactor(tvix/libutil): Mark single-argument constructors explicit 2020-08-23 11:58:44 +00:00
store-api.hh chore(tvix): Add TODO comment for std::ostream in buildDerivation 2020-08-21 00:37:16 +00:00
worker-protocol.hh refactor(3p/nix/libexpr): Back Nix lists with std::vector 2020-07-18 18:08:42 +00:00