aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-07-23 17:27:56 +0200
committerMarc André Tanner <mat@brain-dump.org>2017-07-23 17:35:11 +0200
commiteb5135b31932e6f63820b56dabb3d57ea9ad6b38 (patch)
tree0c62b18101c4a3b398a93a3de57f67eaa6d0680a
parent33b0513d5e02019a777ec5e06c1a751fd7aeefaa (diff)
downloadvis-eb5135b31932e6f63820b56dabb3d57ea9ad6b38.tar.gz
vis-eb5135b31932e6f63820b56dabb3d57ea9ad6b38.tar.xz
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.
-rw-r--r--vis.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/vis.c b/vis.c
index f1bc7f3..fe46690 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;
}
}