All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Follow-up on top of js/mingw-use-utf8
@ 2019-07-04 22:36 Johannes Schindelin via GitGitGadget
  2019-07-04 22:36 ` [PATCH 1/1] mingw: fix possible buffer overrun when calling `GetUserNameW()` Johannes Schindelin via GitGitGadget
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2019-07-04 22:36 UTC (permalink / raw)
  To: git; +Cc: Beat Bolli, Junio C Hamano

A quick fix for a patch that is already in next.

Johannes Schindelin (1):
  mingw: fix possible buffer overrun when calling `GetUserNameW()`

 compat/mingw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 94238859b9809afc806919cb7022a45cdc8e6748
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-283%2Fdscho%2Fmingw-use-utf8-fixup-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-283/dscho/mingw-use-utf8-fixup-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/283
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] mingw: fix possible buffer overrun when calling `GetUserNameW()`
  2019-07-04 22:36 [PATCH 0/1] Follow-up on top of js/mingw-use-utf8 Johannes Schindelin via GitGitGadget
@ 2019-07-04 22:36 ` Johannes Schindelin via GitGitGadget
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2019-07-04 22:36 UTC (permalink / raw)
  To: git; +Cc: Beat Bolli, Junio C Hamano, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

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>
---
 compat/mingw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compat/mingw.c b/compat/mingw.c
index b8a62bf914..a0eb695653 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1952,7 +1952,7 @@ struct passwd *getpwuid(int uid)
 	if (initialized)
 		return p;
 
-	len = sizeof(buf);
+	len = ARRAY_SIZE(buf);
 	if (!GetUserNameW(buf, &len)) {
 		initialized = 1;
 		return NULL;
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-04 22:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-04 22:36 [PATCH 0/1] Follow-up on top of js/mingw-use-utf8 Johannes Schindelin via GitGitGadget
2019-07-04 22:36 ` [PATCH 1/1] mingw: fix possible buffer overrun when calling `GetUserNameW()` Johannes Schindelin via GitGitGadget

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.