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)
diff --git a/src/fileio.c b/src/fileio.c
index 5755156..82659be 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1956,17 +1956,17 @@
{
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
index 71569b3..f66e292 100644
--- a/src/version.c
+++ b/src/version.c
@@ -762,6 +762,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1227,
+/**/
1226,
/**/
1225,