[Libreoffice-commits] core.git: fpicker/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Mon Aug 21 01:49:08 UTC 2017
fpicker/source/office/RemoteFilesDialog.cxx | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
New commits:
commit 893298e777decac8671fa24b3083357f31a924eb
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Jul 31 02:22:54 2017 +0200
avoid out of bounds access
Change-Id: I4c7ddf2fcabc231b7250306b4a9255fab1a9ef7c
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index ca37b71c8c15..df8e1282e415 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -529,9 +529,10 @@ int RemoteFilesDialog::GetSelectedServicePos()
if( m_aServices.empty() )
return -1;
- while( nPos < ( int )m_aServices.size() )
+ int nServices = static_cast<int>(m_aServices.size());
+ while( nPos < nServices )
{
- while( m_aServices[nPos]->IsLocal() )
+ while( (nPos < nServices) && m_aServices[nPos]->IsLocal() )
nPos++;
i++;
if( i == nSelected )
More information about the Libreoffice-commits
mailing list