Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix heap-buffer-overflow issue with tf.raw_ops.SparseSplit.
PiperOrigin-RevId: 371242872
Change-Id: I482bb3d12602c7c3cc9446f97fb9f584bb98e9a4
  • Loading branch information
Amit Patankar authored and tensorflower-gardener committed Apr 30, 2021
1 parent 699bff5 commit 8ba6fa2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tensorflow/core/util/sparse/sparse_tensor.h
Expand Up @@ -527,6 +527,10 @@ inline Status SparseTensor::Split(const SparseTensor& input_tensor,
for (int i = 0; i < input_tensor.indices().dim_size(0); ++i) {
const int dim = input_tensor.indices().matrix<int64>()(i, split_dim);
int slice_index = GetSliceIndex(dim, split_size, residual);
if (slice_index >= num_values.size()) {
return errors::InvalidArgument("Slice index ", slice_index,
" is larger than num_split.");
}
num_values[slice_index]++;
}

Expand Down

0 comments on commit 8ba6fa2

Please sign in to comment.