diff --git a/python/ql/src/Expressions/ExpectedMappingForFormatString.ql b/python/ql/src/Expressions/ExpectedMappingForFormatString.ql index b3cfac42e5c..76d2f874779 100644 --- a/python/ql/src/Expressions/ExpectedMappingForFormatString.ql +++ b/python/ql/src/Expressions/ExpectedMappingForFormatString.ql @@ -14,6 +14,13 @@ import python import semmle.python.strings from Expr e, ClassValue t -where exists(BinaryExpr b | b.getOp() instanceof Mod and format_string(b.getLeft()) and e = b.getRight() and -mapping_format(b.getLeft()) and e.pointsTo().getClass() = t and not t.isMapping()) -select e, "Right hand side of a % operator must be a mapping, not class $@.", t, t.getName() \ No newline at end of file +where + exists(BinaryExpr b | + b.getOp() instanceof Mod and + format_string(b.getLeft()) and + e = b.getRight() and + mapping_format(b.getLeft()) and + e.pointsTo().getClass() = t and + not t.isMapping() + ) +select e, "Right hand side of a % operator must be a mapping, not class $@.", t, t.getName()