tulir / gomuks

A Matrix client written in Go.
https://maunium.net/go/gomuks
GNU Affero General Public License v3.0
1.37k stars 123 forks source link

gomuks crashed when uploading an ogg file #394

Closed bodqhrohro closed 1 week ago

bodqhrohro commented 2 years ago
runtime error: invalid memory address or nil pointer dereference
goroutine 17895 [running]:
runtime/debug.Stack()
    /usr/lib/go-1.19/src/runtime/debug/stack.go:24 +0x65
maunium.net/go/gomuks/debug.PrettyPanic({0xf6bd00, 0x182cd30})
    /media/d/temp/git/gomuks/debug/debug.go:133 +0x19a
maunium.net/go/gomuks/debug.Recover()
    /media/d/temp/git/gomuks/debug/debug.go:107 +0x5a
panic({0xf6bd00, 0x182cd30})
    /usr/lib/go-1.19/src/runtime/panic.go:884 +0x212
maunium.net/go/gomuks/ui.(*RoomView).addLocalEcho(0xc0002e6140, 0xc000dbc150)
    /media/d/temp/git/gomuks/ui/room-view.go:844 +0x55b
maunium.net/go/gomuks/ui.(*RoomView).SendMessageMedia(0xc0002e6140, {0xc001218728, 0x28})
    /media/d/temp/git/gomuks/ui/room-view.go:822 +0x2af
created by maunium.net/go/gomuks/ui.cmdUpload
    /media/d/temp/git/gomuks/ui/commands.go:286 +0x1b5

In weechat-matrix I see 01:24 <⚠️ &bodqhrohro> Bad event received, event type: m.room.message

bodqhrohro commented 2 years ago

I can reliably crash it with this file (NSFW): https://0x0.st/oYTH.ogg