From 986f2d3b128477933a5b7b647d0060fbe0873d99 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Fri, 11 Jan 2019 09:36:56 +0000 Subject: [PATCH] Fix buffer overflow in self-test. Derp. This self-test was not used; there's a separate test in test-md5.scm which is fine. (The result in this self-test is also correct -- it just never got tested anywhere.) --- src/microcode/md5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/microcode/md5.c b/src/microcode/md5.c index a9a0fe5be..c93d6697f 100644 --- a/src/microcode/md5.c +++ b/src/microcode/md5.c @@ -321,7 +321,7 @@ md5_selftest(void) md5_init(&m0); md5_update(&m0, s, i/2); - md5_update(&m0, s + i/2, i); + md5_update(&m0, s + i/2, i - i/2); md5_final(&m0, h); md5_update(&m, h, 16); } -- 2.25.1