From 1070d9bfde2fb509efc81616dd8274c9d73080c1 Mon Sep 17 00:00:00 2001 From: Audrey Diacre Date: Mon, 13 Dec 2010 10:56:27 +0000 Subject: [PATCH] fix buffer overflow. --- libfreefare/mifare_desfire.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libfreefare/mifare_desfire.c b/libfreefare/mifare_desfire.c index ddebd8e..8200782 100644 --- a/libfreefare/mifare_desfire.c +++ b/libfreefare/mifare_desfire.c @@ -742,7 +742,7 @@ mifare_desfire_get_file_settings (MifareTag tag, uint8_t file_no, struct mifare_ DESFIRE_TRANSCEIVE (tag, cmd, res); struct mifare_desfire_raw_file_settings raw_settings; - memcpy (&raw_settings, res, BUFFER_SIZE (res)); + memcpy (&raw_settings, res, BUFFER_SIZE (res)-1); settings->file_type = raw_settings.file_type; settings->communication_settings = raw_settings.communication_settings;