Skip to content

Commit

Permalink
'#1998: Do not search for hash of zero bytes.
Browse files Browse the repository at this point in the history
  • Loading branch information
wladimirleite committed Dec 22, 2023
1 parent 1180f8f commit 8297c45
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public class ReportGenerator {
private IItemSearcher searcher;
private boolean firstFragment = true;
private int currentMsg = 0;


private static final String emptyMD5 = "d41d8cd98f00b204e9800998ecf8427e";

private String creatSpanTag(String text) {
return "<span class=\"tooltiptext\">" + SimpleHTMLEncoder.htmlEncode(text) + "</span>";
Expand Down Expand Up @@ -152,9 +153,11 @@ private TagHtml getThumbTag(Message m, String classnotfound) {
byte thumb[] = m.getThumb();

if (searcher != null && thumb == null && m.getMediaHash() != null && !m.getMediaHash().isBlank()) {
List<IItemReader> result = iped.parsers.util.Util.getItems("md5:" + m.getMediaHash(), searcher);
if (result != null && !result.isEmpty()) {
thumb = result.get(0).getThumb();
if (!m.getMediaHash().equalsIgnoreCase(emptyMD5)) {
List<IItemReader> result = iped.parsers.util.Util.getItems("md5:" + m.getMediaHash(), searcher);
if (result != null && !result.isEmpty()) {
thumb = result.get(0).getThumb();
}
}
}

Expand Down

0 comments on commit 8297c45

Please sign in to comment.