Skip to content

Commit 76c52c3

Browse files
Disallow wildcard partial domains when using MatchDomainName.
1 parent 416072f commit 76c52c3

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/internal.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13199,6 +13199,11 @@ int MatchDomainName(const char* pattern, int patternLen, const char* str,
1319913199

1320013200
/* Only single wildcard allowed with strict left only */
1320113201
if (leftWildcardOnly) {
13202+
/* For the left wildcard only case, disallow wildcards with
13203+
* the pattern *domain.com and only allow *.domain.com. */
13204+
if (patternLen > 0 && *pattern != '.')
13205+
return 0;
13206+
1320213207
wildcardEligible = 0;
1320313208
}
1320413209

0 commit comments

Comments
 (0)