From 8e9ebe14de7ab32b438fc6b49828646a827b2e56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Mon, 18 Jun 2007 21:30:11 +0000 Subject: [PATCH] Fail if not finding iv. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21141 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hx509/ks_file.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/hx509/ks_file.c b/lib/hx509/ks_file.c index 24304fed0..87a57b682 100644 --- a/lib/hx509/ks_file.c +++ b/lib/hx509/ks_file.c @@ -232,8 +232,14 @@ parse_rsa_private_key(hx509_context context, const char *fn, } iv = strchr(type, ','); - if (iv) - *iv++ = '\0'; + if (iv == NULL) { + free(type); + hx509_set_error_string(context, 0, HX509_PARSING_KEY_FAILED, + "IV missing"); + return HX509_PARSING_KEY_FAILED; + } + + *iv++ = '\0'; size = strlen(iv); ivdata = malloc(size);