[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - starmath/source

2018-05-11 Thread Caolán McNamara
 starmath/source/mathtype.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 0ec74577a97ca51d50e0f3782c289c95c6430641
Author: Caolán McNamara 
Date:   Fri May 11 09:27:49 2018 +0100

Related: ofz#8226 + valgrind: uninitialized value

Change-Id: I63dea876dffe2d9e17b506dbd8515da2d97fbf08
Reviewed-on: https://gerrit.libreoffice.org/54114
Reviewed-by: Michael Stahl 
Tested-by: Jenkins 

diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index 20486fc9a922..a14dd25c84c2 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -2852,7 +2852,7 @@ void MathType::HandleSetSize()
 bool MathType::HandleChar(sal_Int32 , int , int nLevel,
 sal_uInt8 nTag, sal_uInt8 nSelector, sal_uInt8 nVariation, bool bSilent)
 {
-sal_Unicode nChar;
+sal_Unicode nChar(0);
 bool bRet = true;
 
 if (xfAUTO(nTag))
@@ -2865,7 +2865,7 @@ bool MathType::HandleChar(sal_Int32 , int 
, int nLevel,
 pS->ReadUChar( nTypeFace );
 if (nVersion < 3)
 {
-sal_uInt8 nChar8;
+sal_uInt8 nChar8(0);
 pS->ReadUChar( nChar8 );
 nChar = nChar8;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - starmath/source

2017-12-29 Thread Caolán McNamara
 starmath/source/mathmlattr.hxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 3cd0f7aedc46653ae84db9e460609a814ec9013d
Author: Caolán McNamara 
Date:   Thu Dec 28 21:29:53 2017 +

ofz#4765: Conditional jump or move depends on uninitialised value

Change-Id: Ic8a4fd6cc62c7257f714e2ce2f155f60aa04aa2f
Reviewed-on: https://gerrit.libreoffice.org/47158
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/starmath/source/mathmlattr.hxx b/starmath/source/mathmlattr.hxx
index f5402546e68e..56144b7b6028 100644
--- a/starmath/source/mathmlattr.hxx
+++ b/starmath/source/mathmlattr.hxx
@@ -43,6 +43,10 @@ struct MathMLAttributeLengthValue
 {
 Fraction aNumber;
 MathMLLengthUnit eUnit;
+MathMLAttributeLengthValue()
+: eUnit(MathMLLengthUnit::None)
+{
+}
 };
 
 sal_Int32 ParseMathMLAttributeLengthValue(const OUString , 
MathMLAttributeLengthValue *pV);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - starmath/source

2017-12-05 Thread Caolán McNamara
 starmath/source/mathmlimport.cxx |   17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

New commits:
commit 4963ea48961c7c4dc941c89afe56a1f84b31e66e
Author: Caolán McNamara 
Date:   Fri Dec 1 17:33:20 2017 +

ofz#4531 Bad-cast

Change-Id: I152c2e7fa09fc637b176482de9718cf03880c23e
Reviewed-on: https://gerrit.libreoffice.org/45876
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index e1537bf62d75..e252ee166a2b 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -2637,10 +2637,9 @@ void SmXMLTableContext_Impl::EndElement()
 auto nRows = rNodeStack.size()-nElementCount;
 sal_uInt16 nCols = 0;
 
-SmStructureNode *pArray;
 for (auto i=nRows;i > 0;i--)
 {
-pArray = static_cast(rNodeStack.front().release());
+SmNode* pArray = rNodeStack.front().release();
 rNodeStack.pop_front();
 if (pArray->GetNumSubNodes() == 0)
 {
@@ -2656,22 +2655,24 @@ void SmXMLTableContext_Impl::EndElement()
 aRelationArray.resize(1);
 aRelationArray[0] = pArray;
 SmToken aDummy;
-pArray = new SmExpressionNode(aDummy);
-pArray->SetSubNodes(aRelationArray);
+SmExpressionNode* pExprNode = new SmExpressionNode(aDummy);
+pExprNode->SetSubNodes(aRelationArray);
+pArray = pExprNode;
 }
 
 if (pArray->GetNumSubNodes() > nCols)
 nCols = pArray->GetNumSubNodes();
-aReverseStack.push_front(std::unique_ptr(pArray));
+aReverseStack.push_front(std::unique_ptr(pArray));
 }
 aExpressionArray.resize(nCols*nRows);
 size_t j=0;
 while ( !aReverseStack.empty() )
 {
-pArray = static_cast(aReverseStack.front().release());
+std::unique_ptr 
xArray(static_cast(aReverseStack.front().release()));
 aReverseStack.pop_front();
-for (sal_uInt16 i=0;iGetNumSubNodes();i++)
-aExpressionArray[j++] = pArray->GetSubNode(i);
+for (sal_uInt16 i = 0; i < xArray->GetNumSubNodes(); ++i)
+aExpressionArray[j++] = xArray->GetSubNode(i);
+xArray->SetSubNodes(SmNodeArray());
 }
 
 SmToken aToken;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits