From 2a6c5bb0c4b03a9da81dae64d37c9912e448eaf0 Mon Sep 17 00:00:00 2001 From: Florian Larysch Date: Sat, 8 Oct 2016 17:55:55 +0200 Subject: modeline: Handle version number overflow. #5450 Closes #5449 A file containing the string "vim" followed by a very large number in a modeline location will trigger an overflow in getdigits() which is called by chk_modeline() when trying to parse the version number. Add getdigits_safe(), which does not assert overflows, but reports them to the caller. --- runtime/doc/options.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime') diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index fd2d5232ac..5a5999e64c 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -497,6 +497,7 @@ For example, to use a modeline only for Vim 7.0: To use a modeline for Vim after version 7.2: /* vim>702: set cole=2: */ ~ There can be no blanks between "vim" and the ":". +The modeline is ignored if {vers} does not fit in an integer. {Nvim} The number of lines that are checked can be set with the 'modelines' option. -- cgit