]> git.ipfire.org Git - thirdparty/squid.git/commit
Fix for valgrind-discovered trunk errors.
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Sun, 12 Jun 2016 07:44:36 +0000 (19:44 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 12 Jun 2016 07:44:36 +0000 (19:44 +1200)
commit0a132302bbe4b4cd4ac0fe757da4af6a60b77e2e
tree2735c85d1e9a3ad1265e927e7aeab52f5e0a6970
parenta023fd8e81aef584909d6a256728ba20666d3bdf
Fix for valgrind-discovered trunk errors.

During start-up, Valgrind reported many errors with a similar
message: "Use of uninitialised value of size 8...". These errors
were caused by HttpRequestMethod& parameter during private
key generation: it was used as a raw void* memory there. HttpRequestMethod
is a non-POD type and has some "padding" bytes, which are not initialized
by the constructor.

The patch simplifies private key generation by using a simple counter for this,
which is sufficient to create a unique key within a single Squid process.
Except fixing Valgrind errors, this solution saves many CPU cycles wasted on
generating MD5 hashes just to "guarantee" uniqueness within a single process.
src/store.cc
src/store_key_md5.cc
src/store_key_md5.h