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
da1d075b
Commit
da1d075b
authored
Jan 30, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Make sure returned module info strings are null-terminated.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
aae9700a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
16 deletions
+14
-16
module.c
dlls/dbghelp/module.c
+14
-16
No files found.
dlls/dbghelp/module.c
View file @
da1d075b
...
...
@@ -919,6 +919,12 @@ BOOL WINAPI EnumerateLoadedModulesW64(HANDLE hProcess,
return
sz
!=
0
&&
i
==
sz
;
}
static
void
dbghelp_str_WtoA
(
const
WCHAR
*
src
,
char
*
dst
,
int
dst_len
)
{
WideCharToMultiByte
(
CP_ACP
,
0
,
src
,
-
1
,
dst
,
dst_len
-
1
,
NULL
,
NULL
);
dst
[
dst_len
-
1
]
=
0
;
}
/******************************************************************
* SymGetModuleInfo (DBGHELP.@)
*
...
...
@@ -941,12 +947,9 @@ BOOL WINAPI SymGetModuleInfo(HANDLE hProcess, DWORD dwAddr,
mi
.
CheckSum
=
miw64
.
CheckSum
;
mi
.
NumSyms
=
miw64
.
NumSyms
;
mi
.
SymType
=
miw64
.
SymType
;
WideCharToMultiByte
(
CP_ACP
,
0
,
miw64
.
ModuleName
,
-
1
,
mi
.
ModuleName
,
sizeof
(
mi
.
ModuleName
),
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
miw64
.
ImageName
,
-
1
,
mi
.
ImageName
,
sizeof
(
mi
.
ImageName
),
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
miw64
.
LoadedImageName
,
-
1
,
mi
.
LoadedImageName
,
sizeof
(
mi
.
LoadedImageName
),
NULL
,
NULL
);
dbghelp_str_WtoA
(
miw64
.
ModuleName
,
mi
.
ModuleName
,
sizeof
(
mi
.
ModuleName
));
dbghelp_str_WtoA
(
miw64
.
ImageName
,
mi
.
ImageName
,
sizeof
(
mi
.
ImageName
));
dbghelp_str_WtoA
(
miw64
.
LoadedImageName
,
mi
.
LoadedImageName
,
sizeof
(
mi
.
LoadedImageName
));
memcpy
(
ModuleInfo
,
&
mi
,
ModuleInfo
->
SizeOfStruct
);
...
...
@@ -1010,18 +1013,13 @@ BOOL WINAPI SymGetModuleInfo64(HANDLE hProcess, DWORD64 dwAddr,
mi64
.
CheckSum
=
miw64
.
CheckSum
;
mi64
.
NumSyms
=
miw64
.
NumSyms
;
mi64
.
SymType
=
miw64
.
SymType
;
WideCharToMultiByte
(
CP_ACP
,
0
,
miw64
.
ModuleName
,
-
1
,
mi64
.
ModuleName
,
sizeof
(
mi64
.
ModuleName
),
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
miw64
.
ImageName
,
-
1
,
mi64
.
ImageName
,
sizeof
(
mi64
.
ImageName
),
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
miw64
.
LoadedImageName
,
-
1
,
mi64
.
LoadedImageName
,
sizeof
(
mi64
.
LoadedImageName
),
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
miw64
.
LoadedPdbName
,
-
1
,
mi64
.
LoadedPdbName
,
sizeof
(
mi64
.
LoadedPdbName
),
NULL
,
NULL
);
dbghelp_str_WtoA
(
miw64
.
ModuleName
,
mi64
.
ModuleName
,
sizeof
(
mi64
.
ModuleName
));
dbghelp_str_WtoA
(
miw64
.
ImageName
,
mi64
.
ImageName
,
sizeof
(
mi64
.
ImageName
));
dbghelp_str_WtoA
(
miw64
.
LoadedImageName
,
mi64
.
LoadedImageName
,
sizeof
(
mi64
.
LoadedImageName
));
dbghelp_str_WtoA
(
miw64
.
LoadedPdbName
,
mi64
.
LoadedPdbName
,
sizeof
(
mi64
.
LoadedPdbName
));
mi64
.
CVSig
=
miw64
.
CVSig
;
WideCharToMultiByte
(
CP_ACP
,
0
,
miw64
.
CVData
,
-
1
,
mi64
.
CVData
,
sizeof
(
mi64
.
CVData
),
NULL
,
NULL
);
dbghelp_str_WtoA
(
miw64
.
CVData
,
mi64
.
CVData
,
sizeof
(
mi64
.
CVData
));
mi64
.
PdbSig
=
miw64
.
PdbSig
;
mi64
.
PdbSig70
=
miw64
.
PdbSig70
;
mi64
.
PdbAge
=
miw64
.
PdbAge
;
...
...
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