summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@pardus.org.tr>2018-09-14 14:56:01 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-20 09:52:50 +0200
commit495412c74f52957dd3941970bf34928d069e0dc3 (patch)
treef7287090b3ef3ce10e0cd73df54ef7406ed60080 /cui
parent38898ffcd9bf3253ba7a9df0a3cda6af120a7a34 (diff)
Do not crash when there are more default personas than intended
Change-Id: I516607375b2f296e562bb378e5051303cd27055b Reviewed-on: https://gerrit.libreoffice.org/60492 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@pardus.org.tr> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/options/personalization.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index 4baac93ec917..9c4178d0b987 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -39,6 +39,7 @@
#include <comphelper/simplefileaccessinteraction.hxx>
#define MAX_RESULTS 9
+#define MAX_DEFAULT_PERSONAS 3
using namespace com::sun::star;
using namespace ::com::sun::star::uno;
@@ -428,7 +429,7 @@ void SvxPersonalizationTabPage::LoadDefaultImages()
sal_Int32 nIndex = 0;
bool foundOne = false;
- while( aStream.IsOpen() && !aStream.eof() )
+ while( aStream.IsOpen() && !aStream.eof() && nIndex < MAX_DEFAULT_PERSONAS )
{
OString aLine;
aStream.ReadLine( aLine );