vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit c9d9ff1d0e57cef5968e79daa986761951cd65c6
parent 954d99581085e54f516c20f691baec2f35edb9c8
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Sun, 23 Jul 2017 17:27:56 +0200

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.

Diffstat:
Mvis.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 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; } }