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

matchuser() now always returns 0 when passed an empty 'name'

Also, don't match against deleted (blank) usernames in name.dat
(e.g. when 'name' value consists of a single ETX character).
parent d497c987
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #3214 passed
...@@ -58,7 +58,7 @@ uint matchuser(scfg_t* cfg, const char *name, BOOL sysop_alias) ...@@ -58,7 +58,7 @@ uint matchuser(scfg_t* cfg, const char *name, BOOL sysop_alias)
off_t l,length; off_t l,length;
FILE* stream; FILE* stream;
if(!VALID_CFG(cfg) || name==NULL) if(!VALID_CFG(cfg) || name==NULL || *name == '\0')
return(0); return(0);
if(sysop_alias && if(sysop_alias &&
...@@ -78,6 +78,8 @@ uint matchuser(scfg_t* cfg, const char *name, BOOL sysop_alias) ...@@ -78,6 +78,8 @@ uint matchuser(scfg_t* cfg, const char *name, BOOL sysop_alias)
for(c=0;c<LEN_ALIAS;c++) for(c=0;c<LEN_ALIAS;c++)
if(dat[c]==ETX) break; if(dat[c]==ETX) break;
dat[c]=0; dat[c]=0;
if(c < 1) // Deleted user
continue;
if(matchusername(cfg, dat, name)) if(matchusername(cfg, dat, name))
break; break;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment