forked from Telodendria/Telodendria
[MOD] Clamp depth
This commit is contained in:
parent
327730c2c6
commit
7ee35fcc28
1 changed files with 3 additions and 0 deletions
|
@ -499,6 +499,9 @@ PopulateEventV1(Room * room, HashMap * event, PduV1 * pdu, ServerPart serv)
|
|||
pdu->room_id = StrDuplicate(room->id);
|
||||
pdu->signatures = HashMapCreate();
|
||||
pdu->depth = RoomGetDepth(room) + 1; /* TODO: Clamp this value. */
|
||||
pdu->depth =
|
||||
pdu->depth >= (int64_t) UINT64_MAX ?
|
||||
(int64_t) UINT64_MAX : pdu->depth;
|
||||
|
||||
/* Create a random event ID for this PDU.
|
||||
* TODO: Optionally verify whenever it's already used, but that
|
||||
|
|
Loading…
Reference in a new issue