[haiku-commits] haiku: hrev45220 - src/add-ons/kernel/network/protocols/ipv6

  • From: stefano.ceccherini@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 29 Jan 2013 21:45:41 +0100 (CET)

hrev45220 adds 1 changeset to branch 'master'
old head: 00bc40ad588f4bd59cd7574788b5dc111b62198a
new head: c0b42ec1c191f7934d2960efda9047384461ff1f
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=c0b42ec+%5E00bc40a

----------------------------------------------------------------------------

c0b42ec: 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.

                       [ Stefano Ceccherini <stefano.ceccherini@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev45220
Commit:      c0b42ec1c191f7934d2960efda9047384461ff1f
URL:         http://cgit.haiku-os.org/haiku/commit/?id=c0b42ec
Author:      Stefano Ceccherini <stefano.ceccherini@xxxxxxxxx>
Date:        Tue Jan 29 20:42:14 2013 UTC

Ticket:      https://dev.haiku-os.org/ticket/9184

----------------------------------------------------------------------------

2 files changed, 2 insertions(+), 2 deletions(-)
src/add-ons/kernel/network/protocols/ipv6/ipv6.cpp    | 2 +-
src/add-ons/kernel/network/protocols/ipv6/multicast.h | 2 +-

----------------------------------------------------------------------------

diff --git a/src/add-ons/kernel/network/protocols/ipv6/ipv6.cpp 
b/src/add-ons/kernel/network/protocols/ipv6/ipv6.cpp
index 0a5120f..76a5ec5 100644
--- a/src/add-ons/kernel/network/protocols/ipv6/ipv6.cpp
+++ b/src/add-ons/kernel/network/protocols/ipv6/ipv6.cpp
@@ -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;
diff --git a/src/add-ons/kernel/network/protocols/ipv6/multicast.h 
b/src/add-ons/kernel/network/protocols/ipv6/multicast.h
index 9b3915d..4583d20 100644
--- a/src/add-ons/kernel/network/protocols/ipv6/multicast.h
+++ b/src/add-ons/kernel/network/protocols/ipv6/multicast.h
@@ -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;


Other related posts:

  • » [haiku-commits] haiku: hrev45220 - src/add-ons/kernel/network/protocols/ipv6 - stefano . ceccherini