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

Fix segfault after batch-upload when no "uploads" dir specified

When there's no "uploads" directory configured by the sysop, cfg.upload_dir will be set to INVALID_DIR, which cannot be used as an index into cfg.dir[] to determine if the time used for uploading the files should be "given back" to the user.

In v3.18, we used the first file in the upload queue, if there was one, else fell back to the "uploads" dir (which had to have been defined if there were no files in the queue). So this illegal array indexing was a regression in v3.19.

Reported by Zoltán Gábor on Facebook
parent 53264f2b
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2451 passed
......@@ -194,7 +194,7 @@ void sbbs_t::batchmenu()
start=time(NULL);
protocol(cfg.prot[xfrprot],XFER_BATCH_UPLOAD,str,nulstr,true);
end=time(NULL);
if(!(cfg.dir[xfrdir]->misc&DIR_ULTIME))
if(xfrdir != INVALID_DIR && !(cfg.dir[xfrdir]->misc&DIR_ULTIME))
starttime+=end-start;
}
batch_upload();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment