From a8da912420cabfebcbdb6722b5279e512bb44a76 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Wed, 4 Aug 2021 22:04:42 +0300 Subject: [PATCH] FIx NIC array overflow and increased size. --- ethernet.cpp | 3 ++- include/sana2.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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); -- 2.47.3