Fix compiler identified array bounds issues
This commit is contained in:
parent
d940752232
commit
d291a6e838
2 changed files with 3 additions and 2 deletions
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue