MediaTek interview question

How to prevent buffer overflow attacks?