Skip to content

Commit

Permalink
patch 8.0.1227: undefined left shift in readfile()
Browse files Browse the repository at this point in the history
Problem:    Undefined left shift in readfile(). (Brian 'geeknik' Carpenter)
Solution:   Add cast to unsigned. (Dominique Pelle, closes #2253)
  • Loading branch information
brammool committed Oct 27, 2017
1 parent 2a45d64 commit dc1c981
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/fileio.c
Expand Up @@ -1956,17 +1956,17 @@ readfile(
{
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 */
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -761,6 +761,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1227,
/**/
1226,
/**/
Expand Down

0 comments on commit dc1c981

Please sign in to comment.