Skip to content

Commit

Permalink
Merge pull request #34 from arieleizenberg/master
Browse files Browse the repository at this point in the history
fix getblock integer overflow for buffers over 16GB in size
  • Loading branch information
hajimes authored Mar 23, 2023
2 parents 0216169 + b1c6793 commit 7c12d55
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 7c12d55

Please sign in to comment.