We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3fa2516 commit a1b0315Copy full SHA for a1b0315
cpp/ql/src/experimental/Security/CWE/CWE-266/IncorrectPrivilegeAssignment.ql
@@ -59,7 +59,8 @@ where
59
// unfortunately cannot use numeric value here because // O_CREAT is defined differently on different OSes:
60
// https://github.com/red/red/blob/92feb0c0d5f91e087ab35fface6906afbf99b603/runtime/definitions.reds#L477-L491
61
// this may introduce false negatives
62
- fctmp.getArgument(1).(BitwiseOrExpr).getAChild*().getValueText().matches("O_CREAT")
+ fctmp.getArgument(1).(BitwiseOrExpr).getAChild*().getValueText().matches("O_CREAT") or
63
+ fctmp.getArgument(1).getValueText().matches("%O_CREAT%")
64
) and
65
fctmp.getNumberOfArguments() = 2 and
66
not fctmp.getArgument(0).getValue() = "/dev/null" and
0 commit comments