sot/source/sdstor/stgstrms.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
New commits: commit 312a8a32a579160fd1665ab10dc37bd73c89961a Author: Caolán McNamara <caol...@redhat.com> Date: Thu Oct 19 17:11:37 2017 +0100 ofz+ubsan: runtime error: left shift cannot be represented in type Change-Id: Ic153b39475abbd562e4c81b47089ca8280080cff Reviewed-on: https://gerrit.libreoffice.org/43569 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index 1f7f0769f0ce..0933ba7d265e 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -71,10 +71,12 @@ rtl::Reference< StgPage > StgFAT::GetPhysPage( sal_Int32 nByteOff ) sal_Int32 StgFAT::GetNextPage( sal_Int32 nPg ) { - if( nPg >= 0 ) + if (nPg >= 0) { - rtl::Reference< StgPage > pPg = GetPhysPage( nPg << 2 ); - nPg = pPg.is() ? StgCache::GetFromPage( pPg, m_nOffset >> 2 ) : STG_EOF; + if (nPg > (SAL_MAX_INT32 >> 2)) + return STG_EOF; + rtl::Reference< StgPage > pPg = GetPhysPage( nPg << 2 ); + nPg = pPg.is() ? StgCache::GetFromPage( pPg, m_nOffset >> 2 ) : STG_EOF; } return nPg; }
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits