summaryrefslogtreecommitdiffstats
path: root/src/crypto/bn/random.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/crypto/bn/random.c')
-rw-r--r--src/crypto/bn/random.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/crypto/bn/random.c b/src/crypto/bn/random.c
index 3be7510..549ac48 100644
--- a/src/crypto/bn/random.c
+++ b/src/crypto/bn/random.c
@@ -144,7 +144,7 @@ int BN_rand(BIGNUM *rnd, int bits, int top, int bottom) {
}
if (top != -1) {
- if (top) {
+ if (top && bits > 1) {
if (bit == 0) {
buf[0] = 1;
buf[1] |= 0x80;