File pacemaker-libpengine-child-use-of-null.patch of Package pacemaker.14737
commit cd4bdbf9db8c7efc240a1b30d1a8fe012a59137e
Author: Ken Gaillot <kgaillot@redhat.com>
Date: Fri Sep 30 14:19:48 2016 -0500
Fix: libpengine: ensure child is not null before looking up value
Not necessary with current callers, but it's more robust, and
avoids a static analyzer warning.
diff --git a/lib/pengine/clone.c b/lib/pengine/clone.c
index 3ed0337..6604a29 100644
--- a/lib/pengine/clone.c
+++ b/lib/pengine/clone.c
@@ -318,7 +318,7 @@ configured_role_str(resource_t * rsc)
const char *target_role = g_hash_table_lookup(rsc->meta,
XML_RSC_ATTR_TARGET_ROLE);
- if (target_role == NULL) {
+ if ((target_role == NULL) && rsc->children && rsc->children->data) {
target_role = g_hash_table_lookup(((resource_t*)rsc->children->data)->meta,
XML_RSC_ATTR_TARGET_ROLE);
}