From: Richard Levitte Date: Thu, 27 Jul 2000 21:32:23 +0000 (+0000) Subject: There's a slight possibility that a is 0 in BN_sub_word(), and might X-Git-Tag: OpenSSL-engine-0_9_6-beta1~17^2~4 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8083e1bd9e2bc7d32cee960c09dcb838c12a0495;p=oweals%2Fopenssl.git There's a slight possibility that a is 0 in BN_sub_word(), and might therefore have unallocated parts. Therefore, a check for the 0 case is needed, resulting with the same thing as when a is negative. --- diff --git a/crypto/bn/bn_word.c b/crypto/bn/bn_word.c index 7e7ca58842..f3bdde969c 100644 --- a/crypto/bn/bn_word.c +++ b/crypto/bn/bn_word.c @@ -140,7 +140,7 @@ int BN_sub_word(BIGNUM *a, BN_ULONG w) { int i; - if (a->neg) + if (BN_is_zero(a) || a->neg) { a->neg=0; i=BN_add_word(a,w);