Commit 1aa3b81b authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Fix null pointer dereference in stack backtrace code

Detail:
  c/armsys - _kernel_language will return NULL if the PC was outside any known library language block, so make sure to check for that before dereferencing the pointer
Admin:
  Builds, untested


Version 5.86. Tagged as 'RISC_OSLib-5_86'
parent 03f868ab
...@@ -11,13 +11,13 @@ ...@@ -11,13 +11,13 @@
GBLS Module_HelpVersion GBLS Module_HelpVersion
GBLS Module_ComponentName GBLS Module_ComponentName
GBLS Module_ComponentPath GBLS Module_ComponentPath
Module_MajorVersion SETS "5.85" Module_MajorVersion SETS "5.86"
Module_Version SETA 585 Module_Version SETA 586
Module_MinorVersion SETS "" Module_MinorVersion SETS ""
Module_Date SETS "03 Apr 2015" Module_Date SETS "30 Jun 2015"
Module_ApplicationDate SETS "03-Apr-15" Module_ApplicationDate SETS "30-Jun-15"
Module_ComponentName SETS "RISC_OSLib" Module_ComponentName SETS "RISC_OSLib"
Module_ComponentPath SETS "castle/RiscOS/Sources/Lib/RISC_OSLib" Module_ComponentPath SETS "castle/RiscOS/Sources/Lib/RISC_OSLib"
Module_FullVersion SETS "5.85" Module_FullVersion SETS "5.86"
Module_HelpVersion SETS "5.85 (03 Apr 2015)" Module_HelpVersion SETS "5.86 (30 Jun 2015)"
END END
/* (5.85) /* (5.86)
* *
* This file is automatically maintained by srccommit, do not edit manually. * This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1. * Last processed by srccommit version: 1.1.
* *
*/ */
#define Module_MajorVersion_CMHG 5.85 #define Module_MajorVersion_CMHG 5.86
#define Module_MinorVersion_CMHG #define Module_MinorVersion_CMHG
#define Module_Date_CMHG 03 Apr 2015 #define Module_Date_CMHG 30 Jun 2015
#define Module_MajorVersion "5.85" #define Module_MajorVersion "5.86"
#define Module_Version 585 #define Module_Version 586
#define Module_MinorVersion "" #define Module_MinorVersion ""
#define Module_Date "03 Apr 2015" #define Module_Date "30 Jun 2015"
#define Module_ApplicationDate "03-Apr-15" #define Module_ApplicationDate "30-Jun-15"
#define Module_ComponentName "RISC_OSLib" #define Module_ComponentName "RISC_OSLib"
#define Module_ComponentPath "castle/RiscOS/Sources/Lib/RISC_OSLib" #define Module_ComponentPath "castle/RiscOS/Sources/Lib/RISC_OSLib"
#define Module_FullVersion "5.85" #define Module_FullVersion "5.86"
#define Module_HelpVersion "5.85 (03 Apr 2015)" #define Module_HelpVersion "5.86 (30 Jun 2015)"
#define Module_LibraryVersionInfo "5:85" #define Module_LibraryVersionInfo "5:86"
...@@ -923,7 +923,7 @@ void _backtrace(int why, int *address, _kernel_unwindblock *uwb) ...@@ -923,7 +923,7 @@ void _backtrace(int why, int *address, _kernel_unwindblock *uwb)
char *name = 0; char *name = 0;
int *fp = (int *) uwb->fp; int *fp = (int *) uwb->fp;
_kernel_swi_regs r; _kernel_swi_regs r;
if (lang[0]=='C' && lang[1]==0) { if (lang && (lang[0]=='C') && (lang[1]==0)) {
z = (int *)(fp[0] &~ psr_mask); z = (int *)(fp[0] &~ psr_mask);
/* Check that when I save pc in a STM instruction it could save PC+8 or */ /* Check that when I save pc in a STM instruction it could save PC+8 or */
/* PC+12 beyond the instruction. */ /* PC+12 beyond the instruction. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment