diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-09-14 13:18:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-14 13:18:52 +0200 |
commit | 8ebd10664efbbbe519de9c7dda6768fe1448cfa1 (patch) | |
tree | c34de295bb89dfbeabccd62f29835901b1a68e79 | |
parent | 7cb5f643a6ee5b8ffee2e0bb9159a677ff76d17c (diff) | |
parent | 525b38eee8fac48eb2a82fb78fa0a933a9eee2a4 (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.cc | 7 |
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; } |