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

Mark Wielaard mark at klomp.org
Mon Jul 8 04:51:20 PDT 2013


 starmath/source/mathtype.cxx |    1 +
 1 file changed, 1 insertion(+)

New commits:
commit fb1931f94724703243c31e6be72267c327052f56
Author: Mark Wielaard <mark at klomp.org>
Date:   Sun Jul 7 22:22:25 2013 +0200

    Robustify MathType::HandleRecords.
    
    Initialize nTag to zero before reading from the stream. In case the
    stream is faulty. That will make nRecord equal to END so we drop out
    of the do while loop and don't use unitialized variables.
    
    Change-Id: Iad135e8d7f53c41cf8a764e5c7ab0f0cc5ffc6f0
    Reviewed-on: https://gerrit.libreoffice.org/4759
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>

diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index b910a41..22b48f7 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -670,6 +670,7 @@ int MathType::HandleRecords(int nLevel,sal_uInt8 nSelector,
 
     do
     {
+        nTag = 0;
         *pS >> nTag;
         nRecord = nTag&0x0F;
 


More information about the Libreoffice-commits mailing list