From f07a9f80fb6f3099d75534c1e64f448d4b397931 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 14 May 2026 22:20:02 +0200 Subject: Fix minor errors in the test and check that we are not writing out of bounds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- librecrypt_decompose_chain1.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'librecrypt_decompose_chain1.c') diff --git a/librecrypt_decompose_chain1.c b/librecrypt_decompose_chain1.c index 6eece8d..6fc8a63 100644 --- a/librecrypt_decompose_chain1.c +++ b/librecrypt_decompose_chain1.c @@ -13,11 +13,13 @@ extern inline size_t librecrypt_decompose_chain1(char *hash); do {\ assert(sizeof(IN) <= sizeof(buf));\ assert(sizeof(IN) == sizeof(OUT));\ + CANARY_FILL(buf);\ stpcpy(buf, (IN));\ n = librecrypt_decompose_chain1(buf);\ EXPECT(n == (N));\ EXPECT(n == librecrypt_chain_length(IN));\ EXPECT(!memcmp(buf, (OUT), sizeof(IN)));\ + CANARY_CHECK(buf, sizeof(IN));\ } while (0) -- cgit v1.2.3-70-g09d2