diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-01-17 15:19:03 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-01-17 15:19:03 -0800 |
commit | 8554ee155d8e69703dfaa04d03cd45f2d82f1a0f (patch) | |
tree | 5c0f03e34e0850a85aa2252df7a692afe7072a6d /compat | |
parent | Merge branch 'gv/p4-multi-path-commit-fix' into maint (diff) | |
parent | mingw: consider that UNICODE_STRING::Length counts bytes (diff) | |
download | tgif-8554ee155d8e69703dfaa04d03cd45f2d82f1a0f.tar.xz |
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
Diffstat (limited to 'compat')
-rw-r--r-- | compat/winansi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compat/winansi.c b/compat/winansi.c index 477209fce7..3c9ed3cfe0 100644 --- a/compat/winansi.c +++ b/compat/winansi.c @@ -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') |