change display names/avatar URLS to None if they contain null bytes

This commit is contained in:
H. Shay 2021-11-01 12:18:27 -07:00
parent e81fa92648
commit fdb5ce2ffa

View file

@ -1641,7 +1641,7 @@ class PersistEventsStore:
"""Store a room member in the database."""
def str_or_none(val: Any) -> Optional[str]:
return val if isinstance(val, str) else None
return val if isinstance(val, str) and "\u0000" not in val else None
self.db_pool.simple_insert_many_txn(
txn,