0030985: Modeling Algorithms - heap-use-after-free reported by Clang address sanitize...
authorabv <abv@opencascade.com>
Fri, 20 Sep 2019 04:55:05 +0000 (07:55 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 20 Sep 2019 16:39:33 +0000 (19:39 +0300)
Code is corrected to avoid use of reference to a shape removed from the list after that removal

src/TopOpeBRepTool/TopOpeBRepTool_REGUW.cxx

index a03315b..38bd6ba 100644 (file)
@@ -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();
   }