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

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

Change-Id: Ibdf1aff8680374e4ee13af57d162910b154b8f5e
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]);