diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-04-26 10:52:54 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-04-26 11:12:28 +0200 |
commit | 57a676cf951eaa65831b32b080cf3da013bf60fb (patch) | |
tree | 2fceccd221bee64e316367e0720c21ea94c4f08c | |
parent | use our existing zipfuzzer_seed_corpus (diff) | |
download | core-57a676cf951eaa65831b32b080cf3da013bf60fb.tar.gz core-57a676cf951eaa65831b32b080cf3da013bf60fb.zip |
Related: tdf#155017 Stop after the first pop in case the shell was not on stack
After commit 271f17a6022c64cbbe9befbc66a9eaaa0567d569 (tdf#155017: make
sure that the correct shell is popped from SfxDispatcher, 2023-04-26).
This restores the previous logic for a hypothetical case of a pop without
POP_UNTIL scheduled for a shell, which was not on the stack (so that it
wasn't removed in the code added in the commit mentioned above); I haven't
a reproducer, but it definitely can happen, given how things work here. So
I try to avoid breaking it even further :-)
Change-Id: Ied0a1406881fbefe3cf069f816c50da03a41dcd0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151034
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r-- | sfx2/source/control/dispatch.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index e78789e56271..88377c073155 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -1346,6 +1346,13 @@ void SfxDispatcher::FlushImpl() // Mark the moved Shell aToDoCopy.push_front(SfxToDo_Impl(false, i->bDelete, false, *pPopped)); + if (!i->bUntil) + { + // We get here only when the requested shell was not on the stack. + // I don't know how correct to pop a single random other shell and exit + // in this case, but I just make sure that the previous logic is kept. + break; + } } DBG_ASSERT( bFound, "wrong SfxShell popped" ); } |