summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--smtp-tls.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/smtp-tls.c b/smtp-tls.c
index f51cfad..b5627ce 100644
--- a/smtp-tls.c
+++ b/smtp-tls.c
@@ -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;
}