Synopsis: | Array subscripting requires a pointer to object type and one or more integral subscript expressions. The indices must be within the bounds values of the (allocated) array. |
Language: | C |
Severity Level: | 1 |
Category: | Expressions |
Description: |
Justification Language constraint. To avoid memory access outside the array the index should be within the bounds of the array. Example int i; int a[6]; for (i = 0; i <= 6; i++) { a[i] = 0; /* WRONG: Index gets a value greater than the number of elements. */ } |