1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 01:51:47 +02:00

Merge branch 'master' of github.com:NixOS/nix

This commit is contained in:
Eelco Dolstra 2016-12-15 12:31:52 +01:00
commit 5278bb7c16
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
4 changed files with 47 additions and 2 deletions

View file

@ -165,7 +165,13 @@ Hash parseHash32(HashType ht, const string & s)
unsigned int i = b / 8;
unsigned int j = b % 8;
hash.hash[i] |= digit << j;
if (i < hash.hashSize - 1) hash.hash[i + 1] |= digit >> (8 - j);
if (i < hash.hashSize - 1) {
hash.hash[i + 1] |= digit >> (8 - j);
} else {
if (digit >> (8 - j))
throw BadHash(format("invalid base-32 hash %1%") % s);
}
}
return hash;