From 8e2effdc53cb559b76ce1bfb5ee497f854b4c893 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Fri, 8 Mar 2013 23:43:41 +0100 Subject: [PATCH] Fix cppcheck warning "scanf without field width limits can crash with huge input data" --- libnfc/drivers/pn532_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnfc/drivers/pn532_spi.c b/libnfc/drivers/pn532_spi.c index 05cb000..5824443 100644 --- a/libnfc/drivers/pn532_spi.c +++ b/libnfc/drivers/pn532_spi.c @@ -186,7 +186,7 @@ pn532_connstring_decode(const nfc_connstring connstring, struct pn532_spi_descri return 2; } unsigned long speed; - if (sscanf(speed_s, "%lu", &speed) != 1) { + if (sscanf(speed_s, "%10lu", &speed) != 1) { // speed_s is not a number free(cs); return 2;