mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 18:53:23 -03:00
Merge pull request #863 from sipa/bn2mpifix
Workaround for BN_bn2mpi reading/writing out of bounds
This commit is contained in:
commit
e0b8d459b1
1 changed files with 1 additions and 1 deletions
|
@ -243,7 +243,7 @@ public:
|
||||||
std::vector<unsigned char> getvch() const
|
std::vector<unsigned char> getvch() const
|
||||||
{
|
{
|
||||||
unsigned int nSize = BN_bn2mpi(this, NULL);
|
unsigned int nSize = BN_bn2mpi(this, NULL);
|
||||||
if (nSize < 4)
|
if (nSize <= 4)
|
||||||
return std::vector<unsigned char>();
|
return std::vector<unsigned char>();
|
||||||
std::vector<unsigned char> vch(nSize);
|
std::vector<unsigned char> vch(nSize);
|
||||||
BN_bn2mpi(this, &vch[0]);
|
BN_bn2mpi(this, &vch[0]);
|
||||||
|
|
Loading…
Add table
Reference in a new issue