diff options
Diffstat (limited to 'data/vim/patches/8.1.1411')
-rw-r--r-- | data/vim/patches/8.1.1411 | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/data/vim/patches/8.1.1411 b/data/vim/patches/8.1.1411 new file mode 100644 index 000000000..61078ab87 --- /dev/null +++ b/data/vim/patches/8.1.1411 @@ -0,0 +1,69 @@ +To: vim_dev@googlegroups.com +Subject: Patch 8.1.1411 +Fcc: outbox +From: Bram Moolenaar <Bram@moolenaar.net> +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 8.1.1411 +Problem: Coverity warns for divide by zero. +Solution: Make sure width is larger than zero. +Files: src/charset.c + + +*** ../vim-8.1.1410/src/charset.c 2019-05-24 18:48:36.750128544 +0200 +--- src/charset.c 2019-05-27 21:59:46.180472213 +0200 +*************** +*** 1105,1119 **** + { + if (size + sbrlen + numberwidth > (colnr_T)wp->w_width) + { +! /* calculate effective window width */ + int width = (colnr_T)wp->w_width - sbrlen - numberwidth; + int prev_width = col + ? ((colnr_T)wp->w_width - (sbrlen + col)) : 0; +! if (width == 0) +! width = (colnr_T)wp->w_width; + added += ((size - prev_width) / width) * vim_strsize(p_sbr); + if ((size - prev_width) % width) +! /* wrapped, add another length of 'sbr' */ + added += vim_strsize(p_sbr); + } + else +--- 1105,1120 ---- + { + if (size + sbrlen + numberwidth > (colnr_T)wp->w_width) + { +! // calculate effective window width + int width = (colnr_T)wp->w_width - sbrlen - numberwidth; + int prev_width = col + ? ((colnr_T)wp->w_width - (sbrlen + col)) : 0; +! +! if (width <= 0) +! width = (colnr_T)1; + added += ((size - prev_width) / width) * vim_strsize(p_sbr); + if ((size - prev_width) % width) +! // wrapped, add another length of 'sbr' + added += vim_strsize(p_sbr); + } + else +*** ../vim-8.1.1410/src/version.c 2019-05-27 21:53:53.990229301 +0200 +--- src/version.c 2019-05-27 22:00:33.300237524 +0200 +*************** +*** 769,770 **** +--- 769,772 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1411, + /**/ + +-- +On the other hand, you have different fingers. + -- Steven Wright + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |