aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_dahdi.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-08 22:27:26 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-08 22:27:26 +0000
commitbe518614e5462c8167305f5f17f1b37382ae4a87 (patch)
treed0d0ce162d600477c58a090a1b5dc8aef301f11c /channels/chan_dahdi.c
parent1ee149bae1ae2b0b4308ad76ef1804821cf2639d (diff)
Merged revisions 147689 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r147689 | kpfleming | 2008-10-08 17:26:55 -0500 (Wed, 08 Oct 2008) | 9 lines Merged revisions 147681 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r147681 | kpfleming | 2008-10-08 17:22:09 -0500 (Wed, 08 Oct 2008) | 3 lines when parsing a text configuration option, ensure that the buffer on the stack is actually large enough to hold the legal values of that option, and also ensure that sscanf() knows to stop parsing if it would overrun the buffer (without these changes, specifying "buffers=...,immediate" would overflow the buffer on the stack, and could not have worked as expected) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@147692 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_dahdi.c')
-rw-r--r--channels/chan_dahdi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index fc7cab08d..b0cce0faf 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -13766,8 +13766,9 @@ static int process_dahdi(struct dahdi_chan_conf *confp, const char *cat, struct
return -1;
} else if (!strcasecmp(v->name, "buffers")) {
int res;
- char policy[8] = "";
- res = sscanf(v->value, "%d,%s", &confp->chan.buf_no, policy);
+ char policy[21] = "";
+
+ res = sscanf(v->value, "%d,%20s", &confp->chan.buf_no, policy);
if (res != 2) {
ast_log(LOG_WARNING, "Parsing buffers option data failed, using defaults.\n");
confp->chan.buf_no = numbufs;