diff --git a/src/main/java/org/jboss/netty/handler/stream/ChunkedFile.java b/src/main/java/org/jboss/netty/handler/stream/ChunkedFile.java index 18bf54b580..c24530700a 100644 --- a/src/main/java/org/jboss/netty/handler/stream/ChunkedFile.java +++ b/src/main/java/org/jboss/netty/handler/stream/ChunkedFile.java @@ -67,6 +67,11 @@ public class ChunkedFile implements ChunkedInput { throw new IllegalArgumentException( "length: " + length + " (expected: 0 or greater)"); } + if (chunkSize <= 0) { + throw new IllegalArgumentException( + "chunkSize: " + chunkSize + + " (expected: a positive integer)"); + } this.file = file; this.offset = startOffset = offset;