https://issues.apache.org/jira/browse/AMQ-498 - check max frame size before umarshalling commands

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1133980 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2011-06-09 16:39:20 +00:00
parent 8a82119dd5
commit a4b8c8ee1a
1 changed files with 4 additions and 0 deletions

View File

@ -202,6 +202,10 @@ public final class OpenWireFormat implements WireFormat {
// throw new IOException("Packet size does not match marshaled // throw new IOException("Packet size does not match marshaled
// size"); // size");
} }
if (size > maxFrameSize) {
throw new IOException("Frame size of " + (size / (1024 * 1024)) + " MB larger than max allowed " + (maxFrameSize / (1024 * 1024)) + " MB");
}
} }
Object command = doUnmarshal(bytesIn); Object command = doUnmarshal(bytesIn);