Skip to content

Commit bed11a4

Browse files
authored
Merge pull request #1603 from UltimateHackingKeyboard/sanitize_statesync_properties
StateSync: ignore unknown/out-of-range property ids from peers.
2 parents a9d1453 + 6a6cd73 commit bed11a4

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

device/src/state_sync.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,11 @@ void StateSync_ReceiveStateUpdate(device_id_t src, const uint8_t *data, uint8_t
574574
ATTR_UNUSED message_id_t messageId = *(data++);
575575
ATTR_UNUSED state_sync_prop_id_t propId = *(data++);
576576

577+
if (propId >= StateSyncPropertyId_Count) {
578+
LOG_WRN("Ignoring unknown state sync property id %d from %s", propId, Utils_DeviceIdToString(src));
579+
return;
580+
}
581+
577582
receiveProperty(src, propId, data, len - 2);
578583
}
579584

0 commit comments

Comments
 (0)