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
efbe6951
Commit
efbe6951
authored
Feb 01, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add a helper function for checking stack frame limits.
parent
43682ce1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
13 deletions
+14
-13
signal_i386.c
dlls/ntdll/signal_i386.c
+14
-13
No files found.
dlls/ntdll/signal_i386.c
View file @
efbe6951
...
...
@@ -548,6 +548,16 @@ static inline TEB *get_current_teb(void)
/*******************************************************************
* is_valid_frame
*/
static
inline
BOOL
is_valid_frame
(
void
*
frame
)
{
if
((
ULONG_PTR
)
frame
&
3
)
return
FALSE
;
return
(
frame
>=
NtCurrentTeb
()
->
Tib
.
StackLimit
&&
(
void
**
)
frame
<
(
void
**
)
NtCurrentTeb
()
->
Tib
.
StackBase
-
1
);
}
/*******************************************************************
* raise_handler
*
* Handler for exceptions happening inside a handler.
...
...
@@ -594,9 +604,7 @@ static NTSTATUS call_stack_handlers( EXCEPTION_RECORD *rec, CONTEXT *context )
while
(
frame
!=
(
EXCEPTION_REGISTRATION_RECORD
*
)
~
0UL
)
{
/* Check frame address */
if
(((
void
*
)
frame
<
NtCurrentTeb
()
->
Tib
.
StackLimit
)
||
((
void
*
)(
frame
+
1
)
>
NtCurrentTeb
()
->
Tib
.
StackBase
)
||
(
ULONG_PTR
)
frame
&
3
)
if
(
!
is_valid_frame
(
frame
))
{
rec
->
ExceptionFlags
|=
EH_STACK_INVALID
;
break
;
...
...
@@ -2381,10 +2389,7 @@ void WINAPI __regs_RtlUnwind( EXCEPTION_REGISTRATION_RECORD* pEndFrame, PVOID ta
if
(
pEndFrame
&&
(
frame
>
pEndFrame
))
raise_status
(
STATUS_INVALID_UNWIND_TARGET
,
pRecord
);
if
(((
void
*
)
frame
<
NtCurrentTeb
()
->
Tib
.
StackLimit
)
||
((
void
*
)(
frame
+
1
)
>
NtCurrentTeb
()
->
Tib
.
StackBase
)
||
(
UINT_PTR
)
frame
&
3
)
raise_status
(
STATUS_BAD_STACK
,
pRecord
);
if
(
!
is_valid_frame
(
frame
))
raise_status
(
STATUS_BAD_STACK
,
pRecord
);
/* Call handler */
TRACE
(
"calling handler at %p code=%x flags=%x
\n
"
,
...
...
@@ -2453,17 +2458,13 @@ USHORT WINAPI RtlCaptureStackBackTrace( ULONG skip, ULONG count, PVOID *buffer,
while
(
skip
--
)
{
if
(((
void
*
)
frame
<
NtCurrentTeb
()
->
Tib
.
StackLimit
)
||
((
void
*
)(
frame
+
1
)
>=
NtCurrentTeb
()
->
Tib
.
StackBase
)
||
((
ULONG_PTR
)
frame
&
3
))
return
0
;
if
(
!
is_valid_frame
(
frame
))
return
0
;
frame
=
(
ULONG
*
)
*
frame
;
}
for
(
i
=
0
;
i
<
count
;
i
++
)
{
if
(((
void
*
)
frame
<
NtCurrentTeb
()
->
Tib
.
StackLimit
)
||
((
void
*
)(
frame
+
1
)
>=
NtCurrentTeb
()
->
Tib
.
StackBase
)
||
((
ULONG_PTR
)
frame
&
3
))
break
;
if
(
!
is_valid_frame
(
frame
))
break
;
buffer
[
i
]
=
(
void
*
)
frame
[
1
];
if
(
hash
)
*
hash
+=
frame
[
1
];
frame
=
(
ULONG
*
)
*
frame
;
...
...
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