mautrix / signal

A Matrix-Signal puppeting bridge
GNU Affero General Public License v3.0
499 stars 75 forks source link

Error "cannot convert slice" while relaying message #466

Closed LukasNeuberger closed 7 months ago

LukasNeuberger commented 7 months ago

I am using the bridge docker image 19929f6/commit 2717c53 to relay messages between Whatsapp and Signal groups. While relaying a message from a Whatsapp user to Signal I got the following error:

panic: runtime error: cannot convert slice with length 0 to array or pointer to array with length 65

goroutine 19480 [running]:
go.mau.fi/mautrix-signal/pkg/signalmeow.decryptPendingMember({_, _}, _, {0x0, 0x13, 0x9c, 0xa, 0x6b, 0xc6, 0x26, ...})
    /builds/mautrix/signal/pkg/signalmeow/groups.go:968 +0x459
go.mau.fi/mautrix-signal/pkg/signalmeow.decryptGroup({0x19a40d8, 0xc000437410}, 0xc0004c1400, {0xc0007088a0, 0x2c})
    /builds/mautrix/signal/pkg/signalmeow/groups.go:394 +0x94b
go.mau.fi/mautrix-signal/pkg/signalmeow.(*Client).fetchGroupByID(0xc0001128c0, {0x19a40d8, 0xc000437410}, {0xc00036d6b0, 0x2c})
    /builds/mautrix/signal/pkg/signalmeow/groups.go:525 +0x3b6
go.mau.fi/mautrix-signal/pkg/signalmeow.(*Client).RetrieveGroupByID(0xc0001128c0, {0x19a40d8, 0xc000437410}, {0xc00036d6b0, 0x2c}, 0x0)
    /builds/mautrix/signal/pkg/signalmeow/groups.go:590 +0x1a9
go.mau.fi/mautrix-signal/pkg/signalmeow.(*Client).SendGroupMessage(0xc0001128c0, {0x19a40d8, 0xc000437380}, {0xc00036d6b0, 0x2c}, 0xc000300d20)
    /builds/mautrix/signal/pkg/signalmeow/sending.go:520 +0x365
main.(*Portal).sendSignalMessage(0xc000118dd0, {0x19a40d8, 0xc0004370b0}, 0xc000300d20, 0xc0000009c0, {0xc000708030, 0x2c})
    /builds/mautrix/signal/portal.go:690 +0x50f
main.(*Portal).handleMatrixMessage(0xc000118dd0, {0x19a40d8, 0xc000436e40}, 0xc0002da540, 0xc0004b01a0)
    /builds/mautrix/signal/portal.go:493 +0xda5
main.(*Portal).handleMatrixMessages(0xc000118dd0, {0xc0004b01a0?, 0xc0002da540?})
    /builds/mautrix/signal/portal.go:356 +0x496
main.(*Portal).messageLoop(0xc000118dd0)
    /builds/mautrix/signal/portal.go:339 +0xc5
created by main.(*SignalBridge).NewPortal in goroutine 131
    /builds/mautrix/signal/portal.go:224 +0x725

Is the call stack enough or do you need more info?

maltee1 commented 7 months ago

That might be enough info. I think a Pending member doesn't have its profileKey available, making it size 0 rather than 65. I probably shouldn't try to decrypt it, but there could also be an issue with UUID length, see #465