Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions src/main/java/com/rabbitmq/client/impl/Frame.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ public static Frame readFrom(DataInputStream is, int maxPayloadSize) throws IOEx

channel = is.readUnsignedShort();
int payloadSize = is.readInt();
if (payloadSize >= maxPayloadSize) {
throw new IllegalStateException(format(
"Frame body is too large (%d), maximum configured size is %d. " +
if (payloadSize < 0 || payloadSize >= maxPayloadSize) {
throw new MalformedFrameException(format(
"Frame body size is invalid (%d), maximum configured size is %d. " +
"See ConnectionFactory#setMaxInboundMessageBodySize " +
"if you need to increase the limit.",
payloadSize, maxPayloadSize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,10 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
int type = m.readUnsignedByte();
int channel = m.readUnsignedShort();
int payloadSize = m.readInt();
if (payloadSize >= maxPayloadSize) {
throw new IllegalStateException(
if (payloadSize < 0 || payloadSize >= maxPayloadSize) {
throw new MalformedFrameException(
format(
"Frame body is too large (%d), maximum configured size is %d. "
"Frame body size is invalid (%d), maximum configured size is %d. "
+ "See ConnectionFactory#setMaxInboundMessageBodySize "
+ "if you need to increase the limit.",
payloadSize, maxPayloadSize));
Expand Down
Loading