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
1ff1e111
Commit
1ff1e111
authored
Feb 03, 2010
by
Huw Davies
Committed by
Alexandre Julliard
Feb 03, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Zero pad the facename buffer so that we don't write uninitialized data to the metafile.
Found by Valgrind.
parent
4f1d040e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
objects.c
dlls/gdi32/mfdrv/objects.c
+4
-2
No files found.
dlls/gdi32/mfdrv/objects.c
View file @
1ff1e111
...
...
@@ -365,6 +365,7 @@ static UINT16 MFDRV_CreateFontIndirect(PHYSDEV dev, HFONT hFont, LOGFONTW *logfo
char
buffer
[
sizeof
(
METARECORD
)
-
2
+
sizeof
(
LOGFONT16
)];
METARECORD
*
mr
=
(
METARECORD
*
)
&
buffer
;
LOGFONT16
*
font16
;
INT
written
;
mr
->
rdSize
=
(
sizeof
(
METARECORD
)
+
sizeof
(
LOGFONT16
)
-
2
)
/
2
;
mr
->
rdFunction
=
META_CREATEFONTINDIRECT
;
...
...
@@ -383,8 +384,9 @@ static UINT16 MFDRV_CreateFontIndirect(PHYSDEV dev, HFONT hFont, LOGFONTW *logfo
font16
->
lfClipPrecision
=
logfont
->
lfClipPrecision
;
font16
->
lfQuality
=
logfont
->
lfQuality
;
font16
->
lfPitchAndFamily
=
logfont
->
lfPitchAndFamily
;
WideCharToMultiByte
(
CP_ACP
,
0
,
logfont
->
lfFaceName
,
-
1
,
font16
->
lfFaceName
,
LF_FACESIZE
,
NULL
,
NULL
);
font16
->
lfFaceName
[
LF_FACESIZE
-
1
]
=
0
;
written
=
WideCharToMultiByte
(
CP_ACP
,
0
,
logfont
->
lfFaceName
,
-
1
,
font16
->
lfFaceName
,
LF_FACESIZE
-
1
,
NULL
,
NULL
);
/* Zero pad the facename buffer, so that we don't write uninitialized data to disk */
memset
(
font16
->
lfFaceName
+
written
,
0
,
LF_FACESIZE
-
written
);
if
(
!
(
MFDRV_WriteRecord
(
dev
,
mr
,
mr
->
rdSize
*
2
)))
return
0
;
...
...
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