[commit] r1597 - trunk/GME/GMEActiveBrowser

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Tue Oct 11 10:10:37 CDT 2011


Author: ksmyth
Date: Tue Oct 11 10:10:36 2011
New Revision: 1597

Log:
Dont use array without checking bounds

Modified:
   trunk/GME/GMEActiveBrowser/ActiveBrowserPropertyPage.cpp

Modified: trunk/GME/GMEActiveBrowser/ActiveBrowserPropertyPage.cpp
==============================================================================
--- trunk/GME/GMEActiveBrowser/ActiveBrowserPropertyPage.cpp	Tue Oct 11 10:10:26 2011	(r1596)
+++ trunk/GME/GMEActiveBrowser/ActiveBrowserPropertyPage.cpp	Tue Oct 11 10:10:36 2011	(r1597)
@@ -2303,7 +2303,7 @@
 			_bstr_t bId = Id;
 			CComPtr<IMgaObject> iitem;
 			CComPtr<IMgaFCO> fiitem;
-			_bstr_t item[100];
+			std::vector<_bstr_t> item;
 			int itemcount = 0;
 			CComPtr<IMgaObject> parent;
 			
@@ -2311,14 +2311,16 @@
 			CComPtr<IMgaProject> project = pMgaContext->m_ccpProject;
 			COMTHROW(project->GetFCOByID(bId, &fiitem));
 			fiitem.QueryInterface(&iitem);
-			item[itemcount++] = Id;
+			item.push_back(Id);
+			itemcount++;
 			do
 			{
 				COMTHROW(iitem->GetParent(&parent));
 				_bstr_t bstrid;
 				COMTHROW(parent->get_ID(bstrid.GetAddress()));
 				id = bstrid;
-				item[itemcount++] = id;
+				item.push_back(id);
+				itemcount++;
 				iitem = parent;
 				parent.Release();
 			} while (!m_TreeAggregate.m_MgaMap.SearchTreeItem(id,hNewItem, pUnknown));


More information about the gme-commit mailing list