[Asterisk-cvs] asterisk/apps app_chanisavail.c,1.3.2.1,1.3.2.2
citats at lists.digium.com
citats at lists.digium.com
Tue Mar 2 12:59:19 CST 2004
Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv18372/apps
Modified Files:
Tag: v1-0_stable
app_chanisavail.c
Log Message:
Fix app_chanisavail.c when passed string is big (bug #1139)
Index: app_chanisavail.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_chanisavail.c,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -u -d -r1.3.2.1 -r1.3.2.2
--- app_chanisavail.c 29 Feb 2004 18:32:03 -0000 1.3.2.1
+++ app_chanisavail.c 2 Mar 2004 17:49:52 -0000 1.3.2.2
@@ -38,9 +38,9 @@
static char *descrip =
" ChanIsAvail(Technology/resource[&Technology2/resource2...]): \n"
"Checks is any of the requested channels are available. If none\n"
-"of the requested channels are available the new priority will\n"
-"be n+101 (unless such a priority does not exist, in which case\n"
-"ChanIsAvail will return -1. If any of the requested channels\n"
+"of the requested channels are available the new priority will be\n"
+"n+101 (unless such a priority does not exist or on error, in which\n"
+"case ChanIsAvail will return -1). If any of the requested channels\n"
"are available, the next priority will be n+1, the channel variable\n"
"${AVAILCHAN} will be set to the name of the available channel and\n"
"the ChanIsAvail app will return 0.\n";
@@ -53,7 +53,7 @@
{
int res=-1;
struct localuser *u;
- char info[256], *peers, *tech, *number, *rest, *cur;
+ char info[512], *peers, *tech, *number, *rest, *cur;
struct ast_channel *tempchan;
if (!data) {
@@ -62,7 +62,7 @@
}
LOCAL_USER_ADD(u);
- strncpy(info, (char *)data, strlen((char *)data) + AST_MAX_EXTENSION-1);
+ strncpy(info, (char *)data, sizeof(info)-1);
peers = info;
if (peers) {
cur = peers;
More information about the svn-commits
mailing list