]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
config.c: Fix a crash in extconfig parsing
authorChris-Savinovich <csavinovich@digium.com>
Thu, 4 Apr 2019 21:02:42 +0000 (16:02 -0500)
committerChristian Savinovich <csavinovich@digium.com>
Fri, 5 Apr 2019 21:41:50 +0000 (15:41 -0600)
When extconfig.conf file is parsed, the code previously searched for
character comma without verifying if error (null or blank).  This caused
a segmentation error.

Change-Id: Id76b452d8f330d11c2742c37232761ad71472a8b

main/config.c

index d864af2e097ff01ca2c9986526ab3982eae6d6ac..0267979e8c3a7df78e5964be7ddb29c46d288c29 100644 (file)
@@ -2913,7 +2913,10 @@ int read_config_maps(void)
                ast_copy_string(buf, v->value, sizeof(buf));
                stringp = buf;
                driver = strsep(&stringp, ",");
-
+               if (!stringp) {
+                       ast_log(LOG_WARNING, "extconfig.conf: value '%s' ignored due to wrong format\n", v->value);
+                       continue;
+               }
                if ((tmp = strchr(stringp, '\"')))
                        stringp = tmp;