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
3ee30586
Commit
3ee30586
authored
Oct 01, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Fix GetAcceptLanguagesA to not read past the end of the buffer.
parent
78af9e6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
ordinal.c
dlls/shlwapi/ordinal.c
+9
-3
No files found.
dlls/shlwapi/ordinal.c
View file @
3ee30586
...
...
@@ -529,9 +529,15 @@ HRESULT WINAPI GetAcceptLanguagesA( LPSTR langbuf, LPDWORD buflen)
langbufW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WCHAR
)
*
buflenW
);
retval
=
GetAcceptLanguagesW
(
langbufW
,
&
buflenW
);
/* FIXME: this is wrong, the string may not be null-terminated */
convlen
=
WideCharToMultiByte
(
CP_ACP
,
0
,
langbufW
,
-
1
,
langbuf
,
*
buflen
,
NULL
,
NULL
);
if
(
retval
==
S_OK
)
{
convlen
=
WideCharToMultiByte
(
CP_ACP
,
0
,
langbufW
,
-
1
,
langbuf
,
*
buflen
,
NULL
,
NULL
);
}
else
/* copy partial string anyway */
{
convlen
=
WideCharToMultiByte
(
CP_ACP
,
0
,
langbufW
,
*
buflen
,
langbuf
,
*
buflen
,
NULL
,
NULL
);
if
(
convlen
<
*
buflen
)
langbuf
[
convlen
]
=
0
;
}
*
buflen
=
buflenW
?
convlen
:
0
;
HeapFree
(
GetProcessHeap
(),
0
,
langbufW
);
...
...
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