]> 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)
committerChris-Savinovich <csavinovich@digium.com>
Fri, 5 Apr 2019 21:40:23 +0000 (16:40 -0500)
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 f694c2bd8c6bda8f3a082e5fe2fb19e1e259eeea..5660fbe963e39f785bf75b1093faebfc0220ffba 100644 (file)
@@ -2904,7 +2904,10 @@ static int reload_module(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;