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
e0ea2318
Commit
e0ea2318
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
kernelbase: Validate pointers before calling heap functions.
parent
c7eb844c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
memory.c
dlls/kernelbase/memory.c
+4
-2
No files found.
dlls/kernelbase/memory.c
View file @
e0ea2318
...
...
@@ -903,7 +903,8 @@ HLOCAL WINAPI DECLSPEC_HOTPATCH LocalFree( HLOCAL handle )
TRACE_
(
globalmem
)(
"handle %p
\n
"
,
handle
);
RtlLockHeap
(
heap
);
if
((
ptr
=
unsafe_ptr_from_HLOCAL
(
handle
)))
if
((
ptr
=
unsafe_ptr_from_HLOCAL
(
handle
))
&&
HeapValidate
(
heap
,
HEAP_NO_SERIALIZE
,
ptr
))
{
if
(
HeapFree
(
heap
,
HEAP_NO_SERIALIZE
,
ptr
))
ret
=
0
;
}
...
...
@@ -985,7 +986,8 @@ HLOCAL WINAPI DECLSPEC_HOTPATCH LocalReAlloc( HLOCAL handle, SIZE_T size, UINT f
if
(
flags
&
LMEM_ZEROINIT
)
heap_flags
|=
HEAP_ZERO_MEMORY
;
RtlLockHeap
(
heap
);
if
((
ptr
=
unsafe_ptr_from_HLOCAL
(
handle
)))
if
((
ptr
=
unsafe_ptr_from_HLOCAL
(
handle
))
&&
HeapValidate
(
heap
,
HEAP_NO_SERIALIZE
,
ptr
))
{
if
(
flags
&
LMEM_MODIFY
)
ret
=
handle
;
else
...
...
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