From 422419367fe231e2074945fabae1d7a280baf14a Mon Sep 17 00:00:00 2001 From: tc-wleite Date: Fri, 31 May 2024 09:42:32 -0300 Subject: [PATCH] '#2234: Do not try to link items with zero length. --- .../java/iped/parsers/bittorrent/TorrentFileParser.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/bittorrent/TorrentFileParser.java b/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/bittorrent/TorrentFileParser.java index 88cc3d3c4d..e6996a4ea2 100644 --- a/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/bittorrent/TorrentFileParser.java +++ b/iped-parsers/iped-parsers-impl/src/main/java/iped/parsers/bittorrent/TorrentFileParser.java @@ -372,9 +372,11 @@ private static List extractFileList(BencodedDict dict, Metadata m // Try to link files to case items by hash for (FileInTorrent file : files) { - linkTorrentToItem(searcher, metadata, file, "md5", file.md5, md5Len); - linkTorrentToItem(searcher, metadata, file, "sha-1", file.sha1, sha1Len); - linkTorrentToItem(searcher, metadata, file, "edonkey", file.ed2k, edonkeyLen); + if (file.length > 0) { + linkTorrentToItem(searcher, metadata, file, "md5", file.md5, md5Len); + linkTorrentToItem(searcher, metadata, file, "sha-1", file.sha1, sha1Len); + linkTorrentToItem(searcher, metadata, file, "edonkey", file.ed2k, edonkeyLen); + } } } else {