Skip to content

Commit 8d60ae7

Browse files
committed
JS: Avoid unnecessary casts
1 parent 9f1617a commit 8d60ae7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

javascript/ql/src/semmle/javascript/security/dataflow/TaintedPath.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,10 @@ module TaintedPath {
221221
// If in doubt, we assume it is absolute.
222222
n > 0 and
223223
srclabel.canContainDotDotSlash() and
224-
dstlabel.(Label::PosixPath).isNormalized() and
224+
dstlabel.isNormalized() and
225225
if isRelative(join.getArgument(0).getStringValue())
226-
then dstlabel.(Label::PosixPath).isRelative()
227-
else dstlabel.(Label::PosixPath).isAbsolute()
226+
then dstlabel.isRelative()
227+
else dstlabel.isAbsolute()
228228
)
229229
)
230230
or
@@ -238,11 +238,11 @@ module TaintedPath {
238238
or
239239
n > 0 and
240240
srclabel.canContainDotDotSlash() and
241-
dstlabel.(Label::PosixPath).isNonNormalized() and // The ../ is no longer at the beginning of the string.
241+
dstlabel.isNonNormalized() and // The ../ is no longer at the beginning of the string.
242242
(
243243
if isRelative(StringConcatenation::getOperand(operator, 0).getStringValue())
244-
then dstlabel.(Label::PosixPath).isRelative()
245-
else dstlabel.(Label::PosixPath).isAbsolute()
244+
then dstlabel.isRelative()
245+
else dstlabel.isAbsolute()
246246
)
247247
)
248248
}

0 commit comments

Comments
 (0)