diff options
author | witcher <witcher@wiredspace.de> | 2023-03-02 20:44:21 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-03-02 22:09:11 +0100 |
commit | 58ca92bcd872e3114c9261819aae6118ea267d63 (patch) | |
tree | 7b31beab6b95420762f6ed18eb17178ebedd4564 /worker/mbox/models.go | |
parent | 8e70c7d40c62ae32463d1ff766b40a5e371bf2aa (diff) | |
download | aerc-58ca92bcd872e3114c9261819aae6118ea267d63.tar.gz |
pgp: fix segfault for opportunistic encryption
Commit 2af81a743048 ("pgp: add configurable error level for
opportunistic encryption") introduced a bug where if the
pgp-opportunistic-encrypt attribute is set to true and a new message is
composed, aerc would crash. This is because no recipients have been
specified, so checkEncryption() would fail early and *not* call
updateCrypto(), which would then cause a segfault in SetEncrypt() later
on.
To avoid this, when the function would have returned early, it instead
does *not* set c.encrypt to true and still calls updateCrypto().
Fixes: 2af81a743048 ("pgp: add configurable error level for opportunistic encryption")
Signed-off-by: witcher <witcher@wiredspace.de>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'worker/mbox/models.go')
0 files changed, 0 insertions, 0 deletions