GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Do no check length parameter of ByteBufOutputStream.write(byte[], int… · netty/netty@c173c94

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • buffer/src
    • main/java/io/netty/buffer
      • ByteBufOutputStream.java
    • test/java/io/netty/buffer
      • ByteBufStreamTest.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎buffer/src/main/java/io/netty/buffer/ByteBufOutputStream.java‎

Copy file name to clipboardExpand all lines: buffer/src/main/java/io/netty/buffer/ByteBufOutputStream.java
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@ public int writtenBytes() {
7272

7373
@Override
7474
public void write(byte[] b, int off, int len) throws IOException {
75-
if (len == 0) {
76-
return;
77-
}
78-
7975
buffer.writeBytes(b, off, len);
8076
}
8177

Collapse file

‎buffer/src/test/java/io/netty/buffer/ByteBufStreamTest.java‎

Copy file name to clipboardExpand all lines: buffer/src/test/java/io/netty/buffer/ByteBufStreamTest.java
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,14 @@ public void testAll() throws Exception {
4848
// Expected
4949
}
5050

51-
ByteBufOutputStream out = new ByteBufOutputStream(buf);
51+
final ByteBufOutputStream out = new ByteBufOutputStream(buf);
5252
try {
53+
assertThrows(IndexOutOfBoundsException.class, new Executable() {
54+
@Override
55+
public void execute() throws Throwable {
56+
out.write(EMPTY_BYTES, -1, 0);
57+
}
58+
});
5359
assertSame(buf, out.buffer());
5460
out.writeBoolean(true);
5561
out.writeBoolean(false);

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.