From 5121500699e5e6a8cec5a41bf33da2321d96e00d 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 61100b8ea0..988e31192b 100644 --- a/criu/uffd.c +++ b/criu/uffd.c @@ -730,6 +730,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;