[Libreoffice-commits] .: svtools/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Oct 30 09:26:12 PDT 2012


 svtools/source/contnr/treelist.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b72fca4ec4ad00786192bad68eba245cdeb6a692
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Tue Oct 30 17:24:59 2012 +0100

    SvTreeList::GetEntry: detect an out-of-bound and return NULL in that case
    
    That's how this worked prior to stlification.
    
    Change-Id: I4b1a9735c92efc181a2d1f47cafb04d2855fdfe2

diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx
index 895ef97..1716e27 100644
--- a/svtools/source/contnr/treelist.cxx
+++ b/svtools/source/contnr/treelist.cxx
@@ -1862,7 +1862,7 @@ SvTreeListEntry* SvTreeList::GetEntry( SvTreeListEntry* pParent, sal_uLong nPos
 SvTreeListEntry* SvTreeList::GetEntry( sal_uLong nRootPos ) const
 {
     SvTreeListEntry* pRet = 0;
-    if ( nEntryCount )
+    if ( nEntryCount && nRootPos < pRootItem->maChildren.size())
         pRet = &pRootItem->maChildren[nRootPos];
     return pRet;
 }


More information about the Libreoffice-commits mailing list