Commit 7ae988f2 authored by Thomas Lake's avatar Thomas Lake 🔧
Browse files

Prevent transition to invalid room numbers from webclient

parent 4f639e10
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -407,6 +407,10 @@ static int handle_command(CONNECTION *co)
		user->record.idletime = lastcomm;
		if (newroom == oldroom) {
			return 1;
		}else if (newroom<0 || newroom>65535) {
			snprintf(line, sizeof line, "\03314Not leaving to invalid room ID %d", newroom);
			ipc_send_to_username(user->record.name, IPC_TEXT, line);
			return 1;
		}else{
			user->record.room = newroom;
			snprintf(line, sizeof line, "\03313%s has left to room %d", user->record.name, newroom);
+1 −1
Original line number Diff line number Diff line
@@ -245,7 +245,7 @@ function cmdParser(text) {
		sendCmdHandle('who', drawWho);
		break;
	case "room":
                if (args == undefined){
                if (args == undefined || args < 0 || args > 65535){
                        $('#textlist').append("<div class='error'>Usage: "+cmd+" &lt;number&gt;</div>");
                }else{
			sendCmd('channel '+args);