summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralexei.volkov.bugs%sun.com <devnull@localhost>2006-04-22 01:13:12 +0000
committeralexei.volkov.bugs%sun.com <devnull@localhost>2006-04-22 01:13:12 +0000
commit1609a763e3fd653bc7b97926dd30a60b0bc6a94b (patch)
tree199201d4314796b77b45ebac8fee7969e1144d58
parentb105c5157ae0f232967e00e2fcadfc5488e8624d (diff)
downloadnss-hg-1609a763e3fd653bc7b97926dd30a60b0bc6a94b.tar.gz
Patch contributed by timeless@bemail.org
[Bug 334328] nsspkcs5_PKCS12PBE: Variable "A" tracked as NULL was dereferenced. r=nelson
-rw-r--r--security/nss/lib/softoken/lowpbe.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/security/nss/lib/softoken/lowpbe.c b/security/nss/lib/softoken/lowpbe.c
index 694cd4f52..b73485948 100644
--- a/security/nss/lib/softoken/lowpbe.c
+++ b/security/nss/lib/softoken/lowpbe.c
@@ -546,13 +546,15 @@ loser:
PORT_FreeArena(arena, PR_TRUE);
}
- /* if i != c, then we didn't complete the loop above and must of failed
- * somwhere along the way */
- if (i != c) {
- SECITEM_ZfreeItem(A,PR_TRUE);
- A = NULL;
- } else {
- A->len = bytesNeeded;
+ if (A) {
+ /* if i != c, then we didn't complete the loop above and must of failed
+ * somwhere along the way */
+ if (i != c) {
+ SECITEM_ZfreeItem(A,PR_TRUE);
+ A = NULL;
+ } else {
+ A->len = bytesNeeded;
+ }
}
return A;