Fix bug 75490: memory bug in decodeAndImportKey causes SEGV.

git-svn-id: svn://10.0.0.236/trunk@92112 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
nicolson%netscape.com
2001-04-12 22:13:25 +00:00
parent b706a3912a
commit 482d265222

View File

@@ -807,15 +807,13 @@ decodeAndImportKey(SECItem *dervalue,
return OUT_OF_MEM;
}
pki = (SECKEYPrivateKeyInfo *)
PORT_ArenaZAlloc(temparena, sizeof(SECKEYPrivateKeyInfo));
pki = PR_NEWZAP(SECKEYPrivateKeyInfo);
if(pki == NULL) {
result = DECODE_FAILURE;
goto loser;
}
pk = (SECKEYLowPrivateKey *)
PORT_ArenaZAlloc(temparena, sizeof(SECKEYLowPrivateKey));
pk = PR_NEWZAP(SECKEYLowPrivateKey);
if(pk == NULL) {
result = DECODE_FAILURE;
goto loser;