From 8928f7f4e45884676d39421cfe4dcce69aa8f150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Olav=20Sel=C3=A5sdal?= Date: Thu, 17 Jan 2013 16:34:04 +0100 Subject: [PATCH] fix buffer overflow in test_hex --- test/test_hex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_hex.c b/test/test_hex.c index d7a111b..a3c7bc4 100644 --- a/test/test_hex.c +++ b/test/test_hex.c @@ -15,7 +15,7 @@ END_TEST START_TEST (test_uc_hex_encode_2) uint8_t binary[] = {127, 128, 129}; - char hex[4] = ""; + char hex[sizeof binary * 2 + 1] = ""; uc_hex_encode(binary, sizeof binary, hex); @@ -25,7 +25,7 @@ END_TEST START_TEST (test_uc_hex_encode_3) uint8_t binary[] = {0, 1, 9, 11}; - char hex[5] = ""; + char hex[sizeof binary * 2 + 1] = ""; uc_hex_encode(binary, sizeof binary, hex);