]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Correct out-of-bounds array access in basic_ncsa_auth helper
authorFrancesco Chemolli <kinkie@squid-cache.org>
Thu, 15 Nov 2012 22:26:23 +0000 (23:26 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Thu, 15 Nov 2012 22:26:23 +0000 (23:26 +0100)
helpers/basic_auth/NCSA/basic_ncsa_auth.cc

index 1425db85d93d22fcbe0a0e9cf4124519f10580ad..7ce42f8b002be6308b28673ec48f6ef8633ed6ee 100644 (file)
@@ -85,7 +85,7 @@ read_passwd_file(const char *passwdfile)
         exit(1);
     }
     unsigned int lineCount = 0;
-    buf[sizeof(buf)] = '\0';
+    buf[HELPER_INPUT_BUFFER-1] = '\0';
     while (fgets(buf, sizeof(buf)-1, f) != NULL) {
         ++lineCount;
         if ((buf[0] == '#') || (buf[0] == ' ') || (buf[0] == '\t') ||