diff options
author | Robin Jarry <robin@jarry.cc> | 2024-05-29 22:49:53 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2024-06-04 21:11:16 +0200 |
commit | 20c63c6943ad06989ffa9953534d1c3f2011b18d (patch) | |
tree | 6f085b3d03735aa49862847c865048f4aa6627ed /commands/testdata/foo | |
parent | 0465509eedade77954e003a82529435c14cf1f3b (diff) | |
download | aerc-20c63c6943ad06989ffa9953534d1c3f2011b18d.tar.gz |
move: avoid crash when message list is not ready
Fix the following crash:
panic: runtime error: invalid memory address or nil pointer dereference
goroutine 1 [running]:
runtime/panic.go:770 +0x132
git.sr.ht/~rjarry/aerc/lib.(*MessageStore).Selected(...)
git.sr.ht/~rjarry/aerc/lib/msgstore.go:709
git.sr.ht/~rjarry/aerc/commands/msg.Move.CallBack()
git.sr.ht/~rjarry/aerc/commands/msg/move.go:178 +0x78
git.sr.ht/~rjarry/aerc/commands/msg.Move.Execute.func1()
git.sr.ht/~rjarry/aerc/commands/msg/move.go:75 +0x90
git.sr.ht/~rjarry/aerc/lib.(*MessageStore).Move.func1()
git.sr.ht/~rjarry/aerc/lib/msgstore.go:645 +0x138
When a move operation finishes, the callback is invoked but there is no
guarantee that the target account has any message store ready (e.g. IMAP
may be disconnected).
Only access acct.Store() in the happy code path and even there, only use
store if is is not nil.
Fixes: 40c25caafd58 ("mv: allow to move messages across accounts")
Link: https://lists.sr.ht/~rjarry/aerc-devel/%3CD114PEHTFKRE.2R9XF4U2BBDD6@mailbox.org%3E
Link: https://lists.sr.ht/~rjarry/aerc-devel/%3CD118R1N4XZ1X.1ZFQPGG8DSCDA@schaeffer.tk%3E
Link: https://lists.sr.ht/~rjarry/aerc-devel/%3CD1B2PVIVGPOZ.1925R9LL60EAZ@disroot.org%3E
Reported-by: Alex Freudenberg <alexfxd@mailbox.org>
Reported-by: Evin Yulo <yujiri@disroot.org>
Reported-by: Maarten Aertsen <sagi+aerc-devel@rtsn.nl>
Reported-by: Yuri Schaeffer <yuri@schaeffer.tk>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Tristan Partin <tristan@partin.io>
Diffstat (limited to 'commands/testdata/foo')
0 files changed, 0 insertions, 0 deletions