summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranziskus Kiefer <franziskuskiefer@gmail.com>2018-06-06 10:42:53 +0200
committerFranziskus Kiefer <franziskuskiefer@gmail.com>2018-06-06 10:42:53 +0200
commit80865df7927563225e91f1f865ee1546166cdf53 (patch)
tree2794c0d7c9b71b4ce8397bdc7df976046c45efbe
parente91223fccde55dd18c4d1f0ece913bcf7b293cd2 (diff)
downloadnss-hg-80865df7927563225e91f1f865ee1546166cdf53.tar.gz
Bug 1464616 - make sure arenas are the same, r=mt
Differential Revision: https://phabricator.services.mozilla.com/D1565
-rw-r--r--lib/pkcs12/p12e.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/pkcs12/p12e.c b/lib/pkcs12/p12e.c
index b07d37fbc..c42c4d2e2 100644
--- a/lib/pkcs12/p12e.c
+++ b/lib/pkcs12/p12e.c
@@ -884,7 +884,9 @@ sec_PKCS12AddAttributeToBag(SEC_PKCS12ExportContext *p12ctxt,
unsigned int nItems = 0;
SECStatus rv;
- if (!safeBag || !p12ctxt) {
+ PORT_Assert(p12ctxt->arena == safeBag->arena);
+ if (!safeBag || !p12ctxt || p12ctxt->arena != safeBag->arena) {
+ PORT_SetError(SEC_ERROR_INVALID_ARGS);
return SECFailure;
}