Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
C6411
Collapse the table of content
Expand the table of content

C6411

Warning C6411: Potentially reading invalid data from the buffer.

This warning indicates that the value of the index that is used to read from the buffer can exceed the readable size of the buffer. Because the code analysis tool reports this warning when it cannot reduce a complex expression that represents the buffer size, or the index used to access the buffer, this warning might be reported in error.

The following code generates this warning.

char *a = new char[strlen(InputParam)];
delete[] a;
a[10];

The following code corrects this error.

int i = strlen(InputParam);
char *a = new char[i];
if (i > 10) a[10];
delete[] a;
Show:
© 2015 Microsoft