[PATCH] [CTDB] CID 1435726: NULL pointer dereference

Swen Schillig swen at vnet.ibm.com
Fri May 25 07:34:15 UTC 2018


Please review and push if happy.

Cheers Swen
-------------- next part --------------
From 2b760a98487dc7bb1e8b4f3ef079b46c81706664 Mon Sep 17 00:00:00 2001
From: Swen Schillig <swen at vnet.ibm.com>
Date: Fri, 25 May 2018 08:42:43 +0200
Subject: [PATCH] [CTDB] CID 1435726: NULL pointer dereference

Signed-off-by: Swen Schillig <swen at vnet.ibm.com>
---
 ctdb/cluster/cluster_conf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ctdb/cluster/cluster_conf.c b/ctdb/cluster/cluster_conf.c
index 540732d5b91..6a8676e9b8f 100644
--- a/ctdb/cluster/cluster_conf.c
+++ b/ctdb/cluster/cluster_conf.c
@@ -38,7 +38,8 @@ static bool check_static_string_change(const char *key,
 				       enum conf_update_mode mode)
 {
 	if (mode == CONF_MODE_RELOAD) {
-		if (strcmp(old_value, new_value) != 0) {
+		if (!(old_value && new_value) ||
+		    (strcmp(old_value, new_value) != 0)) {
 			D_WARNING("Ignoring update of [%s] -> %s\n",
 				  CLUSTER_CONF_SECTION,
 				  key);
-- 
2.14.3



More information about the samba-technical mailing list