aerc/widgets
Robin Jarry bf2bf8c242 compose: prevent out of bounds access
Fix the following panic, seen while switching accounts:

runtime error: index out of range [4] with length 4

goroutine 6 [running]:
git.sr.ht/~rjarry/aerc/widgets.(*Composer).Focus(0xc005cfbe30?, 0x40?)
        git.sr.ht/~rjarry/aerc/widgets/compose.go:618 +0x51
git.sr.ht/~rjarry/aerc/widgets.(*Aerc).focus(0xc00034c000, {0x0?, 0x0})
        git.sr.ht/~rjarry/aerc/widgets/aerc.go:568 +0xec
git.sr.ht/~rjarry/aerc/widgets.(*Aerc).BeginExCommand.func2()
        git.sr.ht/~rjarry/aerc/widgets/aerc.go:590 +0x4c
git.sr.ht/~rjarry/aerc/widgets.(*ExLine).Event(0xc009453860, {0xbb6820?, 0xc009baa320?})
        git.sr.ht/~rjarry/aerc/widgets/exline.go:81 +0xbc
git.sr.ht/~rjarry/aerc/widgets.(*Aerc).Event(0xc009ab1950?, {0xbb6820?, 0xc009baa320?})
        git.sr.ht/~rjarry/aerc/widgets/aerc.go:285 +0x470
git.sr.ht/~rjarry/aerc/lib/ui.(*UI).ProcessEvents(0xc000327540)
        git.sr.ht/~rjarry/aerc/lib/ui/ui.go:117 +0x202
created by main.main
        git.sr.ht/~rjarry/aerc/aerc.go:244 +0x94c

Protect Composer.editable and Composer.focus with a mutex.

Reported-by: Bence Ferdinandy <bence@ferdinandy.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
2022-09-29 16:52:27 +02:00
..
account-wizard.go wizard: add plaintext password warning 2022-08-22 09:30:37 +02:00
account.go checkmail: protect access to acct.checkingmail 2022-09-26 17:32:00 +02:00
aerc.go exline: don't draw completions for keybinds 2022-09-29 16:42:10 +02:00
authinfo.go lint: homogenize operations and minor fixes (gocritic) 2022-08-04 21:58:01 +02:00
compose.go compose: prevent out of bounds access 2022-09-29 16:52:27 +02:00
dialog.go widgets: add dialog interface 2022-08-22 09:30:37 +02:00
dirlist.go notmuch: move logic for dynamic folders to backend 2022-09-29 16:52:12 +02:00
dirtree.go dirtree: fix build errors 2022-08-22 09:57:23 +02:00
exline.go exline: don't draw completions for keybinds 2022-09-29 16:42:10 +02:00
getpasswd.go lint: apply new formatting rules 2022-08-01 10:44:52 +02:00
headerlayout.go go.mod: change base git url 2021-11-05 10:21:45 +01:00
listbox.go widgets: add list box with filter/scrollbar 2022-08-22 09:30:37 +02:00
msglist.go store: improve cursor position 2022-08-22 10:01:46 +02:00
msgviewer.go msgviewer: fix segfault when closing viewer 2022-09-19 21:25:13 +02:00
pgpinfo.go lint: remove ineffectual assignments (ineffassign) 2022-08-04 21:57:50 +02:00
providesmessage.go msgviewer: open http links from messages 2022-06-14 22:12:48 +02:00
scrollable.go lint: apply new formatting rules 2022-08-01 10:44:52 +02:00
selector.go lint: homogenize operations and minor fixes (gocritic) 2022-08-04 21:58:01 +02:00
spinner.go logging: added a log on panic 2022-03-23 20:56:09 +01:00
status.go uiconfig: use pointer references to uiConfig 2022-07-03 21:32:18 +02:00
tabhost.go Implement style configuration. 2020-08-06 21:42:06 +02:00
terminal.go terminal: prevent draw loop when unfocused 2022-09-26 17:31:05 +02:00