Add empty key validation in parseRelayConf()

This commit is contained in:
Zac Gaetano 2026-05-06 20:30:53 -04:00
parent 4318387637
commit 7bb3ef95ec

View file

@ -42,6 +42,11 @@ bool parseRelayConf(const std::string &path, RelayConf &conf, std::string &errOu
std::string key = trim(trimmed.substr(0, eq));
std::string value = trim(trimmed.substr(eq + 1));
if (key.empty()) {
errOut = "relay.conf line " + std::to_string(lineNum) + ": missing key before '='";
return false;
}
if (key == "server_address") conf.server_address = value;
else if (key == "private_key") conf.private_key = value;
else if (key == "server_public_key") conf.server_public_key = value;