[NSS] Fix uninitialized value in cert_ComputeCertType.

This commit is contained in:
Moonchild 2022-07-27 04:42:20 +00:00 committed by roytam1
commit 10fdf0e1c5
3 changed files with 8 additions and 6 deletions

View file

@ -417,12 +417,14 @@ CERT_FindBitStringExtension(CERTCertExtension **extensions, int tag,
goto loser;
}
retItem->data = (unsigned char *)PORT_Alloc((tmpItem.len + 7) >> 3);
retItem->data = (unsigned char *)PORT_ZAlloc((tmpItem.len + 7) >> 3);
if (retItem->data == NULL) {
goto loser;
}
PORT_Memcpy(retItem->data, tmpItem.data, (tmpItem.len + 7) >> 3);
if (tmpItem.len > 0) {
PORT_Memcpy(retItem->data, tmpItem.data, (tmpItem.len + 7) >> 3);
}
retItem->len = tmpItem.len;
rv = SECSuccess;