mirror of
https://github.com/NixOS/nix.git
synced 2024-11-26 16:52:27 +00:00
Merge branch 'base32-overflow' of git://github.com/vcunat/nix
This commit is contained in:
commit
f867f090ed
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user