From bf5abe5a3ecc3e0e10242328d6f3a141ce3a2682 Mon Sep 17 00:00:00 2001
From: Ken Gaillot <kgaillot@redhat.com>
Date: Thu, 19 Jan 2017 10:13:50 -0600
Subject: [PATCH] Low: libcrmcommon: ensure filename is not NULL before opening
unlikely, but makes coverity happy
---
lib/common/schemas.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/common/schemas.c b/lib/common/schemas.c
index b8280b2..f1a0238 100644
--- a/lib/common/schemas.c
+++ b/lib/common/schemas.c
@@ -580,6 +580,8 @@ validate_xml_verbose(xmlNode *xml_blob)
gboolean rc = FALSE;
char *filename = strdup(CRM_STATE_DIR "/cib-invalid.XXXXXX");
+ CRM_CHECK(filename != NULL, return FALSE);
+
umask(S_IWGRP | S_IWOTH | S_IROTH);
fd = mkstemp(filename);
write_xml_fd(xml_blob, filename, fd, FALSE);
--
1.8.3.1