To: vim_dev@googlegroups.com Subject: Patch 8.2.0428 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0428 Problem: Buffer name may leak. Solution: Free the buffer name before overwriting it. Files: src/terminal.c *** ../vim-8.2.0427/src/terminal.c 2020-03-19 18:46:53.960641454 +0100 --- src/terminal.c 2020-03-22 19:14:08.483370040 +0100 *************** *** 465,471 **** buf_T *buf; // Create a new buffer without a window. Make it the current buffer for ! // a moment to be able to do the initialisations. buf = buflist_new((char_u *)"", NULL, (linenr_T)0, BLN_NEW | BLN_LISTED); if (buf == NULL || ml_open(buf) == FAIL) --- 465,471 ---- buf_T *buf; // Create a new buffer without a window. Make it the current buffer for ! // a moment to be able to do the initializations. buf = buflist_new((char_u *)"", NULL, (linenr_T)0, BLN_NEW | BLN_LISTED); if (buf == NULL || ml_open(buf) == FAIL) *************** *** 526,534 **** --- 526,540 ---- apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf); if (opt->jo_term_name != NULL) + { + vim_free(curbuf->b_ffname); curbuf->b_ffname = vim_strsave(opt->jo_term_name); + } else if (argv != NULL) + { + vim_free(curbuf->b_ffname); curbuf->b_ffname = vim_strsave((char_u *)"!system"); + } else { int i; *************** *** 1983,1989 **** redraw_buf_and_status_later(curbuf, NOT_VALID); #ifdef FEAT_PROP_POPUP if (WIN_IS_POPUP(curwin)) ! redraw_win_later(curwin, NOT_VALID); #endif } --- 1989,1995 ---- redraw_buf_and_status_later(curbuf, NOT_VALID); #ifdef FEAT_PROP_POPUP if (WIN_IS_POPUP(curwin)) ! redraw_later(NOT_VALID); #endif } *************** *** 4321,4326 **** --- 4327,4334 ---- vterm_obtain_state(term->tl_vterm), &term->tl_default_color.fg, &term->tl_default_color.bg); + + redraw_later(NOT_VALID); } /* *** ../vim-8.2.0427/src/version.c 2020-03-22 16:16:48.548189763 +0100 --- src/version.c 2020-03-22 19:24:45.783821791 +0100 *************** *** 740,741 **** --- 740,743 ---- { /* Add new patch number below this line */ + /**/ + 428, /**/ -- FATHER: Did you kill all those guards? LAUNCELOT: Yes ... I'm very sorry ... FATHER: They cost fifty pounds each! "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@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 ///