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

Commit 8a6e043

Browse files
authored
Avoid mutating cached room aliases. (#15038)
This might cause incorrect data in other callers which are not expecting the canonical alias to be added into the response.
1 parent 733531e commit 8a6e043

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

changelog.d/15038.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a long-standing bug where the room aliases returned could be corrupted.

synapse/handlers/directory.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,8 @@ async def edit_published_room_list(
485485
)
486486
)
487487
if canonical_alias:
488-
room_aliases.append(canonical_alias)
488+
# Ensure we do not mutate room_aliases.
489+
room_aliases = room_aliases + [canonical_alias]
489490

490491
if not self.config.roomdirectory.is_publishing_room_allowed(
491492
user_id, room_id, room_aliases

0 commit comments

Comments
 (0)