Tag-mismatch in nfc_enabled Bug: 155234594 Test: build ok Change-Id: I9d04081d05bbcc2e7d1666c34e74fde87b8982bd
diff --git a/src/nfc/nfc/nfc_main.cc b/src/nfc/nfc/nfc_main.cc index 991d320..a03fa7a 100644 --- a/src/nfc/nfc/nfc_main.cc +++ b/src/nfc/nfc/nfc_main.cc
@@ -317,8 +317,9 @@ memcpy(evt_data.enable.vs_interface, nfc_cb.vs_interface, NFC_NFCC_MAX_NUM_VS_INTERFACE); } else { - /* one byte is consumed in the top expression */ - lremain -= sizeof(uint16_t) + NFC_NFCC_INFO_LEN; + /* For VERSION_UNKNOWN one byte is consumed in the top expression */ + lremain -= sizeof(uint16_t) + NFC_NFCC_INFO_LEN + + (nfc_cb.nci_version == NCI_VERSION_1_0 ? 1 : 0); if (lremain < 0) { nfc_status = NCI_STATUS_FAILED; goto plen_err;