Actions
Bug #22516
openEmacs-Mule accepts a code point whose first byte is below 0x80 in format("%c")
Bug #22516:
Emacs-Mule accepts a code point whose first byte is below 0x80 in format("%c")
Description
format("%c") in Emacs-Mule accepts a code point that Integer#chr rejects, and writes more bytes than it allocated.
fmt = ("a" * 100 + "%c").force_encoding("Emacs-Mule")
p format(fmt, 0x01018000)
# expected: ArgumentError (invalid character)
# actual: "aaa...aaa\x01\x01" (the other 2 bytes "\x80\x00" of the character are written past the buffer)
p 0x01018000.chr("Emacs-Mule") #=> #<RangeError: invalid codepoint 0x1018000 in Emacs-Mule> (as expected)
Updated by mame (Yusuke Endoh) 1 day ago
Actions