diff options
| author | Johannes Altmanninger <aclopte@gmail.com> | 2024-08-28 15:47:27 +0200 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2024-09-02 19:46:33 +1000 |
| commit | 6e5bc9dd6c477a71020dcbe6c7a387673825d941 (patch) | |
| tree | 0ba00e8d741f4ffb82514980cfad60b477b51155 /src/insert_completer.cc | |
| parent | 9275d965a6952d44035fd0502ee0d3991352c460 (diff) | |
Fix <c-r> use-after-free InsertCompletionHide touches used register
Before performing the insertion, InsertCompleter::insert calls
try_accept() to accept any selected completion candidate. If there
is one, we fire InsertCompletionHide. If that one modifies the register
used by <c-r>, the inserted StringViews will be dangling.
Fix this by running try_insert first, and read from the register later.
Note that we call try_accept() twice but that's fine.
It would probably make more sense to copy the register before calling
insert() but I don't think it matters.
Closes #5220
Diffstat (limited to 'src/insert_completer.cc')
0 files changed, 0 insertions, 0 deletions
