Skip to content

Commit a1b0315

Browse files
authored
Update cpp/ql/src/experimental/Security/CWE/CWE-266/IncorrectPrivilegeAssignment.ql
1 parent 3fa2516 commit a1b0315

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ where
5959
// unfortunately cannot use numeric value here because // O_CREAT is defined differently on different OSes:
6060
// https://github.com/red/red/blob/92feb0c0d5f91e087ab35fface6906afbf99b603/runtime/definitions.reds#L477-L491
6161
// this may introduce false negatives
62-
fctmp.getArgument(1).(BitwiseOrExpr).getAChild*().getValueText().matches("O_CREAT")
62+
fctmp.getArgument(1).(BitwiseOrExpr).getAChild*().getValueText().matches("O_CREAT") or
63+
fctmp.getArgument(1).getValueText().matches("%O_CREAT%")
6364
) and
6465
fctmp.getNumberOfArguments() = 2 and
6566
not fctmp.getArgument(0).getValue() = "/dev/null" and

0 commit comments

Comments
 (0)