changeset 336:26817025351f

merge
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 09 Apr 2014 13:49:59 +0000
parents 81a205fc651e (diff) 811eec4e1b99 (current diff)
children 2207e94a0cc3
files ui/management.cpp ui/managementwindow.cpp ui/managementwindow.h
diffstat 2 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/cinst/mozilla.c	Wed Apr 09 12:44:44 2014 +0200
+++ b/cinst/mozilla.c	Wed Apr 09 13:49:59 2014 +0000
@@ -370,6 +370,11 @@
   size_t name_len;
   cn_str = x509_parse_subject(secitemp->data, secitemp->len, CERT_OID_CN);
   o_str = x509_parse_subject(secitemp->data, secitemp->len, CERT_OID_O);
+  if (!cn_str || !o_str)
+    {
+      DEBUGPRINTF("FATAL: Could not parse certificate!");
+      exit(ERR_INVALID_CERT);
+    }
   name_len = strlen(cn_str) + strlen(o_str) + 4;
   name = (char *)xmalloc(name_len);
   snprintf(name, name_len, "%s - %s", cn_str, o_str);
--- a/common/certhelp.c	Wed Apr 09 12:44:44 2014 +0200
+++ b/common/certhelp.c	Wed Apr 09 13:49:59 2014 +0000
@@ -33,8 +33,8 @@
   x509_crt_init(&chain);
   if (x509_crt_parse_der(&chain, derdata, derlen) != 0)
     {
-      DEBUGPRINTF("FATAL: Could not parse certificate!");
-      exit(ERR_INVALID_CERT);
+      ERRORPRINTF("Could not parse certificate!\n");
+      return NULL;
     }
   else
     {

http://wald.intevation.org/projects/trustbridge/