aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-20 22:17:44 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-20 22:17:44 +0000
commit2bec1768de2e2b5a3d24632592e551242550fee2 (patch)
treefffcf5f10518018f9cd7321d3a6b8849d322a96f /apps
parent6be7a13c164cc5ac90ed4a274f523469a9496e14 (diff)
Merged revisions 139215 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r139215 | russell | 2008-08-20 17:16:36 -0500 (Wed, 20 Aug 2008) | 19 lines Merged revisions 139213 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r139213 | russell | 2008-08-20 17:14:35 -0500 (Wed, 20 Aug 2008) | 11 lines Fix a crash in the ChanSpy application. The issue here is that if you call ChanSpy and specify a spy group, and sit in the application long enough looping through the channel list, you will eventually run out of stack space and the application with exit with a seg fault. The backtrace was always inside of a harmless snprintf() call, so it was tricky to track down. However, it turned out that the call to snprintf() was just the biggest stack consumer in this code path, so it would always be the first one to hit the boundary. (closes issue #13338) Reported by: ruddy ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@139216 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_chanspy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index b2cb3defa..9d606ec7b 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -613,7 +613,7 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
int igrp = !mygroup;
char *groups[25];
int num_groups = 0;
- char *dup_group;
+ char dup_group[512];
int x;
char *s;
char *buffer;
@@ -650,7 +650,7 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
if (mygroup) {
if ((group = pbx_builtin_getvar_helper(peer, "SPYGROUP"))) {
- dup_group = ast_strdupa(group);
+ ast_copy_string(dup_group, group, sizeof(dup_group));
num_groups = ast_app_separate_args(dup_group, ':', groups,
ARRAY_LEN(groups));
}