Patch 8.2.1088

3 views
Skip to first unread message

Bram Moolenaar

unread,
Jun 29, 2020, 3:32:39 PM6/29/20
to vim...@googlegroups.com

Patch 8.2.1088
Problem: A very long translation might cause a buffer overflow.
Solution: Trunctate the message if needed.
Files: src/fileio.c


*** ../vim-8.2.1087/src/fileio.c 2020-06-16 20:03:38.747351038 +0200
--- src/fileio.c 2020-06-29 21:28:08.859892024 +0200
***************
*** 52,61 ****
if (msg_silent != 0)
return;
msg_add_fname(buf, name); // put file name in IObuff with quotes
// If it's extremely long, truncate it.
! if (STRLEN(IObuff) > IOSIZE - 80)
! IObuff[IOSIZE - 80] = NUL;
! STRCAT(IObuff, s);
/*
* For the first message may have to start a new line.
* For further ones overwrite the previous one, reset msg_scroll before
--- 52,65 ----
if (msg_silent != 0)
return;
msg_add_fname(buf, name); // put file name in IObuff with quotes
+
// If it's extremely long, truncate it.
! if (STRLEN(IObuff) > IOSIZE - 100)
! IObuff[IOSIZE - 100] = NUL;
!
! // Avoid an over-long translation to cause trouble.
! STRNCAT(IObuff, s, 99);
!
/*
* For the first message may have to start a new line.
* For further ones overwrite the previous one, reset msg_scroll before
*** ../vim-8.2.1087/src/version.c 2020-06-29 21:14:47.254822187 +0200
--- src/version.c 2020-06-29 21:28:29.999803772 +0200
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 1088,
/**/

--
(letter from Mark to Mike, about the film's probable certificate)
I would like to get back to the Censor and agree to lose the shits, take
the odd Jesus Christ out and lose Oh fuck off, but to retain 'fart in
your general direction', 'castanets of your testicles' and 'oral sex'
and ask him for an 'A' rating on that basis.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@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 ///
Reply all
Reply to author
Forward
0 new messages