From: Michael Jerris Date: Tue, 13 Jun 2006 21:41:16 +0000 (+0000) Subject: fix off by 1 in console cmd handling. Thanks trixter for identifying this. X-Git-Tag: v1.0-beta1~2583 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a98739f2e4ab7b569113e99f5f83d4277ce88be;p=thirdparty%2Ffreeswitch.git fix off by 1 in console cmd handling. Thanks trixter for identifying this. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1616 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/switch_console.c b/src/switch_console.c index 4a60cb15c6..880c3e1448 100644 --- a/src/switch_console.c +++ b/src/switch_console.c @@ -198,7 +198,7 @@ SWITCH_DECLARE(void) switch_console_loop(void) } memset(&cmd, 0, sizeof(cmd)); - for (x = 0; x < sizeof(cmd); x++) { + for (x = 0; x < (sizeof(cmd)-1); x++) { cmd[x] = (char) getchar(); if (cmd[x] == '\n') { cmd[x] = '\0';