]> OCCT Git - occt.git/commit
0032181: Modeling Algorithms - ChFi3d missing error checking
authorChris Hennes (chennes) <chennes@gmail.com>
Sat, 27 Feb 2021 17:58:50 +0000 (11:58 -0600)
committerbugmaster <bugmaster@opencascade.com>
Thu, 4 Mar 2021 16:42:05 +0000 (19:42 +0300)
commit329e5df986519164083d78b28ae62d1a3b10fa6a
tree2ac563e10ce1b369d77e9fc733befcb4b4daee0c
parent7fd4958d451a9c8dcf1c58e100c8ac898484addd
0032181: Modeling Algorithms - ChFi3d missing error checking

Throughout the ChFi3d fillet creation functions there are two sets of unchecked
errors that can result in segmentation faults when geometry-creation problems
occur.

The first is that the functions ChFi3d_cherche_* may fail to find the requested
item: they silently return without setting the required reference, which is
then accessed by the algorithms. This can be caught with a conditional at the
end of the function that throws an exception if the required item was not
found.

The second class of unchecked error is the use of BRep_Tool::CurveOnSurface,
which may fail to create the required curve, returning a null handle. In many
cases in the existing fillet code this is not checked. This can be dealt with
by checking the returned handle using IsNull() and throwing an exception
if the call did not result in valid geometry.
src/ChFi3d/ChFi3d_Builder_0.cxx
src/ChFi3d/ChFi3d_Builder_C1.cxx
src/ChFi3d/ChFi3d_Builder_CnCrn.cxx