Merge remote-tracking branch 'origin/tracking' into custom

This commit is contained in:
roytam1 2025-02-06 09:30:57 +08:00
commit f7298813f9
11 changed files with 44 additions and 91 deletions

View file

@ -577,9 +577,11 @@ get_token_objects_for_cache(
} else {
PRUint32 j;
for (j = 0; j < i; j++) {
/* Any token references that were removed in successful loop iterations
* need to be restored before we call nssCryptokiObjectArray_Destroy */
nssToken_AddRef(cache->objects[objectType][j]->object->token);
/* Objects that were successfully added to the cache do not own a
* token reference (they share a reference with the cache itself).
* Nulling out the pointer here prevents the token's refcount
* from being decremented in nssCryptokiObject_Destroy */
cache->objects[objectType][j]->object->token = NULL;
nssArena_Destroy(cache->objects[objectType][j]->arena);
}
nss_ZFreeIf(cache->objects[objectType]);

View file

@ -520,6 +520,8 @@ CERT_DecodeCertFromPackage(char *certbuf, int certlen)
CERTCertificate *cert = NULL;
collectArgs.arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
collectArgs.cert.data = NULL;
collectArgs.cert.len = 0;
rv = CERT_DecodeCertPackage(certbuf, certlen, collect_certs,
(void *)&collectArgs);