aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjp39 <jp39@gmx.com>2024-03-18 10:45:01 +0100
committerRobin Jarry <robin@jarry.cc>2024-04-02 22:22:00 +0200
commite4ad97a3f0c437381cf08e3c8bb008c8a9487d01 (patch)
tree41cedee29d421d61fd013f52e91a2136e390354f
parent7c789624d7da0a45c33519ff10830e6c1b97dd1e (diff)
downloadaerc-e4ad97a3f0c437381cf08e3c8bb008c8a9487d01.tar.gz
search: fix crash during message search
Initialize info in SearchMessage irregardless of the message parts flags otherwise it will crash when we attempt to read it in the next switch statement. Fixes: 8464b3738 ("search: use a common api for all workers") Signed-off-by: jp39 <jp39@gmx.com> Acked-by: Robin Jarry <robin@jarry.cc>
-rw-r--r--worker/lib/search.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/worker/lib/search.go b/worker/lib/search.go
index 31e4843f..d44e2ce1 100644
--- a/worker/lib/search.go
+++ b/worker/lib/search.go
@@ -53,11 +53,9 @@ func SearchMessage(message rfc822.RawMessage, criteria *types.SearchCriteria,
return false, err
}
}
- if parts&HEADER > 0 || parts&DATE > 0 || (parts&(BODY|ALL)) == 0 {
- info, err = rfc822.MessageInfo(message)
- if err != nil {
- return false, err
- }
+ info, err = rfc822.MessageInfo(message)
+ if err != nil {
+ return false, err
}
switch {
case parts&BODY > 0: