[PATCH] fix crash with out of bound accelerater vector access fdo#36802

Michael Meeks michael.meeks at novell.com
Mon May 9 13:43:31 PDT 2011


---
 vcl/source/window/accel.cxx |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx
index 83b765f..c17bd20 100644
--- a/vcl/source/window/accel.cxx
+++ b/vcl/source/window/accel.cxx
@@ -118,7 +118,9 @@ static void ImplAccelEntryInsert( ImplAccelList* pList, ImplAccelEntry* pEntry )
         do
         {
             nIndex++;
-            ImplAccelEntry* pTempEntry = (*pList)[ nIndex ];
+            ImplAccelEntry* pTempEntry = NULL;
+            if ( nIndex < pList->size() )
+                pTempEntry = (*pList)[ nIndex ];
             if ( !pTempEntry || (pTempEntry->mnId != pEntry->mnId) )
                 break;
         }
-- 
1.7.3.4


-- 
 michael.meeks at novell.com  <><, Pseudo Engineer, itinerant idiot




More information about the LibreOffice mailing list