Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix heap-buffer-overflow issue with tf.raw_ops.SparseFillEmptyRows.
PiperOrigin-RevId: 372009178
Change-Id: Ia1a9e9691ecaa072f32fb39a0887b2aabd399210
  • Loading branch information
Amit Patankar authored and tensorflower-gardener committed May 4, 2021
1 parent fdc8208 commit faa76f3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tensorflow/core/kernels/sparse_fill_empty_rows_op.cc
Expand Up @@ -228,7 +228,10 @@ void SparseFillEmptyRowsOpImpl(OpKernelContext* context,
default_value_t.shape().DebugString()),
done);
// TODO(ebrevdo): add shape checks between values, indices,
// dense_shape. Also add check that dense rank > 0.
// Also add check that dense rank > 0.
OP_REQUIRES_ASYNC(context, dense_shape_t.NumElements() != 0,
errors::InvalidArgument("Dense shape cannot be empty."),
done);

using FunctorType = functor::SparseFillEmptyRows<Device, T, Tindex>;
OP_REQUIRES_OK_ASYNC(context,
Expand Down

0 comments on commit faa76f3

Please sign in to comment.