From 4fd8d5c48fa03a5837cc2a7b31ed761166134fa3 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 18 Oct 2020 11:03:29 +0200 Subject: [PATCH] Prevent downloading of sub attachments --- app/src/main/java/eu/faircode/email/Core.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index 23696a0cc8..2861024e1e 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -1448,6 +1448,8 @@ class Core { attachment = db.attachment().getAttachment(message.id, (int) id); // legacy if (attachment == null) throw new IllegalArgumentException("Local attachment not found"); + if (attachment.subsequence != null) + throw new IllegalArgumentException("Download of sub attachment"); if (attachment.available) return; @@ -2093,7 +2095,8 @@ class Core { parts.getWarnings(message.warning)); for (EntityAttachment attachment : parts.getAttachments()) - parts.downloadAttachment(context, attachment); + if (attachment.subsequence == null) + parts.downloadAttachment(context, attachment); if (message.received > account.created) updateContactInfo(context, folder, message);