mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
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 #2253)
This commit is contained in:
12
src/fileio.c
12
src/fileio.c
@@ -1956,17 +1956,17 @@ retry:
|
|||||||
{
|
{
|
||||||
if (fio_flags & FIO_ENDIAN_L)
|
if (fio_flags & FIO_ENDIAN_L)
|
||||||
{
|
{
|
||||||
u8c = (*--p << 24);
|
u8c = (unsigned)*--p << 24;
|
||||||
u8c += (*--p << 16);
|
u8c += (unsigned)*--p << 16;
|
||||||
u8c += (*--p << 8);
|
u8c += (unsigned)*--p << 8;
|
||||||
u8c += *--p;
|
u8c += *--p;
|
||||||
}
|
}
|
||||||
else /* big endian */
|
else /* big endian */
|
||||||
{
|
{
|
||||||
u8c = *--p;
|
u8c = *--p;
|
||||||
u8c += (*--p << 8);
|
u8c += (unsigned)*--p << 8;
|
||||||
u8c += (*--p << 16);
|
u8c += (unsigned)*--p << 16;
|
||||||
u8c += (*--p << 24);
|
u8c += (unsigned)*--p << 24;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else /* UTF-8 */
|
else /* UTF-8 */
|
||||||
|
@@ -761,6 +761,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1227,
|
||||||
/**/
|
/**/
|
||||||
1226,
|
1226,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user