Merge "Prevent OOB error in rw_i93_sm_read_ndef()" into oc-dev am: 46f44fd653 am: e010bdd3de
am: e079b7a95a

Change-Id: I6e24e6eca85a59767f5227755389e63b32ad1254
(cherry picked from commit baa27d0bcc73012684fab286c52a0830f0f1ccb3)
diff --git a/src/nfc/tags/rw_i93.cc b/src/nfc/tags/rw_i93.cc
index bcc6421..48edb76 100644
--- a/src/nfc/tags/rw_i93.cc
+++ b/src/nfc/tags/rw_i93.cc
@@ -1992,6 +1992,12 @@
 
   DLOG_IF(INFO, nfc_debug_enabled) << __func__;
 
+  if (length == 0) {
+    android_errorWriteLog(0x534e4554, "122035770");
+    rw_i93_handle_error(NFC_STATUS_FAILED);
+    return;
+  }
+
   STREAM_TO_UINT8(flags, p);
   length--;