Core: Fix a bug in BigNumber::SetBinary

This commit is contained in:
QAston committed 2013-08-18 17:44:02 +02:00
1 parent 10fb50ad66
commit 8160633e12
1 file changed
+8 -3
+8 -3
View File
@@ -57,9 +57,14 @@ void BigNumber::SetQword(uint64 val)
void BigNumber::SetBinary(uint8 const* bytes, int32 len)
{
uint8 t[1000];
for (int i = 0; i < len; i++) t[i] = bytes[len - 1 - i];
BN_bin2bn(t, len, _bn);
uint8* array = new uint8[len];
for (int i = 0; i < len; i++)
array[i] = bytes[len - 1 - i];
BN_bin2bn(array, len, _bn);
delete[] array;
}
void BigNumber::SetHexStr(char const* str)