• Jeffrey Lee's avatar
    Add null hash table entry checks to SysCommsModule & UtilityModule hash table lookup · 97f47c50
    Jeffrey Lee authored
      s/Oscli - In SysCommsHashedLookup and UtilCommsHashedLookup, check for null hash table entries instead of just blindly calling ModCommsLookUp_AltEntry.
      This fixes an issue where a crash will occur iff:
      (a) You enter a command which has no entry in one of the two hash tables
      (b) The command is a valid command (with a code entry point) if you reinterpret the corresponding module header as a command table
      In reality, for recent versions of RISC OS 5, you'll get a crash only when trying to execute the command 's'. Some previous OS versions (e.g. 5.12) appear to have been immune to the crash.
      If (a) was true but (b) was false the bug would have also resulted in a small performance hit caused by attempting to scan the module headers for matching commands.
      Tested in Tungsten & OMAP ROM builds
      's' no longer crashes, and commands included in the two hash tables still seem to function as normal.
      Fixes issue reported on forums:
    Version 5.35, Tagged as 'Kernel-5_35-4_79_2_135'
Oscli 45.5 KB