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


Fix accessing vector out of its boundaries preventing possible crash, this
is for 3.4 branch and master.
From 95f73056bdf9e4b0e0f45bf46376dae5128f11d3 Mon Sep 17 00:00:00 2001
From: Rafael Dominguez <venccsralph@gmail.com>
Date: Tue, 17 May 2011 23:17:10 -0430
Subject: [PATCH] Fix index out of bounds in ScTableConditionalFormat.

---
 sc/source/ui/unoobj/fmtuno.cxx |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sc/source/ui/unoobj/fmtuno.cxx b/sc/source/ui/unoobj/fmtuno.cxx
index 7e1694d..457e79f 100644
--- a/sc/source/ui/unoobj/fmtuno.cxx
+++ b/sc/source/ui/unoobj/fmtuno.cxx
@@ -287,7 +287,7 @@ void ScTableConditionalFormat::AddEntry_Impl(const ScCondFormatEntryItem& aEntry
 
 ScTableConditionalEntry* ScTableConditionalFormat::GetObjectByIndex_Impl(sal_uInt16 nIndex) const
 {
-    return aEntries[nIndex];
+    return nIndex < aEntries.size() ? aEntries[nIndex] : NULL;
 }
 
 void SAL_CALL ScTableConditionalFormat::addNew(
-- 
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.