From d5bc6bda34ed6dd83aba2d32411a884dda7ce7ae Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 27 Mar 2026 16:39:56 +1100 Subject: [PATCH] AP_ADSB: correct copying of callsign in Sagetech XP ADSB driver this appeared to be overwriting all of the data at the start of the mavlink packet, rather than overwriting the callsign within the packet. --- libraries/AP_ADSB/AP_ADSB_Sagetech.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/AP_ADSB/AP_ADSB_Sagetech.cpp b/libraries/AP_ADSB/AP_ADSB_Sagetech.cpp index 6b2c89d97034d..bfb2c981d91e8 100644 --- a/libraries/AP_ADSB/AP_ADSB_Sagetech.cpp +++ b/libraries/AP_ADSB/AP_ADSB_Sagetech.cpp @@ -241,7 +241,8 @@ void AP_ADSB_Sagetech::handle_adsb_in_msg(const Packet_XP &msg) if (msg.payload[16] != 0) { // if string is non-null, consider it valid - memcpy(&vehicle.info, &msg.payload[16], 8); + // "The callsign, 8+null" (from the mavlink spec) means we subtract one here + memcpy(&vehicle.info.callsign, &msg.payload[16], MIN(ARRAY_SIZE(vehicle.info.callsign)-1, 8U)); vehicle.info.flags |= ADSB_FLAGS_VALID_CALLSIGN; }