提交 25f85e49 编写于 作者: M Matthias Bolte

Remove PATH_MAX sized stack allocation from virFileOpenTtyAt

上级 f0443765
......@@ -1902,14 +1902,13 @@ int virFileOpenTtyAt(const char *ptmx,
}
if (ttyName) {
char tempTtyName[PATH_MAX];
if (ptsname_r(*ttymaster, tempTtyName, sizeof(tempTtyName)) < 0)
goto cleanup;
if ((*ttyName = strdup(tempTtyName)) == NULL) {
if (VIR_ALLOC_N(*ttyName, PATH_MAX) < 0) {
errno = ENOMEM;
goto cleanup;
}
if (ptsname_r(*ttymaster, *ttyName, PATH_MAX) < 0)
goto cleanup;
}
rc = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册