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
87fc5320
Commit
87fc5320
authored
Oct 23, 2020
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Oct 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inetcomm: Zero terminate the mhtml WCHAR strings.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f4b04e2e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
19 deletions
+16
-19
mimeole.c
dlls/inetcomm/mimeole.c
+3
-5
protocol.c
dlls/inetcomm/protocol.c
+13
-14
No files found.
dlls/inetcomm/mimeole.c
View file @
87fc5320
...
...
@@ -3697,8 +3697,6 @@ HRESULT WINAPI MimeOleObjectFromMoniker(BINDF bindf, IMoniker *moniker, IBindCtx
size_t
len
;
HRESULT
hres
;
static
const
WCHAR
mhtml_prefixW
[]
=
{
'm'
,
'h'
,
't'
,
'm'
,
'l'
,
':'
};
WARN
(
"(0x%08x, %p, %p, %s, %p, %p) semi-stub
\n
"
,
bindf
,
moniker
,
binding
,
debugstr_guid
(
riid
),
out
,
moniker_new
);
if
(
!
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
{
...
...
@@ -3713,12 +3711,12 @@ HRESULT WINAPI MimeOleObjectFromMoniker(BINDF bindf, IMoniker *moniker, IBindCtx
TRACE
(
"display name %s
\n
"
,
debugstr_w
(
display_name
));
len
=
lstrlenW
(
display_name
);
mhtml_url
=
heap_alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
+
sizeof
(
mhtml_prefixW
));
mhtml_url
=
heap_alloc
(
len
*
sizeof
(
WCHAR
)
+
sizeof
(
L"mhtml:"
));
if
(
!
mhtml_url
)
return
E_OUTOFMEMORY
;
memcpy
(
mhtml_url
,
mhtml_prefixW
,
sizeof
(
mhtml_prefixW
)
);
lstrc
pyW
(
mhtml_url
+
ARRAY_SIZE
(
mhtml_prefixW
)
,
display_name
);
lstrcpyW
(
mhtml_url
,
L"mhtml:"
);
lstrc
atW
(
mhtml_url
,
display_name
);
HeapFree
(
GetProcessHeap
(),
0
,
display_name
);
hres
=
CreateURLMoniker
(
NULL
,
mhtml_url
,
moniker_new
);
...
...
dlls/inetcomm/protocol.c
View file @
87fc5320
...
...
@@ -59,8 +59,8 @@ typedef struct {
WCHAR
url
[
1
];
}
MimeHtmlBinding
;
static
const
WCHAR
mhtml_prefixW
[]
=
{
'm'
,
'h'
,
't'
,
'm'
,
'l'
,
':'
}
;
static
const
WCHAR
mhtml_separatorW
[]
=
{
'!'
,
'x'
,
'-'
,
'u'
,
's'
,
'c'
,
':'
}
;
static
const
WCHAR
mhtml_prefixW
[]
=
L"mhtml:"
;
static
const
WCHAR
mhtml_separatorW
[]
=
L"!x-usc:"
;
static
inline
LPWSTR
heap_strdupW
(
LPCWSTR
str
)
{
...
...
@@ -82,16 +82,16 @@ static HRESULT parse_mhtml_url(const WCHAR *url, mhtml_url_t *r)
{
const
WCHAR
*
p
;
if
(
wcsnicmp
(
url
,
mhtml_prefixW
,
ARRAY_SIZE
(
mhtml_prefixW
)))
if
(
wcsnicmp
(
url
,
mhtml_prefixW
,
lstrlenW
(
mhtml_prefixW
)))
return
E_FAIL
;
r
->
mhtml
=
url
+
ARRAY_SIZE
(
mhtml_prefixW
);
r
->
mhtml
=
url
+
lstrlenW
(
mhtml_prefixW
);
p
=
wcschr
(
r
->
mhtml
,
'!'
);
if
(
p
)
{
r
->
mhtml_len
=
p
-
r
->
mhtml
;
/* FIXME: We handle '!' and '!x-usc:' in URLs as the same thing. Those should not be the same. */
if
(
!
wcsncmp
(
p
,
mhtml_separatorW
,
ARRAY_SIZE
(
mhtml_separatorW
)))
p
+=
ARRAY_SIZE
(
mhtml_separatorW
);
if
(
!
wcsncmp
(
p
,
mhtml_separatorW
,
lstrlenW
(
mhtml_separatorW
)))
p
+=
lstrlenW
(
mhtml_separatorW
);
else
p
++
;
}
else
{
...
...
@@ -656,7 +656,7 @@ static HRESULT WINAPI MimeHtmlProtocolInfo_CombineUrl(IInternetProtocolInfo *ifa
DWORD
cchResult
,
DWORD
*
pcchResult
,
DWORD
dwReserved
)
{
MimeHtmlProtocol
*
This
=
impl_from_IInternetProtocolInfo
(
iface
);
size_t
len
=
ARRAY_SIZE
(
mhtml_prefixW
);
size_t
len
=
lstrlenW
(
mhtml_prefixW
);
mhtml_url_t
url
;
WCHAR
*
p
;
HRESULT
hres
;
...
...
@@ -669,27 +669,26 @@ static HRESULT WINAPI MimeHtmlProtocolInfo_CombineUrl(IInternetProtocolInfo *ifa
if
(
FAILED
(
hres
))
return
hres
;
if
(
!
wcsnicmp
(
pwzRelativeUrl
,
mhtml_prefixW
,
ARRAY_SIZE
(
mhtml_prefixW
)
))
{
if
(
!
wcsnicmp
(
pwzRelativeUrl
,
mhtml_prefixW
,
len
))
{
FIXME
(
"Relative URL is mhtml protocol
\n
"
);
return
INET_E_USE_DEFAULT_PROTOCOLHANDLER
;
}
len
+=
url
.
mhtml_len
;
if
(
*
pwzRelativeUrl
)
len
+=
lstrlenW
(
pwzRelativeUrl
)
+
ARRAY_SIZE
(
mhtml_separatorW
);
len
+=
lstrlenW
(
pwzRelativeUrl
)
+
lstrlenW
(
mhtml_separatorW
);
if
(
len
>=
cchResult
)
{
*
pcchResult
=
0
;
return
E_FAIL
;
}
memcpy
(
pwzResult
,
mhtml_prefixW
,
sizeof
(
mhtml_prefixW
)
);
p
=
pwzResult
+
ARRAY_SIZE
(
mhtml_prefixW
);
lstrcpyW
(
pwzResult
,
mhtml_prefixW
);
p
=
pwzResult
+
lstrlenW
(
mhtml_prefixW
);
memcpy
(
p
,
url
.
mhtml
,
url
.
mhtml_len
*
sizeof
(
WCHAR
));
p
+=
url
.
mhtml_len
;
if
(
*
pwzRelativeUrl
)
{
memcpy
(
p
,
mhtml_separatorW
,
sizeof
(
mhtml_separatorW
));
p
+=
ARRAY_SIZE
(
mhtml_separatorW
);
lstrcpyW
(
p
,
pwzRelativeUrl
);
lstrcpyW
(
p
,
mhtml_separatorW
);
lstrcatW
(
p
,
pwzRelativeUrl
);
}
else
{
*
p
=
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