Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

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

hermensef467a030342
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() {