]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
cel_manager: Don't crash if configuration file is invalid.
authorJoshua Colp <jcolp@digium.com>
Wed, 15 Jan 2014 16:34:45 +0000 (16:34 +0000)
committerJoshua Colp <jcolp@digium.com>
Wed, 15 Jan 2014 16:34:45 +0000 (16:34 +0000)
The cel_manager module did not properly handle the case where the
configuration file was invalid. The module will now output a warning
message and disable itself if this occurs.

Reported by: Bryan Walters

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@405581 65c4cc65-6c06-0410-ace0-fbb531ad65f3

cel/cel_manager.c

index 76ca48bbb72b602e9a76ff1bd7acfbbe5d857bea..c173d2cbad4a4e1d7f5f7a68d4fc03f342f61105 100644 (file)
@@ -128,7 +128,12 @@ static int load_config(int reload)
                return 0;
        }
 
-       if (!cfg) {
+       if (cfg == CONFIG_STATUS_FILEINVALID) {
+               ast_log(LOG_WARNING, "Configuration file '%s' is invalid. CEL manager Module not activated.\n",
+                       CONF_FILE);
+               enablecel = 0;
+               return -1;
+       } else if (!cfg) {
                ast_log(LOG_WARNING, "Failed to load configuration file. CEL manager Module not activated.\n");
                enablecel = 0;
                return -1;