提交 aec8336d 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!116 modify path length check

Merge pull request !116 from gaohuatao/ght_logs
......@@ -70,12 +70,13 @@ static int shim_rename_old_log_file(log_terminal *terminal)
static int shim_dump_log_file(log_terminal *terminal)
{
int ret;
size_t len_path;
char *file_newname = NULL;
size_t len_path = strlen(terminal->log_path) + sizeof(".1");
if (len_path > PATH_MAX) {
if (strlen(terminal->log_path) > (PATH_MAX - sizeof(".1"))) {
return SHIM_ERR;
}
len_path = strlen(terminal->log_path) + sizeof(".1");
/* isulad: rotate old log file first */
ret = shim_rename_old_log_file(terminal);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册