summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-03-04 15:50:08 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-03-04 20:51:58 +0100
commit61ff5e8126c64ff521a148c5003e15a86d50c4cc (patch)
tree5a69bae5878d28dcbc2cc30d61cbfd5c3c64260b
parent0087dc55121808a7fbf09cd94549b44dc17707dd (diff)
ofz#31672 Bad-cast
==3484068== Invalid read of size 8 ==3484068== at 0x226E9EDC: SwClient::GetRegisteredIn() const (calbck.hxx:159) ==3484068== by 0x22A09E30: SwDoc::ChgPageDesc(unsigned long, SwPageDesc const&) (docdesc.cxx:465) ==3484068== by 0x238B1ECC: UpdatePageDescs(SwDoc&, unsigned long) (fltshell.cxx:1094) ==3484068== by 0x1CDD6E52: SwWW8ImplReader::CoreLoad(WW8Glossary const*) (ww8par.cxx:5482) ==3484068== by 0x1CDD90A1: SwWW8ImplReader::LoadThroughDecryption(WW8Glossary*) (ww8par.cxx:5939) ==3484068== by 0x1CDDAE71: SwWW8ImplReader::LoadDoc(WW8Glossary*) (ww8par.cxx:6243) ==3484068== Address 0x28c215c8 is 40 bytes inside a block of size 56 free'd ==3484068== at 0x483AEDD: operator delete(void*) (vg_replace_malloc.c:584) ==3484068== by 0x23009F47: SwFormatHeader::~SwFormatHeader() (atrfrm.cxx:503) ==3484068== by 0x9DDC3F3: SfxItemPool::Remove(SfxPoolItem const&) (itempool.cxx:741) ==3484068== by 0x9E17BD6: SfxItemSet::~SfxItemSet() (itemset.cxx:252) ==3484068== by 0x227FE847: SwAttrSet::~SwAttrSet() (swatrset.hxx:161) ==3484068== by 0x227FD139: SwFormat::SetFormatAttr(SfxPoolItem const&) (format.cxx:524) ==3484068== by 0x22A07AA6: SwDoc::CopyMasterHeader(SwPageDesc const&, SwFormatHeader const&, SwPageDesc&, bool, bool) (docdesc.cxx:248) ==3484068== by 0x22A09B4D: SwDoc::ChgPageDesc(unsigned long, SwPageDesc const&) (docdesc.cxx:457) ==3484068== by 0x238B1ECC: UpdatePageDescs(SwDoc&, unsigned long) (fltshell.cxx:1094) ==3484068== by 0x1CDD6E52: SwWW8ImplReader::CoreLoad(WW8Glossary const*) (ww8par.cxx:5482) ==3484068== by 0x1CDD90A1: SwWW8ImplReader::LoadThroughDecryption(WW8Glossary*) (ww8par.cxx:5939) ==3484068== by 0x1CDDAE71: SwWW8ImplReader::LoadDoc(WW8Glossary*) (ww8par.cxx:6243) since... commit f5dc6b11d2218d94c9effe7a1ab418d0133da5e3 Date: Tue Jan 26 13:11:42 2021 +0100 tdf#140117 sw UI: keep headers/footers when inactive Change-Id: I14787d4203c457393e8b5d0222df67d394a4c9ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111970 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/core/doc/docdesc.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 87a99ff13f84..1c40970c4ecd 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -462,11 +462,11 @@ void SwDoc::ChgPageDesc( size_t i, const SwPageDesc &rChged )
const bool bStashLeftHead = !rDesc.IsHeaderShared() && rChged.IsHeaderShared();
const bool bStashFirstMasterHead = !rDesc.IsFirstShared() && rChged.IsFirstShared();
const bool bStashFirstLeftHead = (!rDesc.IsHeaderShared() && rChged.IsHeaderShared()) || (!rDesc.IsFirstShared() && rChged.IsFirstShared());
- if (rLeftHead.GetRegisteredIn() && bStashLeftHead)
+ if (bStashLeftHead && rLeftHead.GetRegisteredIn())
rDesc.StashFrameFormat(rChged.GetLeft(), true, true, false);
- if (rFirstMasterHead.GetRegisteredIn() && bStashFirstMasterHead)
+ if (bStashFirstMasterHead && rFirstMasterHead.GetRegisteredIn())
rDesc.StashFrameFormat(rChged.GetFirstMaster(), true, false, true);
- if (rFirstLeftHead.GetRegisteredIn() && bStashFirstLeftHead)
+ if (bStashFirstLeftHead && rFirstLeftHead.GetRegisteredIn())
rDesc.StashFrameFormat(rChged.GetFirstLeft(), true, true, true);
rDesc.ChgHeaderShare( rChged.IsHeaderShared() );
@@ -500,11 +500,11 @@ void SwDoc::ChgPageDesc( size_t i, const SwPageDesc &rChged )
const bool bStashLeftFoot = !rDesc.IsFooterShared() && rChged.IsFooterShared();
const bool bStashFirstMasterFoot = !rDesc.IsFirstShared() && rChged.IsFirstShared();
const bool bStashFirstLeftFoot = (!rDesc.IsFooterShared() && rChged.IsFooterShared()) || (!rDesc.IsFirstShared() && rChged.IsFirstShared());
- if (rLeftFoot.GetRegisteredIn() && bStashLeftFoot)
+ if (bStashLeftFoot && rLeftFoot.GetRegisteredIn())
rDesc.StashFrameFormat(rChged.GetLeft(), false, true, false);
- if (rFirstMasterFoot.GetRegisteredIn() && bStashFirstMasterFoot)
+ if (bStashFirstMasterFoot && rFirstMasterFoot.GetRegisteredIn())
rDesc.StashFrameFormat(rChged.GetFirstMaster(), false, false, true);
- if (rFirstLeftFoot.GetRegisteredIn() && bStashFirstLeftFoot)
+ if (bStashFirstLeftFoot && rFirstLeftFoot.GetRegisteredIn())
rDesc.StashFrameFormat(rChged.GetFirstLeft(), false, true, true);
rDesc.ChgFooterShare( rChged.IsFooterShared() );