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 <[email protected]>
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
_______________________________________________
LibreOffice mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice