mirror of
https://github.com/github/codeql.git
synced 2026-01-29 14:23:03 +01:00
Merge branch 'standard-lib-pt-20' into from-331-to-337
This commit is contained in:
@@ -38,6 +38,7 @@ import semmle.go.frameworks.stdlib.Strings
|
||||
import semmle.go.frameworks.stdlib.Sync
|
||||
import semmle.go.frameworks.stdlib.SyncAtomic
|
||||
import semmle.go.frameworks.stdlib.Syscall
|
||||
import semmle.go.frameworks.stdlib.Sort
|
||||
import semmle.go.frameworks.stdlib.TextScanner
|
||||
import semmle.go.frameworks.stdlib.TextTabwriter
|
||||
import semmle.go.frameworks.stdlib.TextTemplate
|
||||
|
||||
23
ql/src/semmle/go/frameworks/stdlib/Sort.qll
Normal file
23
ql/src/semmle/go/frameworks/stdlib/Sort.qll
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Provides classes modeling security-relevant aspects of the `sort` package.
|
||||
*/
|
||||
|
||||
import go
|
||||
|
||||
/** Provides models of commonly used functions in the `sort` package. */
|
||||
module Sort {
|
||||
private class FunctionModels extends TaintTracking::FunctionModel {
|
||||
FunctionInput inp;
|
||||
FunctionOutput outp;
|
||||
|
||||
FunctionModels() {
|
||||
// signature: func Reverse(data Interface) Interface
|
||||
hasQualifiedName("sort", "Reverse") and
|
||||
(inp.isParameter(0) and outp.isResult())
|
||||
}
|
||||
|
||||
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
|
||||
input = inp and output = outp
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// Code generated by https://github.com/gagliardetto/codebox. DO NOT EDIT.
|
||||
|
||||
package main
|
||||
|
||||
import "sort"
|
||||
|
||||
func TaintStepTest_SortReverse_B0I0O0(sourceCQL interface{}) interface{} {
|
||||
fromInterface656 := sourceCQL.(sort.Interface)
|
||||
intoInterface414 := sort.Reverse(fromInterface656)
|
||||
return intoInterface414
|
||||
}
|
||||
|
||||
func RunAllTaints_Sort() {
|
||||
{
|
||||
source := newSource(0)
|
||||
out := TaintStepTest_SortReverse_B0I0O0(source)
|
||||
sink(0, out)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user