Made sure corrupted frame data is skipped
This commit is contained in:
parent
7ea187df89
commit
7fa20dcb07
@ -124,12 +124,14 @@ public class LengthFieldBasedFrameDecoder extends FrameDecoder {
|
||||
}
|
||||
|
||||
if (frameLength < 0) {
|
||||
buffer.skipBytes(actualLengthFieldOffset + lengthFieldLength);
|
||||
throw new CorruptedFrameException(
|
||||
"negative pre-adjustment length field: " + frameLength);
|
||||
}
|
||||
|
||||
frameLength += lengthAdjustment + lengthFieldEndOffset;
|
||||
if (frameLength < lengthFieldEndOffset) {
|
||||
buffer.skipBytes(actualLengthFieldOffset + lengthFieldLength);
|
||||
throw new CorruptedFrameException(
|
||||
"Adjusted length (" + frameLength + ") is less than " +
|
||||
lengthFieldEndOffset);
|
||||
|
Loading…
Reference in New Issue
Block a user