Commit d4e94a2
committed
read-cache: check range before dereferencing an array element
Before accessing an array element at a given index, we should make sure
that the index is within the desired bounds, not afterwards, otherwise
it may not make sense to even access the array element in the first
place.
Pointed out by CodeQL's `cpp/offset-use-before-range-check` rule.
Signed-off-by: Johannes Schindelin <[email protected]>1 parent ddfb44e commit d4e94a2
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2686 | 2686 | | |
2687 | 2687 | | |
2688 | 2688 | | |
2689 | | - | |
2690 | | - | |
| 2689 | + | |
| 2690 | + | |
2691 | 2691 | | |
2692 | 2692 | | |
2693 | 2693 | | |
| |||
0 commit comments