summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-10-27 22:15:24 +0200
committerBram Moolenaar <Bram@vim.org>2017-10-27 22:15:24 +0200
commitdc1c98129484e7879bc6dbf38e523beb730988b6 (patch)
tree49b538e8d07657b3e625f5b3c50f39b6b2b3e30e
parent2a45d64d0a7ab28d77eee277244e76dbbf8c2db8 (diff)
downloadvim-git-dc1c98129484e7879bc6dbf38e523beb730988b6.tar.gz
patch 8.0.1227: undefined left shift in readfile()v8.0.1227
Problem: Undefined left shift in readfile(). (Brian 'geeknik' Carpenter) Solution: Add cast to unsigned. (Dominique Pelle, closes #2253)
-rw-r--r--src/fileio.c12
-rw-r--r--src/version.c2
2 files changed, 8 insertions, 6 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 575515613..82659be07 100644
--- 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
index 71569b34d..f66e29255 100644
--- 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,