# HG changeset patch # User Christian Brabandt # Date 1509136206 -7200 # Node ID 6d3d64be7945b2fe722ecc44b0a3b73e3ee30e9e # Parent 6d76bde47f3e8d04cdcab0f950c73df8feecf5fd patch 8.0.1227: undefined left shift in readfile() commit https://github.com/vim/vim/commit/dc1c98129484e7879bc6dbf38e523beb730988b6 Author: Bram Moolenaar Date: Fri Oct 27 22:15:24 2017 +0200 patch 8.0.1227: undefined left shift in readfile() Problem: Undefined left shift in readfile(). (Brian 'geeknik' Carpenter) Solution: Add cast to unsigned. (Dominique Pelle, closes https://github.com/vim/vim/issues/2253) diff --git a/src/fileio.c b/src/fileio.c --- a/src/fileio.c +++ b/src/fileio.c @@ -1956,17 +1956,17 @@ retry: { if (fio_flags & FIO_ENDIAN_L) { - u8c = (*--p << 24); - u8c += (*--p << 16); - u8c += (*--p << 8); + u8c = (unsigned)*--p << 24; + u8c += (unsigned)*--p << 16; + u8c += (unsigned)*--p << 8; u8c += *--p; } else /* big endian */ { u8c = *--p; - u8c += (*--p << 8); - u8c += (*--p << 16); - u8c += (*--p << 24); + u8c += (unsigned)*--p << 8; + u8c += (unsigned)*--p << 16; + u8c += (unsigned)*--p << 24; } } else /* UTF-8 */ diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1227, +/**/ 1226, /**/ 1225,