From 5ad4dc60737738c2745beeb5c1ee1863d98479dc Mon Sep 17 00:00:00 2001 From: Dmitrii Khurtin Date: Tue, 25 May 2021 20:02:55 +0300 Subject: [PATCH] fix a bug with heap buffer overflow (#5793) --- inference-engine/src/gna_plugin/layers/gna_layer_info.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inference-engine/src/gna_plugin/layers/gna_layer_info.hpp b/inference-engine/src/gna_plugin/layers/gna_layer_info.hpp index 7a955c9c7e3f3b..a4681bdff41e01 100644 --- a/inference-engine/src/gna_plugin/layers/gna_layer_info.hpp +++ b/inference-engine/src/gna_plugin/layers/gna_layer_info.hpp @@ -264,7 +264,7 @@ class LayerInfo { return false; } // check dims in between - for (int j = permute.first + 1; j != permute.second; j++) { + for (int j = std::min(permute.first, permute.second) + 1; j < std::max(permute.first, permute.second); j++) { if (inputsOrderTransformed[j] != 1) { return false; }