mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-13 15:48:12 -05:00
hle: kernel: hle_ipc: Ensure SessionRequestHandler is valid.
This commit is contained in:
@ -41,6 +41,21 @@ SessionRequestManager::SessionRequestManager(KernelCore& kernel_) : kernel{kerne
|
||||
|
||||
SessionRequestManager::~SessionRequestManager() = default;
|
||||
|
||||
bool SessionRequestManager::HasSessionRequestHandler(const HLERequestContext& context) const {
|
||||
if (IsDomain() && context.HasDomainMessageHeader()) {
|
||||
const auto& message_header = context.GetDomainMessageHeader();
|
||||
const auto object_id = message_header.object_id;
|
||||
|
||||
if (object_id > DomainHandlerCount()) {
|
||||
LOG_CRITICAL(IPC, "object_id {} is too big!", object_id);
|
||||
return false;
|
||||
}
|
||||
return DomainHandler(object_id - 1) != nullptr;
|
||||
} else {
|
||||
return session_handler != nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void SessionRequestHandler::ClientConnected(KServerSession* session) {
|
||||
session->SetSessionHandler(shared_from_this());
|
||||
}
|
||||
|
Reference in New Issue
Block a user