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

Insure that the max (uploaded) filename limit is in the range 8-65535 characters

Upgrading fromm v3.19 can result in a setting of filename_maxlen=0 in file.ini, so let's
put a special check in place to insure this can't happen (thus preventing any file
uploads). I chose '8' as a kind of arbitrary minimum maximum value (MS-DOS filenames
maxed out at 12 characters), but at least 0 won't be possibly any longer.

As reported on DOVE-Net by Codefenix and confirmed by xbit.
parent b4d2fa8f
Branches
Tags
No related merge requests found
......@@ -70,7 +70,7 @@ BOOL read_file_cfg(scfg_t* cfg, char* error, size_t maxerrlen)
cfg->leech_pct = iniGetShortInt(ini, ROOT_SECTION, "leech_pct", 0);
cfg->leech_sec = iniGetShortInt(ini, ROOT_SECTION, "leech_sec", 0);
cfg->file_misc = iniGetInt32(ini, ROOT_SECTION, "settings", 0);
cfg->filename_maxlen = iniGetShortInt(ini, ROOT_SECTION, "filename_maxlen", SMB_FILEIDX_NAMELEN);
cfg->filename_maxlen = iniGetIntInRange(ini, ROOT_SECTION, "filename_maxlen", 8, SMB_FILEIDX_NAMELEN, UINT16_MAX);
named_str_list_t** sections = iniParseSections(ini);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment