Commit 4ff07f0c authored by rswindell's avatar rswindell
Browse files

When loginFailure() is called with a NULL username, always treat it as a

"unique" login attempt (e.g. hack attempt).
parent 771ef6f0
......@@ -2940,18 +2940,17 @@ ulong DLLCALL loginFailure(link_list_t* list, const union xp_sockaddr* addr, con
return 0;
memset(&first, 0, sizeof(first));
if(user == NULL)
user = "<unspecified>";
if((node=login_attempted(list, addr)) != NULL) {
/* Don't count consecutive duplicate attempts (same name and password): */
if(strcmp(attempt->user,user)==0 && (pass==NULL || strcmp(attempt->pass,pass)==0))
if((user!=NULL && strcmp(attempt->user,user)==0) && (pass==NULL || strcmp(attempt->pass,pass)==0))
memcpy(&attempt->addr, addr, sizeof(*addr));
SAFECOPY(attempt->user, user);
if(user != NULL)
SAFECOPY(attempt->user, user);
memset(attempt->pass, 0, sizeof(attempt->pass));
if(pass != NULL)
SAFECOPY(attempt->pass, pass);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment