Skip to content

Commit b8ce465

Browse files
author
oleksiys
committed
+ fix buffer overflow
1 parent 98a45dd commit b8ce465

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/ning/http/client/generators/InputStreamBodyGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public long getContentLength() {
6767
public long read(ByteBuffer buffer) throws IOException {
6868

6969
// To be safe.
70-
chunk = new byte[buffer.capacity() - 10];
70+
chunk = new byte[buffer.remaining() - 10];
7171

7272

7373
int read = -1;

0 commit comments

Comments
 (0)