Skip to content

Commit 6c8b1cf

Browse files
committed
changes based on Python review
1 parent 35e8d6a commit 6c8b1cf

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

python/ql/lib/semmle/python/RegexTreeView.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ module Impl implements RegexTreeViewSig {
858858
* ```
859859
*/
860860
class RegExpAnchor extends RegExpSpecialChar {
861-
RegExpAnchor() { this.getChar() = ["^", "$"] }
861+
RegExpAnchor() { this.getChar() = ["\\A", "^", "$", "\\Z"] }
862862
}
863863

864864
/**

shared/regex/codeql/regex/HostnameRegexp.qll

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,15 +245,11 @@ module Make<RegexTreeViewSig TreeImpl, HostnameRegexpSig<TreeImpl> Specific> {
245245
term.isRootTerm()
246246
or
247247
exists(RegExpTerm parent |
248-
term = getLastChild(parent) and
248+
term = parent.getLastChild() and
249249
isRightArmTerm(parent)
250250
)
251251
}
252252

253-
private RegExpTerm getLastChild(RegExpTerm parent) {
254-
result = max(RegExpTerm child, int i | child = parent.getChild(i) | child order by i)
255-
}
256-
257253
/**
258254
* Holds if `regexp` is a regular expression that is likely to match a hostname,
259255
* but the pattern is incomplete and may match more hosts than intended.

0 commit comments

Comments
 (0)