]> OCCT Git - occt-copy.git/commitdiff
0030992: Foundation Classes - heap-buffer-overflow reported by Clang address sanitize...
authorabv <abv@opencascade.com>
Tue, 1 Oct 2019 05:23:26 +0000 (08:23 +0300)
committerabv <abv@opencascade.com>
Sat, 19 Oct 2019 09:31:38 +0000 (12:31 +0300)
Inconsistent code for guessing bspline span index is removed in Geom_OsculatingSurface::BuildOsculatingSurface().

src/Geom/Geom_OsculatingSurface.cxx
tests/bugs/moddata_3/bug24621

index da2a54df775fc98f0f9f46feb7967e26284cfa14..665d97b760316c79259a70d0abd6be562eb4f3ff 100644 (file)
@@ -446,7 +446,6 @@ Standard_Boolean  Geom_OsculatingSurface::BuildOsculatingSurface
   const Handle(Geom_BSplineSurface)& BS,
   Handle(Geom_BSplineSurface)& BSpl) const
 {
-  Standard_Integer i, j;
   Standard_Boolean OsculSurf=Standard_True;
 #ifdef OCCT_DEBUG
   std::cout<<"t = "<<Param<<std::endl;
@@ -492,7 +491,7 @@ Standard_Boolean  Geom_OsculatingSurface::BuildOsculatingSurface
     MaxUDegree = (Standard_Integer ) udeg;
     MaxVDegree = (Standard_Integer ) vdeg;
 
-    for (i=1;i<=2;i++) 
+    for (Standard_Integer i = 1; i <= 2; i++) 
     {
       PolynomialUIntervals->ChangeValue(i) = i-1;
       PolynomialVIntervals->ChangeValue(i) = i-1;
@@ -560,8 +559,6 @@ Standard_Boolean  Geom_OsculatingSurface::BuildOsculatingSurface
 
     VLocalIndex = 0;
     ULocalIndex = 0;
-    for(j = 1; j <= SVKnot; j++) VLocalIndex += BS->VMultiplicity(j);
-    for(i = 1; i <= SUKnot; i++) ULocalIndex += BS->UMultiplicity(i);
     ucacheparameter = BS->UKnot(SUKnot);
     vcacheparameter = BS->VKnot(SVKnot);
     vspanlength = BS->VKnot(SVKnot + 1) - BS->VKnot(SVKnot);
index bfb93bb1ddd1a8c11fce2a638c1d9073e948bcbf..e2eeb05842112637240855fcfd85062d89d218a6 100755 (executable)
@@ -1,14 +1,7 @@
-puts "TODO OCC24621 Windows: An exception was caught"
-puts "TODO OCC24621 Windows: \\*\\* Exception \\*\\*.*"
-puts "TODO OCC24621 Windows: TEST INCOMPLETE"
-
 puts "========"
-puts "OCC24621"
+puts "OCC24621: F a i l e d to build Geom_OffsetSurface on B-Spline"
 puts "========"
 puts ""
-##################################################
-# Failed to build Geom_OffsetSurface on B-Spline
-##################################################
 
 restore [locate_data_file bug24621_bs.draw] bs