From c95b59c72eb025567ff05680604a44e8e3251057 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 13 Aug 2019 03:01:24 -0400 Subject: [PATCH] sm/notifications: Prevent potential null pointer dereference in ReceiveNotification Based off the conditions, this is a potential null pointer dereference that can occur. We need to check for null before accessing nbPendingNotifications. This is unlikely to occur in common usage, however it's a fairly straightforward amendment. --- sysmodules/sm/source/notifications.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysmodules/sm/source/notifications.c b/sysmodules/sm/source/notifications.c index ca87da5..8294957 100644 --- a/sysmodules/sm/source/notifications.c +++ b/sysmodules/sm/source/notifications.c @@ -101,7 +101,7 @@ Result ReceiveNotification(SessionData *sessionData, u32 *notificationId) if(processData == NULL || !processData->notificationEnabled || processData->nbPendingNotifications == 0) { - if(processData->nbPendingNotifications) + if(processData != NULL && processData->nbPendingNotifications) *notificationId = 0; return 0xD8806404; }