reinstate capacity check

This commit is contained in:
zab2
2018-07-06 17:13:48 +00:00
parent 998931ffde
commit ab4a8ef16c

View File

@ -471,6 +471,11 @@ class EventPumper implements Runnable {
* High-frequency path in thread.
*/
public static void releaseBuf(ByteBuffer buf) {
// double check
if (buf.capacity() < BUF_SIZE) {
I2PAppContext.getGlobalContext().logManager().getLog(EventPumper.class).error("Bad size " + buf.capacity(), new Exception());
return;
}
buf.clear();
_bufferCache.release(buf);
}