From: Ján Tomko Date: Thu, 13 Dec 2012 10:44:37 +0000 (+0100) Subject: selinux: fix NULL dereference in GetSecurityMountOptions X-Git-Tag: v1.0.1-rc2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b28fb61fd7b7b74b523825a71f37a634bd371151;p=thirdparty%2Flibvirt.git selinux: fix NULL dereference in GetSecurityMountOptions In the case of an OOM error in virDomainDefGetSecurityLabelDef, secdef is set to NULL, then dereferenced while printing the debug message. --- diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c index 5409e32a40..9134bc8379 100644 --- a/src/security/security_selinux.c +++ b/src/security/security_selinux.c @@ -1993,7 +1993,8 @@ virSecuritySELinuxGetSecurityMountOptions(virSecurityManagerPtr mgr, return NULL; } - VIR_DEBUG("imageLabel=%s opts=%s", secdef->imagelabel, opts); + VIR_DEBUG("imageLabel=%s opts=%s", + secdef ? secdef->imagelabel : "(null)", opts); return opts; }