diff options
-rw-r--r-- | smtp-tls.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -441,16 +441,24 @@ static int match_component (const char *dom, const char *edom, const char *ref, const char *eref) { + int wildcard = 0; + while (dom < edom && ref < eref) { /* Accept a final '*' in the reference as a wildcard */ if (*ref == '*' && ref + 1 == eref) - break; + { + wildcard = 1; + break; + } /* compare the domain name case insensitive */ if (!(*dom == *ref || tolower (*dom) == tolower (*ref))) return 0; ref++, dom++; } + if (!wildcard && (dom < edom || ref < eref)) + return 0; + return 1; } |