File pacemaker-crm_mon-CRM_notify_recipient-null.patch of Package pacemaker.3577

commit ee43de927d08865764f1d0383aece9ac9b2bc61a
Author: Nate Clark <nate@neworld.us>
Date:   Tue Aug 30 14:54:41 2016 -0400

    Fix: crm_mon: Do not call setenv with null value
    
    setenv can cause a segfault if the value passed to it is NULL. Only set CRM_notify_recipient if
    external_recipient is not NULL.

diff --git a/tools/crm_mon.c b/tools/crm_mon.c
index b180cc4..8087212 100644
--- a/tools/crm_mon.c
+++ b/tools/crm_mon.c
@@ -3583,7 +3583,9 @@ send_custom_trap(const char *node, const char *rsc, const char *task, int target
     if(rsc) {
         setenv("CRM_notify_rsc", rsc, 1);
     }
-    setenv("CRM_notify_recipient", external_recipient, 1);
+    if (external_recipient) {
+        setenv("CRM_notify_recipient", external_recipient, 1);
+    }
     setenv("CRM_notify_node", node, 1);
     setenv("CRM_notify_task", task, 1);
     setenv("CRM_notify_desc", desc, 1);
openSUSE Build Service is sponsored by