Browse Source

Merge pull request #863 from sipa/bn2mpifix

Workaround for BN_bn2mpi reading/writing out of bounds
pull/1/head
Pieter Wuille 11 years ago
parent
commit
e0b8d459b1
  1. 2
      src/bignum.h

2
src/bignum.h

@ -243,7 +243,7 @@ public: @@ -243,7 +243,7 @@ public:
std::vector<unsigned char> getvch() const
{
unsigned int nSize = BN_bn2mpi(this, NULL);
if (nSize < 4)
if (nSize <= 4)
return std::vector<unsigned char>();
std::vector<unsigned char> vch(nSize);
BN_bn2mpi(this, &vch[0]);

Loading…
Cancel
Save