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

Commit 4325be1

Browse files
committed
Fix missing null character check on guest_access room state
When updating room_stats_state, we try to check for null bytes slipping in to the content for state events. It turns out we had added guest_access as a field to room_stats_state without including it in the null byte check. Lo and behold, a null byte in a m.room.guest_access event then breaks room_stats_state updates. This PR adds the check for guest_access. A further PR will improve this function so that this hopefully does not happen again in future.
1 parent 8998217 commit 4325be1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

synapse/storage/databases/main/stats.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ async def update_room_state(self, room_id: str, fields: Dict[str, Any]) -> None:
210210
* topic
211211
* avatar
212212
* canonical_alias
213+
* guest_access
213214
214215
A is_federatable key can also be included with a boolean value.
215216
@@ -234,6 +235,7 @@ async def update_room_state(self, room_id: str, fields: Dict[str, Any]) -> None:
234235
"topic",
235236
"avatar",
236237
"canonical_alias",
238+
"guest_access",
237239
):
238240
field = fields.get(col, sentinel)
239241
if field is not sentinel and (not isinstance(field, str) or "\0" in field):

0 commit comments

Comments
 (0)