From 1a115ed8cb93fe37a7f1d40cd21ea4a9c4fb294d Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Thu, 25 Jul 2019 17:05:05 -0700 Subject: [PATCH] Fix buffer overrun bug in CPU upsample op (#1501) --- onnxruntime/core/providers/cpu/tensor/upsample.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onnxruntime/core/providers/cpu/tensor/upsample.cc b/onnxruntime/core/providers/cpu/tensor/upsample.cc index b65645ae06..bd98715423 100644 --- a/onnxruntime/core/providers/cpu/tensor/upsample.cc +++ b/onnxruntime/core/providers/cpu/tensor/upsample.cc @@ -342,7 +342,7 @@ Status Upsample::BaseCompute(OpKernelContext* context, const std::vectorOutput(0, Y_dims); if (no_scale) { - memcpy(Y->MutableDataRaw(), X->DataRaw(), Y->Size() * sizeof(T)); + memcpy(Y->MutableDataRaw(), X->DataRaw(), Y->Size()); return Status::OK(); }