ArcSoft Interview Question

How to detect the allocated memory is overwritten?