Fix stack-buffer-overflow in tile_functor_gpu.h. host_buf has size = size(int32)*num elements but we are trying to copy size(int64)*num elements out of it.

PiperOrigin-RevId: 338550422
Change-Id: I50d4cdba0cfb6fb6fde96d317d6627bdae1d3a73
This commit is contained in:
Anna R 2020-10-22 14:32:59 -07:00 committed by TensorFlower Gardener
parent 3ee3eea626
commit 5bb73bc2aa

View File

@ -66,7 +66,7 @@ void TileSimple(const Eigen::GpuDevice& d, Tensor* out, const Tensor& in) {
}
// Copies the input strides, output strides and input dimension sizes to the
// device.
auto num_bytes = sizeof(int64) * host_buf.size();
auto num_bytes = sizeof(int32) * host_buf.size();
auto dev_buf = d.allocate(num_bytes);
// NOTE: host_buf is not allocated by GpuHostAllocator, and
// therefore we are doing a sync copy effectively.