зеркало из https://github.com/github/ruby.git
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:
Родитель
40b5f2b85d
Коммит
1aa05fddd8
|
@ -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);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче