aboutsummaryrefslogtreecommitdiff
path: root/editors/patch.c
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2026-03-22 15:58:31 +0200
committerRon Yorston <rmy@pobox.com>2026-03-25 14:53:20 +0000
commit4e7a8bfc75b129b3a671229544f9e5c4168daabf (patch)
treef90ba5d38df63bf143e6c0921f1ab71706f18e0a /editors/patch.c
parent8d97f41766c905bf527ee1b08d021fc4ae9d5af3 (diff)
downloadbusybox-w32-4e7a8bfc75b129b3a671229544f9e5c4168daabf.tar.gz
busybox-w32-4e7a8bfc75b129b3a671229544f9e5c4168daabf.tar.bz2
busybox-w32-4e7a8bfc75b129b3a671229544f9e5c4168daabf.zip
win32: UTF8_OUTPUT: reject overlong encoding
Overlong UTF8 encoding means that a codepoint is encoded using more bytes than necessary, and it's disallowed. Until now we didn't reject it, e.g. 2-bytes sequence of 0xc0 0x9b was incorrectly decoded as codepoint 0x1b (ESC), but it's overlong because 1-byte 0x1b is enough for this codepoint. Now we reject such sequences and print '?' (CONFIG_SUBST_WCHAR). Additionally, we now also reject 4-bytes sequences which end up above the maximum valid codepoint value (0x10ffff). No such issue with 1/2/3 bytes UTF-8 because technically only 4 can encode a too big value.
Diffstat (limited to 'editors/patch.c')
0 files changed, 0 insertions, 0 deletions