Skip to content

em_exchange_mark has a possibility to set invalid byte_pointer #794

@tompng

Description

@tompng

Description

  1. Set em_set_mark to non-zero byte_pointer.
    Type A to set byte_pointer to 1 and M-space to set mark to that byte pointer

  2. Edit the input line and make the marked value an invalid value for byte_pointer.
    Type DELETE . valid byte_pointer is 0 or 3.

  3. Type C-x C-x to trigger em_exchange_mark.
    byte_pointer will be an invalid value 1.

irb(main):001> あ/Users/tomoya.ishida/.rbenv/versions/3.3.1/lib/ruby/gems/3.3.0/gems/reline-0.5.12/lib/reline/unicode.rb:136:in `scan': invalid byte sequence in UTF-8 (ArgumentError)

    rest.scan(WIDTH_SCANNER) do |non_printing_start, non_printing_end, csi, osc, gc|
              ^^^^^^^^^^^^^
	from /Users/tomoya.ishida/.rbenv/versions/3.3.1/lib/ruby/gems/3.3.0/gems/reline-0.5.12/lib/reline/unicode.rb:136:in `split_line_by_width'
        ...
        This backtrace is not important. em_exchange_mark sets invalid byte_pointer. Thats all.

Whole input to reproduce is "A\e \C-hあ\C-x\C-x"

Terminal Emulator

Any

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions