GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Go: Tainted data does not propagate data flow after append function · Issue #14116 · github/codeql Open Labels questionFurther information is requestedFurther information is requested DescriptionGo: v1.19.1 linux/amd64 Question: Query the data flow results from the package main import ( "fmt" ) type info struct { name string } func main() { source("input") } func source(input string) { var data []info data = append(data, info{ name: input, }) dao(data) } func dao(data []info) { for _, item := range data { name := item.name sink(name) } } func sink(name string) { fmt.Println(name) } The following is my query statement. After execution, I did not get the expected results.
/** * @kind path-problem */ import go import DataFlow::PathGraph class Configuration extends TaintTracking::Configuration { Configuration() { this = "Configuration" } override predicate isSource(DataFlow::Node source) { exists(Function func | func.getName() = "source" | func.getParameter(0) = source.asParameter()) } override predicate isSink(DataFlow::Node sink) { exists(DataFlow::CallNode call | call.getTarget().getName() = "sink" | call.getArgument(0) = sink ) } } from Configuration cfg, DataFlow::PathNode source, DataFlow::PathNode sink where cfg.hasFlowPath(source, sink) select sink.getNode(), source, sink, "Source: $@ , Sink: $@ .", source.getNode(), source.toString(), sink.getNode(), sink.toString() When I debug using
/** * @kind path-problem */ import go import DataFlow::PartialPathGraph class Configuration extends TaintTracking::Configuration { Configuration() { this = "Configuration" } override predicate isSource(DataFlow::Node source) { exists(Function func | func.getName() = "source" | func.getParameter(0) = source.asParameter()) } override predicate isSink(DataFlow::Node sink) { exists(DataFlow::CallNode call | call.getTarget().getName() = "sink" | call.getArgument(0) = sink ) } override int explorationLimit() { result = 5 } } from Configuration cfg, DataFlow::PartialPathNode source, DataFlow::PartialPathNode sink where cfg.hasPartialFlow(source, sink, _) select sink.getNode(), source, sink, "Source: $@ , Sink: $@ .", source.getNode(), source.toString(), sink.getNode(), sink.toString() How to solve this problem? Activity
MetadataMetadataAssigneesLabelsquestionFurther information is requestedFurther information is requested TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |