From cbaac5de6d9dd755a459ad140e8afb498c507688 Mon Sep 17 00:00:00 2001 From: abv Date: Fri, 20 Sep 2019 07:55:05 +0300 Subject: [PATCH] 0030985: Modeling Algorithms - heap-use-after-free reported by Clang address sanitizer in TopOpeBRepTool_REGUW::InitBlock() Code is corrected to avoid use of reference to a shape removed from the list after that removal --- src/TopOpeBRepTool/TopOpeBRepTool_REGUW.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_REGUW.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_REGUW.cxx index a03315b991..38bd6ba383 100644 --- a/src/TopOpeBRepTool/TopOpeBRepTool_REGUW.cxx +++ b/src/TopOpeBRepTool/TopOpeBRepTool_REGUW.cxx @@ -447,8 +447,8 @@ Standard_Boolean TopOpeBRepTool_REGUW::InitBlock() const TopOpeBRepTool_connexity& cmu = mymapvEds.FindFromKey(vmu); Standard_Boolean mult = cmu.IsMultiple(); if (!mult) { - myListVmultiple.Remove(itmu); mymapvmultiple.Remove(vmu); + myListVmultiple.Remove(itmu); } else itmu.Next(); }