forked from boostorg/container_hash
Fixing UB by using memcpy instead of old style cast
[SVN r82218]
This commit is contained in:
1 parent
061e0d9d6d
commit
7e162c4f03
1 file changed
+3
-1
@@ -73,7 +73,9 @@ namespace boost
|
||||
ptr += sizeof(std::size_t);
|
||||
|
||||
while(length >= sizeof(std::size_t)) {
|
||||
hash_float_combine(seed, *(std::size_t*) ptr);
|
||||
std::size_t buffer = 0;
|
||||
std::memcpy(&buffer, ptr, sizeof(std::size_t));
|
||||
hash_float_combine(seed, buffer);
|
||||
length -= sizeof(std::size_t);
|
||||
ptr += sizeof(std::size_t);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user