projects
/
mit-scheme.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
30d140e
)
Unfix the fix for an off-by-zero.
author
Taylor R Campbell
<campbell@mumble.net>
Wed, 7 Nov 2018 02:39:25 +0000
(
02:39
+0000)
committer
Taylor R Campbell
<campbell@mumble.net>
Wed, 7 Nov 2018 02:39:25 +0000
(
02:39
+0000)
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.
src/microcode/prchacha.c
patch
|
blob
|
history
diff --git
a/src/microcode/prchacha.c
b/src/microcode/prchacha.c
index 1bfa74fe49ef7e002dc0e28764fb43e98839eccd..bc77900f175f421692aa97b6ab4eaa97dc0fef46 100644
(file)
--- 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)));