diff options
| author | Paul Eggert | 2011-09-24 18:22:30 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-09-24 18:22:30 -0700 |
| commit | 3c7649c1859d6252444044fd64c7b27d8e487f68 (patch) | |
| tree | c36db71bf71b503000c025d9586fb962e88cecb9 /src/coding.c | |
| parent | 7c85f529fd12a8cb12eb85944877d0a52b6380a7 (diff) | |
| download | emacs-3c7649c1859d6252444044fd64c7b27d8e487f68.tar.gz emacs-3c7649c1859d6252444044fd64c7b27d8e487f68.zip | |
* charset.c: Integer overflow fixes.
Don't rely on undefined behavior with signed left shift overflow.
Don't assume unsigned int fits into fixnum, or that fixnum fits
into unsigned int. Don't require max_code to be a valid fixnum;
that's not true for gb10830 4-byte on a 32-bit host. Allow
invalid_code to be a cons, for the same reason. Require code_offset
to be a character. Avoid int overflow if max_char is close
to INT_MAX.
(CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
this is intended anyway and avoids some undefined behavior.
(load_charset_map): Pass unsigned, not int, as 2nd arg of
INDEX_TO_CODE_POINT, as that's what it expects.
(Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
Diffstat (limited to 'src/coding.c')
0 files changed, 0 insertions, 0 deletions