[Libreoffice-commits] core.git: 3 commits - libexttextcat/exttextcat-memcpy.patch.1 libexttextcat/UnpackedTarball_exttextcat.mk linguistic/source sal/osl

Michael Stahl mstahl at redhat.com
Thu Jul 4 15:17:12 PDT 2013


 libexttextcat/UnpackedTarball_exttextcat.mk |    1 +
 libexttextcat/exttextcat-memcpy.patch.1     |   16 ++++++++++++++++
 linguistic/source/dicimp.cxx                |    7 ++++++-
 sal/osl/w32/file_error.c                    |    1 +
 4 files changed, 24 insertions(+), 1 deletion(-)

New commits:
commit 1d8ae0c040319ba7d969fa236b7a6bb22d0f55df
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Jul 5 00:11:53 2013 +0200

    sal: add ERROR_SHARING_VIOLATION to win32 error table
    
    It's apparently a popular error; map it to E_ACCES which is the same as
    the catch-all clause does (for compatibility).
    
    Change-Id: I55fd932248a2ecbacd4fd6584e92918da95e3cff

diff --git a/sal/osl/w32/file_error.c b/sal/osl/w32/file_error.c
index 505cde5..f1cd9ce 100644
--- a/sal/osl/w32/file_error.c
+++ b/sal/osl/w32/file_error.c
@@ -55,6 +55,7 @@ static const struct osl_file_error_entry errtable[] = {
   {  ERROR_NOT_SAME_DEVICE,        osl_File_E_XDEV     },  /* 17 */
   {  ERROR_NO_MORE_FILES,          osl_File_E_NOENT    },  /* 18 */
   {  ERROR_NOT_READY,              osl_File_E_NOTREADY },  /* 21 */
+  {  ERROR_SHARING_VIOLATION,      osl_File_E_ACCES    },  /* 32 */
   {  ERROR_LOCK_VIOLATION,         osl_File_E_ACCES    },  /* 33 */
   {  ERROR_BAD_NETPATH,            osl_File_E_NOENT    },  /* 53 */
   {  ERROR_NETWORK_ACCESS_DENIED,  osl_File_E_ACCES    },  /* 65 */
commit d68de5195605bd9236851e0714dd9b03b0f5f3be
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Jul 5 00:07:43 2013 +0200

    fdo#66420: fix user dictionaries on Windows
    
    28300209604ee1bb8e5050322b29e95a07f679d8 added yet another silly temp
    file wrapper class, and introduced 2 bugs: the file descriptor is not
    closed before renaming it which fails with ERROR_SHARING_VIOLATION
    on Win32, and (as a consequence of that) another attempt to save the
    dictionary during shutdown fails because SimpleFileAccess cannot be
    created and this is not checked.
    
    Change-Id: I7bd3f5d349ed550440a93fe71e3791c9919de3af

diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx
index 083f4c5..5af73a8 100644
--- a/linguistic/source/dicimp.cxx
+++ b/linguistic/source/dicimp.cxx
@@ -393,7 +393,10 @@ struct TmpDictionary
     {
         try
         {
-            mxAccess->kill(maTmpURL);
+            if (mxAccess.is())
+            {
+                mxAccess->kill(maTmpURL);
+            }
         }
         catch (const uno::Exception &) { }
     }
@@ -492,6 +495,8 @@ sal_uLong DictionaryNeo::saveEntries(const OUString &rURL)
             break;
     }
 
+    pStream.reset(); // fdo#66420 close streams so Win32 can move the file
+    xStream.clear();
     nErr = aTmpDictionary.renameTmpToURL();
 
     //If we are migrating from an older version, then on first successful
commit 3bde0af3a8fd09defd47465d4b62541350cecc1c
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Jul 4 23:12:53 2013 +0200

    libexttextcat: fix overlapping memcpy
    
    Change-Id: I3225043560a3c0e02345bc4e8a8d0f9cca2e3cd0

diff --git a/libexttextcat/UnpackedTarball_exttextcat.mk b/libexttextcat/UnpackedTarball_exttextcat.mk
index ef90108..1bf53fb 100644
--- a/libexttextcat/UnpackedTarball_exttextcat.mk
+++ b/libexttextcat/UnpackedTarball_exttextcat.mk
@@ -13,6 +13,7 @@ $(eval $(call gb_UnpackedTarball_set_tarball,exttextcat,$(LIBEXTTEXTCAT_TARBALL)
 
 $(eval $(call gb_UnpackedTarball_add_patches,exttextcat,\
 	libexttextcat/android.patch \
+	libexttextcat/exttextcat-memcpy.patch.1 \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/libexttextcat/exttextcat-memcpy.patch.1 b/libexttextcat/exttextcat-memcpy.patch.1
new file mode 100644
index 0000000..b3e399a
--- /dev/null
+++ b/libexttextcat/exttextcat-memcpy.patch.1
@@ -0,0 +1,16 @@
+fix overlapped memcpy in heapextract
+
+--- a/src/fingerprint.c 2013-07-04 22:53:25.674741538 +0200
++++ b/src/fingerprint.c	2013-07-04 22:54:09.009741166 +0200
+@@ -254,7 +254,10 @@
+     p = &(t->heap[0]);
+ 
+     memcpy(item, p, sizeof(entry_t));
+-    memcpy(&(t->heap[0]), &(t->heap[t->size - 1]), sizeof(entry_t));
++    if (t->size > 1)
++    {
++        memcpy(&(t->heap[0]), &(t->heap[t->size - 1]), sizeof(entry_t));
++    }
+ 
+     siftdown(t, t->size, 0);
+     t->size--;


More information about the Libreoffice-commits mailing list