diff options
author | Eli Zaretskii <eliz@gnu.org> | 2018-06-15 17:39:34 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2018-06-15 17:39:34 +0300 |
commit | 22aa665c9b536775a28ff2e4907afc31b69ccb21 (patch) | |
tree | 4866771b8bf81174d9a9c7e2c23fa320c948468f /src/character.h | |
parent | 0d3c35807d0b0a3aaa4c4ebd2f040bb78013879d (diff) | |
download | emacs-22aa665c9b536775a28ff2e4907afc31b69ccb21.tar.gz emacs-22aa665c9b536775a28ff2e4907afc31b69ccb21.tar.bz2 emacs-22aa665c9b536775a28ff2e4907afc31b69ccb21.zip |
Reject invalid 5-byte sequences when detecting UTF-8 encoding
* src/coding.c (detect_coding_utf_8): Reject multibyte sequences
whose leading byte is greater than MAX_MULTIBYTE_LEADING_CODE.
(Bug#31829)
* src/character.h (MAX_MULTIBYTE_LEADING_CODE): Add commentary
about the connection between the value of this macro and MAX_CHAR.
Diffstat (limited to 'src/character.h')
-rw-r--r-- | src/character.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/character.h b/src/character.h index 1f21b2ad330..bc65759aa2a 100644 --- a/src/character.h +++ b/src/character.h @@ -57,7 +57,8 @@ INLINE_HEADER_BEGIN /* Minimum leading code of multibyte characters. */ #define MIN_MULTIBYTE_LEADING_CODE 0xC0 -/* Maximum leading code of multibyte characters. */ +/* Maximum leading code of multibyte characters. Note: this must be + updated if we ever increase MAX_CHAR above. */ #define MAX_MULTIBYTE_LEADING_CODE 0xF8 /* Unicode character values. */ |