Skip to content

Commit 5e7bc38

Browse files
markt-asfac000
authored andcommitted
java: websocket: Fix calculation of payload length for > 32bit values
Patch taken from <https://github.com/apache/tomcat/commit/1cddae8da4ecb4ac04575d3b5fba2daa2e0c8ead.patch> [ Subject / message tweak - Andrew ] Signed-off-by: Andrew Clayton <[email protected]>
1 parent 3fea47e commit 5e7bc38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/java/nginx/unit/websocket/WsFrameBase.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ protected static long byteArrayToLong(byte[] b, int start, int len) throws IOExc
670670
int shift = 0;
671671
long result = 0;
672672
for (int i = start + len - 1; i >= start; i--) {
673-
result = result + ((b[i] & 0xFF) << shift);
673+
result = result + ((b[i] & 0xFFL) << shift);
674674
shift += 8;
675675
}
676676
return result;

0 commit comments

Comments
 (0)