Skip to content
Snippets Groups Projects
Commit 4325be1a authored by Andrew Morgan's avatar Andrew Morgan
Browse files

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.
parent 89982175
No related branches found
No related tags found
No related merge requests found
...@@ -210,6 +210,7 @@ class StatsStore(StateDeltasStore): ...@@ -210,6 +210,7 @@ class StatsStore(StateDeltasStore):
* topic * topic
* avatar * avatar
* canonical_alias * canonical_alias
* guest_access
A is_federatable key can also be included with a boolean value. A is_federatable key can also be included with a boolean value.
...@@ -234,6 +235,7 @@ class StatsStore(StateDeltasStore): ...@@ -234,6 +235,7 @@ class StatsStore(StateDeltasStore):
"topic", "topic",
"avatar", "avatar",
"canonical_alias", "canonical_alias",
"guest_access",
): ):
field = fields.get(col, sentinel) field = fields.get(col, sentinel)
if field is not sentinel and (not isinstance(field, str) or "\0" in field): if field is not sentinel and (not isinstance(field, str) or "\0" in field):
......
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