Skip to content

Commit

Permalink
Fix out of Bounds Read in convertSubgraphFromHAL in ShimConverter.cpp…
Browse files Browse the repository at this point in the history
… in libneuralnetworks_shim_static

Bug: 269270167
Test: N/A
(cherry picked from commit 4bf7bb6b50b412678a681d29f7ced70a4d737762)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:244ac21307a785d49930d4c7e289b74856fa9647)
Merged-In: I33272284b965efcbb531f64cbf838a0d59c28e00
Change-Id: I33272284b965efcbb531f64cbf838a0d59c28e00
  • Loading branch information
ianhua2022 authored and thestinger committed Sep 6, 2023
1 parent beaa8f0 commit a1370bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions shim_and_sl/ShimConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ ANeuralNetworksModel* convertSubgraphFromHAL(
break;
}
case OperandLifeTime::CONSTANT_POOL: {
if (operand.location.poolIndex >= memoryPools.size()) {
*errorStatus = ErrorStatus::INVALID_ARGUMENT;
return nullptr;
}
resultModel.setOperandValueFromMemory(
i, memoryPools[operand.location.poolIndex].get(), operand.location.offset,
operand.location.length);
Expand Down

0 comments on commit a1370bd

Please sign in to comment.