View Issue Details

IDProjectCategoryView StatusLast Update
0030203CommunityOCCT:Modeling Algorithmspublic2019-01-23 19:15
Reportergalbramc Assigned Toapn  
PrioritynormalSeveritycrash 
Status closedResolutionfixed 
Product Version7.3.0 
Target Version7.4.0Fixed in Version7.4.0 
Summary0030203: ProjLib_ComputeApproxOnPolarSurface::BuildInitialCurve2d array out of bound
DescriptionOn line 1189 of src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx Param.Value is accessed as Param.Value(tPp+j) where j is initially 1. However, tPp is sometimes equal to the size of Param, hence an out of bounds access occurs. Setting j = 0 on line 1186 or moving up the check "if( (tPp+j) > NbOfPnts ) break;" will prevent this. The following patch simply avoids the array out of bounds:

Index: src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx
===================================================================
--- src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx (revision 1)
+++ src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx (working copy)
@@ -1183,7 +1183,7 @@
         if( tPp != 0 ) {
           gp_Pnt2d aPp = gp_Pnt2d(u,v);
           gp_Pnt2d aPn;
- j = 1;
+ j = 0;
           Standard_Boolean isFound = Standard_False;
           while( !isFound ) {
         Curve->D0( Param.Value(tPp+j), pntproj );
Steps To Reproducetest case
bugs modalg_7 bug30203

test uses files bug30203_curv.brep and bug30203_surf.brep (attached)
TagsNo tags attached.
Test case numberbugs modalg_7 bug30203

Attached Files

  • ProjLib_OutOfBound.tgz (2,025 bytes)
  • bug30203_curv.brep (421 bytes)
  • bug30203_surf.brep (3,861 bytes)

Activities

galbramc

2018-10-05 02:22

reporter  

ProjLib_OutOfBound.tgz (2,025 bytes)

git

2018-10-16 17:13

administrator   ~0080023

Branch CR30203 has been created by ifv.

SHA-1: c77cf5ff386e78d0470586ac6b9016e172f56596


Detailed log of new commits:

Author: ifv
Date: Tue Oct 16 17:10:44 2018 +0300

    0030203: ProjLib_ComputeApproxOnPolarSurface::BuildInitialCurve2d array out of bound

git

2018-10-19 15:28

administrator   ~0080125

Branch CR30203 has been updated forcibly by ifv.

SHA-1: 3488862a1013382deb43203a310fedbc968710ea

git

2018-10-19 15:55

administrator   ~0080129

Branch CR30203 has been updated forcibly by ifv.

SHA-1: 26269d1a174f0e6abba02a28d830d9dcf1346f55

ifv

2018-10-19 15:57

developer  

bug30203_curv.brep (421 bytes)

ifv

2018-10-19 15:57

developer  

bug30203_surf.brep (3,861 bytes)

ifv

2018-10-19 16:01

developer   ~0080131

CR30203 is ready for review, test results exist

git

2018-10-23 11:09

administrator   ~0080221

Branch CR30203 has been updated forcibly by msv.

SHA-1: bbb826366fef8c960778e90cd2f335e779bb9714

msv

2018-10-23 11:21

developer   ~0080223

Reviewed.

apn

2018-10-23 16:09

administrator   ~0080235

Combination -
OCCT branch : CR30203 SHA - bbb826366fef8c960778e90cd2f335e779bb9714
Products branch : master SHA - 35af85def09c66ceeaf90b4e4fb8b54e68d5e98c
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

Test case:
bugs modalg_7 bug30203 - OK

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 17650.049999999817 / 17520.90999999988 [+0.74%]
Products
Total CPU difference: 7401.310000000056 / 7462.09000000004 [-0.81%]
Windows-64-VC14:
OCCT
Total CPU difference: 17595.96119389854 / 17666.582846598394 [-0.40%]
Products
Total CPU difference: 8375.615689499997 / 8372.402068899986 [+0.04%]

Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2018-10-28 16:13

administrator   ~0080414

Branch CR30203 has been deleted by inv.

SHA-1: bbb826366fef8c960778e90cd2f335e779bb9714

Related Changesets

occt: master e5826d91

2018-10-16 14:10:44

ifv


Committer: apn Details Diff
0030203: ProjLib_ComputeApproxOnPolarSurface::BuildInitialCurve2d array out of bound

Bug fixing: avoiding calculation if tPp == NbOfPnts
Affected Issues
0030203
mod - src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx Diff File
add - tests/bugs/modalg_7/bug30203 Diff File

Issue History

Date Modified Username Field Change
2018-10-05 02:22 galbramc New Issue
2018-10-05 02:22 galbramc Assigned To => msv
2018-10-05 02:22 galbramc File Added: ProjLib_OutOfBound.tgz
2018-10-05 09:32 msv Assigned To msv => ifv
2018-10-05 09:32 msv Status new => assigned
2018-10-05 09:32 msv Target Version => 7.4.0
2018-10-16 17:13 git Note Added: 0080023
2018-10-19 15:28 git Note Added: 0080125
2018-10-19 15:55 git Note Added: 0080129
2018-10-19 15:57 ifv File Added: bug30203_curv.brep
2018-10-19 15:57 ifv File Added: bug30203_surf.brep
2018-10-19 15:59 ifv Steps to Reproduce Updated
2018-10-19 16:01 ifv Note Added: 0080131
2018-10-19 16:01 ifv Assigned To ifv => msv
2018-10-19 16:01 ifv Status assigned => resolved
2018-10-19 16:01 ifv Steps to Reproduce Updated
2018-10-23 11:09 git Note Added: 0080221
2018-10-23 11:21 msv Note Added: 0080223
2018-10-23 11:21 msv Assigned To msv => bugmaster
2018-10-23 11:21 msv Status resolved => reviewed
2018-10-23 16:09 apn Test case number => bugs modalg_7 bug30203
2018-10-23 16:09 apn Note Added: 0080235
2018-10-23 16:09 apn Status reviewed => tested
2018-10-28 13:20 apn Changeset attached => occt master e5826d91
2018-10-28 13:20 apn Assigned To bugmaster => apn
2018-10-28 13:20 apn Status tested => verified
2018-10-28 13:20 apn Resolution open => fixed
2018-10-28 16:13 git Note Added: 0080414