From: Toni Wilen Date: Wed, 4 Aug 2021 19:04:42 +0000 (+0300) Subject: FIx NIC array overflow and increased size. X-Git-Tag: 4900~97 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=a8da912420cabfebcbdb6722b5279e512bb44a76;p=francis%2Fwinuae.git FIx NIC array overflow and increased size. --- diff --git a/ethernet.cpp b/ethernet.cpp index 7aa35d60..843a0fb7 100644 --- a/ethernet.cpp +++ b/ethernet.cpp @@ -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]; } diff --git a/include/sana2.h b/include/sana2.h index 72df9305..6c066679 100644 --- a/include/sana2.h +++ b/include/sana2.h @@ -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);