Patch 8.2.5161
Problem: Might still access invalid memory.
Solution: Add extra check for negative value.
Files: src/message.c
*** ../vim-8.2.5160/src/message.c 2022-06-15 12:12:40.970209115 +0100
--- src/message.c 2022-06-26 11:16:31.072399940 +0100
***************
*** 949,956 ****
int n;
int room;
room = (int)(Rows - cmdline_row - 1) * Columns + sc_col - 1;
! if ((force || (shortmess(SHM_TRUNC) && !exmode_active))
&& (n = (int)STRLEN(s) - room) > 0)
{
if (has_mbyte)
--- 949,958 ----
int n;
int room;
+ // If something unexpected happened "room" may be negative, check for that
+ // just in case.
room = (int)(Rows - cmdline_row - 1) * Columns + sc_col - 1;
! if (room > 0 && (force || (shortmess(SHM_TRUNC) && !exmode_active))
&& (n = (int)STRLEN(s) - room) > 0)
{
if (has_mbyte)
*** ../vim-8.2.5160/src/version.c 2022-06-25 19:54:05.121293709 +0100
--- src/version.c 2022-06-26 11:14:53.144543007 +0100
***************
*** 737,738 ****
--- 737,740 ----
{ /* Add new patch number below this line */
+ /**/
+ 5161,
/**/
--
A)bort, R)etry, P)lease don't bother me again
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20220626101737.5C9CC1C4808%40moolenaar.net.