Skip to content

Commit ae2daeb

Browse files
Prevent array OOB read/write
PiperOrigin-RevId: 371026165 Change-Id: I26ac6372c87246e03c7eb8c94e84c84d86054b36
1 parent c59c37e commit ae2daeb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tensorflow/lite/kernels/split_v.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ TfLiteStatus ResizeOutputTensors(TfLiteContext* context, TfLiteNode* node,
9696
}
9797
}
9898

99+
TF_LITE_ENSURE(context, axis_value >= 0);
100+
TF_LITE_ENSURE(context, axis_value < NumDimensions(input));
99101
const int input_size = SizeOfDimension(input, axis_value);
100102

101103
if (minus_one_index != -1) {

0 commit comments

Comments
 (0)