Skip to content

Latest commit

 

History

History
35 lines (26 loc) · 908 Bytes

c6411.md

File metadata and controls

35 lines (26 loc) · 908 Bytes
description title ms.date f1_keywords ms.assetid
Learn more about: Warning C6411
Warning C6411
11/04/2016
C6411
POTENTIAL_READ_OVERRUN
6bbc1734-eec4-4ad6-9908-4ed2a5f025db

Warning C6411

Potentially reading invalid data from 'buffer'.

Remarks

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. The code analysis tool may report this warning in error. The error may occur when it can't reduce a complex expression that represents the buffer size, or the index used to access the buffer.

Code analysis name: POTENTIAL_READ_OVERRUN

Example

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;