Skip to content

Commit 6ee1dae

Browse files
committed
fix bug in websocket library
1 parent 0fd8a95 commit 6ee1dae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

SocketIOClientSwift/WebSocket.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ public class WebSocket : NSObject, NSStreamDelegate {
495495
dataLength = UInt64(bytes[0].bigEndian)
496496
offset += sizeof(UInt16)
497497
}
498-
if bufferLen < offset {
498+
if bufferLen < offset || UInt64(bufferLen - offset) < dataLength {
499499
fragBuffer = NSData(bytes: buffer, length: bufferLen)
500500
return
501501
}

0 commit comments

Comments
 (0)