Implemented buffer overflow protection during FLASHEVENT reading.