[Libreoffice-commits] core.git: vcl/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Fri May 24 13:09:45 UTC 2019


 vcl/source/window/accessibility.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit e0a5f0738b76dd06e9d258cfa674de86f34bd6ec
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri May 24 09:43:39 2019 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri May 24 15:08:29 2019 +0200

    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 cca4d9ab39499562614f0f778a2fffe5a40fde88
    "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: Stephan Bergmann <sbergman at redhat.com>

diff --git a/vcl/source/window/accessibility.cxx b/vcl/source/window/accessibility.cxx
index 1b858386eb06..ef3bf456e7a9 100644
--- a/vcl/source/window/accessibility.cxx
+++ b/vcl/source/window/accessibility.cxx
@@ -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:


More information about the Libreoffice-commits mailing list