Fix out of bounds access.

key.first is a pointer, so we shouldn't use the & operator here.
CID 610870 and 610871.
Should also fix ticket #9184. At least I cannot reproduce it anymore.
This commit is contained in:
Stefano Ceccherini
2013-01-29 21:45:22 +01:00
parent 00bc40ad58
commit c0b42ec1c1
2 changed files with 2 additions and 2 deletions
@@ -501,7 +501,7 @@ size_t
MulticastStateHash::HashKey(const KeyType &key) const
{
size_t result = 0;
result = jenkins_hashword((const uint32*)&key.first,
result = jenkins_hashword((const uint32*)key.first,
sizeof(in6_addr) / sizeof(uint32), result);
result = jenkins_hashword(&key.second, 1, result);
return result;
@@ -172,7 +172,7 @@ public:
size_t HashKey(const KeyType &key) const
{
size_t result = 0;
result = jenkins_hashword((const uint32*)&key.first,
result = jenkins_hashword((const uint32*)key.first,
sizeof(in6_addr) / sizeof(uint32), result);
result = jenkins_hashword(&key.second, 1, result);
return result;