SysCall: Added sanity checks.

This commit is contained in:
Mikhail Krichanov 2024-05-29 09:40:29 +03:00
parent 12c9c0a53d
commit cb3eea69af

View File

@ -251,6 +251,7 @@ PrepareRing3Interface (
Unicode->SupportedLanguages Unicode->SupportedLanguages
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "Could not copy string!\n"));
return NULL; return NULL;
} }
@ -346,9 +347,10 @@ CallBootService (
DisableSMAP (); DisableSMAP ();
if (Interface != NULL) { if (Interface != NULL) {
Interface = PrepareRing3Interface (CoreProtocol, Interface, MemoryCoreSize); Interface = PrepareRing3Interface (CoreProtocol, Interface, MemoryCoreSize);
} ASSERT (Interface != NULL);
*(VOID **)CoreRbp->Argument3 = Interface; *(VOID **)CoreRbp->Argument3 = Interface;
}
EnableSMAP (); EnableSMAP ();
return Status; return Status;
@ -558,9 +560,10 @@ CallBootService (
DisableSMAP (); DisableSMAP ();
if (Interface != NULL) { if (Interface != NULL) {
Interface = PrepareRing3Interface (CoreProtocol, Interface, MemoryCoreSize); Interface = PrepareRing3Interface (CoreProtocol, Interface, MemoryCoreSize);
} ASSERT (Interface != NULL);
*(VOID **)CoreRbp->Argument3 = Interface; *(VOID **)CoreRbp->Argument3 = Interface;
}
EnableSMAP (); EnableSMAP ();
return Status; return Status;