Kaydet (Commit) e0a5f073 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

A CALCINPUTLINE is not an Edit

Under ASan, clicking into the Calc "input line" control (in the toolbars) caused

> ==26138==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x616000107a4c at pc 0x7fc890d792cb bp 0x7fff4cab6d90 sp 0x7fff4cab6d88
> READ of size 1 at 0x616000107a4c thread T0
>  #0 in Edit::IsPassword() const at include/vcl/edit.hxx:285:38
>  #1 in vcl::Window::getDefaultAccessibleRole() const at vcl/source/window/accessibility.cxx:327:73
[...]
> 0x616000107a4c is located 116 bytes to the right of 600-byte region [0x616000107780,0x6160001079d8)
> allocated by thread T0 here:
>  #0 in operator new(unsigned long) at /data/sbergman/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_new_delete.cc:105:3
>  #1 in VclPtr<ScInputBarGroup> VclPtr<ScInputBarGroup>::Create<vcl::Window*&, ScTabViewShell*&>(vcl::Window*&, ScTabViewShell*&) at include/vcl/vclptr.hxx:129:42
>  #2 in lcl_chooseRuntimeImpl(vcl::Window*, SfxBindings const*) at sc/source/ui/app/inputwin.cxx:157:12

This looks like it got broken with cca4d9ab
"convert WB_PASSWORD to a bool field on Edit" assuming that a Window of type
CALCINPUTLINE derives from Edit, even though ScInputBarGroup does not.

Change-Id: I1457c6cd07477ee0fa868c3949105aa96116a366
Reviewed-on: https://gerrit.libreoffice.org/72893
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 863533ee
......@@ -323,9 +323,10 @@ sal_uInt16 Window::getDefaultAccessibleRole() const
case WindowType::MULTILINEEDIT: nRole = accessibility::AccessibleRole::SCROLL_PANE; break;
case WindowType::PATTERNFIELD:
case WindowType::CALCINPUTLINE:
case WindowType::EDIT: nRole = static_cast<Edit const *>(this)->IsPassword() ? accessibility::AccessibleRole::PASSWORD_TEXT : accessibility::AccessibleRole::TEXT; break;
case WindowType::CALCINPUTLINE: nRole = accessibility::AccessibleRole::TEXT; break;
case WindowType::PATTERNBOX:
case WindowType::NUMERICBOX:
case WindowType::METRICBOX:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment