Commit 64fca455 by Serge Hallyn Committed by Stéphane Graber

get_item(utsname): don't dereference utsname if it is NULL

parent 4a7c7daa
...@@ -1530,7 +1530,7 @@ int lxc_get_config_item(struct lxc_conf *c, char *key, char *retv, int inlen) ...@@ -1530,7 +1530,7 @@ int lxc_get_config_item(struct lxc_conf *c, char *key, char *retv, int inlen)
else if (strncmp(key, "lxc.cgroup.", 11) == 0) // specific cgroup info else if (strncmp(key, "lxc.cgroup.", 11) == 0) // specific cgroup info
return lxc_get_cgroup_entry(c, retv, inlen, key + 11); return lxc_get_cgroup_entry(c, retv, inlen, key + 11);
else if (strcmp(key, "lxc.utsname") == 0) else if (strcmp(key, "lxc.utsname") == 0)
v = c->utsname->nodename; v = c->utsname ? c->utsname->nodename : NULL;
else if (strcmp(key, "lxc.console") == 0) else if (strcmp(key, "lxc.console") == 0)
v = c->console.path; v = c->console.path;
else if (strcmp(key, "lxc.rootfs.mount") == 0) else if (strcmp(key, "lxc.rootfs.mount") == 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment