]> git.ipfire.org Git - thirdparty/squid.git/commit
negotiate_kerberos_auth: better bounds checking
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 18 Nov 2012 07:06:26 +0000 (00:06 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 18 Nov 2012 07:06:26 +0000 (00:06 -0700)
commitbc30ad64c005e42f71721b6538fe45442e149e8b
treed65fb49e6df01df01ca7eba6c65d595d5980dee2
parent77468ee555f93fb2d68c134da9b83877140e0785
negotiate_kerberos_auth: better bounds checking

* sysconf() may return -N values on some platforms or values larger than
  the hard-coded 1024 buffer size for hostname. Use sizeof() instead
  since the buffer is hardcoded anyway.

* also, use return instead of exit() on the test binary to reduce
  warnings from static analysis compilers.

 Detected by Coverity Scan. Issues 740392, 740484
helpers/negotiate_auth/kerberos/negotiate_kerberos_auth.cc
helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc