From 8d74401e871831a814afc66a498d8461efa8d0fb Mon Sep 17 00:00:00 2001 From: Romain Tartiere Date: Sat, 18 Dec 2010 01:44:20 +0000 Subject: [PATCH] Enlarge another buffer to workaround the read_data() buffer overrun. --- test/test_mifare_desfire_ev1_aes.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_mifare_desfire_ev1_aes.c b/test/test_mifare_desfire_ev1_aes.c index f0b6bf1..993a826 100644 --- a/test/test_mifare_desfire_ev1_aes.c +++ b/test/test_mifare_desfire_ev1_aes.c @@ -654,7 +654,7 @@ test_mifare_desfire_ev1_aes (void) for (int transaction = 0; transaction < 50; transaction++) { char data_buffer[100]; - char read_buffer[100]; + char read_buffer[100+20]; // XXX uint8_t cs = transaction % 3; if (cs == 2) cs++; @@ -699,7 +699,7 @@ test_mifare_desfire_ev1_aes (void) cut_assert_equal_int (-1, n, cut_message ("Wrong return value")); } else { cut_assert_equal_int (100, n, cut_message ("Wrong return value")); - cut_assert_not_equal_memory (data_buffer, sizeof (data_buffer), read_buffer, sizeof (read_buffer), cut_message ("Wrong data")); + cut_assert_not_equal_memory (data_buffer, sizeof (data_buffer), read_buffer, 100, cut_message ("Wrong data")); } } else { res = mifare_desfire_commit_transaction (tag); @@ -707,7 +707,7 @@ test_mifare_desfire_ev1_aes (void) ssize_t n = mifare_desfire_read_records (tag, 6, 0, 1, read_buffer); cut_assert_equal_int (100, n, cut_message ("Wrong return value")); - cut_assert_equal_memory (data_buffer, sizeof (data_buffer), read_buffer, sizeof (read_buffer), cut_message ("Wrong data")); + cut_assert_equal_memory (data_buffer, sizeof (data_buffer), read_buffer, 100, cut_message ("Wrong data")); } }