Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 4503: Added check into BufferedChannel's read to avoid endless loop #4506

Merged
merged 4 commits into from
Feb 17, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixing checkstyle issues
StefanoBelli authored Sep 18, 2024
commit 753c908950983f7405d0a02bd143e7a1cb5771b4
Original file line number Diff line number Diff line change
@@ -243,9 +243,9 @@ public long forceWrite(boolean forceMetadata) throws IOException {

@Override
public synchronized int read(ByteBuf dest, long pos, int length) throws IOException {
if(dest.writableBytes() < length) {
throw new IllegalArgumentException("dest buffer remaining capacity is not enough" +
"(must be at least as \"length\"=" + length +")");
if (dest.writableBytes() < length) {
throw new IllegalArgumentException("dest buffer remaining capacity is not enough"
+ "(must be at least as \"length\"=" + length +")");
}

long prevPos = pos;
@@ -300,4 +300,4 @@ public synchronized int getNumOfBytesInWriteBuffer() {
long getUnpersistedBytes() {
return unpersistedBytes.get();
}
}
}