FIx NIC array overflow and increased size.

This commit is contained in:
Toni Wilen 2021-08-04 22:04:42 +03:00
parent 5b8d5c6007
commit a8da912420
2 changed files with 3 additions and 2 deletions

View File

@ -232,7 +232,8 @@ bool ethernet_enumerate (struct netdriverdata **nddp, int romtype)
#ifdef WITH_UAENET_PCAP
nd = uaenet_enumerate (NULL);
if (nd) {
for (int i = 0; i < MAX_TOTAL_NET_DEVICES; i++) {
int last = MAX_TOTAL_NET_DEVICES - 1 - j;
for (int i = 0; i < last; i++) {
if (nd[i].active)
nddp[j++] = &nd[i];
}

View File

@ -11,7 +11,7 @@
#include "uae/types.h"
#define MAX_TOTAL_NET_DEVICES 10
#define MAX_TOTAL_NET_DEVICES 30
uaecptr netdev_startup(TrapContext*, uaecptr resaddr);
void netdev_install(void);