Commit ddfb44e
committed
diff: 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 683c54c commit ddfb44e
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
892 | 892 | | |
893 | 893 | | |
894 | 894 | | |
895 | | - | |
| 895 | + | |
896 | 896 | | |
897 | 897 | | |
898 | 898 | | |
| |||
0 commit comments