Commit 8ef5e6c9 authored by Rob Swindell's avatar Rob Swindell

Address "TypeError: buf is null" reported by Melkor

parent 3005a5a9
......@@ -217,7 +217,7 @@ BinkP.prototype.crypt = {
var ret = '';
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));
ret += ch;
this.update_keys(keys, ch);
......@@ -229,7 +229,7 @@ BinkP.prototype.crypt = {
var i;
var ret = '';
for (i=0; i<buf.length; i++) {
for (i=0; buf !== null && i<buf.length; i++) {
t = this.decrypt_byte(keys);
this.update_keys(keys, buf[i]);
ret += ascii(ascii(buf[i]) ^ t);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment