diff options
author | Damien Miller <djm@mindrot.org> | 2002-01-22 13:07:21 +0100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2002-01-22 13:07:21 +0100 |
commit | 503761ac45c1546f211c3585f58f352f16400891 (patch) | |
tree | 1e41ec352243d0e057e957d93b4f9a5ed774a854 /key.c | |
parent | - deraadt@cvs.openbsd.org 2001/12/24 07:29:43 (diff) | |
download | openssh-503761ac45c1546f211c3585f58f352f16400891.tar.xz openssh-503761ac45c1546f211c3585f58f352f16400891.zip |
- markus@cvs.openbsd.org 2001/12/25 18:49:56
[key.c]
be more careful on allocation
Diffstat (limited to '')
-rw-r--r-- | key.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -32,7 +32,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: key.c,v 1.36 2001/12/19 07:18:56 deraadt Exp $"); +RCSID("$OpenBSD: key.c,v 1.37 2001/12/25 18:49:56 markus Exp $"); #include <openssl/evp.h> @@ -63,6 +63,8 @@ key_new(int type) rsa = RSA_new(); rsa->n = BN_new(); rsa->e = BN_new(); + if (rsa == NULL || rsa->n == NULL || rsa->e == NULL) + fatal("key_new: malloc failure"); k->rsa = rsa; break; case KEY_DSA: @@ -71,6 +73,9 @@ key_new(int type) dsa->q = BN_new(); dsa->g = BN_new(); dsa->pub_key = BN_new(); + if (dsa == NULL || dsa->p == NULL || dsa->q == NULL || + dsa->g == NULL || dsa->pub_key == NULL) + fatal("key_new: malloc failure"); k->dsa = dsa; break; case KEY_UNSPEC: |