Commit 6e4b7f42 authored by Robert Sprowson's avatar Robert Sprowson Committed by ROOL

Fix for NULL pointer dereference when server list is empty

Check the active server pointer before testing the magic word.
Fixes issue described https://www.riscosopen.org/forum/forums/4/topics/15005

Version 0.73. Tagged as 'OmniNFS-0_73'
parent 1fdbd273
/* (0.72)
/* (0.73)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.72
#define Module_MajorVersion_CMHG 0.73
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 25 Sep 2018
#define Module_Date_CMHG 01 Feb 2020
#define Module_MajorVersion "0.72"
#define Module_Version 72
#define Module_MajorVersion "0.73"
#define Module_Version 73
#define Module_MinorVersion ""
#define Module_Date "25 Sep 2018"
#define Module_Date "01 Feb 2020"
#define Module_ApplicationDate "25-Sep-18"
#define Module_ApplicationDate "01-Feb-20"
#define Module_ComponentName "OmniNFS"
#define Module_ComponentPath "castle/RiscOS/Sources/Networking/Omni/Protocols/OmniNFS"
#define Module_FullVersion "0.72"
#define Module_HelpVersion "0.72 (25 Sep 2018)"
#define Module_LibraryVersionInfo "0:72"
#define Module_FullVersion "0.73"
#define Module_HelpVersion "0.73 (01 Feb 2020)"
#define Module_LibraryVersionInfo "0:73"
......@@ -470,14 +470,16 @@ static _kernel_oserror *Op_Servers(_kernel_swi_regs *r)
else
as = (onfs_active_server *) r->r[3];
while (as != 0)
{
/* Check list integrity */
if (as->magic != ONFS_SERVER_MAGIC)
return intl_error(err_BAD_MAGIC);
while (as != 0)
{
dprintf(("", "Server id %p, name %s, address %x, last seen %d, %sill\n",
as, as->server_name, as->addr, as->last_seen,
as->server_ill ? "" : "not "));
/* Only update the buffer if the server is not ill */
if (as->server_ill == 0)
{
......@@ -523,7 +525,7 @@ static _kernel_oserror *Op_Servers(_kernel_swi_regs *r)
as = as->next;
}
dprintf (("", "Finnished list\n"));
dprintf (("", "Finished list\n"));
r->r[1] = (int) buffer;
r->r[3] = (int) as;
......
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