From cfba0896f0725726210366eee05adaebf206eefe Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Fri, 4 Sep 2020 17:02:53 +0100 Subject: [PATCH] Improve code style No behavioural changes --- ql/src/semmle/go/frameworks/Protobuf.qll | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ql/src/semmle/go/frameworks/Protobuf.qll b/ql/src/semmle/go/frameworks/Protobuf.qll index 9447a46b062..a9157749a9c 100644 --- a/ql/src/semmle/go/frameworks/Protobuf.qll +++ b/ql/src/semmle/go/frameworks/Protobuf.qll @@ -64,12 +64,11 @@ module Protobuf { */ private class MarshalStateStep extends TaintTracking::AdditionalTaintStep { override predicate step(DataFlow::Node pred, DataFlow::Node succ) { - exists(DataFlow::Node marshalInput, DataFlow::CallNode marshalStateCall | + exists(DataFlow::PostUpdateNode marshalInput, DataFlow::CallNode marshalStateCall | marshalStateCall = marshalStateMethod().getACall() and // pred -> marshalInput.Message any(DataFlow::Write w) - .writesField(marshalInput.(DataFlow::PostUpdateNode).getPreUpdateNode(), - inputMessageField(), pred) and + .writesField(marshalInput.getPreUpdateNode(), inputMessageField(), pred) and // marshalInput -> marshalStateCall marshalStateCall.getArgument(0) = globalValueNumber(marshalInput).getANode() and // marshalStateCall -> succ @@ -154,7 +153,7 @@ module Protobuf { * * For example, in the expression a.b[c].d[e], this would return the dataflow node for the read from `a`. */ - DataFlow::Node getUnderlyingNode(DataFlow::ReadNode read) { + private DataFlow::Node getUnderlyingNode(DataFlow::ReadNode read) { (result = read or result = getBaseLookingThroughDerefs+(read)) and not result instanceof DataFlow::ComponentReadNode }