1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-11-09 21:51:45 +00:00

kern: fix KHandleTable null deref in ipc

This commit is contained in:
Michael Scire 2020-12-02 04:05:16 -08:00
parent eccadf2958
commit 94d818db90

View file

@ -166,8 +166,10 @@ namespace ams::kern {
KScopedSpinLock lk(this->lock);
KAutoObject *obj = this->GetObjectImpl(handle);
if (obj->DynamicCast<KInterruptEvent *>() != nullptr) {
return nullptr;
if (AMS_LIKELY(obj != nullptr)) {
if (AMS_UNLIKELY(obj->DynamicCast<KInterruptEvent *>() != nullptr)) {
return nullptr;
}
}
return obj;