diff --git a/include/nfc/nfc-types.h b/include/nfc/nfc-types.h index a18e4aaf..89ad3978 100644 --- a/include/nfc/nfc-types.h +++ b/include/nfc/nfc-types.h @@ -311,7 +311,7 @@ typedef enum { NMT_ISO14443B2SR, // ISO14443-2B ST SRx NMT_ISO14443B2CT, // ISO14443-2B ASK CTx NMT_FELICA, - NMT_DEP, + NMT_DEP, // DEP should be kept last one as it's used as end-of-enum } nfc_modulation_type; /** diff --git a/libnfc/chips/pn53x.c b/libnfc/chips/pn53x.c index 5c197674..03642486 100644 --- a/libnfc/chips/pn53x.c +++ b/libnfc/chips/pn53x.c @@ -85,7 +85,7 @@ pn53x_init(struct nfc_device *pnd) } if (!CHIP_DATA(pnd)->supported_modulation_as_initiator) { - CHIP_DATA(pnd)->supported_modulation_as_initiator = malloc(sizeof(nfc_modulation_type) * 9); + CHIP_DATA(pnd)->supported_modulation_as_initiator = malloc(sizeof(nfc_modulation_type) * (NMT_DEP + 1)); if (! CHIP_DATA(pnd)->supported_modulation_as_initiator) return NFC_ESOFT; int nbSupportedModulation = 0;