From ecf3edd8b9d59cd8c4b094ef3dc1ed4c8594e822 Mon Sep 17 00:00:00 2001 From: Karl Kfoury <76066593+KarlKfoury@users.noreply.github.com> Date: Sat, 31 Aug 2024 17:14:01 +0300 Subject: [PATCH] checking if 'name' parameter was provided with 'setoption' before proceeding with execution adressing issue #1843 --- src/chess/uciloop.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/chess/uciloop.cc b/src/chess/uciloop.cc index 4135895965..0c6e76f1c1 100644 --- a/src/chess/uciloop.cc +++ b/src/chess/uciloop.cc @@ -153,8 +153,13 @@ bool UciLoop::DispatchCommand( } else if (command == "isready") { CmdIsReady(); } else if (command == "setoption") { +if (GetOrEmpty(params, "name").empty()) { + throw Exception("setoption requires name"); + } + else { CmdSetOption(GetOrEmpty(params, "name"), GetOrEmpty(params, "value"), GetOrEmpty(params, "context")); + } } else if (command == "ucinewgame") { CmdUciNewGame(); } else if (command == "position") {