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:
e3d0e0a
)
don't let BN_CTX_free(NULL) segfault
author
Nils Larsch
<nils@openssl.org>
Fri, 29 Apr 2005 21:20:31 +0000
(21:20 +0000)
committer
Nils Larsch
<nils@openssl.org>
Fri, 29 Apr 2005 21:20:31 +0000
(21:20 +0000)
crypto/bn/bn_ctx.c
patch
|
blob
|
history
diff --git
a/crypto/bn/bn_ctx.c
b/crypto/bn/bn_ctx.c
index 7010193033f9e8a139b55fede7210efcbbcbc817..b3452f1a91e31081e18667e25c49790b5b5a876a 100644
(file)
--- a/
crypto/bn/bn_ctx.c
+++ b/
crypto/bn/bn_ctx.c
@@
-230,7
+230,10
@@
BN_CTX *BN_CTX_new(void)
void BN_CTX_free(BN_CTX *ctx)
{
+ if (ctx == NULL)
+ return;
#ifdef BN_CTX_DEBUG
+ {
BN_POOL_ITEM *pool = ctx->pool.head;
fprintf(stderr,"BN_CTX_free, stack-size=%d, pool-bignums=%d\n",
ctx->stack.size, ctx->pool.size);
@@
-242,6
+245,7
@@
void BN_CTX_free(BN_CTX *ctx)
pool = pool->next;
}
fprintf(stderr,"\n");
+ }
#endif
BN_STACK_finish(&ctx->stack);
BN_POOL_finish(&ctx->pool);