projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Apply "better safe than sorry" approach after addressing sporadic SEGV in
[oweals/openssl.git]
/
crypto
/
bn
/
bn_shift.c
diff --git
a/crypto/bn/bn_shift.c
b/crypto/bn/bn_shift.c
index 69c03570bd22d3c313c32ff3ab24379f92a5859e..de9312dce231f5de6c03a90baf42ee867c6b6838 100644
(file)
--- a/
crypto/bn/bn_shift.c
+++ b/
crypto/bn/bn_shift.c
@@
-200,13
+200,13
@@
int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
if (rb == 0)
{
if (rb == 0)
{
- for (i=j
+1; i >
0; i--)
+ for (i=j
; i !=
0; i--)
*(t++)= *(f++);
}
else
{
l= *(f++);
*(t++)= *(f++);
}
else
{
l= *(f++);
- for (i=
1; i<j; i++
)
+ for (i=
j-1; i != 0; i--
)
{
tmp =(l>>rb)&BN_MASK2;
l= *(f++);
{
tmp =(l>>rb)&BN_MASK2;
l= *(f++);
@@
-214,7
+214,6
@@
int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
}
*(t++) =(l>>rb)&BN_MASK2;
}
}
*(t++) =(l>>rb)&BN_MASK2;
}
- *t=0;
bn_correct_top(r);
bn_check_top(r);
return(1);
bn_correct_top(r);
bn_check_top(r);
return(1);