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
fd098468
Commit
fd098468
authored
Apr 05, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Make test for heap boundaries more strict in HEAP_FindSubHeap.
parent
74c04149
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
heap.c
dlls/ntdll/heap.c
+8
-8
No files found.
dlls/ntdll/heap.c
View file @
fd098468
...
...
@@ -395,7 +395,8 @@ static SUBHEAP *HEAP_FindSubHeap(
while
(
sub
)
{
if
(((
const
char
*
)
ptr
>=
(
const
char
*
)
sub
)
&&
((
const
char
*
)
ptr
<
(
const
char
*
)
sub
+
sub
->
size
))
return
(
SUBHEAP
*
)
sub
;
((
const
char
*
)
ptr
<
(
const
char
*
)
sub
+
sub
->
size
-
sizeof
(
ARENA_INUSE
)))
return
(
SUBHEAP
*
)
sub
;
sub
=
sub
->
next
;
}
return
NULL
;
...
...
@@ -783,7 +784,7 @@ static ARENA_FREE *HEAP_FindFreeBlock( HEAP *heap, SIZE_T size,
*
* Check that the pointer is inside the range possible for arenas.
*/
static
BOOL
HEAP_IsValidArenaPtr
(
const
HEAP
*
heap
,
const
void
*
ptr
)
static
BOOL
HEAP_IsValidArenaPtr
(
const
HEAP
*
heap
,
const
ARENA_FREE
*
ptr
)
{
int
i
;
const
SUBHEAP
*
subheap
=
HEAP_FindSubHeap
(
heap
,
ptr
);
...
...
@@ -1003,13 +1004,12 @@ static BOOL HEAP_IsRealArena( HEAP *heapPtr, /* [in] ptr to the heap */
if
(
!
(
flags
&
HEAP_NO_SERIALIZE
))
RtlEnterCriticalSection
(
&
heapPtr
->
critSection
);
if
(
block
)
if
(
block
)
/* only check this single memory block */
{
/* Only check this single memory block */
const
ARENA_INUSE
*
arena
=
(
const
ARENA_INUSE
*
)
block
-
1
;
if
(
!
(
subheap
=
HEAP_FindSubHeap
(
heapPtr
,
block
))
||
((
const
char
*
)
block
<
(
char
*
)
subheap
+
subheap
->
headerSize
+
sizeof
(
ARENA_INUSE
)))
if
(
!
(
subheap
=
HEAP_FindSubHeap
(
heapPtr
,
arena
))
||
((
const
char
*
)
arena
<
(
char
*
)
subheap
+
subheap
->
headerSize
))
{
if
(
quiet
==
NOISY
)
ERR
(
"Heap %p: block %p is not inside heap
\n
"
,
heapPtr
,
block
);
...
...
@@ -1017,7 +1017,7 @@ static BOOL HEAP_IsRealArena( HEAP *heapPtr, /* [in] ptr to the heap */
WARN
(
"Heap %p: block %p is not inside heap
\n
"
,
heapPtr
,
block
);
ret
=
FALSE
;
}
else
ret
=
HEAP_ValidateInUseArena
(
subheap
,
(
const
ARENA_INUSE
*
)
block
-
1
,
quiet
);
ret
=
HEAP_ValidateInUseArena
(
subheap
,
arena
,
quiet
);
if
(
!
(
flags
&
HEAP_NO_SERIALIZE
))
RtlLeaveCriticalSection
(
&
heapPtr
->
critSection
);
...
...
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