Just learned this last week. The c language malloc() function stores its internal data adjacent to the memory it allocates for the user. So what happens when you write more data into the allocated memory than it can hold it'll blast malloc's internal data. From that point on malloc() will cause a segmentation fault. That bug drove me nuts til I learned that.

Same thing happens with a c++ new operator. It probably calls malloc().

Heads up!