Skip to content
Snippets Groups Projects
Unverified Commit 774ac493 authored by Carl Bordum Hansen's avatar Carl Bordum Hansen Committed by GitHub
Browse files

Make sure `prev_ids` defaults to empty list (#12829)

parent 29891155
No related branches found
No related tags found
No related merge requests found
Fix a bug where we did not correctly handle invalid device list updates over federation. Contributed by Carl Bordum Hansen.
......@@ -763,6 +763,10 @@ class DeviceListUpdater:
device_id = edu_content.pop("device_id")
stream_id = str(edu_content.pop("stream_id")) # They may come as ints
prev_ids = edu_content.pop("prev_id", [])
if not isinstance(prev_ids, list):
raise SynapseError(
400, "Device list update had an invalid 'prev_ids' field"
)
prev_ids = [str(p) for p in prev_ids] # They may come as ints
if get_domain_from_id(user_id) != origin:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment