From 3593b5f7c78035925482071a7ae77b5c182636d1 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sun, 31 Dec 2023 15:07:25 +0100 Subject: [PATCH] Parse uuid safely when adding signal quote --- portal.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/portal.go b/portal.go index 5926f961..0ab09db4 100644 --- a/portal.go +++ b/portal.go @@ -1069,8 +1069,12 @@ func (portal *Portal) addSignalQuote(ctx context.Context, content *event.Message if quote == nil { return } + quotedSender, err := uuid.Parse(quote.QuotedSender) + if err != nil { + return + } originalMessage, err := portal.bridge.DB.Message.GetBySignalID( - ctx, uuid.MustParse(quote.QuotedSender), quote.QuotedTimestamp, 0, portal.Receiver, + ctx, quotedSender, quote.QuotedTimestamp, 0, portal.Receiver, ) if err != nil { zerolog.Ctx(ctx).Err(err).Str("quoted_sender", quote.QuotedSender).Uint64("quoted_timestamp", quote.QuotedTimestamp).Msg("Failed to get quoted message from database")