From c6386269ef2bd590ffc9bebb26df429839ddf9b3 Mon Sep 17 00:00:00 2001 From: Mihai Tudor Panu Date: Tue, 22 Sep 2015 16:55:21 -0700 Subject: [PATCH] pn532: fixed uninitialized variable and URL buffer Signed-off-by: Mihai Tudor Panu --- src/pn532/pn532.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pn532/pn532.cxx b/src/pn532/pn532.cxx index b9e23b7d..e70604bf 100644 --- a/src/pn532/pn532.cxx +++ b/src/pn532/pn532.cxx @@ -152,7 +152,7 @@ static void PrintHexChar(const uint8_t * data, const uint32_t numBytes) /**************************************************************************/ uint32_t PN532::getFirmwareVersion() { - uint32_t response; + uint32_t response = 0; pn532_packetbuffer[0] = CMD_GETFIRMWAREVERSION; @@ -1033,7 +1033,7 @@ bool PN532::mifareclassic_WriteNDEFURI (uint8_t sectorNumber, memcpy (sectorbuffer1+9, url, 7); memcpy (sectorbuffer2, url+7, 16); memcpy (sectorbuffer3, url+23, len-24); - sectorbuffer3[len-22] = 0xFE; + sectorbuffer3[len-23] = 0xFE; } // Now write all three blocks back to the card