]> OCCT Git - occt.git/commit
0032931: Modeling Algorithms - Crash in ChFi3d_IsInFront when no face was found
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:46:28 +0000 (17:46 +0300)
commitd30f25e6b1a91e5d9de1dd18d3c951274d486103
tree9230d4b95aa411fe04f7bf5298d1b06a82d7f68c
parentcec41bb93d2980247ee6318c3c1620100a3ed6b7
0032931: Modeling Algorithms - Crash in ChFi3d_IsInFront when no face was found

The ChFi3d_IsInFront code is currently not handling all the combinations
correctly. For example, if `if(fd1->IndexOfS2() == fd2->IndexOfS2())` is
true, it can happen that the `TopoDS::Face(DStr.Shape(fd1->Index(jf1)))`
returns a Face with entity == NULL. The subsequent usage of this NULL face
in `BRep_Tool::Parameters( Vtx, face )` will then cause a segfault.

While the best approach would be to identify the implementation bug in the
algorithm behind PChFi3d_IsInFron, a check + exception is used instead
because the actual algorithm is not known.

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