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)

84d14ccdb5

Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
This commit is contained in:
zeertzjq
2022-11-29 11:18:15 +08:00
committed by GitHub
parent 65e8ed45de
commit 7328c4de54
5 changed files with 17 additions and 9 deletions

View File

@@ -1461,7 +1461,7 @@ static time_t swapfile_info(char_u *fname)
msg_puts(_(" dated: "));
#endif
x = file_info.stat.st_mtim.tv_sec;
char ctime_buf[50];
char ctime_buf[100]; // hopefully enough for every language
msg_puts(os_ctime_r(&x, ctime_buf, sizeof(ctime_buf)));
}