From ef467a03034299ea096e28147920959d0a13e3fa Mon Sep 17 00:00:00 2001 From: hermens Date: Sat, 10 Apr 2010 13:57:46 +0000 Subject: [PATCH] Another workaround for the second part of http://forum.yacy-websuche.de/viewtopic.php?f=5&t=2770 This should prevent URLs with bad referrer entries from being dropped by transferURL or even crashing the whole Transmission$Chunk git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6792 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- .../net/yacy/kelondro/data/meta/URIMetadataRow.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source/net/yacy/kelondro/data/meta/URIMetadataRow.java b/source/net/yacy/kelondro/data/meta/URIMetadataRow.java index 2e90fbc73..4408c474e 100644 --- a/source/net/yacy/kelondro/data/meta/URIMetadataRow.java +++ b/source/net/yacy/kelondro/data/meta/URIMetadataRow.java @@ -416,8 +416,16 @@ public class URIMetadataRow implements URIMetadata { } public byte[] referrerHash() { - // return the creator's hash - return entry.getColBytes(col_referrer, true); + // return the creator's hash or null if there is none + // FIXME: There seem to be some malformed entries in the databasees like "null\0\0\0\0\0\0\0\0" + final byte[] r = entry.getColBytes(col_referrer, true); + if (r != null) { + int i = r.length; + while (i > 0) { + if (r[--i] == 0) return null; + } + } + return r; } public String md5() {