From d8c9434e4488196f38af1c09750c2ad8b4513d78 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Mon, 9 Dec 2024 12:07:48 -0600 Subject: [PATCH] Initialize dmac array to nulls I don't fully understand why, but I've seen segfaults when the dmac value isn't initialized to 0s. --- src/platform/portduino/PortduinoGlue.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index b6a017d9fd..573e166a90 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -203,7 +203,7 @@ void portduinoSetup() } } - uint8_t dmac[6]; + uint8_t dmac[6] = {0}; getMacAddr(dmac); if (dmac[0] == 0 && dmac[1] == 0 && dmac[2] == 0 && dmac[3] == 0 && dmac[4] == 0 && dmac[5] == 0) { std::cout << "*** Blank MAC Address not allowed!" << std::endl; @@ -531,4 +531,4 @@ bool MAC_from_string(std::string mac_str, uint8_t *dmac) } else { return false; } -} \ No newline at end of file +}