Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If we stay in 0. vt, and press shift+prnt_scr, then we dropped to 3. console. Proof: -- op@robot /tmp> cat foo.c #include <stdio.h> #define MOD 12U int main(int argc, char **argv) { int c=0; printf("not fixed: \n"); for (int i=0; i<7; i++) { c = (c - 1) % MOD; printf("%d\n", c); } printf("fixed: \n"); for (int i=0; i<7; i++) { c = (c - 1 + MOD) % MOD; printf("%d\n", c); } return (0); } op@robot /tmp> ./foo not fixed: 3 2 1 0 3 2 1 fixed: 0 11 10 9 8 7 6 -- If the MOD in proof is not unsigned, then this mod leads to arr[-1] access. Signed-off-by: Oliver Pinter <oliver.pinter@hardenedbsd.org> CC: Aleksandr Rybalko <ray@freebsd.org>
- Loading branch information