Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Fix possible oob when trying to erase an element. Please review and signoff
for merging into 3.4.1
From eb95ef34e1e10787e582726bb660b821bdee74b3 Mon Sep 17 00:00:00 2001
From: Rafael Dominguez <venccsralph@gmail.com>
Date: Thu, 26 May 2011 15:33:07 -0430
Subject: [PATCH] Make sure we dont oob when erasing.

---
 vcl/source/control/ilstbox.cxx |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index 340a349..cbe5de3 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -274,10 +274,10 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* 
pNewEntry
 
 void ImplEntryList::RemoveEntry( sal_uInt16 nPos )
 {
-    boost::ptr_vector<ImplEntryType>::iterator iter = maEntries.begin()+ nPos;
-
-    if (iter != maEntries.end())
+    if (nPos < maEntries.size())
     {
+        boost::ptr_vector<ImplEntryType>::iterator iter = maEntries.begin()+ nPos;
+
         if ( !!iter->maImage )
             mnImages--;
 
-- 
1.7.3.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.