From 915be1f6f0c50f81f50630be8acb61959a957e7e Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 1 Dec 2018 14:13:51 +0000 Subject: [PATCH] testbn: add a missing initialisation in argument setup. The code that parses hexadecimal test arguments out of test lines writes them into a buffer in binary form, and sets ptrs[i] to be the starting point of each argument. The idea is that ptrs[i+1]-ptrs[i] is the length of each argument - but for that to apply to the _final_ argument, we need to have set one final element in ptrs[], which I forgot to do. --- testbn.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/testbn.c b/testbn.c index 364f704a..32b1b77c 100644 --- a/testbn.c +++ b/testbn.c @@ -90,6 +90,9 @@ int main(int argc, char **argv) } } + if (ptrnum < lenof(ptrs)) + ptrs[ptrnum] = q; + if (!strcmp(buf, "mul")) { Bignum a, b, c, p;