Skip to content

Commit

Permalink
Fix access to uninited memory on clearing view
Browse files Browse the repository at this point in the history
After graphical preview.
  • Loading branch information
xaizek committed Nov 12, 2018
1 parent f9498c9 commit 58a6ca2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Fixed `:tabnew ..` not working due to use of uninitialized data.

Fixed access to uninitialized memory on clearing view after graphical
preview.

0.10-beta to 0.10 (2018-11-11)

Display list of files in removal confirmation dialog. Thanks to ovk.
Expand Down
4 changes: 2 additions & 2 deletions src/ui/ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -2197,15 +2197,15 @@ ui_view_wipe(view_t *view)
short int fg, bg;
char line_filler[getmaxx(view->win) + 1];

line_filler[sizeof(line_filler) - 1] = '\0';
line_filler[sizeof(line_filler) - 1U] = '\0';
height = getmaxy(view->win);

/* User doesn't need to see fake filling so draw it with the color of
* background. */
(void)pair_content(PAIR_NUMBER(getbkgd(view->win)), &fg, &bg);
wattrset(view->win, COLOR_PAIR(colmgr_get_pair(bg, bg)));

memset(line_filler, '\t', sizeof(line_filler));
memset(line_filler, '\t', sizeof(line_filler) - 1U);
for(i = 0; i < height; ++i)
{
mvwaddstr(view->win, i, 0, line_filler);
Expand Down

0 comments on commit 58a6ca2

Please sign in to comment.