From 863d2ad5c02cccde9a4d1a392a7cae78d001c8a9 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 6 Jan 2014 17:10:40 -0800 Subject: [PATCH] CheckPassiveGrabsOnWindow() needs to handle NULL return value from AllocGrab() CheckPassiveGrabsOnWindow() calls AllocGrab() which can fail and return NULL. This return value is not checked, and can cause NULL pointer dereferences. Signed-off-by: Alan Coopersmith Signed-off-by: Peter Hutterer Reviewed-by: Peter Hutterer --- dix/events.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dix/events.c b/dix/events.c index 2f0605e..acf97cc 100644 --- a/dix/events.c +++ b/dix/events.c @@ -3956,6 +3956,8 @@ CheckPassiveGrabsOnWindow(WindowPtr pWin, return NULL; tempGrab = AllocGrab(NULL); + if (tempGrab == NULL) + return NULL; /* Fill out the grab details, but leave the type for later before * comparing */ -- 2.7.4