From: Bernhard Übelacker <bernhardu@mailbox.org> Happened when watching a leftover from winetest: $WINEPREFIX/user.reg: [WineTest] 1735348650 #time=1db58c643eafd1e "CapitalsOfEurope"=str(7):"Brussels\0Paris\0%PATH%" --- programs/regedit/listview.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/regedit/listview.c b/programs/regedit/listview.c index 757ce41855c..a99b22b8e4e 100644 --- a/programs/regedit/listview.c +++ b/programs/regedit/listview.c @@ -401,7 +401,7 @@ BOOL RefreshListView(HWND hwndLV, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR highli /* account for the terminator char */ max_val_name_len++; - max_val_size++; + max_val_size += sizeof(WCHAR); valName = malloc(max_val_name_len * sizeof(WCHAR)); valBuf = malloc(max_val_size); @@ -416,7 +416,7 @@ BOOL RefreshListView(HWND hwndLV, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR highli valType = 0; errCode = RegEnumValueW(hKey, index, valName, &valNameLen, NULL, &valType, valBuf, &valSize); if (errCode != ERROR_SUCCESS) goto done; - valBuf[valSize] = 0; + *(WCHAR*)(valBuf + valSize) = 0; AddEntryToList(hwndLV, valName[0] ? valName : NULL, valType, valBuf, valSize, -1); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11282