mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
"misdn show config" segfaults asterisk, if no MSN lists
(closes issue #14976) Reported by: alecdavis Patches: misdn_config.diff.txt uploaded by alecdavis (license 585) Tested by: alecdavis, FabienToune git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@193262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -798,7 +798,9 @@ void misdn_cfg_get_config_string (int port, enum misdn_cfg_elements elem, char*
|
||||
for (; iter; iter = iter->next) {
|
||||
strncat(tempbuf, iter->msn, sizeof(tempbuf) - strlen(tempbuf) - 1);
|
||||
}
|
||||
tempbuf[strlen(tempbuf)-2] = 0;
|
||||
if (strlen(tempbuf) > 1) {
|
||||
tempbuf[strlen(tempbuf)-2] = 0;
|
||||
}
|
||||
}
|
||||
snprintf(buf, bufsize, " -> msns: %s", *tempbuf ? tempbuf : "none");
|
||||
break;
|
||||
|
Reference in New Issue
Block a user