From 4f6d6d905ffe4e9962ea858d415273df4f5829fd Mon Sep 17 00:00:00 2001 From: Bartosz Kosiorek Date: Sat, 14 Jan 2017 00:03:25 +0100 Subject: 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 Reviewed-by: Markus Mohrhard --- sc/source/core/data/document.cxx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'sc') diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index da23524ad344..f486e28139be 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; nColaCol.size(); nCol < nColSize; ++nCol) + if ( HasColNotes(nCol, nTab) ) + return true; + + return false; } bool ScDocument::HasNotes() const -- cgit