[MOAB-dev] r2641 - MOAB/trunk

kraftche at mcs.anl.gov kraftche at mcs.anl.gov
Fri Feb 13 09:32:06 CST 2009


Author: kraftche
Date: 2009-02-13 09:32:06 -0600 (Fri, 13 Feb 2009)
New Revision: 2641

Modified:
   MOAB/trunk/TagServer.hpp
Log:
check for invalid tag handles

Modified: MOAB/trunk/TagServer.hpp
===================================================================
--- MOAB/trunk/TagServer.hpp	2009-02-12 22:49:44 UTC (rev 2640)
+++ MOAB/trunk/TagServer.hpp	2009-02-13 15:32:06 UTC (rev 2641)
@@ -352,7 +352,7 @@
 
 inline const TagInfo* TagServer::get_tag_info( MBTagId id, MBTagType type ) const
 {
-  if (id <= mTagTable[type].size() && mTagTable[type][id-1].is_valid())
+  if (id > 0 && id <= mTagTable[type].size() && mTagTable[type][id-1].is_valid())
     return &mTagTable[type][id-1];
   else
     return NULL;
@@ -360,7 +360,7 @@
 
 inline TagInfo* TagServer::get_tag_info( MBTagId id, MBTagType type )
 {
-  if (id <= mTagTable[type].size() && mTagTable[type][id-1].is_valid())
+  if (id > 0 && id <= mTagTable[type].size() && mTagTable[type][id-1].is_valid())
     return &mTagTable[type][id-1];
   else
     return NULL;



More information about the moab-dev mailing list