fix possible underflow in BlowfishKeyProvider.LenBigNum()
This commit is contained in:
committed by
Matthias Mailänder
parent
8ce9e01c1c
commit
c56d2c1bbe
@@ -90,8 +90,14 @@ namespace OpenRA.Mods.Cnc.FileFormats
|
||||
|
||||
static uint LenBigNum(uint[] n, uint len)
|
||||
{
|
||||
var i = len - 1;
|
||||
while (n[i] == 0) i--;
|
||||
if (len == 0)
|
||||
return 0;
|
||||
|
||||
var i = len;
|
||||
while (n[--i] == 0)
|
||||
if (i == 0)
|
||||
return 0; // all zero
|
||||
|
||||
return i + 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user