Skip to content

Commit

Permalink
Update to account for changes on main
Browse files Browse the repository at this point in the history
  • Loading branch information
smowton committed Dec 16, 2024
1 parent d958c22 commit 14e0ce8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
12 changes: 7 additions & 5 deletions go/ql/lib/semmle/go/dataflow/internal/DataFlowPrivate.qll
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,11 @@ ContentApprox getContentApprox(Content c) { any() }
/**
* Holds if the the content `c` is a container.
*/
predicate containerContent(ContentSet c) {
c instanceof ArrayContent or
c instanceof CollectionContent or
c instanceof MapKeyContent or
c instanceof MapValueContent
predicate containerContentSet(ContentSet cs) {
exists(Content c | cs.asOneContent() = c |
c instanceof ArrayContent or
c instanceof CollectionContent or
c instanceof MapKeyContent or
c instanceof MapValueContent
)
}
10 changes: 5 additions & 5 deletions go/ql/lib/semmle/go/dataflow/internal/TaintTrackingUtil.qll
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ predicate localTaintStep(DataFlow::Node src, DataFlow::Node sink) {
FlowSummaryImpl::Private::Steps::summaryThroughStepTaint(src, sink, _)
or
// Treat container flow as taint for the local taint flow relation
exists(DataFlow::Content c | DataFlowPrivate::containerContent(c) |
DataFlowPrivate::readStep(src, c, sink) or
DataFlowPrivate::storeStep(src, c, sink) or
FlowSummaryImpl::Private::Steps::summaryGetterStep(src, c, sink, _) or
FlowSummaryImpl::Private::Steps::summarySetterStep(src, c, sink, _)
exists(DataFlow::ContentSet cs | DataFlowPrivate::containerContentSet(cs) |
DataFlowPrivate::readStep(src, cs, sink) or
DataFlowPrivate::storeStep(src, cs, sink) or
FlowSummaryImpl::Private::Steps::summaryGetterStep(src, cs, sink, _) or
FlowSummaryImpl::Private::Steps::summarySetterStep(src, cs, sink, _)
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import go
import TestUtilities.InlineFlowTest
import utils.test.InlineFlowTest

string getArgString(DataFlow::Node src, DataFlow::Node sink) {
exists(sink) and
Expand Down

0 comments on commit 14e0ce8

Please sign in to comment.