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
ad57c70a
Commit
ad57c70a
authored
Jun 05, 2007
by
Alexander Nicolaysen Sørnes
Committed by
Alexandre Julliard
Jun 06, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wordpad: Fix potential buffer overflow.
parent
4f14c470
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
wordpad.c
programs/wordpad/wordpad.c
+18
-5
No files found.
programs/wordpad/wordpad.c
View file @
ad57c70a
...
...
@@ -133,15 +133,28 @@ static WCHAR wszFileName[MAX_PATH];
static
void
set_caption
(
LPCWSTR
wszNewFileName
)
{
static
const
WCHAR
wszSeparator
[]
=
{
' '
,
'-'
,
' '
,
'\0'
};
WCHAR
wszCaption
[
MAX_PATH
];
static
const
WCHAR
wszSeparator
[]
=
{
' '
,
'-'
,
' '
};
if
(
wszNewFileName
)
{
lstrcpyW
(
wszCaption
,
wszNewFileName
);
lstrcatW
(
wszCaption
,
wszSeparator
);
lstrcatW
(
wszCaption
,
wszAppTitle
);
WCHAR
*
wszCaption
;
SIZE_T
length
=
0
;
wszCaption
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
lstrlenW
(
wszNewFileName
)
*
sizeof
(
WCHAR
)
+
sizeof
(
wszSeparator
)
+
sizeof
(
wszAppTitle
));
if
(
!
wszCaption
)
return
;
memcpy
(
wszCaption
,
wszNewFileName
,
lstrlenW
(
wszNewFileName
)
*
sizeof
(
WCHAR
));
length
+=
lstrlenW
(
wszNewFileName
);
memcpy
(
wszCaption
+
length
,
wszSeparator
,
sizeof
(
wszSeparator
));
length
+=
sizeof
(
wszSeparator
)
/
sizeof
(
WCHAR
);
memcpy
(
wszCaption
+
length
,
wszAppTitle
,
sizeof
(
wszAppTitle
));
SetWindowTextW
(
hMainWnd
,
wszCaption
);
HeapFree
(
GetProcessHeap
(),
0
,
wszCaption
);
}
else
{
SetWindowTextW
(
hMainWnd
,
wszAppTitle
);
...
...
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