File pacemaker-crmd-avoid-core-dump-if-remote-connection-doesnt-exist.patch of Package pacemaker.14737
commit b4834b881666620b2530875fa43d39c08ae0fb1d
Author: Ken Gaillot <kgaillot@redhat.com>
Date: Thu Mar 1 11:05:21 2018 -0600
Low: crmd: avoid core dump if remote connection doesn't exist
do_lrm_invoke() calls synthesize_lrmd_failure() with a NULL lrm_state if asked
to perform an operation on a remote node that has never been connected locally.
Previously, this would cause a null dereference in construct_op(). Now,
construct_op() handles the situation reasonably.
Index: pacemaker/crmd/lrm.c
===================================================================
--- pacemaker.orig/crmd/lrm.c
+++ pacemaker/crmd/lrm.c
@@ -1950,7 +1950,11 @@ construct_op(lrm_state_t * lrm_state, xm
op->params = params;
} else {
- rsc_history_t *entry = g_hash_table_lookup(lrm_state->resource_history, rsc_id);
+ rsc_history_t *entry = NULL;
+
+ if (lrm_state) {
+ entry = g_hash_table_lookup(lrm_state->resource_history, rsc_id);
+ }
/* If we do not have stop parameters cached, use
* whatever we are given */