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

runtime error: slice bounds out of range [:-1] #369

Closed rghvdberg closed 1 week ago

rghvdberg commented 2 years ago

I pressed backspace for a longer time to delete some tekst and a crash occured

runtime error: slice bounds out of range [:-1]
goroutine 1 [running]:
runtime/debug.Stack(0x13f0ce0, 0xc0008ae5a0, 0xc000671688)
    /usr/local/go/src/runtime/debug/stack.go:24 +0x9f
maunium.net/go/gomuks/debug.PrettyPanic(0xef7a40, 0xc000cf62b8)
    /builds/tulir/gomuks/debug/debug.go:133 +0x245
maunium.net/go/gomuks/debug.Recover()
    /builds/tulir/gomuks/debug/debug.go:107 +0x65
panic(0xef7a40, 0xc000cf62b8)
    /usr/local/go/src/runtime/panic.go:965 +0x1b9
maunium.net/go/mauview.(*Application).Start.func1(0xc0000930e0)
    /builds/tulir/gomuks/.cache/pkg/mod/maunium.net/go/mauview@v0.1.2/application.go:104 +0x87
panic(0xef7a40, 0xc000cf62b8)
    /usr/local/go/src/runtime/panic.go:965 +0x1b9
maunium.net/go/mauview.(*InputArea).RemovePreviousCharacter(0xc000783180)
    /builds/tulir/gomuks/.cache/pkg/mod/maunium.net/go/mauview@v0.1.2/inputarea.go:856 +0x265
maunium.net/go/mauview.(*InputArea).OnKeyEvent(0xc000783180, 0x1400018, 0xc00077acc0, 0xc000671cb8)
    /builds/tulir/gomuks/.cache/pkg/mod/maunium.net/go/mauview@v0.1.2/inputarea.go:1000 +0x45e
maunium.net/go/gomuks/ui.(*RoomView).OnKeyEvent(0xc0007832c0, 0x1400018, 0xc00077acc0, 0x19588e0)
    /builds/tulir/gomuks/ui/room-view.go:378 +0x172
maunium.net/go/mauview.(*Box).OnKeyEvent(0xc0001f60e0, 0x1400018, 0xc00077acc0, 0xc0005fe000)
    /builds/tulir/gomuks/.cache/pkg/mod/maunium.net/go/mauview@v0.1.2/box.go:196 +0x5a
maunium.net/go/mauview.(*Flex).OnKeyEvent(...)
    /builds/tulir/gomuks/.cache/pkg/mod/maunium.net/go/mauview@v0.1.2/flex.go:116
maunium.net/go/gomuks/ui.(*MainView).OnKeyEvent(0xc0005f0000, 0x1400018, 0xc00077acc0, 0x0)
    /builds/tulir/gomuks/ui/view-main.go:204 +0x1e4
maunium.net/go/mauview.(*Application).Start(0xc0000930e0, 0x0, 0x0)
    /builds/tulir/gomuks/.cache/pkg/mod/maunium.net/go/mauview@v0.1.2/application.go:155 +0x390
maunium.net/go/gomuks/ui.(*GomuksUI).Start(0xc00007e210, 0x10266d8, 0xc00007e1b0)
    /builds/tulir/gomuks/ui/ui.go:75 +0x2f
main.(*Gomuks).Start(0xc00007e1b0)
    /builds/tulir/gomuks/gomuks.go:115 +0x11d
main.main()
    /builds/tulir/gomuks/main.go:89 +0x7c5