Skip to content

Commit

Permalink
umm_malloc: print block start address before heap corruption callback…
Browse files Browse the repository at this point in the history
… is triggered
  • Loading branch information
igrr committed May 10, 2016
1 parent 4b3c36b commit 5b264af
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cores/esp8266/umm_malloc/umm_malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,13 +841,15 @@ static int check_poison_block( umm_block *pblock ) {

pc_cur = pc + sizeof(UMM_POISONED_BLOCK_LEN_TYPE);
if (!check_poison(pc_cur, UMM_POISON_SIZE_BEFORE, "before")) {
printf("block start: %08x\n", pc + sizeof(UMM_POISONED_BLOCK_LEN_TYPE) + UMM_POISON_SIZE_BEFORE);
UMM_HEAP_CORRUPTION_CB();
ok = 0;
goto clean;
}

pc_cur = pc + *((UMM_POISONED_BLOCK_LEN_TYPE *)pc) - UMM_POISON_SIZE_AFTER;
if (!check_poison(pc_cur, UMM_POISON_SIZE_AFTER, "after")) {
printf("block start: %08x\n", pc + sizeof(UMM_POISONED_BLOCK_LEN_TYPE) + UMM_POISON_SIZE_BEFORE);
UMM_HEAP_CORRUPTION_CB();
ok = 0;
goto clean;
Expand Down

0 comments on commit 5b264af

Please sign in to comment.