Files
odfstudio/sc/source/ui/vba
Stephan Bergmann da6eea908e Fix heap-use-after-free
...as uncovered by 448426998cc561414ec250d0dc7f0a72ea10c757 "lsan:fix leak of
VbaEventsHelperBase instances" in UITest_calc_tests9,

> ==3008693==ERROR: AddressSanitizer: heap-use-after-free on address 0x7c90789fc488 at pc 0x7b70220491ba bp 0x7ffc8e6e67a0 sp 0x7ffc8e6e6798
> READ of size 8 at 0x7c90789fc488 thread T0
>  #0 in osl::Mutex::release() at include/osl/mutex.hxx:77:37
>  #1 in osl::Guard<osl::Mutex>::~Guard() at include/osl/mutex.hxx:146:17
>  #2 in ScVbaEventListener::processWindowResizeEvent(void*) at sc/source/ui/vba/vbaeventshelper.cxx:515:1
>  #3 in ScVbaEventListener::LinkStubprocessWindowResizeEvent(void*, void*) at sc/source/ui/vba/vbaeventshelper.cxx:478:32
>  #4 in Link<void*, void>::Call(void*) const at include/tools/link.hxx:105:45
>  #5 in ImplHandleUserEvent(ImplSVEvent*) at vcl/source/window/winproc.cxx:2311:30
>  #6 in ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) at vcl/source/window/winproc.cxx:2868:13
>  #7 in SalFrame::CallCallback(SalEvent, void const*) const at vcl/inc/salframe.hxx:310:29
>  #8 in SvpSalInstance::ProcessEvent(SalUserEventList::SalUserEvent) at vcl/headless/svpinst.cxx:289:22
>  #9 in non-virtual thunk to SvpSalInstance::ProcessEvent(SalUserEventList::SalUserEvent) at vcl/headless/svpinst.cxx
>  #10 in SalUserEventList::DispatchUserEvents(bool)::$_0::operator()() const at vcl/source/app/salusereventlist.cxx:119:58
>  #11 in SalUserEventList::DispatchUserEvents(bool) at vcl/source/app/salusereventlist.cxx:120:13
>  #12 in SvpSalInstance::ImplYield(bool, bool) at vcl/headless/svpinst.cxx:442:22
>  #13 in SvpSalInstance::DoYield(bool, bool) at vcl/headless/svpinst.cxx:519:21
>  #14 in InnerYield(bool, bool) at vcl/source/app/svapp.cxx:389:48
>  #15 in Application::Yield() at vcl/source/app/svapp.cxx:502:5
>  #16 in Application::Execute() at vcl/source/app/svapp.cxx:364:13
>  #17 in desktop::Desktop::Main() at desktop/source/app/app.cxx:1681:13
>
> 0x7c90789fc488 is located 72 bytes inside of 264-byte region [0x7c90789fc440,0x7c90789fc548)
> freed by thread T0 here:
>  #0 in free at ~/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:51:3
>  #1 in rtl_freeMemory at sal/rtl/alloc_global.cxx:43:5
>  #2 in cppu::OWeakObject::operator delete(void*) at include/cppuhelper/weak.hxx:88:11
>  #3 in ScVbaEventListener::~ScVbaEventListener() at sc/source/ui/vba/vbaeventshelper.cxx:120:7
>  #4 in cppu::OWeakObject::release() at cppuhelper/source/weak.cxx:230:9
>  #5 in cppu::WeakImplHelper<com::sun::star::awt::XTopWindowListener, com::sun::star::awt::XWindowListener, com::sun::star::frame::XBorderResizeListener, com::sun::star::util::XChangesListener>::release() at include/cppuhelper/implbase.hxx:115:66
>  #6 in ScVbaEventListener::processWindowResizeEvent(void*) at sc/source/ui/vba/vbaeventshelper.cxx:514:5

Signed-off-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Change-Id: I150e2b0da80aa816c3c4b9650ee92d0604e14790
(cherry-picked from commit I150e2b0da80aa816c3c4b9650ee92d0604e14790)
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2310
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205024
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-05-10 15:14:33 +02:00
..
2025-03-07 17:30:50 +01:00
2024-12-08 00:00:43 +01:00
2024-12-08 00:00:43 +01:00
2024-12-18 14:49:14 +01:00
2024-12-18 14:49:14 +01:00
2026-05-10 15:14:33 +02:00
2024-12-08 00:00:43 +01:00
2025-03-07 17:30:50 +01:00
2024-12-18 14:49:14 +01:00
2024-12-18 14:49:14 +01:00
2024-12-18 14:49:14 +01:00
2024-12-18 14:49:14 +01:00
2024-11-08 05:34:20 +01:00