Skip to content

Commit

Permalink
vis: use strncpy to copy into fixed sized buffer
Browse files Browse the repository at this point in the history
In practice this was never an issue also it is guaranteed that the
terminating zero byte is already there.

Fixes coverity issue 157023.
  • Loading branch information
martanne committed Jul 23, 2017
1 parent 33b0513 commit eb5135b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vis.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ static void window_draw_eof(Win *win) {
return;
CellStyle style = win->ui->style_get(win->ui, UI_STYLE_EOF);
for (Line *l = view_lines_last(view)->next; l; l = l->next) {
strcpy(l->cells[0].data, view_symbol_eof_get(view));
strncpy(l->cells[0].data, view_symbol_eof_get(view), sizeof(l->cells[0].data)-1);
l->cells[0].style = style;
}
}
Expand Down

0 comments on commit eb5135b

Please sign in to comment.