From f2c264d4ae88fab8317190fe7eb7d6eafbbe6832 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sat, 18 Feb 2017 17:29:57 +0100 Subject: [PATCH] pn53x: avoid warning about uninitialized value (false positive) pn53x.c:1746:15: warning: Function call argument is an uninitialized value *cycles = __pn53x_get_timer(pnd, pbtTxRaw[szTx + 1]); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- libnfc/chips/pn53x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnfc/chips/pn53x.c b/libnfc/chips/pn53x.c index f48fd48..db7f741 100644 --- a/libnfc/chips/pn53x.c +++ b/libnfc/chips/pn53x.c @@ -1733,7 +1733,7 @@ pn53x_initiator_transceive_bytes_timed(struct nfc_device *pnd, const uint8_t *pb if (pnd->bCrc) { // We've to compute CRC ourselves to know last byte actually sent uint8_t *pbtTxRaw; - pbtTxRaw = (uint8_t *) malloc(szTx + 2); + pbtTxRaw = (uint8_t *) calloc(szTx + 2, 1); if (!pbtTxRaw) return NFC_ESOFT; memcpy(pbtTxRaw, pbtTx, szTx);