From 367e14dcc03e4c4fe620c2d05e45e1ed582b5ea8 Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Wed, 21 Apr 2010 10:58:04 +0000 Subject: [PATCH] Prevent from potential buffer-overflows. --- libnfc/drivers/pn532_uart.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/libnfc/drivers/pn532_uart.c b/libnfc/drivers/pn532_uart.c index 6c584d3..2ccbb45 100644 --- a/libnfc/drivers/pn532_uart.c +++ b/libnfc/drivers/pn532_uart.c @@ -106,19 +106,21 @@ pn532_uart_list_devices(nfc_device_desc_t pnddDevices[], size_t szDevices, size_ *pszDeviceFound = 0; serial_port sp; - char acConnect[BUFFER_LENGTH]; + char acPort[BUFFER_LENGTH]; int iDevice; // I have no idea how MAC OS X deals with multiple devices, so a quick workaround for (iDevice=0; iDevice= szDevices) break; } #ifdef DEBUG - if (sp == INVALID_SERIAL_PORT) DBG("Invalid serial port: %s",acConnect); - if (sp == CLAIMED_SERIAL_PORT) DBG("Serial port already claimed: %s",acConnect); + if (sp == INVALID_SERIAL_PORT) DBG("Invalid serial port: %s",acPort); + if (sp == CLAIMED_SERIAL_PORT) DBG("Serial port already claimed: %s",acPort); #endif /* DEBUG */ } #endif /* SERIAL_AUTOPROBE_ENABLED */