From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabio M. Di Nitto Date: Wed, 23 Nov 2011 11:15:53 +0100 Subject: [Cluster-devel] [PATCH 34/41] qdiskd: avoid a potential crash in case config state is invalid In-Reply-To: <1322043360-17037-1-git-send-email-fdinitto@redhat.com> References: <1322043360-17037-1-git-send-email-fdinitto@redhat.com> Message-ID: List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Spotted by Coverify Scan Signed-off-by: Fabio M. Di Nitto --- :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