Question

Is it possible for a stack buffer overflow to cause heap corruption issues without overflowing the return address? If so, can you think of an example?

Was it helpful?

Solution

Whether it can cause heap corruption depends a lot on the platform.

But say for example that a buffer overflow overwrites a pointer variable so that it gets a new value that happens to be a different, but valid pointer. If the code then goes on to free said pointer (not knowing it is now something else) then the code that references this pointer could crash or behave erratically because the memory has been prematurely freed and possibly reallocated for a different purpose.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top