Alistair Leslie-Hughes : regedit: Grow the buffer when modifying a DWORD value.

Alexandre Julliard julliard at winehq.org
Fri Aug 23 09:31:24 CDT 2019


Module: wine
Branch: stable
Commit: a5079be68f86b2991f94107e8484721a1d7e7726
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a5079be68f86b2991f94107e8484721a1d7e7726

Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date:   Wed Mar 20 21:53:19 2019 +0000

regedit: Grow the buffer when modifying a DWORD value.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=19098
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 75d8081dc6c6dda04f583c01c301e3c7b8087904)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 programs/regedit/edit.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/programs/regedit/edit.c b/programs/regedit/edit.c
index a3cf17b..5f2cc52 100644
--- a/programs/regedit/edit.c
+++ b/programs/regedit/edit.c
@@ -283,7 +283,9 @@ BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR valueName)
         }
     } else if ( type == REG_DWORD ) {
         static const WCHAR x[] = {'%','x',0};
-        wsprintfW(stringValueData, x, *((DWORD*)stringValueData));
+        DWORD value = *((DWORD*)stringValueData);
+        stringValueData = heap_xrealloc(stringValueData, 64);
+        wsprintfW(stringValueData, x, value);
 	if (DialogBoxW(0, MAKEINTRESOURCEW(IDD_EDIT_DWORD), hwnd, modify_dlgproc) == IDOK) {
 	    DWORD val;
 	    CHAR* valueA = GetMultiByteString(stringValueData);




More information about the wine-cvs mailing list