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


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/1726

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/26/1726/1

Resolves: fdo#59183 Copy 4 or more slides then crash

regression from 17afe4cea7e01aef1e5270cc09f438bc6fde3211 which is totally
forgivable as its riddled with asserts that suggest there should be no
out-of-bounds accesses and there probably shouldn't and those queries are
possibly bugs. But double-checking 3-6 it is the case that non-existant pages
were queried for in that version too, so return NULL on out-of-bounds
like the original pre-stl conversion code did.

Change-Id: Ic918419b6cb76b083de6b6911dde9d6e00258324
(cherry picked from commit 63de2b8f1493f24669c78df3bc2d48d13528bd9f)
---
M svx/source/svdraw/svdmodel.cxx
1 file changed, 2 insertions(+), 2 deletions(-)



diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 4e9c6e4..75993f6 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -1996,13 +1996,13 @@
 const SdrPage* SdrModel::GetPage(sal_uInt16 nPgNum) const
 {
     DBG_ASSERT(nPgNum < maPages.size(), "SdrModel::GetPage: Access out of range (!)");
-    return maPages[nPgNum];
+    return nPgNum < maPages.size() ? maPages[nPgNum] : NULL;
 }
 
 SdrPage* SdrModel::GetPage(sal_uInt16 nPgNum)
 {
     DBG_ASSERT(nPgNum < maPages.size(), "SdrModel::GetPage: Access out of range (!)");
-    return maPages[nPgNum];
+    return nPgNum < maPages.size() ? maPages[nPgNum] : NULL;
 }
 
 sal_uInt16 SdrModel::GetPageCount() const

-- 
To view, visit https://gerrit.libreoffice.org/1726
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic918419b6cb76b083de6b6911dde9d6e00258324
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Caolán McNamara <caolanm@redhat.com>


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.