Pergunta

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?

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top