{"thread":{"id":"51433","subject":"[PATCH 0/1] Follow-up on top of js/mingw-use-utf8","startedAt":"2019-07-04T22:37:00Z","lastAt":"2019-07-04T22:37:01Z","messageCount":2,"participants":["Johannes Schindelin via GitGitGadget"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"378609","messageId":"pull.283.git.gitgitgadget@gmail.com","threadId":"51433","inReplyTo":null,"subject":"[PATCH 0/1] Follow-up on top of js/mingw-use-utf8","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-04T22:36:56Z","receivedAt":"2019-07-04T22:37:00Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"A quick fix for a patch that is already in next.\n\nJohannes Schindelin (1):\n  mingw: fix possible buffer overrun when calling `GetUserNameW()`\n\n compat/mingw.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\n\nbase-commit: 94238859b9809afc806919cb7022a45cdc8e6748\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-283%2Fdscho%2Fmingw-use-utf8-fixup-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-283/dscho/mingw-use-utf8-fixup-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/283\n-- \ngitgitgadget\n"},{"id":"378610","messageId":"15bd816ea576554beefe5b1d495e0ec2810a7d5b.1562279815.git.gitgitgadget@gmail.com","threadId":"51433","inReplyTo":"pull.283.git.gitgitgadget@gmail.com","subject":"[PATCH 1/1] mingw: fix possible buffer overrun when calling `GetUserNameW()`","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-07-04T22:36:57Z","receivedAt":"2019-07-04T22:37:01Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nIn 39a98e9b68b8 (mingw: get pw_name in UTF-8 format, 2019-06-27), this\ndeveloper missed the fact that the `GetUserNameW()` function takes the\nnumber of characters as `len` parameter, not the number of bytes.\n\nReported-by: Beat Bolli <dev+git@drbeat.li>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n compat/mingw.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex b8a62bf914..a0eb695653 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -1952,7 +1952,7 @@ struct passwd *getpwuid(int uid)\n \tif (initialized)\n \t\treturn p;\n \n-\tlen = sizeof(buf);\n+\tlen = ARRAY_SIZE(buf);\n \tif (!GetUserNameW(buf, &len)) {\n \t\tinitialized = 1;\n \t\treturn NULL;\n-- \ngitgitgadget\n"}]}