aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/hardcopy.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-11-29 11:18:15 +0800
committerGitHub <noreply@github.com>2022-11-29 11:18:15 +0800
commit7328c4de54ac96b39853b3f43736aff863fd209d (patch)
treea8305c852721863b08d9cea796bf0d2611a52f8d /src/nvim/hardcopy.c
parent65e8ed45de98bf93491c6740772f0a42834696ab (diff)
downloadrneovim-7328c4de54ac96b39853b3f43736aff863fd209d.tar.gz
rneovim-7328c4de54ac96b39853b3f43736aff863fd209d.tar.bz2
rneovim-7328c4de54ac96b39853b3f43736aff863fd209d.zip
vim-patch:9.0.0733: use of strftime() is not safe (#21228)
Problem: Use of strftime() is not safe. Solution: Check the return value of strftime(). Use a larger buffer and correctly pass the available space. (Dominique Pellé, closes vim/vim#11348) https://github.com/vim/vim/commit/84d14ccdb50dc9f362066a2c83bfaf331314e5ea Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
Diffstat (limited to 'src/nvim/hardcopy.c')
-rw-r--r--src/nvim/hardcopy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c
index 0cfe77b530..6394792c85 100644
--- a/src/nvim/hardcopy.c
+++ b/src/nvim/hardcopy.c
@@ -2416,7 +2416,7 @@ bool mch_print_begin(prt_settings_T *psettings)
prt_dsc_textline("For", buffer);
prt_dsc_textline("Creator", longVersion);
// Note: to ensure Clean8bit I don't think we can use LC_TIME
- char ctime_buf[50];
+ char ctime_buf[100]; // hopefully enough for every language
char *p_time = os_ctime(ctime_buf, sizeof(ctime_buf));
// Note: os_ctime() adds a \n so we have to remove it :-(
p = (char_u *)vim_strchr(p_time, '\n');