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

Fix error when client supplies invalid Base64 string during auth

IIRC, the error was undefined has no properties or split() is not a function,
something like that.
parent c6515aa6
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -891,7 +891,12 @@ var unauthenticated_command_handlers = {
}
client.socket.send("+\r\n");
line=client.socket.recvline(10240, 1800);
args=base64_decode(line).split(/\x00/);
line=base64_decode(line);
if(!line) {
tagged("NO", "Wrong format");
return;
}
args=line.split(/\x00/);
if(args === null || (!login(args[1],args[2]))) {
tagged(tag, "NO", "No AUTH for you.");
return;
......@@ -904,7 +909,12 @@ var unauthenticated_command_handlers = {
challenge = '<'+random(2147483647)+"."+time()+"@"+system.host_name+'>';
client.socket.send("+ "+base64_encode(challenge)+"\r\n");
line=client.socket.recvline(10240, 1800);
args=base64_decode(line).split(/ /);
line=base64_decode(line);
if(!line) {
tagged("NO", "Wrong format");
return;
}
args=line.split(/ /);
un = system.matchuser(args[0], false);
if (un == 0) {
tagged(tag, "NO", "No AUTH for you.");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment