From: Russell Bryant Date: Fri, 1 Feb 2008 17:27:02 +0000 (+0000) Subject: off by one error X-Git-Tag: 1.4.19~215 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aa58033acbb948d4df24500158eb5b998cb2dbc5;p=thirdparty%2Fasterisk.git off by one error git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101820 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_authenticate.c b/apps/app_authenticate.c index c7a0618290..b6ccffce54 100644 --- a/apps/app_authenticate.c +++ b/apps/app_authenticate.c @@ -170,8 +170,8 @@ static int auth_exec(struct ast_channel *chan, void *data) fgets(buf, sizeof(buf), f); if (!feof(f) && !ast_strlen_zero(buf)) { size_t len = strlen(buf); - if (buf[len] == '\n') - buf[len] = '\0'; + if (buf[len - 1] == '\n') + buf[len - 1] = '\0'; if (ast_test_flag(&flags,OPT_MULTIPLE)) { md5secret = strchr(buf, ':'); if (md5secret == NULL)