projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Problem: bn_mul_normal() misbehaves if the size of b is 0.
[openssl.git]
/
crypto
/
bn
/
bn_mul.c
diff --git
a/crypto/bn/bn_mul.c
b/crypto/bn/bn_mul.c
index b4ed7e23e62daa6a0864c2e59f3117c011960cf1..94db7c05e61f609d83643ae43ff4c652755bc6d1 100644
(file)
--- a/
crypto/bn/bn_mul.c
+++ b/
crypto/bn/bn_mul.c
@@
-1110,7
+1110,13
@@
void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb)
}
rr= &(r[na]);
- rr[0]=bn_mul_words(r,a,na,b[0]);
+ if (nb <= 0)
+ {
+ (void)bn_mul_words(r,a,na,0);
+ return;
+ }
+ else
+ rr[0]=bn_mul_words(r,a,na,b[0]);
for (;;)
{