Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
6d1067b9
Commit
6d1067b9
authored
Aug 19, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure the string is null-terminated in memory_get_string.
parent
ec1cdfd1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
memory.c
programs/winedbg/memory.c
+12
-6
No files found.
programs/winedbg/memory.c
View file @
6d1067b9
...
@@ -243,13 +243,19 @@ BOOL memory_get_string(struct dbg_process* pcs, void* addr, BOOL in_debuggee,
...
@@ -243,13 +243,19 @@ BOOL memory_get_string(struct dbg_process* pcs, void* addr, BOOL in_debuggee,
if
(
!
addr
)
return
FALSE
;
if
(
!
addr
)
return
FALSE
;
if
(
in_debuggee
)
if
(
in_debuggee
)
{
{
if
(
!
unicode
)
return
pcs
->
process_io
->
read
(
pcs
->
handle
,
addr
,
buffer
,
size
,
&
sz
)
;
BOOL
ret
;
buffW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
*
sizeof
(
WCHAR
));
if
(
!
unicode
)
ret
=
pcs
->
process_io
->
read
(
pcs
->
handle
,
addr
,
buffer
,
size
,
&
sz
);
pcs
->
process_io
->
read
(
pcs
->
handle
,
addr
,
buffW
,
size
*
sizeof
(
WCHAR
),
&
sz
);
else
WideCharToMultiByte
(
CP_ACP
,
0
,
buffW
,
sz
/
sizeof
(
WCHAR
),
buffer
,
size
,
{
NULL
,
NULL
);
buffW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
*
sizeof
(
WCHAR
));
HeapFree
(
GetProcessHeap
(),
0
,
buffW
);
ret
=
pcs
->
process_io
->
read
(
pcs
->
handle
,
addr
,
buffW
,
size
*
sizeof
(
WCHAR
),
&
sz
);
WideCharToMultiByte
(
CP_ACP
,
0
,
buffW
,
sz
/
sizeof
(
WCHAR
),
buffer
,
size
,
NULL
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
buffW
);
}
if
(
size
)
buffer
[
size
-
1
]
=
0
;
return
ret
;
}
}
else
else
{
{
...
...
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