From a8c449fbaef566561d34a55ab42e4c1e3e22a66b Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Fri, 26 May 2006 04:22:55 +0000 Subject: [PATCH] Fix segfault if rrp_mode: MODE isn't set in configuration file. git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1047 fd59a12c-fef9-0310-b244-a6a79926bd2f --- exec/totemconfig.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/exec/totemconfig.c b/exec/totemconfig.c index 08a956b0..ac871c8f 100644 --- a/exec/totemconfig.c +++ b/exec/totemconfig.c @@ -139,6 +139,8 @@ extern int totem_config_read ( totem_config->secauth = 1; + strcpy (totem_config->rrp_mode, "none"); + objdb->object_find_reset (OBJECT_PARENT_HANDLE); if (objdb->object_find ( @@ -420,6 +422,15 @@ int totem_config_validate ( goto parse_error; } + /* + * RRP values validation + */ + if (strcmp (totem_config->rrp_mode, "none") && + strcmp (totem_config->rrp_mode, "active") && + strcmp (totem_config->rrp_mode, "passive")) { + sprintf (local_error_reason, "The RRP mode \"%s\" specified is invalid. It must be none, active, or passive.\n", totem_config->rrp_mode); + goto parse_error; + } if (totem_config->rrp_problem_count_timeout == 0) { totem_config->rrp_problem_count_timeout = RRP_PROBLEM_COUNT_TIMEOUT; }