scwuaptx / Pwngdb

gdb for pwn
GNU General Public License v3.0
888 stars 126 forks source link

a bug of parse_heap #25

Closed matrix1001 closed 5 years ago

matrix1001 commented 5 years ago

Problem

This bug is due to a strange alignment strategy in newer version of 32 bit glibc.

In a nutshell, the first 16 bytes of heap is 0 in glibc-2.26 (32bit), glibc-2.27 (32bit).

As a result, while parsing heap, the first chunk has size 0 and trigger stop.

Fix

Fix is really easy, just ignore the first chunk if size is 0.

More

This problem was initially found when I was finishing my project HeapInspect.

Then I find that pwndbg has this problem. So does your amazing angelheap.

image

scwuaptx commented 5 years ago

Fixed. Thank you.