Compartilhar via


PREfast Warning 203 (Windows CE 5.0)

Send Feedback

203 - Buffer overrun for buffer <variable> in call to <function>.
Additional Information: Length exceeds buffer size.This warning indicates that a parameter pointing to a non-stack buffer of known size is being passed into a function that copies more bytes into it than that size. This situation will cause a buffer overrun.

This defect can result in an exploitable security hole or a program crash.

If PREfast can determine that the mismatch between the length and size is caused confusion between character and byte count, it reports warning 57.

Example

Defective Source

static char charArray[5];
static int intArray[5];
memset ((void *)charArray, 0, sizeof intArray);

Corrected Source

static char charArray[5];
static int intArray[5];

memset ((void *)charArray, 0, sizeof charArray);

memset ((void *)charArray, 0, sizeof charArray);

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.