Author: nextgens
Date: 2008-11-16 22:22:55 +0000 (Sun, 16 Nov 2008)
New Revision: 23665
Modified:
trunk/freenet/src/freenet/client/ArchiveManager.java
Log:
add a sanity check here too
Modified: trunk/freenet/src/freenet/client/ArchiveManager.java
===================================================================
--- trunk/freenet/src/freenet/client/ArchiveManager.java 2008-11-16
20:22:29 UTC (rev 23664)
+++ trunk/freenet/src/freenet/client/ArchiveManager.java 2008-11-16
22:22:55 UTC (rev 23665)
@@ -257,8 +257,12 @@
throwAtExit = true;
ctx.setLastHash(realHash);
}
- if(data.size() > archiveContext.maxArchiveSize)
- throw new ArchiveFailureException("Archive too big
("+data.size()+" > "+archiveContext.maxArchiveSize+")!");
+
+ long dataSize = data.size();
+ if(dataSize > archiveContext.maxArchiveSize)
+ throw new ArchiveFailureException("Archive too big
("+dataSize+" > "+archiveContext.maxArchiveSize+")!");
+ else if(dataSize <= 0)
+ throw new ArchiveFailureException("Archive too small!
("+dataSize+')');
else if(logMINOR)
Logger.minor(this, "Container size (possibly
compressed): "+data.size()+" for "+data);
_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs