(natbyname): Do not look up a non-active country.
Previously a blank country name or deleted country name would return a pointer to non-active countries. This creates a security problem where some one can successfully login into the server without country or password. Closes #1219569.
This commit is contained in:
parent
f17cedfccd
commit
779a41c71b
1 changed files with 2 additions and 1 deletions
|
@ -45,7 +45,8 @@ natbyname(s_char *name, natid *result)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; NULL != (np = getnatp(i)); i++) {
|
for (i = 0; NULL != (np = getnatp(i)); i++) {
|
||||||
if (strcmp(np->nat_cnam, name) == 0) {
|
if ((np->nat_stat & STAT_INUSE) &&
|
||||||
|
(strcmp(np->nat_cnam, name) == 0)) {
|
||||||
*result = i;
|
*result = i;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue