From: John Ferlan Date: Thu, 20 Dec 2018 21:30:24 +0000 (-0500) Subject: security: Fix comparison for virSecuritySELinuxRecallLabel X-Git-Tag: v5.0.0-rc1~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d42d51eef793d7cbbf03801922c47fa3566d441;p=thirdparty%2Flibvirt.git security: Fix comparison for virSecuritySELinuxRecallLabel The @con type security_context_t is actually a "char *", so the correct check should be to dereference one more level; otherwise, we could return/use the NULL pointer later in a subsequent virSecuritySELinuxSetFileconImpl call (using @fcon). Suggested-by: Michal Prívozník Signed-off-by: John Ferlan Reviewed-by: Ján Tomko --- diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c index f3690a4cb1..5cdb839c13 100644 --- a/src/security/security_selinux.c +++ b/src/security/security_selinux.c @@ -211,7 +211,7 @@ virSecuritySELinuxRecallLabel(const char *path, path, con) < 0) return -1; - if (!con) + if (!*con) return 1; return 0;