Skip to content

Commit

Permalink
GCS_MAVLink: zero signing key structure for valgrind
Browse files Browse the repository at this point in the history
the signing key structure is not marked as packed, which means it has
a 4 byte padding between the uint32_t magic and the uint64_t
timestamp. This gets written to the database and valgrind warns about
a write of uninitialised bytes. It is harmless as when the structure
is read the field is not used
  • Loading branch information
tridge committed Sep 7, 2024
1 parent 7280ff3 commit 5422a41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/GCS_MAVLink/GCS_Signing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void GCS_MAVLINK::handle_setup_signing(const mavlink_message_t &msg) const
mavlink_setup_signing_t packet;
mavlink_msg_setup_signing_decode(&msg, &packet);

struct SigningKey key;
struct SigningKey key {};
key.magic = SIGNING_KEY_MAGIC;
key.timestamp = packet.initial_timestamp;
memcpy(key.secret_key, packet.secret_key, 32);
Expand Down

0 comments on commit 5422a41

Please sign in to comment.