JS: Avoid unnecessary casts

This commit is contained in:
Asger F
2019-05-28 11:54:42 +01:00
parent 9f1617a6a8
commit 8d60ae7200

View File

@@ -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()
)
)
}