forked from boostorg/container_hash
Fixing UB by using memcpy instead of old style cast
[SVN r82218]
This commit is contained in:
@@ -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