From a8e2446f000e32b66e4808e974c059f7b84f7c60 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sat, 28 Dec 2024 18:05:25 -0600 Subject: [PATCH 1/4] Initialize array to 0s (#5688) --- src/platform/portduino/PortduinoGlue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index 4fadc3ca9..fd489829b 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -90,7 +90,7 @@ void getMacAddr(uint8_t *dmac) if (strlen(optionMac) >= 12) { MAC_from_string(optionMac, dmac); } else { - uint32_t hwId; + uint32_t hwId = {0}; sscanf(optionMac, "%u", &hwId); dmac[0] = 0x80; dmac[1] = 0; From 6749367a73134d9b0e524bb12701105e7d254064 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 28 Dec 2024 18:23:56 -0600 Subject: [PATCH 2/4] [create-pull-request] automated change (#5686) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.properties b/version.properties index ba7d7fe6f..800529e39 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 5 -build = 18 +build = 19 From 57a9a5ca21a3e148151d60a33a111570f4795b89 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sat, 28 Dec 2024 18:48:54 -0600 Subject: [PATCH 3/4] Another Valgrind fix (#5690) --- src/platform/portduino/PortduinoGlue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index fd489829b..0c981bf16 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -104,7 +104,7 @@ void getMacAddr(uint8_t *dmac) exit; } else { - struct hci_dev_info di; + struct hci_dev_info di = {0}; di.dev_id = 0; bdaddr_t bdaddr; int btsock; From e45c0e4d4082e3e78f9124381de01583314ecd59 Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Sun, 29 Dec 2024 11:56:05 +1100 Subject: [PATCH 4/4] Minor cppcheck fixes (#5689) * In graphics/Screen.cpp, a copy/paste error to do with hearts * In mesh/http/ContentHandler.cpp, an unused variable * in mqtt/MQTT.cpp, remove unneded logic " '!A || (A && B)' is equivalent to '!A || B'" --- src/graphics/Screen.cpp | 4 ++-- src/mesh/http/ContentHandler.cpp | 1 - src/mqtt/MQTT.cpp | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 4cfb8701e..31647c92d 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -1015,7 +1015,7 @@ static void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - devil_height) / 2 + 2 + 5, devil_width, devil_height, devil); } else if (strcmp(msg, "♥️") == 0 || strcmp(msg, "\U0001F9E1") == 0 || strcmp(msg, "\U00002763") == 0 || strcmp(msg, "\U00002764") == 0 || strcmp(msg, "\U0001F495") == 0 || strcmp(msg, "\U0001F496") == 0 || - strcmp(msg, "\U0001F497") == 0 || strcmp(msg, "\U0001F496") == 0) { + strcmp(msg, "\U0001F497") == 0 || strcmp(msg, "\U0001F498") == 0) { display->drawXbm(x + (SCREEN_WIDTH - heart_width) / 2, y + (SCREEN_HEIGHT - FONT_HEIGHT_MEDIUM - heart_height) / 2 + 2 + 5, heart_width, heart_height, heart); } else { @@ -2756,4 +2756,4 @@ int Screen::handleAdminMessage(const meshtastic_AdminMessage *arg) } // namespace graphics #else graphics::Screen::Screen(ScanI2C::DeviceAddress, meshtastic_Config_DisplayConfig_OledType, OLEDDISPLAY_GEOMETRY) {} -#endif // HAS_SCREEN +#endif // HAS_SCREEN \ No newline at end of file diff --git a/src/mesh/http/ContentHandler.cpp b/src/mesh/http/ContentHandler.cpp index 2b88702ed..aa8a68f91 100644 --- a/src/mesh/http/ContentHandler.cpp +++ b/src/mesh/http/ContentHandler.cpp @@ -725,7 +725,6 @@ void handleNodes(HTTPRequest *req, HTTPResponse *res) node["position"] = new JSONValue(position); } - JSONObject user; node["long_name"] = new JSONValue(tempNodeInfo->user.long_name); node["short_name"] = new JSONValue(tempNodeInfo->user.short_name); char macStr[18]; diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index c91252231..4260ae201 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -627,8 +627,7 @@ void MQTT::onSend(const meshtastic_MeshPacket &mp_encrypted, const meshtastic_Me // mp_decoded will not be decoded when it's PKI encrypted and not directed to us if (mp_decoded.which_payload_variant == meshtastic_MeshPacket_decoded_tag) { // For uplinking other's packets, check if it's not OK to MQTT or if it's an older packet without the bitfield - bool dontUplink = !mp_decoded.decoded.has_bitfield || - (mp_decoded.decoded.has_bitfield && !(mp_decoded.decoded.bitfield & BITFIELD_OK_TO_MQTT_MASK)); + bool dontUplink = !mp_decoded.decoded.has_bitfield || !(mp_decoded.decoded.bitfield & BITFIELD_OK_TO_MQTT_MASK); // check for the lowest bit of the data bitfield set false, and the use of one of the default keys. if (!isFromUs(&mp_decoded) && !isMqttServerAddressPrivate && dontUplink && (ch.settings.psk.size < 2 || (ch.settings.psk.size == 16 && memcmp(ch.settings.psk.bytes, defaultpsk, 16)) ||