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

If filename_maxlen is 0, don't use it enforce a maximum filename length

This is just extra paranoia now since the reading of file.ini enforces the value range
8 <-> 65535 now.
parent 9c0884f3
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #3724 passed
......@@ -1403,7 +1403,7 @@ bool allowed_filename(scfg_t* cfg, const char *fname)
return false;
size_t len = strlen(fname);
if(len < 1 || len > cfg->filename_maxlen)
if(len < 1 || (cfg->filename_maxlen > 1 && len > cfg->filename_maxlen))
return false;
if(cfg->file_misc & FM_SAFEST)
......
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