diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-04-26 17:26:09 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-04-26 22:18:14 +0200 |
commit | 05459943ce9375e6d8627b5b417c11049d26f15b (patch) | |
tree | 6dcb5779ae2bbc1877299835b419d3c048de185c /include | |
parent | b380c82491593d783ecd5469feda0220ec264db3 (diff) |
ofz#13491 SvxRTFItemStackType dtor excessive recurse depth
ofz#13491 SvxRTFItemStackType dtor recursively calls the dtor of its
m_pChildList. The recurse depth can grow sufficiently to trigger asan.
So breadth-first iterate through the nodes and make a flat vector of them which
can be iterated through in order of most distant from root first and release
their children linearly
Change-Id: Icc7d7130935a27595dae7b55cea41c6a53aed956
Reviewed-on: https://gerrit.libreoffice.org/71386
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/editeng/svxrtf.hxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/editeng/svxrtf.hxx b/include/editeng/svxrtf.hxx index 9d01ca41a0ff..a2de114fffaa 100644 --- a/include/editeng/svxrtf.hxx +++ b/include/editeng/svxrtf.hxx @@ -309,10 +309,11 @@ class EDITENG_DLLPUBLIC SvxRTFItemStackType void Add(std::unique_ptr<SvxRTFItemStackType>); void Compress( const SvxRTFParser& ); + void DropChildList(); public: - SvxRTFItemStackType( const SvxRTFItemStackType&, const EditPosition&, - bool bCopyAttr ); + SvxRTFItemStackType(const SvxRTFItemStackType&, const EditPosition&, + bool bCopyAttr); ~SvxRTFItemStackType(); //cmc, I'm very suspicious about SetStartPos, it doesn't change //its children's starting position, and the implementation looks |