patch 9.1.1129: missing out-of-memory test in buf_write() Commit: https://github.com/vim/vim/commit/fbe2dd7b4c9c41107fa355f58ebc6ed7d19a0f50 Author: John Marriott <basil...@internode.on.net> Date: Thu Feb 20 23:17:09 2025 +0100
patch 9.1.1129: missing out-of-memory test in buf_write() 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 <basil...@internode.on.net> Signed-off-by: Christian Brabandt <c...@256bit.org> diff --git a/src/bufwrite.c b/src/bufwrite.c index 23cd884bf..e88c7b838 100644 --- a/src/bufwrite.c +++ b/src/bufwrite.c @@ -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); } diff --git a/src/version.c b/src/version.c index fc3164666..646905303 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1129, /**/ 1128, /**/ -- -- 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 vim_dev+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1tlF3T-003Gif-69%40256bit.org.