File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
csharp/ql/src/Security Features/CWE-020 Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1313 */
1414
1515import semmle.code.csharp.serialization.Serialization
16+ import semmle.code.csharp.controlflow.Guards
1617
1718/**
1819 * The result is a write to the field `f`, assigning it the value
1920 * of variable `v` which was checked by the condition `check`.
2021 */
21- Expr checkedWrite ( Field f , Variable v , IfStmt check ) {
22+ GuardedExpr checkedWrite ( Field f , Variable v , IfStmt check ) {
2223 result = v .getAnAccess ( ) and
2324 result = f .getAnAssignedValue ( ) and
24- check .getCondition ( ) = v .getAnAccess ( ) .getParent * ( ) and
25- result .getAControlFlowNode ( ) = check .getAControlFlowNode ( ) .getASuccessor * ( )
25+ check .getCondition ( ) .getAChildExpr * ( ) = result .getAGuard ( _, _)
2626}
2727
2828/**
You can’t perform that action at this time.
0 commit comments