mirror of
https://github.com/git/git
synced 2024-08-24 18:26:02 +00:00
Merge branch 'mk/mingw-winansi-ttyname-termination-fix'
A potential but unlikely buffer overflow in Windows port has been fixed. * mk/mingw-winansi-ttyname-termination-fix: mingw: consider that UNICODE_STRING::Length counts bytes
This commit is contained in:
commit
c5139e0e38
|
@ -556,7 +556,7 @@ static void detect_msys_tty(int fd)
|
|||
buffer, sizeof(buffer) - 2, &result)))
|
||||
return;
|
||||
name = nameinfo->Name.Buffer;
|
||||
name[nameinfo->Name.Length] = 0;
|
||||
name[nameinfo->Name.Length / sizeof(*name)] = 0;
|
||||
|
||||
/* check if this could be a MSYS2 pty pipe ('msys-XXXX-ptyN-XX') */
|
||||
if (!wcsstr(name, L"msys-") || !wcsstr(name, L"-pty"))
|
||||
|
|
Loading…
Reference in a new issue