Skip to content

Commit

Permalink
Merge pull request #3875 from 1480c1/wine/detect_msys_tty
Browse files Browse the repository at this point in the history
winansi: check result before using Name for pty
  • Loading branch information
dscho authored May 30, 2022
2 parents 158a93f + 788d6fd commit c5ca16f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compat/winansi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit c5ca16f

Please sign in to comment.