download.lst | 6 external/libxslt/UnpackedTarball_libxslt.mk | 1 external/libxslt/e2584eed1c84c18f16e42188c30d2c3d8e3e8853.patch.1 | 69 ---------- external/libxslt/rpath.patch.0 | 2 hwpfilter/source/htags.cxx | 26 +-- hwpfilter/source/hwpreader.cxx | 64 ++------- sw/qa/core/data/ooxml/fail/LIBREOFFICE-DBDAZAEC.docx |binary sw/source/core/unocore/unodraw.cxx | 2 8 files changed, 32 insertions(+), 138 deletions(-)
New commits: commit 22a8d7c22a023b34ec51cab4772b896dadb4d5ae Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Feb 17 09:57:34 2022 +0000 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Thu Feb 17 21:50:36 2022 +0100 Refetch in case SwTextNode::InsertItem causes it to be deleted Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130087 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> (cherry picked from commit 3dab7bc9dd8763d68fc2e6496e8069c7823685c2) Change-Id: Ie189ae4d37ffc33e58bb405f2521d1ae02a9997b diff --git a/sw/qa/core/data/ooxml/fail/LIBREOFFICE-DBDAZAEC.docx b/sw/qa/core/data/ooxml/fail/LIBREOFFICE-DBDAZAEC.docx new file mode 100755 index 000000000000..add554ae9596 Binary files /dev/null and b/sw/qa/core/data/ooxml/fail/LIBREOFFICE-DBDAZAEC.docx differ diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 876cad2231df..4f8c59dd3fb6 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -1177,6 +1177,8 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a SwFormatFlyCnt aFormat( pFormat ); pNd->InsertItem(aFormat, pInternalPam->GetPoint() ->nContent.GetIndex(), 0 ); + //Refetch in case SwTextNode::InsertItem causes it to be deleted + pFormat = GetFrameFormat(); } else { commit 5da6e5722fffb8f303a5c4f03c9cecb68c5a7f4c Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Jan 28 15:02:54 2022 +0000 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Thu Feb 17 21:50:32 2022 +0100 avoid dangling tmp files in hwp import if there is embedded data use office-binary-data to transport it instead of a temp file https: //issues.oasis-open.org/browse/OFFICE-3933 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129076 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> (cherry picked from commit e95d5d5666505cb05e9660f24f6c7ae039451ef8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129759 (cherry picked from commit bfff5c7dadf9628926fbb5cd0394fcfc4464eb0b) Change-Id: Ia1cebf0770c99210df09f03dbb507451d9cf7764 diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx index d1e3d8d36691..ab400bac045c 100644 --- a/hwpfilter/source/hwpreader.cxx +++ b/hwpfilter/source/hwpreader.cxx @@ -515,62 +515,28 @@ void HwpReader::makeDrawMiscStyle( HWPDrawingObject *hdo ) if( prop->flag >> 18 & 0x01 ) { padd( "draw:name", sXML_CDATA, ascii(Int2Str(hdo->index, "fillimage%d", buf))); - if( !prop->pictype ) + + EmPicture *emp = nullptr; + if (prop->pictype && strlen(prop->szPatternFile) > 3) + emp = hwpfile.GetEmPictureByName(prop->szPatternFile); + if (!emp) { padd( "xlink:href", sXML_CDATA, reinterpret_cast<sal_Unicode const *>(hconv(kstr2hstr( reinterpret_cast<uchar const *>(urltounix(prop->szPatternFile).c_str())).c_str()))); + padd( "xlink:type", sXML_CDATA, "simple"); + padd( "xlink:show", sXML_CDATA, "embed"); + padd( "xlink:actuate", sXML_CDATA, "onLoad"); } - else - { - EmPicture *emp = nullptr; - if ( strlen( prop->szPatternFile ) > 3) - emp = hwpfile.GetEmPictureByName(prop->szPatternFile); - if( emp ) - { - char filename[128+17+9]; - char dirname[128]; - int fd; -#ifdef _WIN32 - GetTempPathA(sizeof(dirname), dirname); - sprintf(filename, "%s%s",dirname, emp->name); - if( (fd = open( filename , _O_CREAT | _O_WRONLY | _O_BINARY , 0666)) >= 0 ) -#else - strcpy(dirname, "/tmp/"); - sprintf(filename, "%s%s", dirname, emp->name); - if( (fd = open( filename , O_CREAT | O_WRONLY , 0666)) >= 0 ) -#endif - { - size_t nWritten = write(fd, emp->data.get(), emp->size); - OSL_VERIFY(nWritten == emp->size); - close(fd); - } -#ifdef _WIN32 - int j; - for(j = 0 ; j < static_cast<int>(strlen( dirname )) ; j++) - { - if( dirname[j] == '\\' ) buf[j] = '/'; - else buf[j] = dirname[j]; - } - buf[j] = '\0'; - sprintf(filename, "file:///%s%s",buf, emp->name ); -#else - sprintf(filename, "file://%s%s",dirname, emp->name ); -#endif - padd( "xlink:href", sXML_CDATA, ascii(filename)); - } - else - { - padd( "xlink:href", sXML_CDATA, - reinterpret_cast<sal_Unicode const *>(hconv(kstr2hstr( reinterpret_cast<uchar const *>(urltounix(prop->szPatternFile).c_str())).c_str()))); - } - - } - padd( "xlink:type", sXML_CDATA, "simple"); - padd( "xlink:show", sXML_CDATA, "embed"); - padd( "xlink:actuate", sXML_CDATA, "onLoad"); rstartEl( "draw:fill-image", mxList.get()); mxList->clear(); + if (emp) + { + rstartEl("office:binary-data", mxList.get()); + std::shared_ptr<char> pStr(base64_encode_string(emp->data.get(), emp->size), Free<char>()); + rchars(ascii(pStr.get())); + rendEl("office:binary-data"); + } rendEl( "draw:fill-image"); } /* If there is a gradient, when a bitmap file is present, this is the first. */ commit cbb5c0e74ec7596a9aa2dc911add8e77d9d22876 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Jan 28 11:34:23 2022 +0000 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Thu Feb 17 21:50:23 2022 +0100 use our own tempfile mechanism Change-Id: Ie7853ea8bd083d1056872cfad4323ff6cede235f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129071 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> (cherry picked from commit 45c15e1112e03b8b211ed0968ed1b16d5ed4ddfe) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129758 (cherry picked from commit 63fcec3105b060cffde5e94fe688c8a59418e4c0) diff --git a/hwpfilter/source/htags.cxx b/hwpfilter/source/htags.cxx index 0c011731c1d4..359c15ae78bc 100644 --- a/hwpfilter/source/htags.cxx +++ b/hwpfilter/source/htags.cxx @@ -19,6 +19,9 @@ #include "precompile.h" +#include <o3tl/char16_t2wchar_t.hxx> +#include <unotools/tempfile.hxx> + #include <string.h> #include "hwplib.h" @@ -108,27 +111,20 @@ void OlePicture::Read(HWPFile & hwpf) delete [] data; return; } - FILE *fp; - char tname[200]; - wchar_t wtname[200]; - tmpnam(tname); - if (nullptr == (fp = fopen(tname, "wb"))) - { - delete [] data; - return; - } - fwrite(data, size, 1, fp); + + utl::TempFile aTempFile; + aTempFile.EnableKillingFile(); + + SvFileStream aOutputStream(aTempFile.GetURL(), StreamMode::WRITE); + aOutputStream.WriteBytes(data, size); delete [] data; - fclose(fp); - MultiByteToWideChar(CP_ACP, 0, tname, -1, wtname, 200); - if( StgOpenStorage(wtname, nullptr, + aOutputStream.Close(); + if( StgOpenStorage(o3tl::toW(aTempFile.GetFileName().getStr()), nullptr, STGM_READWRITE|STGM_SHARE_EXCLUSIVE|STGM_TRANSACTED, nullptr, 0, &pis) != S_OK ) { pis = nullptr; - unlink(tname); return; } - unlink(tname); #else hwpf.SkipBlock(size); #endif commit 36e01c12cdfa2719820d817e5ebd257be8ad6263 Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Thu Feb 17 11:04:01 2022 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Thu Feb 17 21:48:06 2022 +0100 libxslt: upgrade to release 1.1.35 Fixes CVE-2021-30560 Change-Id: I334662ddc40955780321133be9aee23858e04dc1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130023 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> (cherry picked from commit d74fbedd96c9563e1f6bb245dc7e136b30bc5e84) diff --git a/download.lst b/download.lst index c91a51db2ef5..0881d52e26d2 100644 --- a/download.lst +++ b/download.lst @@ -155,9 +155,9 @@ export XMLSEC_TARBALL := xmlsec1-1.2.25.tar.gz export LIBXML_SHA256SUM := c8d6681e38c56f172892c85ddc0852e1fd4b53b4209e7f4ebf17f7e2eae71d92 export LIBXML_VERSION_MICRO := 12 export LIBXML_TARBALL := libxml2-2.9.$(LIBXML_VERSION_MICRO).tar.gz -export LIBXSLT_SHA256SUM := 98b1bd46d6792925ad2dfe9a87452ea2adebf69dcb9919ffd55bf926a7f93f7f -export LIBXSLT_VERSION_MICRO := 34 -export LIBXSLT_TARBALL := libxslt-1.1.$(LIBXSLT_VERSION_MICRO).tar.gz +export LIBXSLT_SHA256SUM := 8247f33e9a872c6ac859aa45018bc4c4d00b97e2feac9eebc10c93ce1f34dd79 +export LIBXSLT_VERSION_MICRO := 35 +export LIBXSLT_TARBALL := libxslt-1.1.$(LIBXSLT_VERSION_MICRO).tar.xz export LPSOLVE_SHA256SUM := 171816288f14215c69e730f7a4f1c325739873e21f946ff83884b350574e6695 export LPSOLVE_TARBALL := 26b3e95ddf3d9c077c480ea45874b3b8-lp_solve_5.5.tar.gz export LXML_SHA256SUM := 940caef1ec7c78e0c34b0f6b94fe42d0f2022915ffc78643d28538a5cfd0f40e diff --git a/external/libxslt/UnpackedTarball_libxslt.mk b/external/libxslt/UnpackedTarball_libxslt.mk index b035e99f0a79..eae318ef74b9 100644 --- a/external/libxslt/UnpackedTarball_libxslt.mk +++ b/external/libxslt/UnpackedTarball_libxslt.mk @@ -19,7 +19,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,libxslt,\ external/libxslt/libxslt-msvc.patch.2 \ external/libxslt/libxslt-1.1.26-memdump.patch \ external/libxslt/rpath.patch.0 \ - external/libxslt/e2584eed1c84c18f16e42188c30d2c3d8e3e8853.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/libxslt/e2584eed1c84c18f16e42188c30d2c3d8e3e8853.patch.1 b/external/libxslt/e2584eed1c84c18f16e42188c30d2c3d8e3e8853.patch.1 deleted file mode 100644 index f82c2e4f77ee..000000000000 --- a/external/libxslt/e2584eed1c84c18f16e42188c30d2c3d8e3e8853.patch.1 +++ /dev/null @@ -1,69 +0,0 @@ -From e2584eed1c84c18f16e42188c30d2c3d8e3e8853 Mon Sep 17 00:00:00 2001 -From: Chun-wei Fan <fanchun...@src.gnome.org> -Date: Tue, 12 Nov 2019 17:37:05 +0800 -Subject: [PATCH] win32: Add configuration for profiler - -Without this the generated xsltconfig.h will not be complete as there -will be a configuration variable that is left in the header, breaking -builds. - -This will allow one to enable or disable profiler support in Windows -builds, and the default is to enable this. ---- - win32/configure.js | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/win32/configure.js b/win32/configure.js -index 56694cce..12c99f30 100644 ---- a/win32/configure.js -+++ b/win32/configure.js -@@ -47,6 +47,7 @@ var withIconv = true; - var withZlib = false; - var withCrypto = true; - var withModules = false; -+var withProfiler = true; - /* Win32 build options. */ - var dirSep = "\\"; - var compiler = "msvc"; -@@ -106,6 +107,7 @@ function usage() - txt += " zlib: Use zlib library (" + (withZlib? "yes" : "no") + ")\n"; - txt += " crypto: Enable Crypto support (" + (withCrypto? "yes" : "no") + ")\n"; - txt += " modules: Enable Module support (" + (withModules? "yes" : "no") + ")\n"; -+ txt += " profiler: Enable Profiler support (" + (withProfiler? "yes" : "no") + ")\n"; - txt += "\nWin32 build options, default value given in parentheses:\n\n"; - txt += " compiler: Compiler to be used [msvc|mingw] (" + compiler + ")\n"; - txt += " cruntime: C-runtime compiler option (only msvc) (" + cruntime + ")\n"; -@@ -192,6 +194,7 @@ function discoverVersion() - vf.WriteLine("WITH_ZLIB=" + (withZlib? "1" : "0")); - vf.WriteLine("WITH_CRYPTO=" + (withCrypto? "1" : "0")); - vf.WriteLine("WITH_MODULES=" + (withModules? "1" : "0")); -+ vf.WriteLine("WITH_PROFILER=" + (withProfiler? "1" : "0")); - vf.WriteLine("DEBUG=" + (buildDebug? "1" : "0")); - vf.WriteLine("STATIC=" + (buildStatic? "1" : "0")); - vf.WriteLine("PREFIX=" + buildPrefix); -@@ -240,6 +243,8 @@ function configureXslt() - of.WriteLine(s.replace(/\@WITH_DEBUGGER\@/, withDebugger? "1" : "0")); - } else if (s.search(/\@WITH_MODULES\@/) != -1) { - of.WriteLine(s.replace(/\@WITH_MODULES\@/, withModules? "1" : "0")); -+ } else if (s.search(/\@WITH_PROFILER\@/) != -1) { -+ of.WriteLine(s.replace(/\@WITH_PROFILER\@/, withProfiler? "1" : "0")); - } else if (s.search(/\@LIBXSLT_DEFAULT_PLUGINS_PATH\@/) != -1) { - of.WriteLine(s.replace(/\@LIBXSLT_DEFAULT_PLUGINS_PATH\@/, "NULL")); - } else -@@ -343,6 +348,8 @@ for (i = 0; (i < WScript.Arguments.length) && (error == 0); i++) { - withCrypto = strToBool(arg.substring(opt.length + 1, arg.length)); - else if (opt == "modules") - withModules = strToBool(arg.substring(opt.length + 1, arg.length)); -+ else if (opt == "profiler") -+ withProfiler = strToBool(arg.substring(opt.length + 1, arg.length)); - else if (opt == "compiler") - compiler = arg.substring(opt.length + 1, arg.length); - else if (opt == "cruntime") -@@ -477,6 +484,7 @@ txtOut += " Use iconv: " + boolToStr(withIconv) + "\n"; - txtOut += " With zlib: " + boolToStr(withZlib) + "\n"; - txtOut += " Crypto: " + boolToStr(withCrypto) + "\n"; - txtOut += " Modules: " + boolToStr(withModules) + "\n"; -+txtOut += " Profiler: " + boolToStr(withProfiler) + "\n"; - txtOut += "\n"; - txtOut += "Win32 build configuration\n"; - txtOut += "-------------------------\n"; diff --git a/external/libxslt/rpath.patch.0 b/external/libxslt/rpath.patch.0 index 78c4859251df..798bccec750e 100644 --- a/external/libxslt/rpath.patch.0 +++ b/external/libxslt/rpath.patch.0 @@ -7,4 +7,4 @@ +hardcode_libdir_flag_spec= ;; - netbsd*) + netbsd* | netbsdelf*-gnu)