1 From 8028a537dd936d02204605065eaabf52be148294 Mon Sep 17 00:00:00 2001
2 From: dave lerner <dlerner@windriver.com>
3 Date: Thu, 7 Mar 2013 12:25:19 -0600
4 Subject: [PATCH] unw_is_signal_frame should return false/0 for bad addresses
6 access_mem() could fail and return a non-zero value, which callers
7 interpret as boolean true.
9 Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
11 src/x86/Gos-linux.c | 9 +++++----
12 1 files changed, 5 insertions(+), 4 deletions(-)
14 diff --git a/src/x86/Gos-linux.c b/src/x86/Gos-linux.c
15 index 31f83ba..8bc24a8 100644
16 --- a/src/x86/Gos-linux.c
17 +++ b/src/x86/Gos-linux.c
18 @@ -57,10 +57,11 @@ unw_is_signal_frame (unw_cursor_t *cursor)
19 if SA_SIGINFO is specified.
22 - if ((ret = (*a->access_mem) (as, ip, &w0, 0, arg)) < 0
23 - || (ret = (*a->access_mem) (as, ip + 4, &w1, 0, arg)) < 0)
25 - ret = ((w0 == 0x0077b858 && w1 == 0x80cd0000)
26 + if ((*a->access_mem) (as, ip, &w0, 0, arg) < 0
27 + || (*a->access_mem) (as, ip + 4, &w1, 0, arg) < 0)
30 + ret = ((w0 == 0x0077b858 && w1 == 0x80cd0000)
31 || (w0 == 0x0000adb8 && (w1 & 0xffffff) == 0x80cd00));
32 Debug (16, "returning %d\n", ret);