From: Taylor R Campbell Date: Wed, 7 Nov 2018 02:39:25 +0000 (+0000) Subject: Unfix the fix for an off-by-zero. X-Git-Tag: mit-scheme-pucked-10.1.2~16^2~116^2~43 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=bce218b33964481e02438ebf4471f648a2347b59;p=mit-scheme.git Unfix the fix for an off-by-zero. arg_ulong_index_integer(argno, n) takes n as _exclusive_ upper bound. In this case, n - 64 is a valid starting index. So the exclusive upper bound is n - 64 + 1 = n - 63. --- diff --git a/src/microcode/prchacha.c b/src/microcode/prchacha.c index 1bfa74fe4..bc77900f1 100644 --- a/src/microcode/prchacha.c +++ b/src/microcode/prchacha.c @@ -36,7 +36,7 @@ do_chacha_core (void (*core) (uint8_t *, const uint8_t *, const uint8_t *, if (noutput < 64) error_bad_range_arg (1); - unsigned long offset = (arg_ulong_index_integer (2, (noutput - 64))); + unsigned long offset = (arg_ulong_index_integer (2, (noutput - 64 + 1))); unsigned long ninput; const uint8_t * input = (arg_bytevector (3, (&ninput)));