[MOAB-dev] commit/MOAB: danwu: The unit test scdseq_test failed on gnep build machine (ICC 12, with -O2 and -DNDEBUG). For a few periodic arrays, the sizes have not been updated from 2 to 3. This will lead to potential buffer overflow and undefined behavior.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Sep 10 15:10:17 CDT 2013


1 new commit in MOAB:

https://bitbucket.org/fathomteam/moab/commits/257011884fd8/
Changeset:   257011884fd8
Branch:      master
User:        danwu
Date:        2013-09-10 22:10:06
Summary:     The unit test scdseq_test failed on gnep build machine (ICC 12, with -O2 and -DNDEBUG). For a few periodic arrays, the sizes have not been updated from 2 to 3. This will lead to potential buffer overflow and undefined behavior.

Affected #:  2 files

diff --git a/src/ScdInterface.cpp b/src/ScdInterface.cpp
index a61c8d2..1441e51 100644
--- a/src/ScdInterface.cpp
+++ b/src/ScdInterface.cpp
@@ -753,7 +753,7 @@ ErrorCode ScdInterface::get_neighbor_alljkbal(int np, int pfrom,
   pto = -1;
   across_bdy[0] = across_bdy[1] = across_bdy[2] = 0;
   
-  int ldims[6], pijk[3], lperiodic[2];
+  int ldims[6], pijk[3], lperiodic[3];
   ErrorCode rval = compute_partition_alljkbal(np, pfrom, gdims, gperiodic, 
                                               ldims, lperiodic, pijk);
   if (MB_SUCCESS != rval) return rval;
@@ -1150,7 +1150,7 @@ ErrorCode ScdInterface::get_neighbor_alljorkori(int np, int pfrom,
   pto = -1;
   if (np == 1) return MB_SUCCESS;
   
-  int pijk[3], lperiodic[2], ldims[6];
+  int pijk[3], lperiodic[3], ldims[6];
   rval = compute_partition_alljorkori(np, pfrom, gdims, gperiodic, ldims, lperiodic, pijk);
   if (MB_SUCCESS != rval) return rval;
 

diff --git a/src/moab/ScdInterface.hpp b/src/moab/ScdInterface.hpp
index 31609f2..ef25bb1 100644
--- a/src/moab/ScdInterface.hpp
+++ b/src/moab/ScdInterface.hpp
@@ -166,7 +166,7 @@ public:
      * \param coords Coordinates of vertices, interleaved (xyzxyz...); if NULL, no coords are set
      * \param num_coords Number of coordinate values; if zero, no coords are set
      * \param new_box Reference to box of structured mesh
-     * \param lperiodic[2] If lperiodic[s] != 0, direction s is locally periodic
+     * \param lperiodic[3] If lperiodic[s] != 0, direction s is locally periodic
      * \param par_data If non-NULL, this will get stored on the ScdBox once created, contains info
      *                 about global parallel nature of ScdBox across procs
      * \param assign_global_ids If true, assigns 1-based global ids to vertices using GLOBAL_ID_TAG_NAME
@@ -186,7 +186,7 @@ public:
      * \param type EntityType, one of MBVERTEX, MBEDGE, MBQUAD, MBHEX
      * \param starting_id Requested start id of entities
      * \param new_box Reference to the newly created box of entities
-     * \param is_periodic[2] If is_periodic[s] is non-zero, mesh should be periodic in direction s (s=[0,1])
+     * \param is_periodic[3] If is_periodic[s] is non-zero, mesh should be periodic in direction s (s=[0,1,2])
      */
   ErrorCode create_scd_sequence(HomCoord low, HomCoord high, EntityType type,
                                 int starting_id, ScdBox *&new_box, 
@@ -302,7 +302,7 @@ private:
     /** \param low Lower corner parameters for this box
      * \param high Upper corner parameters for this box
      * \param scd_set Entity set created
-     * \param is_periodic[2] If is_periodic[s] is non-zero, mesh should be periodic in direction s (s=[0,1])
+     * \param is_periodic[3] If is_periodic[s] is non-zero, mesh should be periodic in direction s (s=[0,1,2])
      */
   ErrorCode create_box_set(const HomCoord low, const HomCoord high,
                            EntityHandle &scd_set,

Repository URL: https://bitbucket.org/fathomteam/moab/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.


More information about the moab-dev mailing list