This repository was archived by the owner on Jan 5, 2023. It is now read-only.
Commit e3501dd
Max Schaefer
Introduce more post-update nodes.
To model (taint) flow through functions, we introduce post-update nodes for arguments (including receivers), but only if that argument is mutable.
However, previously our criterion for determining whether an argument is mutable was a little too restrictive. In particular, we would not consider a struct-typed argument as mutable, since structs are passed by value. While this is reasonable for data flow, it is unnecessarily restrictive for taint, since it makes perfect sense to track deep taint through structs.
So instead we now turn things round and instead consider _all_ types to be mutable except for primitive types (booleans, numbers, and strings).1 parent 0dd7676 commit e3501dd
3 files changed
Lines changed: 7 additions & 5 deletions
File tree
- ql
- src/semmle/go/dataflow/internal
- test/library-tests/semmle/go/dataflow/FunctionInputsAndOutputs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
472 | 471 | | |
473 | 472 | | |
474 | 473 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
0 commit comments