From: Russell Bryant Date: Thu, 13 May 2010 15:36:12 +0000 (+0000) Subject: Fix an off by one error that causes a crash. X-Git-Tag: 11.0.0-beta1~3035 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c26cd3aaacb79c8a81dcb21af6e4113f94875a60;p=thirdparty%2Fasterisk.git Fix an off by one error that causes a crash. Thanks to Raymond Burke for pointing it out. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@262897 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_console.c b/channels/chan_console.c index 6c566e9c9e..9d68e9f527 100644 --- a/channels/chan_console.c +++ b/channels/chan_console.c @@ -1196,7 +1196,7 @@ static char *cli_console_active(struct ast_cli_entry *e, int cmd, struct ast_cli return CLI_SUCCESS; } - if (!(pvt = find_pvt(a->argv[e->args]))) { + if (!(pvt = find_pvt(a->argv[e->args - 1]))) { ast_cli(a->fd, "Could not find a device called '%s'.\n", a->argv[e->args]); return CLI_FAILURE; }