C#: Address review comment

- Flow from expressions with a value is excluded.
This commit is contained in:
Calum Grant
2020-02-10 16:02:29 +00:00
parent 7caae01ad1
commit 803cb3f4d1
3 changed files with 8 additions and 6 deletions

View File

@@ -35,7 +35,9 @@ Expr uncheckedWrite(Callable callable, Field f) {
result.getEnclosingCallable() = callable and
not callable.calls*(checkedWrite(f, _, _).getEnclosingCallable()) and
// Exclude object creations because they were not deserialized
not exists(ObjectCreation src | DataFlow::localExprFlow(src, result))
not exists(Expr src | DataFlow::localExprFlow(src, result) |
src instanceof ObjectCreation or src.hasValue()
)
}
from BinarySerializableType t, Field f, IfStmt check, Expr write, Expr unsafeWrite