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

Fix segfault when printing Bad-echo name after failing to load cfg

This is a weird one: sbbsecho ran right as I was saving msgs.cnf via
SCFG and it seems like it loaded 0-byte msgs.cnf into memory and this
segfault was a result of trying to print sub[INVALID_SUB]->code.

The use of [f]nopen() with proper share perms should have prevented this
(truncated msgs.cnf read) from happening, so there's something else afoot here.
parent dc4b1bd9
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #3001 passed
......@@ -6467,7 +6467,8 @@ int main(int argc, char **argv)
}
if(cfg.badecho >= 0)
lprintf(LOG_DEBUG, "Bad-echo area: %s", scfg.sub[cfg.area[cfg.badecho].sub]->code);
lprintf(LOG_DEBUG, "Bad-echo area: %s"
,cfg.area[cfg.badecho].sub == INVALID_SUB ? "INVALID_SUB" : scfg.sub[cfg.area[cfg.badecho].sub]->code);
if(cfg.auto_add_subs) {
for(unsigned subnum = 0; subnum < scfg.total_subs; subnum++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment