Skip to content

Commit 1aa05fd

Browse files
committed
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.
1 parent 40b5f2b commit 1aa05fd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

transient_heap.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,9 @@ clear_marked_index(struct transient_heap_block* block)
780780

781781
while (marked_index != TRANSIENT_HEAP_ALLOC_MARKING_LAST) {
782782
struct transient_alloc_header *header = alloc_header(block, marked_index);
783+
/* header is poisoned to prevent buffer overflow, should
784+
* unpoison first... */
785+
unpoison_memory_region(header, sizeof *header, false);
783786
TH_ASSERT(marked_index != TRANSIENT_HEAP_ALLOC_MARKING_FREE);
784787
if (0) fprintf(stderr, "clear_marked_index - block:%p mark_index:%d\n", (void *)block, marked_index);
785788

0 commit comments

Comments
 (0)