]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
off by one error
authorRussell Bryant <russell@russellbryant.com>
Fri, 1 Feb 2008 17:27:02 +0000 (17:27 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 1 Feb 2008 17:27:02 +0000 (17:27 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101820 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_authenticate.c

index c7a06182902063da35c7a8e3d9d76a0e2ce814d1..b6ccffce54f53fe019cac7d11fd4031f786d6633 100644 (file)
@@ -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)