Yes, when you allocated it with sys_malloc. This contains a check against such bugs. No when it's an overwritten array, a file with wrong internal pointers, or something that you constructed with malloc().