From b28fb61fd7b7b74b523825a71f37a634bd371151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Thu, 13 Dec 2012 11:44:37 +0100 Subject: [PATCH] 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. --- src/security/security_selinux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; }