Merge branch 'security-aosp-tm-release' into int/13/fp3

* security-aosp-tm-release:
  Fix OOB Read in convertSubgraphFromHAL

Change-Id: Ia90b745b25049c2dff8daad160ed77edcd1a2401
diff --git a/shim_and_sl/ShimConverter.cpp b/shim_and_sl/ShimConverter.cpp
index 4830c5d..9914af1 100644
--- a/shim_and_sl/ShimConverter.cpp
+++ b/shim_and_sl/ShimConverter.cpp
@@ -51,6 +51,10 @@
         size_t subgraphIndex, const std::vector<uint8_t>& copiedOperandValues,
         ErrorStatus* errorStatus) {
     *errorStatus = ErrorStatus::NONE;
+    if (allModels == nullptr || subgraphIndex >= (*allModels).size()) {
+        *errorStatus = ErrorStatus::INVALID_ARGUMENT;
+        return nullptr;
+    }
     if ((*allModels)[subgraphIndex].has_value()) {
         return (*allModels)[subgraphIndex]->getHandle();
     }