[MOAB-dev] r1570 - MOAB/trunk

kraftche at mcs.anl.gov kraftche at mcs.anl.gov
Thu Jan 31 13:37:10 CST 2008


Author: kraftche
Date: 2008-01-31 13:37:10 -0600 (Thu, 31 Jan 2008)
New Revision: 1570

Modified:
   MOAB/trunk/MBBits.hpp
Log:
fix write past end of array in previous checkin

Modified: MOAB/trunk/MBBits.hpp
===================================================================
--- MOAB/trunk/MBBits.hpp	2008-01-31 18:24:11 UTC (rev 1569)
+++ MOAB/trunk/MBBits.hpp	2008-01-31 19:37:10 UTC (rev 1570)
@@ -278,7 +278,10 @@
         // individually.
         default:
           memset(mBitArray, 0, mPageSize);
-          for (int i = 0; i < 8 * mPageSize; i += num_bits_per_flag)
+          // Subtract 1 from mPageSize because last byte is unused, allowing
+          // questionable MBBitManipulator code to read/write 1 past end 
+          // of array.
+          for (int i = 0; i < 8 * (mPageSize-1); i += num_bits_per_flag)
             MBBitManipulator::set_bits( i, num_bits_per_flag, defval, mBitArray );
       }
     }




More information about the moab-dev mailing list