changeset 245:fbd74e2370de

Error out, when base64 decode results in empty data.
author Sascha Wilde <wilde@intevation.de>
date Fri, 28 Mar 2014 19:30:35 +0100
parents 0145d2401f46
children 1efe494c3d2b
files cinst/mozilla.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/cinst/mozilla.c	Fri Mar 28 19:28:01 2014 +0100
+++ b/cinst/mozilla.c	Fri Mar 28 19:30:35 2014 +0100
@@ -338,8 +338,9 @@
   unsigned char *dercert = NULL;
   size_t dercertlen;
 
-  if ( str_base64_decode((char **)(&dercert), &dercertlen,
-                         b64, b64len) == 0 )
+  if ((str_base64_decode((char **)(&dercert), &dercertlen,
+                         b64, b64len) == 0) &&
+      (dercertlen > 0))
     {
       secitem->data = dercert;
       secitem->len = dercertlen;

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