From eb0649980adcac4d72bc39f55d719b675c182005 Mon Sep 17 00:00:00 2001 From: Matteo Zarro Date: Sun, 2 Feb 2025 11:47:59 +0100 Subject: [PATCH] Fix null pointer check for ndef_buffer_length in doReadT4tData function --- src/service/linux_nfc_api.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/service/linux_nfc_api.cpp b/src/service/linux_nfc_api.cpp index e9229de..5d55c48 100644 --- a/src/service/linux_nfc_api.cpp +++ b/src/service/linux_nfc_api.cpp @@ -379,7 +379,7 @@ int doWriteT4tData(unsigned char *command, unsigned char *ndef_buffer, int ndef_ int doReadT4tData(unsigned char *command, unsigned char *ndef_buffer, int *ndef_buffer_length) { int ret = 0; - if (ndef_buffer == NULL || ndef_buffer_length <= 0) { + if (ndef_buffer == NULL || ndef_buffer_length == NULL || *ndef_buffer_length <= 0) { NXPLOG_API_E ("%s: invalide buffer!", __FUNCTION__); return NFA_STATUS_FAILED; }