Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rb_str_hash(): Avoid UB with making misaligned pointer
Previously, on common platforms, this code made a pointer to a union of 8 byte alignment out of a char pointer that is not guaranteed to satisfy the alignment requirement. That is undefined behavior according to [C99 6.3.2.3p7](https://port70.net/~nsz/c/c99/n1256.html#6.3.2.3p7). Use memcpy() to do the unaligned read instead.
- Loading branch information