File pacemaker-libcib-xpath-result-empty.patch of Package pacemaker.openSUSE_Leap_42.3_Update
commit aedb43e80ff3ebc592956d3524f38bffc2daf3ef
Author: Ken Gaillot <kgaillot@redhat.com>
Date: Mon Oct 9 16:47:28 2017 -0500
Low: libcib: ensure xpath result isn't empty
Shouldn't be possible, but makes static analysis happy
diff --git a/lib/cib/cib_attrs.c b/lib/cib/cib_attrs.c
index 02d1f65e0..8287a44aa 100644
--- a/lib/cib/cib_attrs.c
+++ b/lib/cib/cib_attrs.c
@@ -416,6 +416,7 @@ get_uuid_from_result(xmlNode *result, char **uuid, int *is_remote)
tag = (const char *) (result->name);
if (safe_str_eq(tag, "xpath-query")) {
result = __xml_first_child(result);
+ CRM_CHECK(result != NULL, return rc);
tag = (const char *) (result->name);
}