From d71c6c86274194c116d4fc866a6ad7f37c9476b8 Mon Sep 17 00:00:00 2001 From: Luis Nassif Date: Wed, 27 Sep 2023 23:25:05 -0300 Subject: [PATCH] '#1898: avoid possible AIOOBE in commit 902326d --- .../src/main/java/iped/parsers/discord/DiscordParser.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/discord/DiscordParser.java b/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/discord/DiscordParser.java index d759fd4202..3ab981ae02 100644 --- a/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/discord/DiscordParser.java +++ b/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/discord/DiscordParser.java @@ -150,7 +150,8 @@ public void parse(InputStream indexFile, ContentHandler handler, Metadata metada // Checking attachments image for (DiscordAttachment att : dr.getAttachments()) { - if (ce2.getRequestURL().contains(att.getUrl().split("https://cdn.discordapp.com/attachments/")[1])) { + String[] parts = att.getUrl().split("https://cdn.discordapp.com/attachments/"); + if (parts.length > 1 && ce2.getRequestURL().contains(parts[1])) { for (IItemReader ib : externalFiles) { if (ib.getName() != null && ib.getName().equals(ce2.getName())) { att.setMediaHash(ib.getHash());