sc/source/core/data/document.cxx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
New commits: commit 4f6d6d905ffe4e9962ea858d415273df4f5829fd Author: Bartosz Kosiorek <gan...@poczta.onet.pl> Date: Sat Jan 14 00:03:25 2017 +0100 tdf#50916 Make sure that we don't access aCol out of range Change-Id: Ib41b474c6ae573ca68614aeff8ca2cda5fd52dbc Reviewed-on: https://gerrit.libreoffice.org/33061 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index da23524..f486e28 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -6420,11 +6420,16 @@ bool ScDocument::HasColNotes(SCCOL nCol, SCTAB nTab) const bool ScDocument::HasTabNotes(SCTAB nTab) const { - bool hasNotes = false; - for (SCCOL nCol=0; nCol<MAXCOLCOUNT && !hasNotes; ++nCol) - hasNotes = HasColNotes(nCol, nTab); + const ScTable* pTab = FetchTable(nTab); + + if ( !pTab ) + return false; - return hasNotes; + for (SCCOL nCol=0, nColSize = pTab->aCol.size(); nCol < nColSize; ++nCol) + if ( HasColNotes(nCol, nTab) ) + return true; + + return false; } bool ScDocument::HasNotes() const _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits