File pacemaker-libcluster-crm_peer_uname-invalid-uuid.patch of Package pacemaker.2980

commit f47c270a934c05a73e71bc9528901a83f512b287
Author: Ken Gaillot <kgaillot@redhat.com>
Date:   Wed Feb 3 11:37:14 2016 -0600

    Fix: libcluster: crm_peer_uname() should return NULL if uuid is invalid
    
    Previously, it would reuse the last node from a previous iteration,
    and set its uuid to the invalid uuid.

diff --git a/lib/cluster/cluster.c b/lib/cluster/cluster.c
index f443c99..a91cad3 100644
--- a/lib/cluster/cluster.c
+++ b/lib/cluster/cluster.c
@@ -361,6 +361,16 @@ get_node_name(uint32_t nodeid)
     return name;
 }
 
+/*!
+ * \brief Get the node name corresponding to a node UUID
+ *
+ * \param[in] uuid  UUID of desired node
+ *
+ * \return name of desired node
+ *
+ * \note This relies on the remote peer cache being populated with all
+ *       remote nodes in the cluster, so callers should maintain that cache.
+ */
 const char *
 crm_peer_uname(const char *uuid)
 {
@@ -384,6 +394,7 @@ crm_peer_uname(const char *uuid)
             break;
         }
     }
+    node = NULL;
 
 #if SUPPORT_COROSYNC
     if (is_openais_cluster()) {
openSUSE Build Service is sponsored by