Menu

#2294 SCI_AUTOCSHOW crashes on empty itemList with SC_ORDER_CUSTOM (Windows)

Bug
closed-fixed
3
2021-12-06
2021-11-12
Kered13
No

Reproduction on Windows:

  1. Call SCI_AUTOCSETORDER with SC_ORDER_CUSTOM
  2. Call SCI_AUTOCSHOW with an empty string for the itemList.

The crash is caused by an assert in AutoCompletion.cxx. The root cause is that ListBoxX::SetList inserts a single empty element when given the empty string, but Sorter does not, and this mismatch trips the assert.

While calling SCI_AUTOCSHOW with an empty list doesn't really make much sense (and I only discovered this on accident due to a bug in my code), Scintilla should not crash in this case.

Related

Bugs: #2307

Discussion

  • Neil Hodgson

    Neil Hodgson - 2021-11-13
    • labels: --> scintilla, autocomplete
    • status: open --> open-fixed
    • assigned_to: Neil Hodgson
    • Priority: 5 --> 3
     
  • Neil Hodgson

    Neil Hodgson - 2021-11-13

    This is just an assertion so won't show in release builds.

    Committed [6d1bb4] that adds an item to Sorter when the list is empty.

     

    Related

    Commit: [6d1bb4]

  • Neil Hodgson

    Neil Hodgson - 2021-12-06
    • status: open-fixed --> closed-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2021-12-06

    This is just an assertion so won't show in release builds.

    Committed [6d1bb4] that adds an item to Sorter when the list is empty.

     

    Related

    Commit: [6d1bb4]


Log in to post a comment.