]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
selinux: fix NULL dereference in GetSecurityMountOptions
authorJán Tomko <jtomko@redhat.com>
Thu, 13 Dec 2012 10:44:37 +0000 (11:44 +0100)
committerEric Blake <eblake@redhat.com>
Thu, 13 Dec 2012 22:41:44 +0000 (15:41 -0700)
In the case of an OOM error in virDomainDefGetSecurityLabelDef, secdef
is set to NULL, then dereferenced while printing the debug message.

src/security/security_selinux.c

index 5409e32a4058b881a2378e3b388a1329b5c65891..9134bc8379396055a63c8f8c3f6886ffa73950ca 100644 (file)
@@ -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;
 }