mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 21:34:54 +03:00
Remove PATH_MAX sized stack allocation from virFileOpenTtyAt
This commit is contained in:
parent
f044376530
commit
25f85e4938
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user