projects
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d2cd461
)
BN_set_bit() etc should use "unsigned int".
author
Ulf Möller
<ulf@openssl.org>
Sat, 15 Nov 2003 08:37:50 +0000
(08:37 +0000)
committer
Ulf Möller
<ulf@openssl.org>
Sat, 15 Nov 2003 08:37:50 +0000
(08:37 +0000)
Keep it as is to avoid an API change, but check for negativ values.
Submitted by: Nils Larsch
crypto/bn/bn_lib.c
patch
|
blob
|
history
diff --git
a/crypto/bn/bn_lib.c
b/crypto/bn/bn_lib.c
index 1f45b09d080b6c86593c5fe304a57d42ccccfc0c..43c336f526091718796d81e16b69843e3fff79de 100644
(file)
--- a/
crypto/bn/bn_lib.c
+++ b/
crypto/bn/bn_lib.c
@@
-782,6
+782,9
@@
int BN_set_bit(BIGNUM *a, int n)
{
int i,j,k;
+ if (n < 0)
+ return 0;
+
i=n/BN_BITS2;
j=n%BN_BITS2;
if (a->top <= i)
@@
-801,6
+804,9
@@
int BN_clear_bit(BIGNUM *a, int n)
{
int i,j;
+ if (n < 0)
+ return 0;
+
i=n/BN_BITS2;
j=n%BN_BITS2;
if (a->top <= i) return(0);
@@
-825,6
+831,9
@@
int BN_mask_bits(BIGNUM *a, int n)
{
int b,w;
+ if (n < 0)
+ return 0;
+
w=n/BN_BITS2;
b=n%BN_BITS2;
if (w >= a->top) return(0);