提交 25e06aeb 编写于 作者: D Daniel Gustafsson

Ensure to NULL terminate string

The strncpy() will make path2 non-NULL terminated in the (rare?)
cases where filespaceLocation2 is MAXPGPATH chars long. Use strlcpy
instead like other places in the codepath does and ensure we always
have a NULL terminated string.
上级 29ad32b6
......@@ -1397,7 +1397,7 @@ mmxlog_add_filespace(
/* isPrimary */ false);
if (filespaceLocation2 != NULL)
{
strncpy(m->path2, filespaceLocation2, MAXPGPATH);
strlcpy(m->path2, filespaceLocation2, MAXPGPATH);
pfree(filespaceLocation2);
}
else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册