]> git.ipfire.org Git - thirdparty/squid.git/commit
negotiate_kerberos_auth: better bounds checking
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 24 Nov 2012 03:53:21 +0000 (20:53 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 24 Nov 2012 03:53:21 +0000 (20:53 -0700)
commit0c4eb297b9df21e0d73e0ee6ee442f34f1b15a31
tree7f02cf6ccfff93a8a38c1b64a9effc6dcf6c0ed3
parentba8866a3884c3a9e913c8f111be80fc653b72658
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