From: Mark Spencer Date: Wed, 22 Sep 2004 05:19:06 +0000 (+0000) Subject: Handle arbitrary long dial sequences (like what we need at Astricon) X-Git-Tag: 1.0.0~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78531a0f32e5d3357226b8083f053e2d397d32fd;p=thirdparty%2Fasterisk.git Handle arbitrary long dial sequences (like what we need at Astricon) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3817 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_dial.c b/apps/app_dial.c index 9ffd1d5a27..7f3c3d7682 100755 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -3,9 +3,9 @@ * * Trivial application to dial a channel and send an URL on answer * - * Copyright (C) 1999, Mark Spencer + * Copyright (C) 1999-2004, Digium, Inc. * - * Mark Spencer + * Mark Spencer * * This program is free software, distributed under the terms of * the GNU General Public License @@ -411,7 +411,7 @@ static int dial_exec(struct ast_channel *chan, void *data) { int res=-1; struct localuser *u; - char info[256], *peers, *timeout, *tech, *number, *rest, *cur; + char *info, *peers, *timeout, *tech, *number, *rest, *cur; char privdb[256] = "", *s; char announcemsg[256] = "", *ann; struct localuser *outgoing=NULL, *tmp; @@ -462,10 +462,13 @@ static int dial_exec(struct ast_channel *chan, void *data) ast_log(LOG_WARNING, "Dial requires an argument (technology1/number1&technology2/number2...|optional timeout|options)\n"); return -1; } - + + if (!(info = ast_strdupa(data))) { + ast_log(LOG_WARNING, "Unable to dupe data :(\n"); + return -1; + } LOCAL_USER_ADD(u); - strncpy(info, (char *)data, sizeof(info) - 1); peers = info; if (peers) {