[SCM] OCE packaging branch, upstream, updated. OCE-0.6.0-230-g17bea23

tpaviot tpaviot at gmail.com
Fri Feb 24 18:50:24 UTC 2012


The following commit has been merged in the upstream branch:
commit c670ff4807b659540ba92052c42cd79ab892b576
Author: tpaviot <tpaviot at gmail.com>
Date:   Sat Jan 14 13:40:49 2012 +0100

    Bugfix: out of bound
    
    cppcheck-1.52 reports the following error:
    [XCAFPrs/XCAFPrs_AISObject.cxx:96]: (error) Array 'X[2]' index 2 out of bounds
    [XCAFPrs/XCAFPrs_AISObject.cxx:96]: (error) Array 'Y[2]' index 2 out of bounds
    [XCAFPrs/XCAFPrs_AISObject.cxx:96]: (error) Array 'Z[2]' index 2 out of bounds
    
    Current implementation is:
    """
      Standard_Real X[2],Y[2],Z[2];
    [..]
      Indx [0]=1;Indx [1]=2;Indx [2]=4;Indx [3]=3;
      Indx [4]=5;Indx [5]=6;Indx [6]=8;Indx [7]=7;
      Indx [8]=1;Indx [9]=3;Indx [10]=7;Indx [11]=5;
      Indx [12]=2;Indx [13]=4;Indx [14]=8;Indx [15]=6;
      B.Get(X[0], Y[0], Z[0], X[1], Y[1], Z[1]);
      Indx [0]=1;Indx [1]=2;Indx [2]=3;Indx [3]=4;Indx [4]=5;Indx [5]=6;Indx [6]=7;
      Indx [7]=8;Indx [8]=1;Indx [9]=2;Indx [10]=6;Indx [10]=5;Indx [10]=3;
      Indx [10]=4;Indx [10]=8;Indx [10]=7;
      B.Get(X[1], Y[1], Z[1], X[2], Y[2], Z[2]);
    """
    
    BUC60577 is not defined, then X[2], Y[2] and Z[2] or out of X,Y and Z bounds.
    
    Defining BUC60577 fixes the issue.

diff --git a/src/XCAFPrs/XCAFPrs_AISObject.cxx b/src/XCAFPrs/XCAFPrs_AISObject.cxx
index f5f578a..c07a6d2 100644
--- a/src/XCAFPrs/XCAFPrs_AISObject.cxx
+++ b/src/XCAFPrs/XCAFPrs_AISObject.cxx
@@ -3,6 +3,8 @@
 // Author:	Andrey BETENEV
 //		<abv at doomox.nnov.matra-dtv.fr>
 
+#define BUC60577	//TP_14012011 Fix out of bound.
+
 #include <XCAFPrs_AISObject.ixx>
 #include <TCollection_ExtendedString.hxx>
 #include <gp_Pnt.hxx>

-- 
OCE packaging



More information about the debian-science-commits mailing list