Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix missing null character check on guest_access room state #8373

Merged
merged 2 commits into from
Sep 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/8373.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Include `guest_access` in the fields that are checked for null bytes when updating `room_stats_state`. Broke in v1.7.2.
2 changes: 2 additions & 0 deletions synapse/storage/databases/main/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ async def update_room_state(self, room_id: str, fields: Dict[str, Any]) -> None:
* topic
* avatar
* canonical_alias
* guest_access

A is_federatable key can also be included with a boolean value.

Expand All @@ -234,6 +235,7 @@ async def update_room_state(self, room_id: str, fields: Dict[str, Any]) -> None:
"topic",
"avatar",
"canonical_alias",
"guest_access",
):
field = fields.get(col, sentinel)
if field is not sentinel and (not isinstance(field, str) or "\0" in field):
Expand Down