Commit 2711a80
committed
Fix out of bounds access in the C code
A compiler warning flagged this one: the global array relatorSelection has
length 5, but the code tried to access `relatorSelection[5]` which would be
the 6th element, as C uses 0-based indexing.
Upon inspecting the code, it also became clear that `relatorSelection[3]`
never is accessed, and that access to `relatorSelection[4]` and
`relatorSelection[5]` only occur together, in two places, and both are
used to modify `selectionPriority`.
Based on this, I believe both of those were off-by-one, and adjusted the code
accordingly1 parent e1eb3d0 commit 2711a80
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
464 | | - | |
| 464 | + | |
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
473 | | - | |
| 473 | + | |
474 | 474 | | |
475 | 475 | | |
476 | 476 | | |
| |||
640 | 640 | | |
641 | 641 | | |
642 | 642 | | |
643 | | - | |
| 643 | + | |
644 | 644 | | |
645 | 645 | | |
646 | 646 | | |
| |||
649 | 649 | | |
650 | 650 | | |
651 | 651 | | |
652 | | - | |
| 652 | + | |
653 | 653 | | |
654 | 654 | | |
655 | 655 | | |
| |||
0 commit comments