Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2015-05-22 00:46:40 +0000
committerGreg Wilkins2015-05-22 00:46:40 +0000
commitac7b515915f7a8e5d8003e9f5dba989f44c04abd (patch)
tree90495abd6ce8559d2716e8d63a071e3060a6b52b
parent8aeec6803cbb941137cd9e71a3d6460819d52e87 (diff)
downloadorg.eclipse.jetty.project-ac7b515915f7a8e5d8003e9f5dba989f44c04abd.tar.gz
org.eclipse.jetty.project-ac7b515915f7a8e5d8003e9f5dba989f44c04abd.tar.xz
org.eclipse.jetty.project-ac7b515915f7a8e5d8003e9f5dba989f44c04abd.zip
465053 Prevent gzip buffer overflow on complete
-rw-r--r--jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/GzipHttpOutput.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/GzipHttpOutput.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/GzipHttpOutput.java
index a56bed0ca5..c7ffcd2aba 100644
--- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/GzipHttpOutput.java
+++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/GzipHttpOutput.java
@@ -388,9 +388,11 @@ public class GzipHttpOutput extends HttpOutput
BufferUtil.compact(_buffer);
int off=_buffer.arrayOffset()+_buffer.limit();
int len=_buffer.capacity()-_buffer.limit() - (_last?8:0);
- int produced=_deflater.deflate(_buffer.array(),off,len,Deflater.NO_FLUSH);
-
- _buffer.limit(_buffer.limit()+produced);
+ if (len>0)
+ {
+ int produced=_deflater.deflate(_buffer.array(),off,len,Deflater.NO_FLUSH);
+ _buffer.limit(_buffer.limit()+produced);
+ }
boolean finished=_deflater.finished();
if (finished)

Back to the top