aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-09-14 13:18:52 +0200
committerGitHub <noreply@github.com>2020-09-14 13:18:52 +0200
commit8ebd10664efbbbe519de9c7dda6768fe1448cfa1 (patch)
treec34de295bb89dfbeabccd62f29835901b1a68e79
parent7cb5f643a6ee5b8ffee2e0bb9159a677ff76d17c (diff)
parent525b38eee8fac48eb2a82fb78fa0a933a9eee2a4 (diff)
Merge pull request #4008 from aszlig/fix-ub-in-reading-ca-map
Fix unspecified behaviour in readStorePathCAMap
-rw-r--r--src/libstore/remote-store.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc
index e4a4ef5af..8bcf92301 100644
--- a/src/libstore/remote-store.cc
+++ b/src/libstore/remote-store.cc
@@ -43,8 +43,11 @@ StorePathCAMap readStorePathCAMap(const Store & store, Source & from)
{
StorePathCAMap paths;
auto count = readNum<size_t>(from);
- while (count--)
- paths.insert_or_assign(store.parseStorePath(readString(from)), parseContentAddressOpt(readString(from)));
+ while (count--) {
+ auto path = store.parseStorePath(readString(from));
+ auto ca = parseContentAddressOpt(readString(from));
+ paths.insert_or_assign(path, ca);
+ }
return paths;
}