Patent ID: 8042179

Claim:
A false code execution prevention method for detecting a buffer-overflow of a memory, said buffer-overflow being that a return address stored in a stack memory area of said memory is overwritten by the execution of a false code; and for preventing an occurrence of said buffer-overflow; when a false code execution prevention program stored in a non-transitory computer-readable medium of an electronic computer is executed by a central processing unit having an architecture with a debug register; said false code execution prevention method comprising the steps of: backing up said return address; recording a memory address storing said return address in said debug register used for said debug function; and detecting a falsification of said return address using a debug function of said central processing unit, when said return address is falsified by said execution of said false code, wherein said detection of said detecting step is performed by production of an error signal by said central processing unit, when a value of said memory address registered in said debug register is falsified.