diff options
author | Adrian Reber <areber@redhat.com> | 2017-02-14 20:34:55 +0300 |
---|---|---|
committer | Pavel Emelyanov <xemul@virtuozzo.com> | 2017-03-06 11:38:35 +0300 |
commit | 3200fa8f934d87de153d9e931f11607fc689b684 (patch) | |
tree | 8b4aed7489fac65e8d9ff99f17dcdd216e25cdd8 | |
parent | d03418459ad84b47f10052ec2b32a0267545d817 (diff) |
cr-service: feature check core dumps if criu_req->criu_opts is empty
Trying to use the FEATURE_CHECK RPC with criu_req->criu_opts set to NULL
makes CRIU segfault. Technically there is no reason to have a valid
criu_req->criu_opt during feature check. The only reason was to set the
image directory for setproctitle(). This removes the segfault and the
unnecessary requirement of setting criu_req->criu_opts.
Another possible solution would have been to return an error if
criu_req->criu_opts is NULL but so far it seems unnecessary to have
criu_req->criu_opts during feature check.
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
-rw-r--r-- | criu/cr-service.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/criu/cr-service.c b/criu/cr-service.c index 78313528e..d5b3848ac 100644 --- a/criu/cr-service.c +++ b/criu/cr-service.c @@ -852,16 +852,13 @@ static int handle_feature_check(int sk, CriuReq * msg) if (pid == 0) { int ret = 1; - if (setup_opts_from_req(sk, msg->opts)) - goto cout; - - setproctitle("feature-check --rpc -D %s", images_dir); + setproctitle("feature-check --rpc"); kerndat_get_dirty_track(); if (kdat.has_dirty_track) ret = 0; -cout: + exit(ret); } |