Merge branch 'mk/mingw-winansi-ttyname-termination-fix' into maint

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:
Junio C Hamano 2017-01-17 15:19:03 -08:00
Родитель 1d5cb4596d c46458e82f
Коммит 8554ee155d
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -540,7 +540,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')