From a4f466df0682427ab6ba1472d3c4e206d51d1575 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sun, 22 Sep 2013 02:41:11 +0200 Subject: [PATCH] Verify return of nfc_device_set_property_bool() Problem reported by Coverity: CID 1090325 (#1 of 1): Unchecked return value (CHECKED_RETURN) unchecked_value: No check of the return value of "nfc_device_set_property_bool(pnd, NP_AUTO_ISO14443_4, false)". --- utils/nfc-mfclassic.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/nfc-mfclassic.c b/utils/nfc-mfclassic.c index f012d97..c1f834c 100644 --- a/utils/nfc-mfclassic.c +++ b/utils/nfc-mfclassic.c @@ -555,7 +555,12 @@ main(int argc, const char *argv[]) exit(EXIT_FAILURE); } // Disable ISO14443-4 switching in order to read devices that emulate Mifare Classic with ISO14443-4 compliance. - nfc_device_set_property_bool(pnd, NP_AUTO_ISO14443_4, false); + if (nfc_device_set_property_bool(pnd, NP_AUTO_ISO14443_4, false) < 0) { + nfc_perror(pnd, "nfc_device_set_property_bool"); + nfc_close(pnd); + nfc_exit(context); + exit(EXIT_FAILURE); + } printf("NFC reader: %s opened\n", nfc_device_get_name(pnd));