From: Christian Brauner Date: Thu, 7 Dec 2017 14:01:51 +0000 (+0100) Subject: coverity: #1425928 X-Git-Tag: lxc-3.0.0.beta1~128^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3ee9e4fb38745f29a4f69528429f5f3be63dfd79;p=thirdparty%2Flxc.git coverity: #1425928 Avoid NULL-pointer dereference. Apparently monitor.{c,h} calls lxc_check_inherited() with NULL passed for the config. This isn't really a big issue since monitor.{c,h} is effectively dead for all liblxc versions that have the state client patch. Also, the patch that introduces the relevant lines into lxc_check_inherited() is only in master and yet unreleased. Signed-off-by: Christian Brauner --- diff --git a/src/lxc/start.c b/src/lxc/start.c index 72e3f0146..b82768687 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -226,14 +226,16 @@ restart: continue; /* Keep state clients that wait on reboots. */ - lxc_list_for_each(cur, &conf->state_clients) { - struct lxc_state_client *client = cur->elem; + if (conf) { + lxc_list_for_each(cur, &conf->state_clients) { + struct lxc_state_client *client = cur->elem; - if (client->clientfd != fd) - continue; + if (client->clientfd != fd) + continue; - matched = true; - break; + matched = true; + break; + } } if (matched)