From a4575507c12988dc59b7f730b271fd222a79d118 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Mon, 29 Nov 2021 13:05:31 +0100 Subject: [PATCH] tests/unittests/tests-base64: enlarge test buffer for worst case --- tests/unittests/tests-base64/tests-base64.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/unittests/tests-base64/tests-base64.c b/tests/unittests/tests-base64/tests-base64.c index 80a5403907..b57f4ea74c 100644 --- a/tests/unittests/tests-base64/tests-base64.c +++ b/tests/unittests/tests-base64/tests-base64.c @@ -414,7 +414,11 @@ static void test_base64_11_urlsafe_encode_int(void) unsigned char expected_encoding[] = "-RAAAA"; size_t base64_out_size = 0; - char base64_out[sizeof(expected_encoding)]; + + /* Up to two = signs are suppressed in urlsafe encoding at the end, but + * still written in the implementation. Just allocate 2 bytes more as worst + * case */ + char base64_out[sizeof(expected_encoding) + 2]; /* * @Note: