Patent ID: 7631249

Claim:
In a computing system having a processor and memory which stores a stack that includes a data area for storing requests, functions, intermediate results, or other data awaiting processing, a method performed by the processor for effectively executing a stack-walk operation by dynamically accessing information about an expected location of a cookie placed on the stack by another operation and used in determining if a portion of the stack has been corrupted, the method comprising: calling a first function that executes a stack-walk operation for identifying protected data on a stack, the stack being stored in the memory of the computing system; while performing the stack-walk operation, accessing cookie location information stored in the memory for determining where a second function different from the first function placed a cookie on the stack, wherein if uncorrupted the cookie includes a known value used in determining that a portion of the stack is uncorrupted after the determined location of the cookie; based on the cookie location information, accessing corrupt data on the stack representative of the cookie; accessing a global cookie from a secure location separate from the stack for determining the known value; comparing the corrupt data with the known value for determining that memory corruption has occurred on the stack at least up to the corrupt data representative of the cookie; and upon determining that memory corruption has occurred, throwing an exception that terminates the stack-walk or terminating the process to avoid a security exploit because of the corruption.