[asterisk-commits] russell: branch 1.4 r139213 - /branches/1.4/apps/app_chanspy.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Aug 20 17:14:36 CDT 2008
Author: russell
Date: Wed Aug 20 17:14:35 2008
New Revision: 139213
URL: http://svn.digium.com/view/asterisk?view=rev&rev=139213
Log:
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
Modified:
branches/1.4/apps/app_chanspy.c
Modified: branches/1.4/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_chanspy.c?view=diff&rev=139213&r1=139212&r2=139213
==============================================================================
--- branches/1.4/apps/app_chanspy.c (original)
+++ branches/1.4/apps/app_chanspy.c Wed Aug 20 17:14:35 2008
@@ -555,7 +555,7 @@
int igrp = !mygroup;
char *groups[25];
int num_groups = 0;
- char *dup_group;
+ char dup_group[512];
int x;
char *s;
@@ -587,7 +587,7 @@
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,
sizeof(groups) / sizeof(groups[0]));
}
More information about the asterisk-commits
mailing list