From: Francesco Chemolli Date: Thu, 15 Nov 2012 22:26:23 +0000 (+0100) Subject: Correct out-of-bounds array access in basic_ncsa_auth helper X-Git-Tag: SQUID_3_4_0_1~502 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2ea57237cee18ce017d5770fab3f0fbecc63714e;p=thirdparty%2Fsquid.git Correct out-of-bounds array access in basic_ncsa_auth helper --- diff --git a/helpers/basic_auth/NCSA/basic_ncsa_auth.cc b/helpers/basic_auth/NCSA/basic_ncsa_auth.cc index 1425db85d9..7ce42f8b00 100644 --- a/helpers/basic_auth/NCSA/basic_ncsa_auth.cc +++ b/helpers/basic_auth/NCSA/basic_ncsa_auth.cc @@ -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') ||