From 66fce528ed935aaff8d6bab77736e5997e908ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Mon, 3 Apr 2006 07:45:48 +0000 Subject: [PATCH] Avoid crashing on bad input. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16980 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hx509/crypto.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/hx509/crypto.c b/lib/hx509/crypto.c index 2581e89d6..b67511e44 100644 --- a/lib/hx509/crypto.c +++ b/lib/hx509/crypto.c @@ -915,7 +915,8 @@ _hx509_parse_private_key(const heim_oid *key_oid, ret = (*md->parse_private_key)(md, data, len, *private_key); if (ret) _hx509_free_private_key(private_key); - (*private_key)->md = md; + else + (*private_key)->md = md; return ret; }