Index: nss/lib/pk11wrap/pk11mech.c |
diff --git a/nss/lib/pk11wrap/pk11mech.c b/nss/lib/pk11wrap/pk11mech.c |
index 415a47b4121572c07823681d007314c447b76d69..edc7a9b6553bf64e00aa0e9323a0c8f1eaab0323 100644 |
--- a/nss/lib/pk11wrap/pk11mech.c |
+++ b/nss/lib/pk11wrap/pk11mech.c |
@@ -1384,12 +1384,13 @@ pk11_GenerateNewParamWithKeyLen(CK_MECHANISM_TYPE type, int keyLen) |
SECItem iv; |
SECStatus rv; |
- |
mech = (SECItem *) PORT_Alloc(sizeof(SECItem)); |
if (mech == NULL) return NULL; |
rv = SECSuccess; |
mech->type = siBuffer; |
+ mech->data = NULL; |
+ mech->len = 0; |
switch (type) { |
case CKM_RC4: |
case CKM_SEED_ECB: |
@@ -1402,8 +1403,6 @@ pk11_GenerateNewParamWithKeyLen(CK_MECHANISM_TYPE type, int keyLen) |
case CKM_CAST_ECB: |
case CKM_CAST3_ECB: |
case CKM_CAST5_ECB: |
- mech->data = NULL; |
- mech->len = 0; |
break; |
case CKM_RC2_ECB: |
rc2_ecb_params = (CK_RC2_PARAMS *)PORT_Alloc(sizeof(CK_RC2_PARAMS)); |
@@ -1451,8 +1450,6 @@ pk11_GenerateNewParamWithKeyLen(CK_MECHANISM_TYPE type, int keyLen) |
return PK11_ParamFromIV(type,&iv); |
default: |
if (pk11_lookup(type)->iv == 0) { |
- mech->data = NULL; |
- mech->len = 0; |
break; |
} |
case CKM_SEED_CBC: |