Skip to content

buffer.selection_n_anchor doesn't check keys and causes crash #631

@tmewett

Description

@tmewett

I want to apply changes to all selections, so I was trying to iterate over buffer.selection_n_anchor. However, using ipairs on it causes Textadept to crash.

  1. Open Command Entry and enter for i,p in ipairs(buffer.selection_n_anchor) do end
  2. Textadept crashes

Also, for k,v in pairs(buffer.selection_n_anchor) do print(k,v) end prints

_self	ta_buffer: 0000017FE97C5C20
_iface	table: 0000017FE48CD770

Meaning pairs and ipairs are inconsistent.

It seems I can access arbitrary memory via this too; buffer.selection_n_anchor[150] gives e.g. 1648849914305 even though I have only one selection in an empty buffer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions