changeset 19005:53088656f5ed v8.2.0063

patch 8.2.0063: wrong size argument to vim_snprintf() Commit: https://github.com/vim/vim/commit/08b28b7ad52d5ee3cb5fa5982b647e325a410484 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Dec 30 20:42:39 2019 +0100 patch 8.2.0063: wrong size argument to vim_snprintf() Problem: Wrong size argument to vim_snprintf(). (Dominique Pelle) Solution: Reduce the size by the length. (related to https://github.com/vim/vim/issues/5410)
author Bram Moolenaar <Bram@vim.org>
date Mon, 30 Dec 2019 20:45:03 +0100
parents d7f09886937a
children 0de1352b2de9
files src/ops.c src/version.c
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ops.c
+++ b/src/ops.c
@@ -3813,8 +3813,12 @@ cursor_pos_info(dict_T *dict)
 
 	bom_count = bomb_size();
 	if (dict == NULL && bom_count > 0)
-	    vim_snprintf((char *)IObuff + STRLEN(IObuff), IOSIZE,
+	{
+	    size_t len = STRLEN(IObuff);
+
+	    vim_snprintf((char *)IObuff + len, IOSIZE - len,
 				 _("(+%lld for BOM)"), (long_long_T)bom_count);
+	}
 	if (dict == NULL)
 	{
 	    // Don't shorten this message, the user asked for it.
--- a/src/version.c
+++ b/src/version.c
@@ -743,6 +743,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    63,
+/**/
     62,
 /**/
     61,