From b4539ac324735badb136ba497c42bc31916ff402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sun, 23 Nov 2008 22:05:36 +0000 Subject: [PATCH] better error checks git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24050 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hx509/cert.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/hx509/cert.c b/lib/hx509/cert.c index cf7beb3da..337eb64f0 100644 --- a/lib/hx509/cert.c +++ b/lib/hx509/cert.c @@ -3349,10 +3349,10 @@ _hx509_cert_to_env(hx509_context context, hx509_cert cert, hx509_env *env) } { - hx509_env envhash = NULL; - heim_octet_string os, sig; - char *buf; Certificate *c = _hx509_get_cert(cert); + heim_octet_string os, sig; + hx509_env envhash = NULL; + char *buf; os.data = c->tbsCertificate.subjectPublicKeyInfo.subjectPublicKey.data; os.length = @@ -3367,8 +3367,10 @@ _hx509_cert_to_env(hx509_context context, hx509_cert cert, hx509_env *env) if (ret != 0) goto out; - hex_encode(sig.data, sig.length, &buf); + ret = hex_encode(sig.data, sig.length, &buf); der_free_octet_string(&sig); + if (ret < 0) + goto out; ret = hx509_env_add(context, &envhash, "sha1", buf); free(buf);