fix buffer overflow in test_hex

This commit is contained in:
Nils Olav Selåsdal
2013-01-17 16:34:04 +01:00
parent 7c7a09421a
commit 8928f7f4e4
+2 -2
View File
@@ -15,7 +15,7 @@ END_TEST
START_TEST (test_uc_hex_encode_2) START_TEST (test_uc_hex_encode_2)
uint8_t binary[] = {127, 128, 129}; uint8_t binary[] = {127, 128, 129};
char hex[4] = ""; char hex[sizeof binary * 2 + 1] = "";
uc_hex_encode(binary, sizeof binary, hex); uc_hex_encode(binary, sizeof binary, hex);
@@ -25,7 +25,7 @@ END_TEST
START_TEST (test_uc_hex_encode_3) START_TEST (test_uc_hex_encode_3)
uint8_t binary[] = {0, 1, 9, 11}; uint8_t binary[] = {0, 1, 9, 11};
char hex[5] = ""; char hex[sizeof binary * 2 + 1] = "";
uc_hex_encode(binary, sizeof binary, hex); uc_hex_encode(binary, sizeof binary, hex);