]> git.ipfire.org Git - thirdparty/git.git/commit
mingw: fix possible buffer overrun when calling `GetUserNameW()`
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Thu, 4 Jul 2019 22:36:57 +0000 (15:36 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 8 Jul 2019 19:09:12 +0000 (12:09 -0700)
commit697bdd22b887a0778489814e44dcec850aa82ad0
treed8799bdc7f1534fbb342c35edf834e6301a9f3bf
parent94238859b9809afc806919cb7022a45cdc8e6748
mingw: fix possible buffer overrun when calling `GetUserNameW()`

In 39a98e9b68b8 (mingw: get pw_name in UTF-8 format, 2019-06-27), this
developer missed the fact that the `GetUserNameW()` function takes the
number of characters as `len` parameter, not the number of bytes.

Reported-by: Beat Bolli <dev+git@drbeat.li>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.c