Skip to content

Commit 90d6312

Browse files
Rework check to avoid changing existing logic.
1 parent 1274c7b commit 90d6312

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/internal.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13285,7 +13285,7 @@ int MatchDomainName(const char* pattern, int patternLen, const char* str,
1328513285
return 1;
1328613286
#endif
1328713287

13288-
while (patternLen > 0 && strLen > 0) {
13288+
while (patternLen > 0) {
1328913289
/* Get the next pattern char to evaluate */
1329013290
char p = (char)XTOLOWER((unsigned char)*pattern);
1329113291
if (p == '\0')
@@ -13356,6 +13356,9 @@ int MatchDomainName(const char* pattern, int patternLen, const char* str,
1335613356
wildcardEligible = 0;
1335713357
}
1335813358

13359+
if (strLen == 0)
13360+
return 0;
13361+
1335913362
/* Simple case, pattern match exactly */
1336013363
if (p != (char)XTOLOWER((unsigned char) *str))
1336113364
return 0;

0 commit comments

Comments
 (0)