@@ -49,28 +49,22 @@ module Protobuf {
49
49
}
50
50
51
51
/**
52
- * Additional taint-flow step modelling flow from MarshalInput.Message to MarshalOutput,
53
- * mediated by a MarshalOptions.MarshalState call.
52
+ * Additional taint-flow step modelling flow from ` MarshalInput.Message` to ` MarshalOutput` ,
53
+ * mediated by a ` MarshalOptions.MarshalState` call.
54
54
*
55
- * Note we can taint the whole MarshalOutput as it only has one field (Buf), and taint-
55
+ * Note we can taint the whole ` MarshalOutput` as it only has one field (` Buf` ), and taint-
56
56
* tracking always considers a field of a tainted struct to itself be tainted.
57
57
*/
58
58
private class MarshalStateStep extends TaintTracking:: AdditionalTaintStep {
59
59
override predicate step ( DataFlow:: Node pred , DataFlow:: Node succ ) {
60
- exists (
61
- DataFlow:: Node marshalInput , DataFlow:: Node passedMarshalInput ,
62
- DataFlow:: CallNode marshalStateCall
63
- |
60
+ exists ( DataFlow:: Node marshalInput , DataFlow:: CallNode marshalStateCall |
64
61
marshalStateCall = marshalStateMethod ( ) .getACall ( ) and
65
62
// pred -> marshalInput.Message
66
63
any ( DataFlow:: Write w )
67
64
.writesField ( marshalInput .( DataFlow:: PostUpdateNode ) .getPreUpdateNode ( ) ,
68
65
inputMessageField ( ) , pred ) and
69
- // marshalInput -> passedMarshalInput
70
- passedMarshalInput .asExpr ( ) .getGlobalValueNumber ( ) =
71
- marshalInput .asExpr ( ) .getGlobalValueNumber ( ) and
72
- // passedMarshalInput -> marshalStateCall
73
- marshalStateCall .getArgument ( 0 ) = passedMarshalInput and
66
+ // marshalInput -> marshalStateCall
67
+ marshalStateCall .getArgument ( 0 ) = globalValueNumber ( marshalInput ) .getANode ( ) and
74
68
// marshalStateCall -> succ
75
69
marshalStateCall .getResult ( ) = succ
76
70
)
0 commit comments