Commit 136bde25 authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Fix packdir peeking and potentially poking the reset vector

Detail:
  c/DOSFSops - packdir() was treating its optional 'preserve' parameter as mandatory, leading to peeking (and potentially poking) of null pointers
Admin:
  Tested on Raspberry Pi with high processor vectors


Version 0.91. Tagged as 'DOSFS-0_91'
parent 0dbabf61
/* (0.90)
/* (0.91)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.90
#define Module_MajorVersion_CMHG 0.91
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 10 Jun 2012
#define Module_Date_CMHG 14 Jul 2012
#define Module_MajorVersion "0.90"
#define Module_Version 90
#define Module_MajorVersion "0.91"
#define Module_Version 91
#define Module_MinorVersion ""
#define Module_Date "10 Jun 2012"
#define Module_Date "14 Jul 2012"
#define Module_ApplicationDate "10-Jun-12"
#define Module_ApplicationDate "14-Jul-12"
#define Module_ComponentName "DOSFS"
#define Module_ComponentPath "castle/RiscOS/Sources/FileSys/ImageFS/DOSFS"
#define Module_FullVersion "0.90"
#define Module_HelpVersion "0.90 (10 Jun 2012)"
#define Module_LibraryVersionInfo "0:90"
#define Module_FullVersion "0.91"
#define Module_HelpVersion "0.91 (14 Jul 2012)"
#define Module_LibraryVersionInfo "0:91"
......@@ -1798,7 +1798,7 @@ static int extend_dir(DIR_info **cdir,DOS_direntry **dentry,DOSdisc *ihand,DIR_i
//Compress' a directory structure by removing deleted entries
void packdir(DIR_info * cdir, DOS_direntry ** preserve)
{
dprintf(("","packdir: cdir = %p, preserve = %p\n",cdir, *preserve));
dprintf(("","packdir: cdir = %p, preserve = %p\n",cdir, (preserve?*preserve:NULL)));
int ip,op;
int ipend = (cdir->dir_size/32);
DOS_direntry * dir = (DOS_direntry*)DI_Base(cdir);
......@@ -1817,7 +1817,7 @@ void packdir(DIR_info * cdir, DOS_direntry ** preserve)
// }
if((ip != op) && (ip<ipend))
{//If we need to move entrys in the dir
if( (dir+ip) == *preserve) *preserve = (dir+op);
if(preserve && ((dir+ip) == *preserve)) *preserve = (dir+op);
dprintf(("","packdir: ip = %d, op = %d\n",ip,op));
memmove(dir+op,dir+ip,sizeof(DOS_direntry));
(dir+ip)->FILE_status = 0xE5;
......@@ -1825,7 +1825,7 @@ void packdir(DIR_info * cdir, DOS_direntry ** preserve)
cdir->lfnp[ip] = NULL;
}
}
dprintf(("","packdir @ exit: cdir = %p, preserve = %p\n",cdir, *preserve));
dprintf(("","packdir @ exit: cdir = %p, preserve = %p\n",cdir, (preserve?*preserve:NULL)));
}
......
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