Skip to content

Commit

Permalink
fixed read crash bug
Browse files Browse the repository at this point in the history
  • Loading branch information
masuidrive committed Nov 16, 2011
1 parent edf1826 commit 59c4c7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/websocket-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ WebSocket.prototype._mask_payload = function(out, outIndex, payload) {
}
};

var parse_frame = function(buffer, size) {
var parse_frame = function(buffer, size, socket) {
if(size < 3) return undefined;

var byte1 = Utils.read_byte(buffer, 0);
Expand Down Expand Up @@ -386,7 +386,7 @@ WebSocket.prototype._readCallback = function(e) {
return;
}

var frame = parse_frame(e.buffer, e.bytesProcessed);
var frame = parse_frame(e.buffer, e.bytesProcessed, this.socket);
e.buffer.clear();
// TODO: check frame

Expand Down

0 comments on commit 59c4c7e

Please sign in to comment.