Merge pull request #1307 from lioncash/null2

sm/notifications: Prevent potential null pointer dereference in ReceiveNotification
This commit is contained in:
TuxSH
2019-11-05 00:14:49 +00:00
committed by GitHub

View File

@@ -101,7 +101,7 @@ Result ReceiveNotification(SessionData *sessionData, u32 *notificationId)
if(processData == NULL || !processData->notificationEnabled || processData->nbPendingNotifications == 0) if(processData == NULL || !processData->notificationEnabled || processData->nbPendingNotifications == 0)
{ {
if(processData->nbPendingNotifications) if(processData != NULL && processData->nbPendingNotifications)
*notificationId = 0; *notificationId = 0;
return 0xD8806404; return 0xD8806404;
} }