[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openssl-cvs
Subject:    [CVS] OpenSSL: openssl/crypto/bn/ bn_ctx.c
From:       "Nils Larsch" <nils () openssl ! org>
Date:       2005-04-29 21:20:31
Message-ID: 20050429212031.8B618203635 () master ! openssl ! org
[Download RAW message or body]

  OpenSSL CVS Repository
  http://cvs.openssl.org/
  ____________________________________________________________________________

  Server: cvs.openssl.org                  Name:   Nils Larsch
  Root:   /e/openssl/cvs                   Email:  nils@openssl.org
  Module: openssl                          Date:   29-Apr-2005 23:20:31
  Branch: HEAD                             Handle: 2005042922203100

  Modified files:
    openssl/crypto/bn       bn_ctx.c

  Log:
    don't let BN_CTX_free(NULL) segfault

  Summary:
    Revision    Changes     Path
    1.17        +4  -0      openssl/crypto/bn/bn_ctx.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openssl/crypto/bn/bn_ctx.c
  ============================================================================
  $ cvs diff -u -r1.16 -r1.17 bn_ctx.c
  --- openssl/crypto/bn/bn_ctx.c	26 Apr 2005 18:53:13 -0000	1.16
  +++ openssl/crypto/bn/bn_ctx.c	29 Apr 2005 21:20:31 -0000	1.17
  @@ -230,7 +230,10 @@
   
   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 @@
   		pool = pool->next;
   	}
   	fprintf(stderr,"\n");
  +	}
   #endif
   	BN_STACK_finish(&ctx->stack);
   	BN_POOL_finish(&ctx->pool);
  @@ .
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
CVS Repository Commit List                     openssl-cvs@openssl.org
Automated List Manager                           majordomo@openssl.org
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic