aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-02-19 09:22:11 -0800
committerPieter Wuille <pieter.wuille@gmail.com>2012-02-19 09:22:11 -0800
commite0b8d459b189ee2b7e95a47b217e4b02bfb523b3 (patch)
treef3b5f41d9c7b9348b285f9c422fe630bd30ff7eb
parent59b1b181e9129dbfbcea87b8cedd5ea29c9ec4ab (diff)
parenta06113b0c5aaa5f34b437bb1ee279dfdc9d870ea (diff)
Merge pull request #863 from sipa/bn2mpifix
Workaround for BN_bn2mpi reading/writing out of bounds
-rw-r--r--src/bignum.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bignum.h b/src/bignum.h
index 4143f6003d..a750025f3d 100644
--- a/src/bignum.h
+++ b/src/bignum.h
@@ -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]);