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

Fix null pointer dereference in findSUBDIR

Detail:
  c/DOSFSops - The while() loop in findSUBDIR now bails immediately if getnextDIRentry() returns NULL. Avoids null pointer dereference when calling buildFILEname().
Admin:
  Tested on Raspberry Pi with high processor vectors


Version 0.92. Tagged as 'DOSFS-0_92'
parent 136bde25
/* (0.91)
/* (0.92)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.91
#define Module_MajorVersion_CMHG 0.92
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 14 Jul 2012
#define Module_Date_CMHG 21 Jul 2012
#define Module_MajorVersion "0.91"
#define Module_Version 91
#define Module_MajorVersion "0.92"
#define Module_Version 92
#define Module_MinorVersion ""
#define Module_Date "14 Jul 2012"
#define Module_Date "21 Jul 2012"
#define Module_ApplicationDate "14-Jul-12"
#define Module_ApplicationDate "21-Jul-12"
#define Module_ComponentName "DOSFS"
#define Module_ComponentPath "castle/RiscOS/Sources/FileSys/ImageFS/DOSFS"
#define Module_FullVersion "0.91"
#define Module_HelpVersion "0.91 (14 Jul 2012)"
#define Module_LibraryVersionInfo "0:91"
#define Module_FullVersion "0.92"
#define Module_HelpVersion "0.92 (21 Jul 2012)"
#define Module_LibraryVersionInfo "0:92"
......@@ -1264,9 +1264,11 @@ static DOS_direntry *findSUBDIR(char *wcname,DIR_info *cdir,int dir_size,int *in
{
oldindex=*index;
dentry = getnextDIRentry(dir,dir_size,index) ;
if(!dentry)
break;
cfile = ((cdir->lfnp[oldindex])!=NULL)?(cdir->lfnp[oldindex]):buildFILEname(dentry,nbuff);
// cfile = buildFILEname(dentry,nbuff);
} while ((dentry != NULL) && (((dentry->FILE_attribute & FILE_subdir) == 0) || (namematch(wcname,cfile) != TRUE))) ;
} while ((((dentry->FILE_attribute & FILE_subdir) == 0) || (namematch(wcname,cfile) != TRUE))) ;
if (dentry)
strcpy(wcname, cfile);
......
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