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
2b99331e
Commit
2b99331e
authored
Jan 13, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 13, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Fixed handling A->W buffer in UrlCanonicalizeA (valgrind).
parent
42874c62
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
url.c
dlls/shlwapi/url.c
+17
-5
No files found.
dlls/shlwapi/url.c
View file @
2b99331e
...
...
@@ -42,6 +42,21 @@ HRESULT WINAPI MLBuildResURLW(LPCWSTR,HMODULE,DWORD,LPCWSTR,LPWSTR,DWORD);
WINE_DEFAULT_DEBUG_CHANNEL
(
shell
);
static
inline
WCHAR
*
heap_strdupAtoW
(
const
char
*
str
)
{
LPWSTR
ret
=
NULL
;
if
(
str
)
{
DWORD
len
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
);
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
ret
,
len
);
}
return
ret
;
}
/* The following schemes were identified in the native version of
* SHLWAPI.DLL version 5.50
*/
...
...
@@ -234,7 +249,6 @@ HRESULT WINAPI UrlCanonicalizeA(LPCSTR pszUrl, LPSTR pszCanonicalized,
{
LPWSTR
url
,
canonical
;
HRESULT
ret
;
DWORD
len
;
TRACE
(
"(%s, %p, %p, 0x%08x) *pcchCanonicalized: %d
\n
"
,
debugstr_a
(
pszUrl
),
pszCanonicalized
,
pcchCanonicalized
,
dwFlags
,
pcchCanonicalized
?
*
pcchCanonicalized
:
-
1
);
...
...
@@ -242,8 +256,7 @@ HRESULT WINAPI UrlCanonicalizeA(LPCSTR pszUrl, LPSTR pszCanonicalized,
if
(
!
pszUrl
||
!
pszCanonicalized
||
!
pcchCanonicalized
||
!*
pcchCanonicalized
)
return
E_INVALIDARG
;
len
=
strlen
(
pszUrl
)
+
1
;
url
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
url
=
heap_strdupAtoW
(
pszUrl
);
canonical
=
HeapAlloc
(
GetProcessHeap
(),
0
,
*
pcchCanonicalized
*
sizeof
(
WCHAR
));
if
(
!
url
||
!
canonical
)
{
HeapFree
(
GetProcessHeap
(),
0
,
url
);
...
...
@@ -251,13 +264,12 @@ HRESULT WINAPI UrlCanonicalizeA(LPCSTR pszUrl, LPSTR pszCanonicalized,
return
E_OUTOFMEMORY
;
}
MultiByteToWideChar
(
0
,
0
,
pszUrl
,
-
1
,
url
,
len
);
ret
=
UrlCanonicalizeW
(
url
,
canonical
,
pcchCanonicalized
,
dwFlags
);
if
(
ret
==
S_OK
)
WideCharToMultiByte
(
0
,
0
,
canonical
,
-
1
,
pszCanonicalized
,
*
pcchCanonicalized
+
1
,
0
,
0
);
HeapFree
(
GetProcessHeap
(),
0
,
url
);
HeapFree
(
GetProcessHeap
(),
0
,
canonical
);
return
ret
;
}
...
...
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