Skip to content

Commit

Permalink
Restored an isdigit() check in the match_address() function, but check
Browse files Browse the repository at this point in the history
the last character in the hostname, not the first.
  • Loading branch information
Wayne Davison committed Jul 5, 2003
1 parent 7a1f46b commit 70a6051
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions access.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ static int match_address(char *addr, char *tok)
p = strchr(tok,'/');
if (p) *p = 0;

/* skip if last char is not a digit (i.e. not an address) */
/* (don't check first char - might be 11.22.33.44.an.isp) */
if (!*tok) return 0; /* nothing to check */
if (!isdigit(*(unsigned char*)tok+strlen(tok)-1)) return 0;

memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
Expand Down

0 comments on commit 70a6051

Please sign in to comment.