From bbf8ba5a5fd7772944251c008416bf429f70c3b0 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Wed, 16 Feb 2022 16:50:53 +0100 Subject: [PATCH] emrtd: fix crash on some platforms as sprint_hex_inrow outputs twice many bytes --- client/src/cmdhfemrtd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/cmdhfemrtd.c b/client/src/cmdhfemrtd.c index c618f3351..c52f34120 100644 --- a/client/src/cmdhfemrtd.c +++ b/client/src/cmdhfemrtd.c @@ -1281,7 +1281,7 @@ static void emrtd_print_issuance(char *data, bool ascii) { static void emrtd_print_personalization_timestamp(uint8_t *data) { char str_date[0x0F] = { 0x00 }; - strcpy(str_date, sprint_hex_inrow(data, 0x0E)); + strcpy(str_date, sprint_hex_inrow(data, 0x07)); char final_date[20] = { 0x00 }; sprintf(final_date, "%.4s-%.2s-%.2s %.2s:%.2s:%.2s", str_date, str_date + 4, str_date + 6, str_date + 8, str_date + 10, str_date + 12);