Merge pull request #524 from kanaka/bug/tight-buffer-overread

Fix buffer over-reads in handle_tight
This commit is contained in:
Solly 2015-08-27 18:46:26 -04:00
commit 40b35fa20d
2 changed files with 5 additions and 1 deletions

View File

@ -1782,8 +1782,8 @@ var RFB;
return dest;
}.bind(this);
var rQ = this._sock.get_rQ();
var rQi = this._sock.get_rQi();
var rQ = this._sock.rQwhole();
var cmode, data;
var cl_header, cl_data;

View File

@ -154,6 +154,10 @@ function Websock() {
this._rQi += len;
},
rQwhole: function () {
return new Uint8Array(this._rQ.buffer, 0, this._rQlen);
},
rQslice: function (start, end) {
if (end) {
return new Uint8Array(this._rQ.buffer, this._rQi + start, end - start);