Skip to content
Snippets Groups Projects
Commit f09df78e authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Better range checking of the configure node paths

parent e5927b5a
Branches
No related tags found
No related merge requests found
...@@ -85,7 +85,7 @@ bool load_cfg(scfg_t* cfg, char* text[], bool prep, bool req_cfg, char* error, s ...@@ -85,7 +85,7 @@ bool load_cfg(scfg_t* cfg, char* text[], bool prep, bool req_cfg, char* error, s
for (i = 0; i < cfg->sys_nodes; i++) for (i = 0; i < cfg->sys_nodes; i++)
prep_dir(cfg->ctrl_dir, cfg->node_path[i], sizeof(cfg->node_path[i])); prep_dir(cfg->ctrl_dir, cfg->node_path[i], sizeof(cfg->node_path[i]));
if (cfg->sys_nodes < 1) if (cfg->sys_nodes < cfg->node_num)
snprintf(error, maxerrlen, "%d nodes configured in %s", cfg->sys_nodes, cfg->filename); snprintf(error, maxerrlen, "%d nodes configured in %s", cfg->sys_nodes, cfg->filename);
else { else {
SAFECOPY(cfg->node_dir, cfg->node_path[cfg->node_num - 1]); SAFECOPY(cfg->node_dir, cfg->node_path[cfg->node_num - 1]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment