1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

pps_ts: avoid nullptr dereference

This commit is contained in:
Steffen Vogel 2021-07-20 12:48:24 +02:00
parent efb5f43980
commit 6c6489f7b3

View file

@ -103,12 +103,14 @@ public:
period = 1.0 / fSmps;
if (!strcmp(mode_str, "simple"))
mode = Mode::SIMPLE;
else if (!strcmp(mode_str, "horizon"))
mode = Mode::HORIZON;
else
throw ConfigError(json, "node-config-hook-pps_ts-mode", "Unsupported mode: {}", mode_str);
if (mode_str) {
if (!strcmp(mode_str, "simple"))
mode = Mode::SIMPLE;
else if (!strcmp(mode_str, "horizon"))
mode = Mode::HORIZON;
else
throw ConfigError(json, "node-config-hook-pps_ts-mode", "Unsupported mode: {}", mode_str);
}
state = State::PARSED;
}