From: Steinar H. Gunderson Date: Sun, 24 Apr 2016 13:26:33 +0000 (+0200) Subject: Protect the node.js against empty fen. X-Git-Url: https://git.sesse.net/?p=remoteglot;a=commitdiff_plain;h=328af66f9b4a34c51c61d19d3d988ee1453bec44;hp=3ffe0de9c707368f992c8ae33f6916b3c7c8cef6 Protect the node.js against empty fen. --- diff --git a/server/hash-lookup.js b/server/hash-lookup.js index 0e7ee52..b9d5f00 100644 --- a/server/hash-lookup.js +++ b/server/hash-lookup.js @@ -16,7 +16,7 @@ var init = function(servers) { exports.init = init; var handle_request = function(fen, response) { - if (!board.validate_fen(fen).valid) { + if (fen === undefined || fen === null || fen === '' || !board.validate_fen(fen).valid) { response.writeHead(400, {}); response.end(); return;