mirror of
https://github.com/git-for-windows/git.git
synced 2026-02-04 03:33:01 -06:00
Merge pull request #3875 from 1480c1/wine/detect_msys_tty
winansi: check result before using Name for pty
This commit is contained in:
commit
bd97b7accc
@ -575,6 +575,9 @@ static void detect_msys_tty(int fd)
|
||||
if (!NT_SUCCESS(NtQueryObject(h, ObjectNameInformation,
|
||||
buffer, sizeof(buffer) - 2, &result)))
|
||||
return;
|
||||
if (result < sizeof(*nameinfo) || !nameinfo->Name.Buffer ||
|
||||
!nameinfo->Name.Length)
|
||||
return;
|
||||
name = nameinfo->Name.Buffer;
|
||||
name[nameinfo->Name.Length / sizeof(*name)] = 0;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user