mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
unpoison header before touching
This header is poisoned to detect unintentional buffer overrun. However in this (and forthcoming) function, we are intentionally looking at the header. We have to unpoison before anything.
This commit is contained in:
parent
40b5f2b85d
commit
1aa05fddd8
1 changed files with 3 additions and 0 deletions
|
@ -780,6 +780,9 @@ clear_marked_index(struct transient_heap_block* block)
|
|||
|
||||
while (marked_index != TRANSIENT_HEAP_ALLOC_MARKING_LAST) {
|
||||
struct transient_alloc_header *header = alloc_header(block, marked_index);
|
||||
/* header is poisoned to prevent buffer overflow, should
|
||||
* unpoison first... */
|
||||
unpoison_memory_region(header, sizeof *header, false);
|
||||
TH_ASSERT(marked_index != TRANSIENT_HEAP_ALLOC_MARKING_FREE);
|
||||
if (0) fprintf(stderr, "clear_marked_index - block:%p mark_index:%d\n", (void *)block, marked_index);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue