From: Serge Hallyn Date: Tue, 4 Sep 2012 23:06:44 +0000 (-0500) Subject: get_item(utsname): don't dereference utsname if it is NULL X-Git-Tag: lxc-0.9.0.alpha1~1^2~139 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64fca455ae305704929a03c27f3ed5866abe8e15;p=thirdparty%2Flxc.git get_item(utsname): don't dereference utsname if it is NULL Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 8b8cb6daa..11d863b34 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -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 return lxc_get_cgroup_entry(c, retv, inlen, key + 11); 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) v = c->console.path; else if (strcmp(key, "lxc.rootfs.mount") == 0)