Patent ID: 7380245

Claim:
A method for detecting corruption associated with a stack in a storage device, the stack encompassing a range of memory of a fixed size, the method comprising the steps of: storing a first predetermined value in a first address location immediately preceding the range of memory; storing a second predetermined value in a second address location immediately following the range of memory; detecting the occurrence of a stack operation within the stack; comparing a value in the first address location to the first predetermined value to determine if the stack operation corrupted the first predetermined value stored in the first address location, where the stack operation is determined to have corrupted the first predetermined value, restoring the first predetermined value to the first address location; comparing a value in the second address location to the second predetermined value to determine if the stack operation corrupted the second predetermined value stored in the second address location; and where the stack operation is determined to have corrupted the second predetermined value, restoring the second predetermined value to the second address location.