From 089ec732a746880d5020401264c1e7c44949fe50 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 10 May 2021 10:08:38 +0200 Subject: [PATCH] fix buffer overflow --- client/src/aiddesfire.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/aiddesfire.c b/client/src/aiddesfire.c index a25e5929f..b628ea072 100644 --- a/client/src/aiddesfire.c +++ b/client/src/aiddesfire.c @@ -101,7 +101,7 @@ static int print_aiddf_description(json_t *root, uint8_t aid[3], char *fmt, bool const char *type = aiddf_json_get_str(elm, "Type"); if (name && vendor) { - char result[4 + strlen(name) + strlen(vendor)]; + char result[5 + strlen(name) + strlen(vendor)]; sprintf(result, " %s [%s]", name, vendor); PrintAndLogEx(INFO, fmt, result); } @@ -125,7 +125,7 @@ static int print_aiddf_description(json_t *root, uint8_t aid[3], char *fmt, bool int AIDDFDecodeAndPrint(uint8_t aid[3]) { open_aiddf_file(&df_known_aids, false); - char fmt[50]; + char fmt[80]; sprintf(fmt, " DF AID Function %02X%02X%02X :" _YELLOW_("%s"), aid[2], aid[1], aid[0], "%s"); print_aiddf_description(df_known_aids, aid, fmt, false); close_aiddf_file(df_known_aids);