]> 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)
committersmoskvin <smoskvin@opencascade.com>
Wed, 20 Jul 2022 09:26:58 +0000 (12:26 +0300)
commit19a49b8e746c2923bb2d266714633b44f2baf2d7
tree02da4e2d909eba4e74864b94cd80d7a015770c06
parentfd29020f8735daf741f7becfae970a0402b1f5c4
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]