mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
BUG/MINOR: pattern: pattern comparison executed twice
If the pattern is set as case insensitive, the string comparison is executed twice. The first time is insensitive comparison, the second is sensitive. This is a recent bug, no backport is needed.
This commit is contained in:
parent
8663105095
commit
35249cb045
@ -1222,11 +1222,14 @@ browse_list:
|
|||||||
continue;
|
continue;
|
||||||
if (pattern.len != pat->len)
|
if (pattern.len != pat->len)
|
||||||
continue;
|
continue;
|
||||||
if ((pat->flags & PAT_F_IGNORE_CASE) &&
|
if (pat->flags & PAT_F_IGNORE_CASE) {
|
||||||
strncasecmp(pattern.ptr.str, pat->ptr.str, pat->len) != 0)
|
if (strncasecmp(pattern.ptr.str, pat->ptr.str, pat->len) != 0)
|
||||||
continue;
|
continue;
|
||||||
if (strncmp(pattern.ptr.str, pat->ptr.str, pat->len) != 0)
|
}
|
||||||
continue;
|
else {
|
||||||
|
if (strncmp(pattern.ptr.str, pat->ptr.str, pat->len) != 0)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
goto found;
|
goto found;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1245,11 +1248,14 @@ browse_list:
|
|||||||
list_for_each_entry(pat, &expr->patterns, list) {
|
list_for_each_entry(pat, &expr->patterns, list) {
|
||||||
if (pat->flags & PAT_F_TREE)
|
if (pat->flags & PAT_F_TREE)
|
||||||
continue;
|
continue;
|
||||||
if ((pat->flags & PAT_F_IGNORE_CASE) &&
|
if (pat->flags & PAT_F_IGNORE_CASE) {
|
||||||
strcasecmp(pattern.ptr.reg->regstr, pat->ptr.reg->regstr) != 0)
|
if (strcasecmp(pattern.ptr.reg->regstr, pat->ptr.reg->regstr) != 0)
|
||||||
continue;
|
continue;
|
||||||
if (strcmp(pattern.ptr.reg->regstr, pat->ptr.reg->regstr) != 0)
|
}
|
||||||
continue;
|
else {
|
||||||
|
if (strcmp(pattern.ptr.reg->regstr, pat->ptr.reg->regstr) != 0)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
goto found;
|
goto found;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user