PREfast Warning 201 (Windows CE 5.0)
201 - Buffer overrun for stack buffer <variable>.
Additional Information: Index exceeds maximum valid index.
This warning indicates that an integer offset into the specified stack array exceeds the maximum bounds of that array.
This defect can result in random behavior or crashes.
One common cause of this defect is using an array's size as an index into the array. Because C/C++ array indexing is zero based, the maximum legal index into an array is one less than the size.
Another common cause for the defect is cut-and-paste errors.
Example
Defective Source
char buff[25];
buff[sizeof buff] = '\0'; // Generates error.
Corrected Source
char buff[25];
buff[sizeof buff - 1] = '\0';
Send Feedback on this topic to the authors