From 1fc5c0244b03487526fd39c15b613c5f0da71fa7 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Wed, 16 Mar 2016 11:52:00 +0300 Subject: [PATCH] criu: pstree_switch_state -- Fix nil deref on error path We may enter with @root_item = NULL in case of error handling, so simply bail out. Signed-off-by: Cyrill Gorcunov Signed-off-by: Pavel Emelyanov --- criu/seize.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/criu/seize.c b/criu/seize.c index d187b7439..06065861b 100644 --- a/criu/seize.c +++ b/criu/seize.c @@ -463,6 +463,9 @@ void pstree_switch_state(struct pstree_item *root_item, int st) { struct pstree_item *item = root_item; + if (!root_item) + return; + if (st != TASK_DEAD) freezer_restore_state();