[PATCH v2 0/1] MR1005: ntdll: fixed size passed to GetTempPathW
Signed-off-by: Marcus Meissner <marcus(a)jet.franken.de> -- v2: ntdll: Fix GetTempPathW() call passing wrong unit for the buffer size https://gitlab.winehq.org/wine/wine/-/merge_requests/1005
From: Marcus Meissner <marcus(a)jet.franken.de> Signed-off-by: Marcus Meissner <marcus(a)jet.franken.de> --- dlls/ntdll/tests/reg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/tests/reg.c b/dlls/ntdll/tests/reg.c index c7d9d7e4c7f..4b0e558e271 100644 --- a/dlls/ntdll/tests/reg.c +++ b/dlls/ntdll/tests/reg.c @@ -2312,7 +2312,7 @@ static void test_NtRegLoadKeyEx(void) UNICODE_STRING hivefile_pathW, key_pathW; HANDLE key = 0; - GetTempPathW(sizeof(temp_path), temp_path); + GetTempPathW(ARRAY_SIZE(temp_path), temp_path); GetTempFileNameW(temp_path, L"key", 0, hivefile_path); DeleteFileW(hivefile_path); RtlDosPathNameToNtPathName_U(hivefile_path, &hivefile_pathW, NULL, NULL); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/1005
Missing period at the end, other than that looks good to me. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1005#note_10029
Ohh so this is why my tests crashed when compiling with no optimizations, thanks for the fix! :-) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1005#note_10033
On Thu Oct 6 18:28:49 2022 +0000, Santino Mazza wrote:
Ohh so this is why my tests crashed when compiling with no optimizations, thanks for the fix! :-) !308 was also created to help prevent bugs like this.
Maybe it would be worth adding at least a static code analyzer to CI. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1005#note_10039
participants (4)
-
Davide Beatrici (@davidebeatrici) -
Marcus Meissner -
Marcus Meissner (@msmeissn) -
Santino Mazza (@tati1454)