sw/source/filter/ww8/wrtww8.cxx |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit f56b2dcb5f8b264366a7f7945f3d5ad83aaa7ea8
Author:     Justin Luth <jl...@mail.com>
AuthorDate: Thu Mar 14 17:28:50 2024 -0400
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Fri Mar 15 22:02:15 2024 +0100

    tdf#160192: avoid crash when trying to overwrite doc/lockfile in RO dir
    
    Bug exposed with 6.1 5259ab8104cfba60c40748ed0cd59d93df038c5b
    sfx2 store: create temp files next to local files
    
    Change-Id: I769096f5ee1b2568e198c1e53b71c10af58f5c9c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164850
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>
    Reviewed-by: Justin Luth <jl...@mail.com>

diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 23bc15c8f941..72ed190b4ec2 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -3553,6 +3553,9 @@ ErrCode WW8Export::ExportDocument_Impl()
     m_pFib.reset(new WW8Fib(8, m_bDot));
 
     rtl::Reference<SotStorageStream> 
xWwStrm(GetWriter().GetStorage().OpenSotStream(m_aMainStg));
+    if (!xWwStrm->IsWritable())
+        return ERRCODE_IO_ACCESSDENIED;
+
     rtl::Reference<SotStorageStream> xTableStrm(xWwStrm), xDataStrm(xWwStrm);
     xWwStrm->SetBufferSize( 32768 );
 

Reply via email to