aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_chanisavail.c
diff options
context:
space:
mode:
authorcitats <citats@f38db490-d61c-443f-a65b-d21fe96a405b>2004-03-02 17:49:33 +0000
committercitats <citats@f38db490-d61c-443f-a65b-d21fe96a405b>2004-03-02 17:49:33 +0000
commit5da362991df25596b7ae400ea620a88c49c6e90a (patch)
tree90cb894ca7b60078ee1e25f73d78c0aed04d4da0 /apps/app_chanisavail.c
parenta842030f76042bc19d30a3ecec26605b36531522 (diff)
Fix app_chanisavail.c when passed string is big (bug #1139)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2295 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_chanisavail.c')
-rwxr-xr-xapps/app_chanisavail.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/app_chanisavail.c b/apps/app_chanisavail.c
index 44a2a23b3..18e61b419 100755
--- a/apps/app_chanisavail.c
+++ b/apps/app_chanisavail.c
@@ -38,9 +38,9 @@ static char *synopsis = "Check if channel is available";
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 @@ static int chanavail_exec(struct ast_channel *chan, void *data)
{
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 @@ static int chanavail_exec(struct ast_channel *chan, void *data)
}
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;