IOS/ES: Add sanity checks to AddTitleFinish

This commit is contained in:
Léo Lam 2017-02-27 23:20:30 +01:00
parent 9263cb1996
commit 1e3f8c1a1d

View file

@ -540,10 +540,11 @@ IPCCommandResult ES::AddContentFinish(const IOCtlVRequest& request)
IPCCommandResult ES::AddTitleFinish(const IOCtlVRequest& request)
{
if (!request.HasNumberOfValidVectors(0, 0))
if (!request.HasNumberOfValidVectors(0, 0) || !m_addtitle_tmd.IsValid())
return GetDefaultReply(ES_PARAMETER_SIZE_OR_ALIGNMENT);
INFO_LOG(IOS_ES, "IOCTL_ES_ADDTITLEFINISH");
m_addtitle_tmd.SetBytes({});
return GetDefaultReply(IPC_SUCCESS);
}