aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/builtins/fetchurl.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-06-01 15:27:43 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-06-01 15:27:43 +0200
commitaec545c20b15eace71c6733107dd6fde7736afbe (patch)
tree92d39dcde117a6ee586e0db12f6035848157db7d /src/libstore/builtins/fetchurl.cc
parent5450af5d0db0fe90ae6e28f051d713b9925d7274 (diff)
Fix segfault in builtin fetchurl with hashed mirrors + SRI hashes
Diffstat (limited to 'src/libstore/builtins/fetchurl.cc')
-rw-r--r--src/libstore/builtins/fetchurl.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstore/builtins/fetchurl.cc b/src/libstore/builtins/fetchurl.cc
index 92aec63a0..b1af3b4fc 100644
--- a/src/libstore/builtins/fetchurl.cc
+++ b/src/libstore/builtins/fetchurl.cc
@@ -64,7 +64,8 @@ void builtinFetchurl(const BasicDerivation & drv, const std::string & netrcData)
try {
if (!hasSuffix(hashedMirror, "/")) hashedMirror += '/';
auto ht = parseHashType(getAttr("outputHashAlgo"));
- fetch(hashedMirror + printHashType(ht) + "/" + Hash(getAttr("outputHash"), ht).to_string(Base16, false));
+ auto h = Hash(getAttr("outputHash"), ht);
+ fetch(hashedMirror + printHashType(h.type) + "/" + h.to_string(Base16, false));
return;
} catch (Error & e) {
debug(e.what());