Blob Blame History Raw
From fdb1739356f723a4e9e4f8b52c37d193a3a5c6e3 Mon Sep 17 00:00:00 2001
From: Quentin Armitage <quentin@armitage.org.uk>
Date: Tue, 27 Nov 2018 10:57:37 +0000
Subject: [PATCH] Fix segfault when smtp alerts configured

Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
---
 keepalived/core/global_data.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/keepalived/core/global_data.c b/keepalived/core/global_data.c
index 6e872dcf..cd381d9b 100644
--- a/keepalived/core/global_data.c
+++ b/keepalived/core/global_data.c
@@ -253,7 +253,7 @@ init_global_data(data_t * data, data_t *old_global_data)
 		if (!data->smtp_connection_to)
 			set_default_smtp_connection_timeout(data);
 
-		if (strcmp(data->local_name, unknown_name)) {
+		if (data->local_name && strcmp(data->local_name, unknown_name)) {
 			if (!data->email_from)
 				set_default_email_from(data, data->local_name);
 
-- 
2.20.1