From 3d137660a5e34ba65d4b2c1e13c887796b43378b Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Mon, 9 Jan 2012 18:20:55 +0000 Subject: sol2-unwind.h (sparc64_is_sighandler): Check that the purported sigacthandler address isn't null before dereferencing it. * config/sparc/sol2-unwind.h (sparc64_is_sighandler): Check that the purported sigacthandler address isn't null before dereferencing it. (sparc_is_sighandler): Likewise. From-SVN: r183020 --- libgcc/ChangeLog | 6 ++++++ libgcc/config/sparc/sol2-unwind.h | 10 ++++------ 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 3f23e72..778848b 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,5 +1,11 @@ 2012-01-09 Eric Botcazou + * config/sparc/sol2-unwind.h (sparc64_is_sighandler): Check that the + purported sigacthandler address isn't null before dereferencing it. + (sparc_is_sighandler): Likewise. + +2012-01-09 Eric Botcazou + PR ada/41929 * config/sparc/sol2-unwind.h (sparc64_is_sighandler): Remove SAVPC and add CFA. Revert back to old code for Solaris 8+ multi-threaded. diff --git a/libgcc/config/sparc/sol2-unwind.h b/libgcc/config/sparc/sol2-unwind.h index ea4c541..7d6bd22 100644 --- a/libgcc/config/sparc/sol2-unwind.h +++ b/libgcc/config/sparc/sol2-unwind.h @@ -124,10 +124,9 @@ sparc64_is_sighandler (unsigned int *pc, void *cfa, int *nframes) /* This matches the call_user_handler pattern for Solaris 10. There are 2 cases so we look for the return address of the caller's caller frame in order to do more pattern matching. */ - unsigned int sah_pattern - = *(unsigned int *)(*(unsigned long *)(cfa + 176 + 15*8) - 4); + unsigned long sah_address = *(unsigned long *)(cfa + 176 + 15*8); - if (sah_pattern == 0x92100019) + if (sah_address && *(unsigned int *)(sah_address - 4) == 0x92100019) /* This is the same setup as for Solaris 9, see below. */ *nframes = 3; else @@ -302,10 +301,9 @@ sparc_is_sighandler (unsigned int *pc, void *cfa, int *nframes) /* This matches the call_user_handler pattern for Solaris 10. There are 2 cases so we look for the return address of the caller's caller frame in order to do more pattern matching. */ - unsigned int sah_pattern - = *(unsigned int *)(*(unsigned int *)(cfa + 96 + 15*4) - 4); + unsigned int sah_address = *(unsigned int *)(cfa + 96 + 15*4); - if (sah_pattern == 0x92100019) + if (sah_address && *(unsigned int *)(sah_address - 4) == 0x92100019) /* This is the same setup as for Solaris 9, see below. */ *nframes = 3; else -- cgit v1.1