Merge "Out of bounds read in hal_core_initialized" into rvc-qpr-dev am: 14162741e7 am: 57fc648599 am: 8716375c32 am: 26bb48d972

Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/14204915

Change-Id: I0c069952bd323514210220b41df6a6fa55d7332a
diff --git a/nfc/1.0/default/Nfc.cpp b/nfc/1.0/default/Nfc.cpp
index fcdcbbc..a1e50f0 100644
--- a/nfc/1.0/default/Nfc.cpp
+++ b/nfc/1.0/default/Nfc.cpp
@@ -38,7 +38,7 @@
 ::android::hardware::Return<NfcStatus> Nfc::coreInitialized(const hidl_vec<uint8_t>& data)  {
     hidl_vec<uint8_t> copy = data;
 
-    if (mDevice == nullptr) {
+    if (mDevice == nullptr || copy.size() == 0) {
         return NfcStatus::FAILED;
     }
     int ret = mDevice->core_initialized(mDevice, &copy[0]);