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

Fix off-by-one for batchdownload list/queue size protection

could allowed max-downloads-per-day + 1 files in queue

related to issue #938
parent e159c509
No related branches found
No related tags found
No related merge requests found
Pipeline #9019 passed
...@@ -743,7 +743,7 @@ bool sbbs_t::addtobatdl(file_t* f) ...@@ -743,7 +743,7 @@ bool sbbs_t::addtobatdl(file_t* f)
bool result = false; bool result = false;
str_list_t filenames = iniGetSectionList(ini, /* prefix: */ NULL); str_list_t filenames = iniGetSectionList(ini, /* prefix: */ NULL);
size_t file_count = strListCount(filenames); size_t file_count = strListCount(filenames);
if (useron.dtoday + file_count > user_downloads_per_day(&cfg, &useron)) { if (useron.dtoday + file_count >= user_downloads_per_day(&cfg, &useron)) {
bprintf(text[CantAddToQueue], f->name); bprintf(text[CantAddToQueue], f->name);
bputs(text[NoMoreDownloads]); bputs(text[NoMoreDownloads]);
} else if (file_count >= cfg.max_batdn) { } else if (file_count >= cfg.max_batdn) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment