Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix getblock integer overflow for buffers over 16GB in size #34

Merged
merged 2 commits into from
Mar 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions MurmurHash3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ inline uint64_t rotl64(uint64_t x, int8_t r) {
// Block read - if your platform needs to do endian-swapping or can only
// handle aligned reads, do the conversion here

FORCE_INLINE uint32_t getblock(const uint32_t *p, int i) { return p[i]; }
FORCE_INLINE uint32_t getblock(const uint32_t *p, Py_ssize_t i) { return p[i]; }

FORCE_INLINE uint64_t getblock(const uint64_t *p, int i) { return p[i]; }
FORCE_INLINE uint64_t getblock(const uint64_t *p, Py_ssize_t i) { return p[i]; }

//-----------------------------------------------------------------------------
// Finalization mix - force all bits of a hash block to avalanche
Expand Down