mirror of
https://github.com/git-for-windows/git.git
synced 2026-03-16 11:02:37 -05:00
Merge pull request #3875 from 1480c1/wine/detect_msys_tty
winansi: check result before using Name for pty
This commit is contained in:
@@ -573,6 +573,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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user