projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
55b3c87
)
handle the case when BN_new returns NULL
author
Bodo Möller
<bodo@openssl.org>
Tue, 7 Nov 2000 09:35:19 +0000
(09:35 +0000)
committer
Bodo Möller
<bodo@openssl.org>
Tue, 7 Nov 2000 09:35:19 +0000
(09:35 +0000)
crypto/bn/bn_lib.c
patch
|
blob
|
history
diff --git
a/crypto/bn/bn_lib.c
b/crypto/bn/bn_lib.c
index 3e4965d695e5c7655d0aea5bca5f06252ae3deb7..89a3267b4af10485ef95b9ffe5e33a169e352feb 100644
(file)
--- a/
crypto/bn/bn_lib.c
+++ b/
crypto/bn/bn_lib.c
@@
-458,12
+458,20
@@
BIGNUM *bn_dup_expand(const BIGNUM *b, int words)
if (a)
{
r = BN_new();
- r->top = b->top;
- r->dmax = words;
- r->neg = b->neg;
- r->d = a;
+ if (r)
+ {
+ r->top = b->top;
+ r->dmax = words;
+ r->neg = b->neg;
+ r->d = a;
+ }
+ else
+ {
+ /* r == NULL, BN_new failure */
+ OPENSSL_free(a);
+ }
}
- /*
Otherwise
, there was an error in allocation in
+ /*
If a == NULL
, there was an error in allocation in
internal_bn_expand(), and NULL should be returned */
}
else