From d326e04860427b0a6a0b66da86fae8e5d23c8a7c Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 15 Mar 2024 08:05:59 +0800 Subject: vim-patch:9.1.0181: no overflow check for string formatting (#27863) Problem: no overflow check for string formatting Solution: Check message formatting function for overflow. (Chris van Willegen) closes: vim/vim#13799 https://github.com/vim/vim/commit/c35fc03dbd47582b256776fb11f11d8ceb24f8f0 Co-authored-by: Christ van Willegen --- src/nvim/eval.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/nvim/eval.lua') diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 810cd2286b..7df4ab71ef 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -7836,6 +7836,9 @@ M.funcs = { echo printf("%1$*2$.*3$f", 1.4142135, 6, 2) < 1.41 + You will get an overflow error |E1510|, when the field-width + or precision will result in a string longer than 6400 chars. + *E1500* You cannot mix positional and non-positional arguments: >vim echo printf("%s%1$s", "One", "Two") -- cgit