diff options
author | Russell Bryant <russell@russellbryant.com> | 2008-12-28 15:15:14 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2008-12-28 15:15:14 +0000 |
commit | e697dfb43f4d99c13be84ddeb800a1ff98b32642 (patch) | |
tree | 75651e7f85bd78968eb882fec03b85ad5ecb09b8 | |
parent | 8664b9111a6a54f35a957304dcb46eb6ea27f769 (diff) |
Merged revisions 166772 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r166772 | russell | 2008-12-28 09:13:48 -0600 (Sun, 28 Dec 2008) | 4 lines
Use strncat() instead of an sprintf() in which source and target buffers overlap
http://lists.digium.com/pipermail/asterisk-dev/2008-December/035919.html
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@166773 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | channels/misdn_config.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/channels/misdn_config.c b/channels/misdn_config.c index 29723e17c..0a7109276 100644 --- a/channels/misdn_config.c +++ b/channels/misdn_config.c @@ -790,8 +790,9 @@ void misdn_cfg_get_config_string (int port, enum misdn_cfg_elements elem, char* else iter = port_cfg[0][place].ml; if (iter) { - for (; iter; iter = iter->next) - sprintf(tempbuf, "%s%s, ", tempbuf, iter->msn); + for (; iter; iter = iter->next) { + strncat(tempbuf, iter->msn, sizeof(tempbuf) - strlen(tempbuf) - 1); + } tempbuf[strlen(tempbuf)-2] = 0; } snprintf(buf, bufsize, " -> msns: %s", *tempbuf ? tempbuf : "none"); |