summary refs log tree commit diff
path: root/gnu/packages/patches/vim-CVE-2017-5953.patch
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2017-02-27 12:42:22 +0100
committerMarius Bakke <mbakke@fastmail.com>2017-02-27 12:42:22 +0100
commit8779987bba029535d3dc00f1aacf59281fdd34f0 (patch)
tree7a6d616d45367d508f94c3593b1ce5c7053c33f5 /gnu/packages/patches/vim-CVE-2017-5953.patch
parent1885bb0c08e943a2e0e37c5c0a83473c8af904d0 (diff)
parenta6d9f8837b118e2126e4b8a19bf48b524229a15c (diff)
downloadguix-8779987bba029535d3dc00f1aacf59281fdd34f0.tar.gz
Merge branch 'master' into python-tests
Diffstat (limited to 'gnu/packages/patches/vim-CVE-2017-5953.patch')
-rw-r--r--gnu/packages/patches/vim-CVE-2017-5953.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/gnu/packages/patches/vim-CVE-2017-5953.patch b/gnu/packages/patches/vim-CVE-2017-5953.patch
new file mode 100644
index 0000000000..070f98c2cb
--- /dev/null
+++ b/gnu/packages/patches/vim-CVE-2017-5953.patch
@@ -0,0 +1,32 @@
+Fix CVE-2017-5953:
+
+https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5953
+https://groups.google.com/forum/#!topic/vim_dev/t-3RSdEnrHY
+
+This change is adapted from the upstream source repository:
+
+https://github.com/vim/vim/commit/6d3c8586fc81b022e9f06c611b9926108fb878c7
+
+diff --git a/src/spellfile.c b/src/spellfile.c
+index c7d87c6..00ef019 100644
+--- a/src/spellfile.c
++++ b/src/spellfile.c
+@@ -1585,7 +1585,7 @@ spell_read_tree(
+     int		prefixtree,	/* TRUE for the prefix tree */
+     int		prefixcnt)	/* when "prefixtree" is TRUE: prefix count */
+ {
+-    int		len;
++    long	len;
+     int		idx;
+     char_u	*bp;
+     idx_T	*ip;
+@@ -1595,6 +1595,9 @@ spell_read_tree(
+     len = get4c(fd);
+     if (len < 0)
+ 	return SP_TRUNCERROR;
++    if (len >= LONG_MAX / (long)sizeof(int))
++	/* Invalid length, multiply with sizeof(int) would overflow. */
++	return SP_FORMERROR;
+     if (len > 0)
+     {
+ 	/* Allocate the byte array. */