diff options
-rw-r--r-- | crypto/bn/bn_intern.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/bn/bn_intern.c b/crypto/bn/bn_intern.c index 9227b6e241..2c970647de 100644 --- a/crypto/bn/bn_intern.c +++ b/crypto/bn/bn_intern.c @@ -167,7 +167,8 @@ int bn_copy_words(BN_ULONG *out, const BIGNUM *in, int size) return 0; memset(out, 0, sizeof(*out) * size); - memcpy(out, in->d, sizeof(*out) * in->top); + if (in->d != NULL) + memcpy(out, in->d, sizeof(*out) * in->top); return 1; } |