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
1997a3a2
Commit
1997a3a2
authored
Apr 21, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 21, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Limit message length to 2000 in IHTMLWindow2::alert.
parent
5d6e0529
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
htmlwindow.c
dlls/mshtml/htmlwindow.c
+18
-4
No files found.
dlls/mshtml/htmlwindow.c
View file @
1997a3a2
...
...
@@ -511,20 +511,34 @@ static HRESULT WINAPI HTMLWindow2_clearTimeout(IHTMLWindow2 *iface, LONG timerID
return
clear_task_timer
(
&
This
->
doc
->
basedoc
,
FALSE
,
timerID
);
}
#define MAX_MESSAGE_LEN 2000
static
HRESULT
WINAPI
HTMLWindow2_alert
(
IHTMLWindow2
*
iface
,
BSTR
message
)
{
HTMLWindow
*
This
=
HTMLWINDOW2_THIS
(
iface
);
WCHAR
wszTitle
[
100
];
WCHAR
title
[
100
],
*
msg
=
message
;
DWORD
len
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
message
));
if
(
!
LoadStringW
(
get_shdoclc
(),
IDS_MESSAGE_BOX_TITLE
,
wszT
itle
,
sizeof
(
wszT
itle
)
/
sizeof
(
WCHAR
)))
{
if
(
!
LoadStringW
(
get_shdoclc
(),
IDS_MESSAGE_BOX_TITLE
,
t
itle
,
sizeof
(
t
itle
)
/
sizeof
(
WCHAR
)))
{
WARN
(
"Could not load message box title: %d
\n
"
,
GetLastError
());
return
S_OK
;
}
MessageBoxW
(
This
->
doc_obj
->
hwnd
,
message
,
wszTitle
,
MB_ICONWARNING
);
len
=
SysStringLen
(
message
);
if
(
len
>
MAX_MESSAGE_LEN
)
{
msg
=
heap_alloc
((
MAX_MESSAGE_LEN
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
msg
)
return
E_OUTOFMEMORY
;
memcpy
(
msg
,
message
,
MAX_MESSAGE_LEN
*
sizeof
(
WCHAR
));
msg
[
MAX_MESSAGE_LEN
]
=
0
;
}
MessageBoxW
(
This
->
doc_obj
->
hwnd
,
msg
,
title
,
MB_ICONWARNING
);
if
(
msg
!=
message
)
heap_free
(
msg
);
return
S_OK
;
}
...
...
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