mirror of
https://github.com/simh/simh.git
synced 2026-02-26 08:44:38 +00:00
Fix compiler identified array bounds issues
This commit is contained in:
2
scp.c
2
scp.c
@@ -1502,7 +1502,7 @@ t_stat shift_args (char *do_arg[], size_t arg_count)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i=1; i<arg_count; ++i)
|
||||
for (i=1; i<arg_count-1; ++i)
|
||||
do_arg[i] = do_arg[i+1];
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
@@ -569,7 +569,8 @@ char* eth_getname(int number, char* name)
|
||||
ETH_LIST list[ETH_MAX_DEVICE];
|
||||
int count = eth_devices(ETH_MAX_DEVICE, list);
|
||||
|
||||
if (count <= number) return NULL;
|
||||
if ((number < 0) || (count <= number))
|
||||
return NULL;
|
||||
strcpy(name, list[number].name);
|
||||
return name;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user