poppler/SignatureHandler.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
New commits: commit 4db6507320b51e060f73f7fb0eab364e8a1fee77 Author: Sebastian Rasmussen <[email protected]> Date: Wed Jan 11 23:37:54 2017 +0100 Check for error from NSS in SignatureHandler construct. And cascading effects in other SignalHandler members. Bug #99363 diff --git a/poppler/SignatureHandler.cc b/poppler/SignatureHandler.cc index a5132a4..71644e5 100644 --- a/poppler/SignatureHandler.cc +++ b/poppler/SignatureHandler.cc @@ -8,6 +8,7 @@ // Copyright 2015 André Esser <[email protected]> // Copyright 2015, 2016 Albert Astals Cid <[email protected]> // Copyright 2015 Markus Kilås <[email protected]> +// Copyright 2017 Sebastian Rasmussen <[email protected]> // //======================================================================== @@ -105,7 +106,8 @@ void SignatureHandler::init_nss() SignatureHandler::SignatureHandler(unsigned char *p7, int p7_length) - : CMSMessage(NULL), + : hash_context(NULL), + CMSMessage(NULL), CMSSignedData(NULL), CMSSignerInfo(NULL), temp_certs(NULL) @@ -115,8 +117,10 @@ SignatureHandler::SignatureHandler(unsigned char *p7, int p7_length) CMSitem.len = p7_length; CMSMessage = CMS_MessageCreate(&CMSitem); CMSSignedData = CMS_SignedDataCreate(CMSMessage); - CMSSignerInfo = CMS_SignerInfoCreate(CMSSignedData); - hash_context = initHashContext(); + if (CMSSignedData) { + CMSSignerInfo = CMS_SignerInfoCreate(CMSSignedData); + hash_context = initHashContext(); + } } HASHContext * SignatureHandler::initHashContext() @@ -131,7 +135,9 @@ HASHContext * SignatureHandler::initHashContext() void SignatureHandler::updateHash(unsigned char * data_block, int data_len) { - HASH_Update(hash_context, data_block, data_len); + if (hash_context) { + HASH_Update(hash_context, data_block, data_len); + } } SignatureHandler::~SignatureHandler()
_______________________________________________ poppler mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/poppler
