Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix heap-buffer-overflow issue with tf.raw_ops.RaggedTensorToTensor.
PiperOrigin-RevId: 371986929
Change-Id: I79ab962a22c5867f36f7f45b780a1ac881b1dbdd
  • Loading branch information
Amit Patankar authored and tensorflower-gardener committed May 4, 2021
1 parent d94227d commit a84358a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tensorflow/core/kernels/ragged_tensor_to_tensor_op.cc
Expand Up @@ -313,6 +313,12 @@ class RaggedTensorToTensorBaseOp : public OpKernel {
output_index_multiplier, output_size, result);
return tensorflow::Status::OK();
case RowPartitionType::ROW_SPLITS:
if (row_partition_tensor.size() - 1 > parent_output_index.size()) {
return errors::InvalidArgument(
"Row partition size is greater than output size: ",
row_partition_tensor.size() - 1, " > ",
parent_output_index.size());
}
CalculateOutputIndexRowSplit(
context, row_partition_tensor, parent_output_index,
output_index_multiplier, output_size, result);
Expand Down

0 comments on commit a84358a

Please sign in to comment.