diff options
author | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-05-08 14:51:09 +0000 |
---|---|---|
committer | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-05-08 14:51:09 +0000 |
commit | 23ec08946d536e682e170e507ecb3fe3cd65d7b5 (patch) | |
tree | 146c8fa5f0638e7dbf43dab9f4392b9a2c46b7a2 /channels | |
parent | f345cf6158851443440ecbddd8b6a5583712593f (diff) |
"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: http://svn.digium.com/svn/asterisk/branches/1.4@193262 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/misdn_config.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/misdn_config.c b/channels/misdn_config.c index e16b8fd85..71f54adcc 100644 --- a/channels/misdn_config.c +++ b/channels/misdn_config.c @@ -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; |