Skip to content

Commit 445926d

Browse files
authored
Fixed frame length issue exceeding short value
Thanks to Michael Niendorf for the report and fix
1 parent 8016c43 commit 445926d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/red5/net/websocket/codec/WebSocketDecoder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ public static void decodeIncommingData(IoBuffer in, IoSession session) {
441441
decoderState.frameLen = (frameInfo2 & (byte) 0x7F);
442442
log.trace("Payload length: {}", decoderState.frameLen);
443443
if (decoderState.frameLen == 126) {
444-
decoderState.frameLen = in.getShort();
444+
decoderState.frameLen = in.getUnsignedShort();
445445
log.trace("Payload length updated: {}", decoderState.frameLen);
446446
} else if (decoderState.frameLen == 127) {
447447
long extendedLen = in.getLong();
@@ -582,4 +582,4 @@ public static Map<String, Object> parseQuerystring(String query) {
582582
return map;
583583
}
584584

585-
}
585+
}

0 commit comments

Comments
 (0)