Commit d9c7abb7 authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Fix a couple of null/bad pointer dereferences

Detail:
  s/FSControl - faff_boot_option_startup (OS_FSControl 47/48) was acting as if it was given a path variable in r3, but neither of those calls use path variables, leading to aborts in some situations due to random bits of memory being peeked at.
  s/FSUtils - When CopyWildObject performs a single object copy, it wasn't taking into account the fact that the src/dest leafname pointers could be null, potentially causing a crash if high processor vectors are in use.
Since I'm not 100% sure what the correct course of action is (in the case I saw it crash, both src and dest leafnames were null), and there aren't any bugs I know of with file copies using the wrong names, the code now uses the dest leafname if the dest leafname is null.
This sounds wrong, but matches the behaviour of the old code, since byte &00000000 is highly unlikely to contain a '*' character
Admin:
  Tested on BB-xM with high processor vectors


Version 2.77. Tagged as 'FileSwitch-2_77'
parent 1f3b4bd6
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "2.76"
Module_Version SETA 276
Module_MajorVersion SETS "2.77"
Module_Version SETA 277
Module_MinorVersion SETS ""
Module_Date SETS "09 Apr 2012"
Module_ApplicationDate SETS "09-Apr-12"
Module_Date SETS "09 Jul 2012"
Module_ApplicationDate SETS "09-Jul-12"
Module_ComponentName SETS "FileSwitch"
Module_ComponentPath SETS "castle/RiscOS/Sources/FileSys/FileSwitch"
Module_FullVersion SETS "2.76"
Module_HelpVersion SETS "2.76 (09 Apr 2012)"
Module_FullVersion SETS "2.77"
Module_HelpVersion SETS "2.77 (09 Jul 2012)"
END
/* (2.76)
/* (2.77)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 2.76
#define Module_MajorVersion_CMHG 2.77
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 09 Apr 2012
#define Module_Date_CMHG 09 Jul 2012
#define Module_MajorVersion "2.76"
#define Module_Version 276
#define Module_MajorVersion "2.77"
#define Module_Version 277
#define Module_MinorVersion ""
#define Module_Date "09 Apr 2012"
#define Module_Date "09 Jul 2012"
#define Module_ApplicationDate "09-Apr-12"
#define Module_ApplicationDate "09-Jul-12"
#define Module_ComponentName "FileSwitch"
#define Module_ComponentPath "castle/RiscOS/Sources/FileSys/FileSwitch"
#define Module_FullVersion "2.76"
#define Module_HelpVersion "2.76 (09 Apr 2012)"
#define Module_LibraryVersionInfo "2:76"
#define Module_FullVersion "2.77"
#define Module_HelpVersion "2.77 (09 Jul 2012)"
#define Module_LibraryVersionInfo "2:77"
......@@ -2668,9 +2668,8 @@ faff_boot_option_startup
Entry "r2-r5"
; Standard PathMunge sequence
MOV r2, r3
MOVS r3, r4
addr r3, anull, EQ
MOV r2, #0
addr r3, anull
MOV r5, #TopPath_WantPartition
BL TopPath_DoBusinessForDirectoryRead
EXIT VS
......
......@@ -561,7 +561,9 @@ CopyWildObject Entry
90
; Use src leafname for dst if dst has a '*' leafname
LDRB r14, [r10]
; Use dst leafname if dst leafname is null (sounds silly, but matches old behaviour before null ptr check was added)
MOVS r14, r10
LDRNEB r14, [r10]
TEQ r14, #"*"
[ debugcopy
BNE %FT01
......
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