Query module ContainerLengthCmpOffByOne

name
Off-by-one comparison against container length
description
The index is compared to be less than or equal to the container length, then used in an array indexing operation that could be out of bounds.
kind
problem
problem.severity
error
precision
high
id
cs/index-out-of-bounds
tags
reliability correctness logic external/cwe/cwe-193

Imports

Guards

Provides classes for working with guarded expressions.

csharp

The default C# QL library.