To: vim_dev@googlegroups.com Subject: Patch 8.2.4298 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4298 Problem: Divide by zero with huge tabstop value. Solution: Reject tabstop value that overflows to zero. Files: src/indent.c, src/testdir/test_vartabs.vim *** ../vim-8.2.4297/src/indent.c 2022-02-03 13:05:28.809273683 +0000 --- src/indent.c 2022-02-05 11:06:50.023324270 +0000 *************** *** 71,77 **** int n = atoi((char *)cp); // Catch negative values, overflow and ridiculous big values. ! if (n < 0 || n > TABSTOP_MAX) { semsg(_(e_invalid_argument_str), cp); vim_free(*array); --- 71,77 ---- int n = atoi((char *)cp); // Catch negative values, overflow and ridiculous big values. ! if (n <= 0 || n > TABSTOP_MAX) { semsg(_(e_invalid_argument_str), cp); vim_free(*array); *** ../vim-8.2.4297/src/testdir/test_vartabs.vim 2021-06-12 12:46:38.055854976 +0100 --- src/testdir/test_vartabs.vim 2022-02-05 11:10:08.162765858 +0000 *************** *** 146,151 **** --- 146,161 ---- bwipeout! endfunc + func Test_retab_invalid_arg() + new + call setline(1, "\ttext") + retab 0 + call assert_fails("retab -8", 'E487: Argument must be positive') + call assert_fails("retab 10000", 'E475:') + call assert_fails("retab 720575940379279360", 'E475:') + bwipe! + endfunc + func Test_vartabs_breakindent() CheckOption breakindent new *** ../vim-8.2.4297/src/version.c 2022-02-04 21:58:53.437278804 +0000 --- src/version.c 2022-02-05 11:12:05.854434139 +0000 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 4298, /**/ -- Contrary to popular belief, it's often your clothing that gets promoted, not you. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///