[Asterisk-code-review] config.c: parsing_extconfig.conf (...asterisk[16])
Christian Savinovich
asteriskteam at digium.com
Thu Apr 4 16:07:00 CDT 2019
Christian Savinovich has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/11230
Change subject: config.c: parsing_extconfig.conf
......................................................................
config.c: parsing_extconfig.conf
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. An "if" was introduced, and if null or blank a
warning is printed and line is skipped.
Change-Id: Id76b452d8f330d11c2742c37232761ad71472a8b
---
M main/config.c
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/30/11230/1
diff --git a/main/config.c b/main/config.c
index f694c2b..1c5262d 100644
--- a/main/config.c
+++ b/main/config.c
@@ -2902,6 +2902,10 @@
for (v = ast_variable_browse(config, "settings"); v; v = v->next) {
char buf[512];
ast_copy_string(buf, v->value, sizeof(buf));
+ if (!strstr(buf,",") || !strlen(buf)) {
+ ast_log(LOG_WARNING,"extconfig.conf: value '%s' ignored due to wrong format\n", v->value);
+ continue;
+ }
stringp = buf;
driver = strsep(&stringp, ",");
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11230
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: Id76b452d8f330d11c2742c37232761ad71472a8b
Gerrit-Change-Number: 11230
Gerrit-PatchSet: 1
Gerrit-Owner: Christian Savinovich <csavinovich at digium.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190404/6a159492/attachment.html>
More information about the asterisk-code-review
mailing list