Skip to content

Commit

Permalink
Merge pull request #51013 from geetachavan1/cherrypicks_9M0PA
Browse files Browse the repository at this point in the history
Prevent an OOB read in `expand_dims.cc`
  • Loading branch information
mihaimaruseac committed Jul 30, 2021
2 parents f33e5bc + 6fadd98 commit af09772
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tensorflow/lite/kernels/expand_dims.cc
Expand Up @@ -37,6 +37,7 @@ TfLiteStatus ExpandTensorDim(TfLiteContext* context, const TfLiteTensor& input,
axis = input_dims.size + 1 + axis;
}
TF_LITE_ENSURE(context, axis <= input_dims.size);
TF_LITE_ENSURE(context, axis >= 0);

TfLiteIntArray* output_dims = TfLiteIntArrayCreate(input_dims.size + 1);
for (int i = 0; i < output_dims->size; ++i) {
Expand Down

0 comments on commit af09772

Please sign in to comment.