mirror of
https://github.com/github/codeql.git
synced 2026-05-01 03:35:13 +02:00
JS: Avoid unnecessary casts
This commit is contained in:
@@ -221,10 +221,10 @@ module TaintedPath {
|
||||
// If in doubt, we assume it is absolute.
|
||||
n > 0 and
|
||||
srclabel.canContainDotDotSlash() and
|
||||
dstlabel.(Label::PosixPath).isNormalized() and
|
||||
dstlabel.isNormalized() and
|
||||
if isRelative(join.getArgument(0).getStringValue())
|
||||
then dstlabel.(Label::PosixPath).isRelative()
|
||||
else dstlabel.(Label::PosixPath).isAbsolute()
|
||||
then dstlabel.isRelative()
|
||||
else dstlabel.isAbsolute()
|
||||
)
|
||||
)
|
||||
or
|
||||
@@ -238,11 +238,11 @@ module TaintedPath {
|
||||
or
|
||||
n > 0 and
|
||||
srclabel.canContainDotDotSlash() and
|
||||
dstlabel.(Label::PosixPath).isNonNormalized() and // The ../ is no longer at the beginning of the string.
|
||||
dstlabel.isNonNormalized() and // The ../ is no longer at the beginning of the string.
|
||||
(
|
||||
if isRelative(StringConcatenation::getOperand(operator, 0).getStringValue())
|
||||
then dstlabel.(Label::PosixPath).isRelative()
|
||||
else dstlabel.(Label::PosixPath).isAbsolute()
|
||||
then dstlabel.isRelative()
|
||||
else dstlabel.isAbsolute()
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user