]> OCCT Git - occt.git/commit
0032929: Modeling Algorithms - Crash in PerformIntersectionAtEnd after deletion of... IR-2022-06-04
authorCharlemagne Lasse <charlemagnelasse@gmail.com>
Wed, 13 Apr 2022 09:54:30 +0000 (11:54 +0200)
committerafokin <afokin@opencascade.com>
Fri, 3 Jun 2022 14:51:01 +0000 (17:51 +0300)
commit24e4b3c83b237dad583f87c983eb06433d56c203
tree3b7c2d8ab8c525d95f72197aaf66ebc7205cb11d
parent10a19b2a75f75fb4c3232d26751e40bd6a5f53a1
0032929: Modeling Algorithms - Crash in PerformIntersectionAtEnd after deletion of surfdata

When creating a fillet, num is calculated via ChFi3d_IndexOfSurfData. If it
returns just the number of entries in surfdata, it can happen that this
value becomes invalid when handling the case "two faces common to the edge
are found". When both components are on an arc, there will be num removed
from the surfdata.

num would then be larger than the number of entries surfdata. The derived
num1 is therefore also incorrect. The subsequent usage of this
value will either:

* Debug build: cause an out of bounds exception in ChangeValue
  (`SeqFil.ChangeValue(num)`)
* Release build: cause a segfault when retrieving it via index num1
  (`SeqFil(num1)`)

num + num1 must be recalculated after the deletion happens to correctly
calculate the fillet.

Signed-off-by: Charlemagne Lasse <charlemagnelasse@gmail.com>
src/ChFi3d/ChFi3d_Builder_C1.cxx
tests/bugs/modalg_8/bug32929 [new file with mode: 0644]