~vcs-imports/libiconv/trunk

Viewing all changes in revision 1283.

  • Committer: Bruno Haible
  • Date: 2024-10-05 00:26:56 UTC
  • Revision ID: git-v1:eed6782cbb4651876e3c8b27ea53273f230ee8e2
Fix undefined behaviour caused by shifting (unsigned char) << 24.

Reported by Tim Sweet <tsweet64@protonmail.com>
at <https://savannah.gnu.org/bugs/?66289>.

* lib/ucs4.h (ucs4_mbtowc): Cast 'unsigned char' values to ucs4_t before
shifting them to the left.
* lib/ucs4be.h (ucs4be_mbtowc): Likewise.
* lib/ucs4le.h (ucs4le_mbtowc): Likewise.
* lib/utf32.h (utf32_mbtowc): Likewise.
* lib/utf32be.h (utf32be_mbtowc): Likewise.
* lib/utf32le.h (utf32le_mbtowc): Likewise.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: