зеркало из https://github.com/mozilla/pjs.git
Detect Null pointer. Assert if null, else don't crash here. Bug 97887.
This commit is contained in:
Родитель
be79e5badd
Коммит
e6d688e56a
|
@ -2122,6 +2122,11 @@ PK11SlotInfo *
|
|||
PK11_GetInternalKeySlot(void)
|
||||
{
|
||||
SECMODModule *mod = SECMOD_GetInternalModule();
|
||||
PORT_Assert(mod != NULL);
|
||||
if (!mod) {
|
||||
PORT_SetError( SEC_ERROR_NO_MODULE );
|
||||
return NULL;
|
||||
}
|
||||
return PK11_ReferenceSlot(mod->isFIPS ? mod->slots[0] : mod->slots[1]);
|
||||
}
|
||||
|
||||
|
@ -2129,7 +2134,13 @@ PK11_GetInternalKeySlot(void)
|
|||
PK11SlotInfo *
|
||||
PK11_GetInternalSlot(void)
|
||||
{
|
||||
return PK11_ReferenceSlot(SECMOD_GetInternalModule()->slots[0]);
|
||||
SECMODModule * mod = SECMOD_GetInternalModule();
|
||||
PORT_Assert(mod != NULL);
|
||||
if (!mod) {
|
||||
PORT_SetError( SEC_ERROR_NO_MODULE );
|
||||
return NULL;
|
||||
}
|
||||
return PK11_ReferenceSlot(mod->slots[0]);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Загрузка…
Ссылка в новой задаче