Skip to content

Commit f102fa1

Browse files
authored
Update IncorrectPrivilegeAssignment.ql
1 parent e383e44 commit f102fa1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cpp/ql/src/experimental/Security/CWE/CWE-266/IncorrectPrivilegeAssignment.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ where
6565
or
6666
exists(Expr exptmp, int i |
6767
numberArgumentModFunctions(fc.getTarget(), i) and
68+
globalValueNumber(exptmp) = globalValueNumber(fc.getArgument(i)) and
69+
exptmp.getAChild*() instanceof BinaryArithmeticOperation and
6870
not exptmp.getAChild*() instanceof FunctionCall and
6971
not exists(SizeofOperator so | exptmp.getAChild*() = so) and
7072
not exists(ArrayExpr aetmp | aetmp.getArrayOffset() = exptmp.getAChild*()) and
71-
exptmp.getAChild*() instanceof BinaryArithmeticOperation and
7273
not exptmp.getAChild*() instanceof BinaryBitwiseOperation and
73-
globalValueNumber(exptmp) = globalValueNumber(fc.getArgument(i)) and
7474
not exptmp.isConstant() and
7575
msg = "Using arithmetic to compute the mask may not be safe."
7676
)

0 commit comments

Comments
 (0)