File pacemaker-crmd-avoid-assert-LRM-query-fails.patch of Package pacemaker.14737
commit 3cfad107985ab8d84e7c5569b30f81227595036e
Author: Ken Gaillot <kgaillot@redhat.com>
Date: Thu Sep 21 15:40:45 2017 -0500
Low: crmd: avoid assert if LRM query fails
diff --git a/crmd/lrm.c b/crmd/lrm.c
index 5b80056b1..5b2b5a153 100644
--- a/crmd/lrm.c
+++ b/crmd/lrm.c
@@ -846,12 +846,15 @@ do_lrm_query(gboolean is_replace, const char *node_name)
xml_state = do_lrm_query_internal(lrm_state,
node_update_cluster|node_update_peer);
- /* In case this function is called to generate a join confirmation to
- * send to the DC, force the current and expected join state to member.
- * This isn't necessary for newer DCs but is backward compatible.
- */
- crm_xml_add(xml_state, XML_NODE_JOIN_STATE, CRMD_JOINSTATE_MEMBER);
- crm_xml_add(xml_state, XML_NODE_EXPECTED, CRMD_JOINSTATE_MEMBER);
+ if (xml_state) {
+ /* @COMPAT DC <1.1.8
+ * In case this function is called to generate a join confirmation to
+ * send to the DC, force the current and expected join state to member.
+ * This isn't necessary for newer DCs but is backward compatible.
+ */
+ crm_xml_add(xml_state, XML_NODE_JOIN_STATE, CRMD_JOINSTATE_MEMBER);
+ crm_xml_add(xml_state, XML_NODE_EXPECTED, CRMD_JOINSTATE_MEMBER);
+ }
return xml_state;
}