comparison cinst/mozilla.c @ 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
comparison
equal deleted inserted replaced
244:0145d2401f46 245:fbd74e2370de
336 base64_to_secitem(char *b64, size_t b64len, SECItem *secitem) 336 base64_to_secitem(char *b64, size_t b64len, SECItem *secitem)
337 { 337 {
338 unsigned char *dercert = NULL; 338 unsigned char *dercert = NULL;
339 size_t dercertlen; 339 size_t dercertlen;
340 340
341 if ( str_base64_decode((char **)(&dercert), &dercertlen, 341 if ((str_base64_decode((char **)(&dercert), &dercertlen,
342 b64, b64len) == 0 ) 342 b64, b64len) == 0) &&
343 (dercertlen > 0))
343 { 344 {
344 secitem->data = dercert; 345 secitem->data = dercert;
345 secitem->len = dercertlen; 346 secitem->len = dercertlen;
346 return true; 347 return true;
347 } 348 }

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