[neovim] 04/06: vim-patch:8.0.0376

James McCoy jamessan at debian.org
Mon Apr 10 13:17:31 UTC 2017


This is an automated email from the git hooks/post-receive script.

jamessan pushed a commit to branch debian/sid
in repository neovim.

commit bd10a9cfde180dc1efd28e8e098b92d873c61d80
Author: James McCoy <jamessan at jamessan.com>
Date:   Sun Apr 9 00:46:52 2017 -0400

    vim-patch:8.0.0376
    
    Problem:    Size computations in spell file reading are not exactly right.
    Solution:   Make "len" a "long" and check with LONG_MAX.
    
    https://github.com/vim/vim/commit/6d3c8586fc81b022e9f06c611b9926108fb878c7
---
 src/nvim/spell.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/nvim/spell.c b/src/nvim/spell.c
index 17c7dd9..7dc9eb0 100644
--- a/src/nvim/spell.c
+++ b/src/nvim/spell.c
@@ -3589,10 +3589,10 @@ spell_read_tree (
 
   // The tree size was computed when writing the file, so that we can
   // allocate it as one long block. <nodecount>
-  int len = get4c(fd);
+  long len = get4c(fd);
   if (len < 0)
     return SP_TRUNCERROR;
-  if (len >= 0x3ffffff) {
+  if ((size_t)len >= SIZE_MAX / sizeof(int)) {
     // Invalid length, multiply with sizeof(int) would overflow.
     return SP_FORMERROR;
   }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vim/neovim.git



More information about the pkg-vim-maintainers mailing list