From da9cb57f577c4bf40fd3905451607348fa02c633 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Sat, 12 Feb 2022 18:52:19 -0600 Subject: [PATCH] 0031585: Access Violation while creating fillet - ChiFi3d_Builder::PerformIntersectionAtEnd There is one case in PerformIntersectionAtEnd that did not test whether an array access exceeded the length of the array, in rare cases resulting in a segmentation fault. That error-handling behavior is replaced by the exception code used elsewhere in the function. For consistency, the code is copied exactly as implemented elsewhere. This code has the same effect as that proposed by the bug submitter. --- src/ChFi3d/ChFi3d_Builder_C1.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ChFi3d/ChFi3d_Builder_C1.cxx b/src/ChFi3d/ChFi3d_Builder_C1.cxx index 9d78c53944..5fd4602470 100644 --- a/src/ChFi3d/ChFi3d_Builder_C1.cxx +++ b/src/ChFi3d/ChFi3d_Builder_C1.cxx @@ -2036,6 +2036,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) if ((possible1 && possible2) || (!possible1 && !possible2) || (nbarete > 4)) { while (!trouve) { nb++; + if (nb>=nn) throw Standard_Failure("IntersectionAtEnd : the max number of faces reached"); if (nb!=1) F3=Face[nb-2]; Face[nb-1]=F3; if (CV1.Arc().IsSame(edgelibre1)) -- 2.39.5