comparison src/terminal.c @ 11923:c9da7b42fdf5 v8.0.0841

patch 8.0.0841: term_getline() may cause a crash commit https://github.com/vim/vim/commit/5c838a3e7141f9950508c84439d2f959bc67e941 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 2 22:10:34 2017 +0200 patch 8.0.0841: term_getline() may cause a crash Problem: term_getline() may cause a crash. Solution: Check that the row is valid. (Hirohito Higashi)
author Christian Brabandt <cb@256bit.org>
date Wed, 02 Aug 2017 22:15:05 +0200
parents cca097489de5
children 728805b1523e
comparison
equal deleted inserted replaced
11922:2f05821e4196 11923:c9da7b42fdf5
1845 VTermScreen *screen = vterm_obtain_screen(term->tl_vterm); 1845 VTermScreen *screen = vterm_obtain_screen(term->tl_vterm);
1846 VTermRect rect; 1846 VTermRect rect;
1847 int len; 1847 int len;
1848 char_u *p; 1848 char_u *p;
1849 1849
1850 if (row < 0 || row >= term->tl_rows)
1851 return;
1850 len = term->tl_cols * MB_MAXBYTES + 1; 1852 len = term->tl_cols * MB_MAXBYTES + 1;
1851 p = alloc(len); 1853 p = alloc(len);
1852 if (p == NULL) 1854 if (p == NULL)
1853 return; 1855 return;
1854 rettv->vval.v_string = p; 1856 rettv->vval.v_string = p;