summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornelson%bolyard.com <devnull@localhost>2007-01-05 09:44:05 +0000
committernelson%bolyard.com <devnull@localhost>2007-01-05 09:44:05 +0000
commitf2205a2e36f3d39dbea94b035f698834efecd86f (patch)
tree10718830103d5e00e7faa3a5ab15fb51a551fad0
parentb14279edcdfd6156f7c6d7233ddf06469218c6bb (diff)
downloadnss-hg-f2205a2e36f3d39dbea94b035f698834efecd86f.tar.gz
Fix crash when importing private key with no label.
Bug 335481. r=julien,rrelyea
-rw-r--r--security/nss/lib/pk11wrap/pk11obj.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/security/nss/lib/pk11wrap/pk11obj.c b/security/nss/lib/pk11wrap/pk11obj.c
index 1bc9e8443..91a28321e 100644
--- a/security/nss/lib/pk11wrap/pk11obj.c
+++ b/security/nss/lib/pk11wrap/pk11obj.c
@@ -951,7 +951,9 @@ PK11_UnwrapPrivKey(PK11SlotInfo *slot, PK11SymKey *wrappingKey,
sizeof(cktrue)); attrs++;
PK11_SETATTRS(attrs, CKA_SENSITIVE, sensitive ? &cktrue : &ckfalse,
sizeof(cktrue)); attrs++;
- PK11_SETATTRS(attrs, CKA_LABEL, label->data, label->len); attrs++;
+ if (label && label->data) {
+ PK11_SETATTRS(attrs, CKA_LABEL, label->data, label->len); attrs++;
+ }
PK11_SETATTRS(attrs, CKA_ID, ck_id->data, ck_id->len); attrs++;
for (i=0; i < usageCount; i++) {
PK11_SETATTRS(attrs, usage[i], &cktrue, sizeof(cktrue)); attrs++;