[Libreoffice-commits] core.git: filter/source

Andre Fischer af at apache.org
Fri Mar 8 08:10:16 PST 2013


 filter/source/msfilter/escherex.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 6bf213237139cf1dbea3b793a90a0245872f1110
Author: Andre Fischer <af at apache.org>
Date:   Tue Jun 12 06:23:27 2012 +0000

    #i119502# Guard array access against invalid indices.
    
    Patch by: SunYing
    Review by: Andre

diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 81a12ed..5d5809b 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1962,8 +1962,12 @@ sal_Int32 GetValueForEnhancedCustomShapeParameter( const com::sun::star::drawing
     {
         case com::sun::star::drawing::EnhancedCustomShapeParameterType::EQUATION :
         {
-            nValue = (sal_uInt16)rEquationOrder[ nValue ];
-            nValue |= (sal_uInt32)0x80000000;
+            OSL_ASSERT(nValue < rEquationOrder.size());
+            if ( nValue < rEquationOrder.size() )
+            {
+                nValue = (sal_uInt16)rEquationOrder[ nValue ];
+                nValue |= (sal_uInt32)0x80000000;
+            }
         }
         break;
         case com::sun::star::drawing::EnhancedCustomShapeParameterType::NORMAL :


More information about the Libreoffice-commits mailing list