Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
101fe51b
Commit
101fe51b
authored
Jul 06, 2022
by
Hugh McMaster
Committed by
Alexandre Julliard
Jul 06, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Correctly calculate REG_MULTI_SZ size before reading from the buffer.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
parent
159f3699
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
edit.c
programs/regedit/edit.c
+6
-6
No files found.
programs/regedit/edit.c
View file @
101fe51b
...
@@ -312,12 +312,12 @@ BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR valueName)
...
@@ -312,12 +312,12 @@ BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR valueName)
WCHAR
*
tmpValueData
=
NULL
;
WCHAR
*
tmpValueData
=
NULL
;
INT
i
,
j
,
count
;
INT
i
,
j
,
count
;
for
(
i
=
0
,
count
=
0
;
i
<
len
-
1
;
i
++
)
for
(
i
=
0
,
count
=
0
;
i
<
len
/
sizeof
(
WCHAR
)
;
i
++
)
if
(
!
stringValueData
[
i
]
&&
stringValueData
[
i
+
1
]
)
if
(
!
stringValueData
[
i
]
&&
stringValueData
[
i
+
1
]
)
count
++
;
count
++
;
tmpValueData
=
heap_xalloc
(
(
len
+
count
)
*
sizeof
(
WCHAR
));
tmpValueData
=
heap_xalloc
(
len
+
(
count
*
sizeof
(
WCHAR
)
));
for
(
i
=
0
,
j
=
0
;
i
<
len
-
1
;
i
++
)
for
(
i
=
0
,
j
=
0
;
i
<
len
/
sizeof
(
WCHAR
)
;
i
++
)
{
{
if
(
!
stringValueData
[
i
]
&&
stringValueData
[
i
+
1
])
if
(
!
stringValueData
[
i
]
&&
stringValueData
[
i
+
1
])
{
{
...
@@ -327,7 +327,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR valueName)
...
@@ -327,7 +327,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR valueName)
else
else
tmpValueData
[
j
++
]
=
stringValueData
[
i
];
tmpValueData
[
j
++
]
=
stringValueData
[
i
];
}
}
tmpValueData
[
j
]
=
stringValueData
[
i
];
heap_free
(
stringValueData
);
heap_free
(
stringValueData
);
stringValueData
=
tmpValueData
;
stringValueData
=
tmpValueData
;
tmpValueData
=
NULL
;
tmpValueData
=
NULL
;
...
@@ -337,7 +337,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR valueName)
...
@@ -337,7 +337,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR valueName)
len
=
lstrlenW
(
stringValueData
);
len
=
lstrlenW
(
stringValueData
);
tmpValueData
=
heap_xalloc
((
len
+
2
)
*
sizeof
(
WCHAR
));
tmpValueData
=
heap_xalloc
((
len
+
2
)
*
sizeof
(
WCHAR
));
for
(
i
=
0
,
j
=
0
;
i
<
len
-
1
;
i
++
)
for
(
i
=
0
,
j
=
0
;
i
<
len
;
i
++
)
{
{
if
(
stringValueData
[
i
]
==
char1
&&
stringValueData
[
i
+
1
]
==
char2
)
if
(
stringValueData
[
i
]
==
char1
&&
stringValueData
[
i
+
1
]
==
char2
)
{
{
...
@@ -348,7 +348,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR valueName)
...
@@ -348,7 +348,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR valueName)
else
else
tmpValueData
[
j
++
]
=
stringValueData
[
i
];
tmpValueData
[
j
++
]
=
stringValueData
[
i
];
}
}
tmpValueData
[
j
++
]
=
stringValueData
[
i
];
tmpValueData
[
j
++
]
=
0
;
tmpValueData
[
j
++
]
=
0
;
tmpValueData
[
j
++
]
=
0
;
tmpValueData
[
j
++
]
=
0
;
heap_free
(
stringValueData
);
heap_free
(
stringValueData
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment