[Cluster-devel] [PATCH 34/41] qdiskd: avoid a potential crash in case config state is invalid

Fabio M. Di Nitto fdinitto at redhat.com
Wed Nov 23 10:15:53 UTC 2011


Spotted by Coverify Scan

Signed-off-by: Fabio M. Di Nitto <fdinitto at redhat.com>
---
:100644 100644 d21c209... 079af01... M	cman/qdisk/main.c
 cman/qdisk/main.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/cman/qdisk/main.c b/cman/qdisk/main.c
index d21c209..079af01 100644
--- a/cman/qdisk/main.c
+++ b/cman/qdisk/main.c
@@ -73,6 +73,7 @@ static void update_local_status(qd_ctx *ctx, node_info_t *ni, int max, int score
 static int get_config_data(qd_ctx *ctx, struct h_data *h, int maxh, int *cfh);
 static int cman_wait(cman_handle_t ch, struct timeval *_tv);
 
+static int fake_cfh = 0;
 
 static void
 int_handler(int sig)
@@ -934,7 +935,7 @@ process_cman_event(cman_handle_t handle, void *private, int reason, int arg)
 		_cman_shutdown = 1;
 		break;
 	case CMAN_REASON_CONFIG_UPDATE:
-		get_config_data(ctx, NULL, 0, NULL);
+		get_config_data(ctx, NULL, 0, &fake_cfh);
 		break;
 	case CMAN_REASON_PORTCLOSED:
 		break;
@@ -978,7 +979,7 @@ quorum_loop(qd_ctx *ctx, node_info_t *ni, int max)
 	_running = 1;
 	while (_running) {
 		if (_reconfig) {
-			get_config_data(ctx, NULL, 0, NULL);
+			get_config_data(ctx, NULL, 0, &fake_cfh);
 			_reconfig = 0;
 		}
 
-- 
1.7.4.4




More information about the Cluster-devel mailing list