import from nss upstream: Bug 1767590 - Initialize pointers passed to NSS_CMSDigestContext_FinishMultiple r=#nss-reviewers,kaie (118b893f8e)

This commit is contained in:
roytam1 2022-06-02 10:10:47 +08:00
commit 5618d02caf
2 changed files with 3 additions and 3 deletions

View file

@ -219,7 +219,7 @@ decode(FILE *out, SECItem *input, const struct decodeOptionsStr *decodeOptions)
switch (typetag) {
case SEC_OID_PKCS7_SIGNED_DATA: {
NSSCMSSignedData *sigd = NULL;
SECItem **digests;
SECItem **digests = NULL;
int nsigners;
int j;

View file

@ -239,7 +239,7 @@ NSS_CMSDigestContext_FinishSingle(NSSCMSDigestContext *cmsdigcx,
SECItem *digest)
{
SECStatus rv = SECFailure;
SECItem **dp;
SECItem **dp = NULL;
PLArenaPool *arena = NULL;
if ((arena = PORT_NewArena(1024)) == NULL)
@ -247,7 +247,7 @@ NSS_CMSDigestContext_FinishSingle(NSSCMSDigestContext *cmsdigcx,
/* get the digests into arena, then copy the first digest into poolp */
rv = NSS_CMSDigestContext_FinishMultiple(cmsdigcx, arena, &dp);
if (rv == SECSuccess) {
if (rv == SECSuccess && dp) {
/* now copy it into poolp */
rv = SECITEM_CopyItem(poolp, digest, dp[0]);
}