From eb5135b31932e6f63820b56dabb3d57ea9ad6b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 23 Jul 2017 17:27:56 +0200 Subject: [PATCH] vis: use strncpy to copy into fixed sized buffer In practice this was never an issue also it is guaranteed that the terminating zero byte is already there. Fixes coverity issue 157023. --- vis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vis.c b/vis.c index f1bc7f37e..fe466902c 100644 --- a/vis.c +++ b/vis.c @@ -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; } }