Skip to content
Snippets Groups Projects
Commit ded257dd authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Address "TypeError: buf is null" reported by Melkor

parent 993c314e
No related branches found
No related tags found
No related merge requests found
...@@ -217,7 +217,7 @@ BinkP.prototype.crypt = { ...@@ -217,7 +217,7 @@ BinkP.prototype.crypt = {
var ret = ''; var ret = '';
var ch; var ch;
for (i=0; i<buf.length; i++) { for (i=0; buf !== null && i<buf.length; i++) {
ch = ascii(ascii(buf[i]) ^ this.decrypt_byte(keys)); ch = ascii(ascii(buf[i]) ^ this.decrypt_byte(keys));
ret += ch; ret += ch;
this.update_keys(keys, ch); this.update_keys(keys, ch);
...@@ -229,7 +229,7 @@ BinkP.prototype.crypt = { ...@@ -229,7 +229,7 @@ BinkP.prototype.crypt = {
var i; var i;
var ret = ''; var ret = '';
for (i=0; i<buf.length; i++) { for (i=0; buf !== null && i<buf.length; i++) {
t = this.decrypt_byte(keys); t = this.decrypt_byte(keys);
this.update_keys(keys, buf[i]); this.update_keys(keys, buf[i]);
ret += ascii(ascii(buf[i]) ^ t); ret += ascii(ascii(buf[i]) ^ t);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment