]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1129: missing out-of-memory test in buf_write() v9.1.1129
authorJohn Marriott <basilisk@internode.on.net>
Thu, 20 Feb 2025 22:17:09 +0000 (23:17 +0100)
committerChristian Brabandt <cb@256bit.org>
Thu, 20 Feb 2025 22:17:09 +0000 (23:17 +0100)
Problem:  missing out-of-memory test in buf_write()
Solution: Check that the returned allocated buffer is not NULL
          (John Marriott)

closes: #16678

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/bufwrite.c
src/version.c

index 23cd884bfa32984bed429d1587e59ca5027e9368..e88c7b8384105d7bd2caa6e3bbb7667c3d1b6a6b 100644 (file)
@@ -2316,6 +2316,8 @@ restore_backup:
                {
                    errmsg_allocated = TRUE;
                    errmsg = alloc(300);
+                   if (errmsg == NULL)
+                       goto fail;
                    vim_snprintf((char *)errmsg, 300, _(e_write_error_conversion_failed_in_line_nr_make_fenc_empty_to_override),
                                         (long)write_info.bw_conv_error_lnum);
                }
index fc316466629ab89771836393e02dcb3b4a8be501..646905303fe65ab10f9d5d064c3208794d7f4e30 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1129,
 /**/
     1128,
 /**/