samba-cvs.cvs
[Top] [All Lists]

svn commit: lorikeet r544 - in trunk/heimdal/lib/hx509: .

Subject: svn commit: lorikeet r544 - in trunk/heimdal/lib/hx509: .
From:
Date: Mon, 8 May 2006 15:09:44 +0000 GMT
Author: abartlet
Date: 2006-05-08 15:09:43 +0000 (Mon, 08 May 2006)
New Revision: 544

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=lorikeet&rev=544

Log:
Don't double-free in case of low system entropy.

Andrew Bartlett

Modified:
   trunk/heimdal/lib/hx509/crypto.c


Changeset:
Modified: trunk/heimdal/lib/hx509/crypto.c
===================================================================
--- trunk/heimdal/lib/hx509/crypto.c    2006-05-08 06:31:54 UTC (rev 543)
+++ trunk/heimdal/lib/hx509/crypto.c    2006-05-08 15:09:43 UTC (rev 544)
@@ -1443,6 +1443,7 @@
 
     if (crypto->key.data) {
        free(crypto->key.data);
+       crypto->key.data = NULL;
        crypto->key.length = 0;
     }
     crypto->key.data = malloc(length);
@@ -1470,6 +1471,7 @@
     }
     if (RAND_bytes(crypto->key.data, crypto->key.length) <= 0) {
        free(crypto->key.data);
+       crypto->key.data = NULL;
        crypto->key.length = 0;
        return HX509_CRYPTO_INTERNAL_ERROR;
     }

<Prev in Thread] Current Thread [Next in Thread>
  • svn commit: lorikeet r544 - in trunk/heimdal/lib/hx509: ., abartlet <=