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
c7eb844c
Commit
c7eb844c
authored
Nov 12, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Nov 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Lock heap and validate pointer in LocalHandle.
parent
d918919d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
heap.c
dlls/kernel32/heap.c
+6
-2
No files found.
dlls/kernel32/heap.c
View file @
c7eb844c
...
...
@@ -343,6 +343,7 @@ UINT WINAPI LocalFlags( HLOCAL handle )
*/
HLOCAL
WINAPI
LocalHandle
(
const
void
*
ptr
)
{
HANDLE
heap
=
GetProcessHeap
();
HLOCAL
handle
=
(
HANDLE
)
ptr
;
ULONG
flags
;
...
...
@@ -354,11 +355,14 @@ HLOCAL WINAPI LocalHandle( const void *ptr )
return
0
;
}
if
(
!
RtlGetUserInfoHeap
(
GetProcessHeap
(),
0
,
(
void
*
)
ptr
,
&
handle
,
&
flags
))
RtlLockHeap
(
heap
);
if
(
!
HeapValidate
(
heap
,
HEAP_NO_SERIALIZE
,
ptr
)
||
!
RtlGetUserInfoHeap
(
heap
,
HEAP_NO_SERIALIZE
,
(
void
*
)
ptr
,
&
handle
,
&
flags
))
{
SetLastError
(
ERROR_INVALID_HANDLE
);
return
0
;
handle
=
0
;
}
RtlUnlockHeap
(
heap
);
return
handle
;
}
...
...
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