Corrected bug in GDB server config (IP address param wasn't being validated properly)

This commit is contained in:
Nav
2024-10-27 00:26:41 +01:00
parent 623743995b
commit e7b270a30c

View File

@@ -9,14 +9,15 @@ namespace DebugServer::Gdb
: DebugServerConfig(debugServerConfig)
{
if (debugServerConfig.debugServerNode["ipAddress"]) {
if (!YamlUtilities::isCastable<std::string>(debugServerConfig.debugServerNode["ipAddress"])) {
if (YamlUtilities::isCastable<std::string>(debugServerConfig.debugServerNode["ipAddress"])) {
this->listeningAddress = debugServerConfig.debugServerNode["ipAddress"].as<std::string>();
} else {
Logger::error(
"Invalid GDB debug server config parameter ('ipAddress') provided - must be a string. The "
"parameter will be ignored."
);
}
this->listeningAddress = debugServerConfig.debugServerNode["ipAddress"].as<std::string>();
}
if (debugServerConfig.debugServerNode["port"]) {