From 6f7f11e3b3d9c7888bf66f83760eaffb4b214e67 Mon Sep 17 00:00:00 2001 From: Mike Rapoport Date: Thu, 16 Jun 2016 08:06:00 +0300 Subject: [PATCH] criu: lazy-pages: take care of possible NULL pointer dereference Fix CID 163485 (#2 of 2): Dereference null return value (NULL_RETURNS) 7. dereference: Dereferencing a pointer that might be null dest when calling handle_user_fault. Signed-off-by: Mike Rapoport Signed-off-by: Pavel Emelyanov --- criu/uffd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/criu/uffd.c b/criu/uffd.c index 60d737b92..3a4be4785 100644 --- a/criu/uffd.c +++ b/criu/uffd.c @@ -731,6 +731,7 @@ static int handle_requests(int epollfd, struct epoll_event *events) for (i = 0; i < ret; i++) { lpi = uffd_to_lpi(events[i].data.fd); + BUG_ON(!lpi); ret = handle_user_fault(lpi, dest); if (ret < 0) goto out;