diff options
-rw-r--r-- | include/jemalloc/internal/safety_check.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/jemalloc/internal/safety_check.h b/include/jemalloc/internal/safety_check.h index 1b53fc4..53339ac 100644 --- a/include/jemalloc/internal/safety_check.h +++ b/include/jemalloc/internal/safety_check.h @@ -9,7 +9,7 @@ JEMALLOC_ALWAYS_INLINE void safety_check_set_redzone(void *ptr, size_t usize, size_t bumped_usize) { assert(usize < bumped_usize); for (size_t i = usize; i < bumped_usize && i < usize + 32; ++i) { - *((unsigned char *)ptr + usize) = 0xBC; + *((unsigned char *)ptr + i) = 0xBC; } } @@ -17,7 +17,7 @@ JEMALLOC_ALWAYS_INLINE void safety_check_verify_redzone(const void *ptr, size_t usize, size_t bumped_usize) { for (size_t i = usize; i < bumped_usize && i < usize + 32; ++i) { - if (unlikely(*((unsigned char *)ptr + usize) != 0xBC)) { + if (unlikely(*((unsigned char *)ptr + i) != 0xBC)) { safety_check_fail("Use after free error\n"); } } |