What is stack corruption?

In a process, a stack is used to store local data of a function, to back up local data during function calls, and to store return addresses and return values. Stack corruption usually occurs when:

  • an array is read beyond its allocated space, 

  • a loose pointer ends up pointing to a location in the stack,

  • a return address gets corrupted during a function call.

Get hands-on with 1200+ tech skills courses.