]> granicus.if.org Git - vim/commitdiff
patch 8.2.0063: wrong size argument to vim_snprintf() v8.2.0063
authorBram Moolenaar <Bram@vim.org>
Mon, 30 Dec 2019 19:42:39 +0000 (20:42 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 30 Dec 2019 19:42:39 +0000 (20:42 +0100)
Problem:    Wrong size argument to vim_snprintf(). (Dominique Pelle)
Solution:   Reduce the size by the length. (related to #5410)

src/ops.c
src/version.c

index 72ffd56bc9b40ca581b068e60830bc3418966cc8..28e97577f3ebe248f46f7b716619ad2a0701d4ac 100644 (file)
--- 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.
index d40cb3b4d1433df75b17fc19fb17ccc61c673729..79f9f7c9c6c2a2d969df7c4209dc4f59e90a9daf 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    63,
 /**/
     62,
 /**/