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 <christian.brauner@ubuntu.com>
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)