[Libreoffice-commits] core.git: 2 commits - hwpfilter/source sfx2/source

Caolán McNamara caolanm at redhat.com
Tue Feb 28 12:35:31 UTC 2017


 hwpfilter/source/hwpfile.cxx     |    6 ++++++
 sfx2/source/control/unoctitm.cxx |    9 +++++----
 2 files changed, 11 insertions(+), 4 deletions(-)

New commits:
commit b9483aacadf443e57f7708f8db64aeeba4666f2a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Feb 28 12:32:07 2017 +0000

    hwp: avoid low hanging invalid input
    
    Change-Id: I06133d6db14edb9d915c38e4c120a9d0905495dd

diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx
index 5f6fe55..0ce3902 100644
--- a/hwpfilter/source/hwpfile.cxx
+++ b/hwpfilter/source/hwpfile.cxx
@@ -350,6 +350,12 @@ void HWPFile::TagsRead()
                      if (!Read4b(_hwpInfo.back_info.size))
                         return;
 
+                     if (_hwpInfo.back_info.size < 0)
+                     {
+                        _hwpInfo.back_info.size = 0;
+                        return;
+                     }
+
                      _hwpInfo.back_info.data = new char[(unsigned int)_hwpInfo.back_info.size];
                      ReadBlock(_hwpInfo.back_info.data, _hwpInfo.back_info.size);
 
commit 727a25090dbb1d3a3a2c33153a12d9c25b4206de
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Feb 28 12:04:40 2017 +0000

    might as well move append 'usage' into the msConfigPath from the start
    
    Change-Id: Ie8a15f1a20621ebdd00ab4ed195495e0acd111a5

diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 6e99463..2191cd8 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -496,7 +496,10 @@ public:
     {
         mbIsCollecting = bIsCollecting;
         if (mbIsCollecting)
+        {
             msConfigPath = SvtPathOptions().GetConfigPath();
+            msConfigPath += "usage/";
+        }
     }
 };
 
@@ -515,9 +518,7 @@ void UsageInfo::save()
     if (!mbIsCollecting)
         return;
 
-    OUString path(msConfigPath);
-    path += "usage/";
-    osl::Directory::createPath(path);
+    osl::Directory::createPath(msConfigPath);
 
     //get system time information.
     TimeValue systemTime;
@@ -532,7 +533,7 @@ void UsageInfo::save()
 
     //filename type: usage-YYYY-MM-DDTHH_MM_SS.csv
     OUString filename = "usage-" + OUString::createFromAscii(time) + ".csv";
-    path += filename;
+    OUString path = msConfigPath + filename;
 
     osl::File file(path);
 


More information about the Libreoffice-commits mailing list