[CRIU] [PATCH] net: check that open_image() doesn't return NULL

Andrey Vagin avagin at openvz.org
Fri Feb 19 09:40:40 PST 2016


From: Andrew Vagin <avagin at virtuozzo.com>

Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
---
 criu/net.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/criu/net.c b/criu/net.c
index cf1e821..a67cd6e 100644
--- a/criu/net.c
+++ b/criu/net.c
@@ -415,6 +415,8 @@ static int restore_nf_ct(int pid, int type)
 	struct cr_img *img;
 
 	img = open_image(type, O_RSTR, pid);
+	if (img == NULL)
+		return -1;
 	if (empty_image(img)) {
 		close_image(img);
 		return 0;
-- 
2.5.0



More information about the CRIU mailing list