From 4417a13f9fc9d908e39d3726c0ad8182287e294d Mon Sep 17 00:00:00 2001 From: Romain Tartiere Date: Sat, 3 Jul 2010 06:24:29 +0000 Subject: [PATCH] Don't assume a Mifare Classic Sector Number will always fit in a byte (currently it's a uint8_t but it exposes some problems). --- libfreefare/mifare_application.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libfreefare/mifare_application.c b/libfreefare/mifare_application.c index 1a78735..4024f5e 100644 --- a/libfreefare/mifare_application.c +++ b/libfreefare/mifare_application.c @@ -135,7 +135,7 @@ mifare_application_alloc (Mad mad, MadAid aid, size_t size) if (sector_map[i]) n++; - if (!(res = malloc (n+1))) + if (!(res = malloc (sizeof (*res) * (n+1)))) return NULL; n = 0;