Abstract: An unauthorized access relating to buffer overflow is prevented reliably and easily, without dependence on the function that a CPU processes. An information device (1) performs data processing in cooperation with a central control unit and each program code developed in a memory; performs a hook process to detect a time when the program code is called; and performs a stack layout check process to sequentially acquire a return address of each program code developed in a RAM (30), detect an unauthorized access on the basis of a destination address indicated by the acquired return address, and stop the data processing when an unauthorized access is detected.