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
e58052d8
Commit
e58052d8
authored
Oct 19, 2022
by
Hugh McMaster
Committed by
Alexandre Julliard
Oct 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Avoid memory leaks in GetConsoleTitleW().
parent
0c3d7826
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
console.c
dlls/kernelbase/console.c
+10
-9
No files found.
dlls/kernelbase/console.c
View file @
e58052d8
...
...
@@ -1057,16 +1057,17 @@ DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleTitleW( LPWSTR title, DWORD size )
if
(
!
(
params
=
HeapAlloc
(
GetProcessHeap
(),
0
,
max_size
)))
return
0
;
if
(
!
console_ioctl
(
RtlGetCurrentPeb
()
->
ProcessParameters
->
ConsoleHandle
,
IOCTL_CONDRV_GET_TITLE
,
NULL
,
0
,
params
,
max_size
,
&
size
))
return
0
;
if
(
size
<
sizeof
(
*
params
))
return
0
;
if
(
console_ioctl
(
RtlGetCurrentPeb
()
->
ProcessParameters
->
ConsoleHandle
,
IOCTL_CONDRV_GET_TITLE
,
NULL
,
0
,
params
,
max_size
,
&
size
)
&&
size
>=
sizeof
(
*
params
))
{
size
-=
sizeof
(
*
params
);
memcpy
(
title
,
params
->
buffer
,
size
);
title
[
size
/
sizeof
(
WCHAR
)
]
=
0
;
size
=
params
->
title_len
;
}
else
size
=
0
;
size
-=
sizeof
(
*
params
);
memcpy
(
title
,
params
->
buffer
,
size
);
title
[
size
/
sizeof
(
WCHAR
)
]
=
0
;
size
=
params
->
title_len
;
HeapFree
(
GetProcessHeap
(),
0
,
params
);
return
size
;
}
...
...
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