diff options
author | Franziskus Kiefer <franziskuskiefer@gmail.com> | 2016-05-20 08:54:51 +0200 |
---|---|---|
committer | Franziskus Kiefer <franziskuskiefer@gmail.com> | 2016-05-20 08:54:51 +0200 |
commit | 6a316457bdbbc12d26df24c3014a3ce1dcbd5730 (patch) | |
tree | 6049e90ed25bea0c50038afaa74fdae1d1c9d3e6 | |
parent | 9ff7336cb3abc39998c10e9a7cfffa0e5c23dc12 (diff) | |
download | nss-hg-6a316457bdbbc12d26df24c3014a3ce1dcbd5730.tar.gz |
Bug 1203229 - fix null deref in p7decode, r=ttaubert
-rw-r--r-- | lib/pkcs7/p7decode.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/pkcs7/p7decode.c b/lib/pkcs7/p7decode.c index 7a52d8203..f968482a8 100644 --- a/lib/pkcs7/p7decode.c +++ b/lib/pkcs7/p7decode.c @@ -648,8 +648,16 @@ sec_pkcs7_decoder_notify (void *arg, PRBool before, void *dest, int depth) after = PR_TRUE; p7dcx = (SEC_PKCS7DecoderContext*)arg; + if (!p7dcx) { + return; + } + cinfo = p7dcx->cinfo; + if (!cinfo) { + return; + } + if (cinfo->contentTypeTag == NULL) { if (after && dest == &(cinfo->contentType)) cinfo->contentTypeTag = SECOID_FindOID(&(cinfo->contentType)); @@ -867,6 +875,10 @@ sec_pkcs7_decoder_notify (void *arg, PRBool before, void *dest, int depth) case SEC_OID_PKCS7_ENCRYPTED_DATA: encd = cinfo->content.encryptedData; + if (!encd) { + break; + } + /* * XXX If the decryption key callback is set, we want to start * the decryption. If the callback is not set, we will treat the |