[Libreoffice-commits] core.git: 2 commits - vcl/source xmlsecurity/source

Caolán McNamara caolanm at redhat.com
Thu Nov 17 13:27:43 UTC 2016


 vcl/source/fontsubset/sft.cxx                          |   29 +++++++++--------
 xmlsecurity/source/helper/documentsignaturemanager.cxx |    5 ++
 2 files changed, 21 insertions(+), 13 deletions(-)

New commits:
commit 447a65db6b7ea2ed580f2fdd364ac6084cc282be
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 17 13:26:36 2016 +0000

    coverity#1394292 Unchecked return value
    
    Change-Id: I90db6e3c69a6dc90ce1df0dbb5b9d7a81cd1bbea

diff --git a/xmlsecurity/source/helper/documentsignaturemanager.cxx b/xmlsecurity/source/helper/documentsignaturemanager.cxx
index f10c277..f9b4355 100644
--- a/xmlsecurity/source/helper/documentsignaturemanager.cxx
+++ b/xmlsecurity/source/helper/documentsignaturemanager.cxx
@@ -63,8 +63,11 @@ bool DocumentSignatureManager::init()
 
 PDFSignatureHelper& DocumentSignatureManager::getPDFSignatureHelper()
 {
+    bool bInit = true;
     if (!mxSecurityContext.is())
-        init();
+        bInit = init();
+
+    SAL_WARN_IF(!bInit, "xmlsecurity.comp", "Error initializing security context!");
 
     if (!mpPDFSignatureHelper)
         mpPDFSignatureHelper.reset(new PDFSignatureHelper(mxContext));
commit dc6d4772e03d78baa6ee85b69b582598fb5f240a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 17 13:23:10 2016 +0000

    coverity#1394372 Division or modulo by zero
    
    Change-Id: I1d8d134bf423778a76f7dc6fc5a5e4f8c30c6c3d

diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index d82c082..8e9ccb9 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -614,18 +614,23 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
         if (abs3 < 0) abs3 = -abs3;
         if (abs3 <= 33) n *= 2;
 
-        for (i=0; i<np; i++) {
-            F16Dot16 t;
-            ControlPoint cp;
-            cp.flags = nextComponent[i].flags;
-            const sal_uInt16 x = nextComponent[i].x;
-            const sal_uInt16 y = nextComponent[i].y;
-            t = fixedMulDiv(a, x << 16, m) + fixedMulDiv(c, y << 16, m) + (e << 16);
-            cp.x = (sal_Int16)(fixedMul(t, m) >> 16);
-            t = fixedMulDiv(b, x << 16, n) + fixedMulDiv(d, y << 16, n) + (f << 16);
-            cp.y = (sal_Int16)(fixedMul(t, n) >> 16);
-
-            myPoints.push_back( cp );
+        SAL_WARN_IF(np && !m, "vcl.fonts", "Parsing error in " << OUString::createFromAscii(ttf->fname) <<
+                     ": " << "divide by zero");
+
+        if (m != 0) {
+            for (i=0; i<np; i++) {
+                F16Dot16 t;
+                ControlPoint cp;
+                cp.flags = nextComponent[i].flags;
+                const sal_uInt16 x = nextComponent[i].x;
+                const sal_uInt16 y = nextComponent[i].y;
+                t = fixedMulDiv(a, x << 16, m) + fixedMulDiv(c, y << 16, m) + (e << 16);
+                cp.x = (sal_Int16)(fixedMul(t, m) >> 16);
+                t = fixedMulDiv(b, x << 16, n) + fixedMulDiv(d, y << 16, n) + (f << 16);
+                cp.y = (sal_Int16)(fixedMul(t, n) >> 16);
+
+                myPoints.push_back( cp );
+            }
         }
 
         free(nextComponent);


More information about the Libreoffice-commits mailing list