From ea8cb168b320aa0bcc6daf60d640963410112120 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sat, 14 Feb 2009 04:17:27 +0000 Subject: [PATCH] don't deref ops, they might be null. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24690 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hx509/crypto.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/hx509/crypto.c b/lib/hx509/crypto.c index c5372c9c8..ef3f5624f 100644 --- a/lib/hx509/crypto.c +++ b/lib/hx509/crypto.c @@ -1453,9 +1453,14 @@ find_sig_alg(const heim_oid *oid) static const AlgorithmIdentifier * alg_for_privatekey(const hx509_private_key pk, int type) { - const heim_oid *keytype = pk->ops->key_oid; + const heim_oid *keytype; unsigned int i; + if (pk->ops == NULL) + return NULL; + + keytype = pk->ops->key_oid; + for (i = 0; sig_algs[i]; i++) { if (sig_algs[i]->key_oid == NULL) continue;