Source
...
Target
Commits (2)
  • Jeffrey Lee's avatar
    Fix null pointer dereference when continuing after some errors · 56e15078
    Jeffrey Lee authored
    Detail:
      c/listfiles - If the first call to enumerate the contents of a directory fails (e.g. when trying to step into a bad image file), next_entry_to_return will be left at a value >= entries_in_buffer. This doesn't impact the operation of the state machine, but it will cause a null/bad pointer dereference in the user interface code when switch_buttons() calls read_next_node_parameters() and the code attempts to construct the path name of the current object. Fix the issue by terminating the path if an invalid cache entry index is found.
    Admin:
      Tested on Iyonix with zero page relocation
    
    
    Version 0.61. Tagged as 'FilerAct-0_61'
    56e15078
  • Robert Sprowson's avatar
    Fix for NULL pointer dereference skipping/retrying the last file · 62fdf168
    Robert Sprowson authored
    If an error occurs during an operation (for example, during a copy move where the source is on a read only medium) the status window changes to an error window with "Abort/Skip/Retry". The skip and retry options call read_next_node_parameters() to peek the next queued item, but would attempt to OS_File 5 of a NULL filename if the error happens when there are no more.
    Check the next_nodename isn't NULL to avoid an abort in OS_GSInit with zero page protection enabled.
    
    Version 0.62. Tagged as 'FilerAct-0_62'
    62fdf168
...@@ -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 "0.60" Module_MajorVersion SETS "0.62"
Module_Version SETA 60 Module_Version SETA 62
Module_MinorVersion SETS "" Module_MinorVersion SETS ""
Module_Date SETS "01 Aug 2014" Module_Date SETS "13 Aug 2016"
Module_ApplicationDate SETS "01-Aug-14" Module_ApplicationDate SETS "13-Aug-16"
Module_ComponentName SETS "FilerAct" Module_ComponentName SETS "FilerAct"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/FilerAct" Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/FilerAct"
Module_FullVersion SETS "0.60" Module_FullVersion SETS "0.62"
Module_HelpVersion SETS "0.60 (01 Aug 2014)" Module_HelpVersion SETS "0.62 (13 Aug 2016)"
END END
/* (0.60) /* (0.62)
* *
* 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 0.60 #define Module_MajorVersion_CMHG 0.62
#define Module_MinorVersion_CMHG #define Module_MinorVersion_CMHG
#define Module_Date_CMHG 01 Aug 2014 #define Module_Date_CMHG 13 Aug 2016
#define Module_MajorVersion "0.60" #define Module_MajorVersion "0.62"
#define Module_Version 60 #define Module_Version 62
#define Module_MinorVersion "" #define Module_MinorVersion ""
#define Module_Date "01 Aug 2014" #define Module_Date "13 Aug 2016"
#define Module_ApplicationDate "01-Aug-14" #define Module_ApplicationDate "13-Aug-16"
#define Module_ComponentName "FilerAct" #define Module_ComponentName "FilerAct"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/FilerAct" #define Module_ComponentPath "castle/RiscOS/Sources/Desktop/FilerAct"
#define Module_FullVersion "0.60" #define Module_FullVersion "0.62"
#define Module_HelpVersion "0.60 (01 Aug 2014)" #define Module_HelpVersion "0.62 (13 Aug 2016)"
#define Module_LibraryVersionInfo "0:60" #define Module_LibraryVersionInfo "0:62"
...@@ -453,7 +453,7 @@ static int size_of_next_filename( search_context *context, search_nest_level *ne ...@@ -453,7 +453,7 @@ static int size_of_next_filename( search_context *context, search_nest_level *ne
if ( context->recursive ) if ( context->recursive )
{ {
while ( nest_level != NULL ) while (( nest_level != NULL ) && ( nest_level->next_entry_to_return >= 0 ) && ( nest_level->next_entry_to_return < nest_level->entries_in_buffer ))
{ {
returned_length += 1 + strlen( nest_level-> returned_length += 1 + strlen( nest_level->
directory_buffer[ nest_level->next_entry_to_return ]. directory_buffer[ nest_level->next_entry_to_return ].
...@@ -505,7 +505,7 @@ static os_error *next_filename( search_context *context, search_nest_level *nest ...@@ -505,7 +505,7 @@ static os_error *next_filename( search_context *context, search_nest_level *nest
*rover = '\0'; *rover = '\0';
while ( nest_level != NULL ) while (( nest_level != NULL ) && ( nest_level->next_entry_to_return >= 0 ) && ( nest_level->next_entry_to_return < nest_level->entries_in_buffer ))
{ {
part_length = strlen( nest_level-> part_length = strlen( nest_level->
directory_buffer[ nest_level->next_entry_to_return ]. directory_buffer[ nest_level->next_entry_to_return ].
...@@ -677,7 +677,7 @@ void read_next_node_parameters( search_handle handle ) ...@@ -677,7 +677,7 @@ void read_next_node_parameters( search_handle handle )
err = next_nodename( handle, &filename ); err = next_nodename( handle, &filename );
if ( err ) if ( err || filename == NULL )
return; return;
fileplace.action = OSFile_ReadInfo; fileplace.action = OSFile_ReadInfo;
......