Merge pull request #274 from gagliardetto/standard-lib-pt-2

Add taint tracking for bufio and bytes packages
This commit is contained in:
Max Schaefer
2020-08-05 17:10:08 +01:00
committed by GitHub
5 changed files with 1203 additions and 22 deletions

View File

@@ -5,6 +5,8 @@
import go
import semmle.go.frameworks.stdlib.ArchiveTar
import semmle.go.frameworks.stdlib.ArchiveZip
import semmle.go.frameworks.stdlib.Bufio
import semmle.go.frameworks.stdlib.Bytes
/** A `String()` method. */
class StringMethod extends TaintTracking::FunctionModel, Method {
@@ -73,17 +75,6 @@ module PathFilePath {
}
}
/** Provides models of commonly used functions in the `bytes` package. */
private module Bytes {
private class BufferBytes extends TaintTracking::FunctionModel, Method {
BufferBytes() { this.hasQualifiedName("bytes", "Buffer", ["Bytes", "String"]) }
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
input.isReceiver() and output.isResult()
}
}
}
/** Provides models of commonly used functions in the `fmt` package. */
module Fmt {
/** The `Sprint` function or one of its variants. */
@@ -384,17 +375,6 @@ module Io {
}
}
/** Provides models of commonly used functions in the `bufio` package. */
module Bufio {
private class NewWriter extends TaintTracking::FunctionModel {
NewWriter() { this.hasQualifiedName("bufio", "NewWriter") }
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
input.isResult() and output.isParameter(0)
}
}
}
/** Provides models of commonly used functions in the `io/ioutil` package. */
module IoUtil {
private class IoUtilFileSystemAccess extends FileSystemAccess::Range, DataFlow::CallNode {

View File

@@ -0,0 +1,126 @@
/**
* Provides classes modeling security-relevant aspects of the `bufio` package.
*/
import go
/** Provides models of commonly used functions in the `bufio` package. */
module Bufio {
private class FunctionModels extends TaintTracking::FunctionModel {
FunctionInput inp;
FunctionOutput outp;
FunctionModels() {
// signature: func NewReadWriter(r *Reader, w *Writer) *ReadWriter
hasQualifiedName("bufio", "NewReadWriter") and
(
inp.isParameter(0) and outp.isResult()
or
inp.isResult() and outp.isParameter(1)
)
or
// signature: func NewReader(rd io.Reader) *Reader
hasQualifiedName("bufio", "NewReader") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func NewReaderSize(rd io.Reader, size int) *Reader
hasQualifiedName("bufio", "NewReaderSize") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func NewScanner(r io.Reader) *Scanner
hasQualifiedName("bufio", "NewScanner") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func NewWriter(w io.Writer) *Writer
hasQualifiedName("bufio", "NewWriter") and
(inp.isResult() and outp.isParameter(0))
or
// signature: func NewWriterSize(w io.Writer, size int) *Writer
hasQualifiedName("bufio", "NewWriterSize") and
(inp.isResult() and outp.isParameter(0))
or
// signature: func ScanBytes(data []byte, atEOF bool) (advance int, token []byte, err error)
hasQualifiedName("bufio", "ScanBytes") and
(inp.isParameter(0) and outp.isResult(1))
or
// signature: func ScanLines(data []byte, atEOF bool) (advance int, token []byte, err error)
hasQualifiedName("bufio", "ScanLines") and
(inp.isParameter(0) and outp.isResult(1))
or
// signature: func ScanRunes(data []byte, atEOF bool) (advance int, token []byte, err error)
hasQualifiedName("bufio", "ScanRunes") and
(inp.isParameter(0) and outp.isResult(1))
or
// signature: func ScanWords(data []byte, atEOF bool) (advance int, token []byte, err error)
hasQualifiedName("bufio", "ScanWords") and
(inp.isParameter(0) and outp.isResult(1))
}
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
input = inp and output = outp
}
}
private class MethodModels extends TaintTracking::FunctionModel, Method {
FunctionInput inp;
FunctionOutput outp;
MethodModels() {
// signature: func (*Reader).Peek(n int) ([]byte, error)
this.hasQualifiedName("bufio", "Reader", "Peek") and
(inp.isReceiver() and outp.isResult(0))
or
// signature: func (*Reader).ReadBytes(delim byte) ([]byte, error)
this.hasQualifiedName("bufio", "Reader", "ReadBytes") and
(inp.isReceiver() and outp.isResult(0))
or
// signature: func (*Reader).ReadLine() (line []byte, isPrefix bool, err error)
this.hasQualifiedName("bufio", "Reader", "ReadLine") and
(inp.isReceiver() and outp.isResult(0))
or
// signature: func (*Reader).ReadSlice(delim byte) (line []byte, err error)
this.hasQualifiedName("bufio", "Reader", "ReadSlice") and
(inp.isReceiver() and outp.isResult(0))
or
// signature: func (*Reader).ReadString(delim byte) (string, error)
this.hasQualifiedName("bufio", "Reader", "ReadString") and
(inp.isReceiver() and outp.isResult(0))
or
// signature: func (*Reader).Reset(r io.Reader)
this.hasQualifiedName("bufio", "Reader", "Reset") and
(inp.isParameter(0) and outp.isReceiver())
or
// signature: func (*Reader).WriteTo(w io.Writer) (n int64, err error)
this.hasQualifiedName("bufio", "Reader", "WriteTo") and
(inp.isReceiver() and outp.isParameter(0))
or
// signature: func (*Scanner).Bytes() []byte
this.hasQualifiedName("bufio", "Scanner", "Bytes") and
(inp.isReceiver() and outp.isResult())
or
// signature: func (*Scanner).Text() string
this.hasQualifiedName("bufio", "Scanner", "Text") and
(inp.isReceiver() and outp.isResult())
or
// signature: func (*Writer).ReadFrom(r io.Reader) (n int64, err error)
this.hasQualifiedName("bufio", "Writer", "ReadFrom") and
(inp.isParameter(0) and outp.isReceiver())
or
// signature: func (*Writer).Reset(w io.Writer)
this.hasQualifiedName("bufio", "Writer", "Reset") and
(inp.isReceiver() and outp.isParameter(0))
or
// signature: func (*Writer).Write(p []byte) (nn int, err error)
this.hasQualifiedName("bufio", "Writer", "Write") and
(inp.isParameter(0) and outp.isReceiver())
or
// signature: func (*Writer).WriteString(s string) (int, error)
this.hasQualifiedName("bufio", "Writer", "WriteString") and
(inp.isParameter(0) and outp.isReceiver())
}
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
input = inp and output = outp
}
}
}

View File

@@ -0,0 +1,206 @@
/**
* Provides classes modeling security-relevant aspects of the `bytes` package.
*/
import go
/** Provides models of commonly used functions in the `bytes` package. */
module Bytes {
private class FunctionModels extends TaintTracking::FunctionModel {
FunctionInput inp;
FunctionOutput outp;
FunctionModels() {
// signature: func Fields(s []byte) [][]byte
hasQualifiedName("bytes", "Fields") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func FieldsFunc(s []byte, f func(rune) bool) [][]byte
hasQualifiedName("bytes", "FieldsFunc") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func Join(s [][]byte, sep []byte) []byte
hasQualifiedName("bytes", "Join") and
(inp.isParameter(_) and outp.isResult())
or
// signature: func Map(mapping func(r rune) rune, s []byte) []byte
hasQualifiedName("bytes", "Map") and
(inp.isParameter(1) and outp.isResult())
or
// signature: func NewBuffer(buf []byte) *Buffer
hasQualifiedName("bytes", "NewBuffer") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func NewBufferString(s string) *Buffer
hasQualifiedName("bytes", "NewBufferString") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func NewReader(b []byte) *Reader
hasQualifiedName("bytes", "NewReader") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func Repeat(b []byte, count int) []byte
hasQualifiedName("bytes", "Repeat") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func Replace(s []byte, old []byte, new []byte, n int) []byte
hasQualifiedName("bytes", "Replace") and
(inp.isParameter([0, 2]) and outp.isResult())
or
// signature: func ReplaceAll(s []byte, old []byte, new []byte) []byte
hasQualifiedName("bytes", "ReplaceAll") and
(inp.isParameter([0, 2]) and outp.isResult())
or
// signature: func Runes(s []byte) []rune
hasQualifiedName("bytes", "Runes") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func Split(s []byte, sep []byte) [][]byte
hasQualifiedName("bytes", "Split") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func SplitAfter(s []byte, sep []byte) [][]byte
hasQualifiedName("bytes", "SplitAfter") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func SplitAfterN(s []byte, sep []byte, n int) [][]byte
hasQualifiedName("bytes", "SplitAfterN") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func SplitN(s []byte, sep []byte, n int) [][]byte
hasQualifiedName("bytes", "SplitN") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func Title(s []byte) []byte
hasQualifiedName("bytes", "Title") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func ToLower(s []byte) []byte
hasQualifiedName("bytes", "ToLower") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func ToLowerSpecial(c unicode.SpecialCase, s []byte) []byte
hasQualifiedName("bytes", "ToLowerSpecial") and
(inp.isParameter(1) and outp.isResult())
or
// signature: func ToTitle(s []byte) []byte
hasQualifiedName("bytes", "ToTitle") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func ToTitleSpecial(c unicode.SpecialCase, s []byte) []byte
hasQualifiedName("bytes", "ToTitleSpecial") and
(inp.isParameter(1) and outp.isResult())
or
// signature: func ToUpper(s []byte) []byte
hasQualifiedName("bytes", "ToUpper") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func ToUpperSpecial(c unicode.SpecialCase, s []byte) []byte
hasQualifiedName("bytes", "ToUpperSpecial") and
(inp.isParameter(1) and outp.isResult())
or
// signature: func ToValidUTF8(s []byte, replacement []byte) []byte
hasQualifiedName("bytes", "ToValidUTF8") and
(inp.isParameter(_) and outp.isResult())
or
// signature: func Trim(s []byte, cutset string) []byte
hasQualifiedName("bytes", "Trim") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func TrimFunc(s []byte, f func(r rune) bool) []byte
hasQualifiedName("bytes", "TrimFunc") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func TrimLeft(s []byte, cutset string) []byte
hasQualifiedName("bytes", "TrimLeft") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func TrimLeftFunc(s []byte, f func(r rune) bool) []byte
hasQualifiedName("bytes", "TrimLeftFunc") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func TrimPrefix(s []byte, prefix []byte) []byte
hasQualifiedName("bytes", "TrimPrefix") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func TrimRight(s []byte, cutset string) []byte
hasQualifiedName("bytes", "TrimRight") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func TrimRightFunc(s []byte, f func(r rune) bool) []byte
hasQualifiedName("bytes", "TrimRightFunc") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func TrimSpace(s []byte) []byte
hasQualifiedName("bytes", "TrimSpace") and
(inp.isParameter(0) and outp.isResult())
or
// signature: func TrimSuffix(s []byte, suffix []byte) []byte
hasQualifiedName("bytes", "TrimSuffix") and
(inp.isParameter(0) and outp.isResult())
}
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
input = inp and output = outp
}
}
private class MethodModels extends TaintTracking::FunctionModel, Method {
FunctionInput inp;
FunctionOutput outp;
MethodModels() {
// signature: func (*Buffer).Bytes() []byte
this.hasQualifiedName("bytes", "Buffer", "Bytes") and
(inp.isReceiver() and outp.isResult())
or
// signature: func (*Buffer).Next(n int) []byte
this.hasQualifiedName("bytes", "Buffer", "Next") and
(inp.isReceiver() and outp.isResult())
or
// signature: func (*Buffer).ReadBytes(delim byte) (line []byte, err error)
this.hasQualifiedName("bytes", "Buffer", "ReadBytes") and
(inp.isReceiver() and outp.isResult(0))
or
// signature: func (*Buffer).ReadFrom(r io.Reader) (n int64, err error)
this.hasQualifiedName("bytes", "Buffer", "ReadFrom") and
(inp.isParameter(0) and outp.isReceiver())
or
// signature: func (*Buffer).ReadString(delim byte) (line string, err error)
this.hasQualifiedName("bytes", "Buffer", "ReadString") and
(inp.isReceiver() and outp.isResult(0))
or
// signature: func (*Buffer).String() string
this.hasQualifiedName("bytes", "Buffer", "String") and
(inp.isReceiver() and outp.isResult())
or
// signature: func (*Buffer).Write(p []byte) (n int, err error)
this.hasQualifiedName("bytes", "Buffer", "Write") and
(inp.isParameter(0) and outp.isReceiver())
or
// signature: func (*Buffer).WriteString(s string) (n int, err error)
this.hasQualifiedName("bytes", "Buffer", "WriteString") and
(inp.isParameter(0) and outp.isReceiver())
or
// signature: func (*Buffer).WriteTo(w io.Writer) (n int64, err error)
this.hasQualifiedName("bytes", "Buffer", "WriteTo") and
(inp.isReceiver() and outp.isParameter(0))
or
// signature: func (*Reader).ReadAt(b []byte, off int64) (n int, err error)
this.hasQualifiedName("bytes", "Reader", "ReadAt") and
(inp.isReceiver() and outp.isParameter(0))
or
// signature: func (*Reader).Reset(b []byte)
this.hasQualifiedName("bytes", "Reader", "Reset") and
(inp.isParameter(0) and outp.isReceiver())
or
// signature: func (*Reader).WriteTo(w io.Writer) (n int64, err error)
this.hasQualifiedName("bytes", "Reader", "WriteTo") and
(inp.isReceiver() and outp.isParameter(0))
}
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
input = inp and output = outp
}
}
}

View File

@@ -0,0 +1,299 @@
// Code generated by https://github.com/gagliardetto/codebox. DO NOT EDIT.
package main
import (
"bufio"
"io"
)
func TaintStepTest_BufioNewReadWriter_B0I0O0(sourceCQL interface{}) interface{} {
fromReader656 := sourceCQL.(*bufio.Reader)
intoReadWriter414 := bufio.NewReadWriter(fromReader656, nil)
return intoReadWriter414
}
func TaintStepTest_BufioNewReadWriter_B1I0O0(sourceCQL interface{}) interface{} {
fromReadWriter518 := sourceCQL.(*bufio.ReadWriter)
var intoWriter650 *bufio.Writer
intermediateCQL := bufio.NewReadWriter(nil, intoWriter650)
link(fromReadWriter518, intermediateCQL)
return intoWriter650
}
func TaintStepTest_BufioNewReader_B0I0O0(sourceCQL interface{}) interface{} {
fromReader784 := sourceCQL.(io.Reader)
intoReader957 := bufio.NewReader(fromReader784)
return intoReader957
}
func TaintStepTest_BufioNewReaderSize_B0I0O0(sourceCQL interface{}) interface{} {
fromReader520 := sourceCQL.(io.Reader)
intoReader443 := bufio.NewReaderSize(fromReader520, 0)
return intoReader443
}
func TaintStepTest_BufioNewScanner_B0I0O0(sourceCQL interface{}) interface{} {
fromReader127 := sourceCQL.(io.Reader)
intoScanner483 := bufio.NewScanner(fromReader127)
return intoScanner483
}
func TaintStepTest_BufioNewWriter_B0I0O0(sourceCQL interface{}) interface{} {
fromWriter989 := sourceCQL.(*bufio.Writer)
var intoWriter982 io.Writer
intermediateCQL := bufio.NewWriter(intoWriter982)
link(fromWriter989, intermediateCQL)
return intoWriter982
}
func TaintStepTest_BufioNewWriterSize_B0I0O0(sourceCQL interface{}) interface{} {
fromWriter417 := sourceCQL.(*bufio.Writer)
var intoWriter584 io.Writer
intermediateCQL := bufio.NewWriterSize(intoWriter584, 0)
link(fromWriter417, intermediateCQL)
return intoWriter584
}
func TaintStepTest_BufioScanBytes_B0I0O0(sourceCQL interface{}) interface{} {
fromByte991 := sourceCQL.([]byte)
_, intoByte881, _ := bufio.ScanBytes(fromByte991, false)
return intoByte881
}
func TaintStepTest_BufioScanLines_B0I0O0(sourceCQL interface{}) interface{} {
fromByte186 := sourceCQL.([]byte)
_, intoByte284, _ := bufio.ScanLines(fromByte186, false)
return intoByte284
}
func TaintStepTest_BufioScanRunes_B0I0O0(sourceCQL interface{}) interface{} {
fromByte908 := sourceCQL.([]byte)
_, intoByte137, _ := bufio.ScanRunes(fromByte908, false)
return intoByte137
}
func TaintStepTest_BufioScanWords_B0I0O0(sourceCQL interface{}) interface{} {
fromByte494 := sourceCQL.([]byte)
_, intoByte873, _ := bufio.ScanWords(fromByte494, false)
return intoByte873
}
func TaintStepTest_BufioReaderPeek_B0I0O0(sourceCQL interface{}) interface{} {
fromReader599 := sourceCQL.(bufio.Reader)
intoByte409, _ := fromReader599.Peek(0)
return intoByte409
}
func TaintStepTest_BufioReaderRead_B0I0O0(sourceCQL interface{}) interface{} {
fromReader246 := sourceCQL.(bufio.Reader)
var intoByte898 []byte
fromReader246.Read(intoByte898)
return intoByte898
}
func TaintStepTest_BufioReaderReadBytes_B0I0O0(sourceCQL interface{}) interface{} {
fromReader598 := sourceCQL.(bufio.Reader)
intoByte631, _ := fromReader598.ReadBytes(0)
return intoByte631
}
func TaintStepTest_BufioReaderReadLine_B0I0O0(sourceCQL interface{}) interface{} {
fromReader165 := sourceCQL.(bufio.Reader)
intoByte150, _, _ := fromReader165.ReadLine()
return intoByte150
}
func TaintStepTest_BufioReaderReadSlice_B0I0O0(sourceCQL interface{}) interface{} {
fromReader340 := sourceCQL.(bufio.Reader)
intoByte471, _ := fromReader340.ReadSlice(0)
return intoByte471
}
func TaintStepTest_BufioReaderReadString_B0I0O0(sourceCQL interface{}) interface{} {
fromReader290 := sourceCQL.(bufio.Reader)
intoString758, _ := fromReader290.ReadString(0)
return intoString758
}
func TaintStepTest_BufioReaderReset_B0I0O0(sourceCQL interface{}) interface{} {
fromReader396 := sourceCQL.(io.Reader)
var intoReader707 bufio.Reader
intoReader707.Reset(fromReader396)
return intoReader707
}
func TaintStepTest_BufioReaderWriteTo_B0I0O0(sourceCQL interface{}) interface{} {
fromReader912 := sourceCQL.(bufio.Reader)
var intoWriter718 io.Writer
fromReader912.WriteTo(intoWriter718)
return intoWriter718
}
func TaintStepTest_BufioScannerBytes_B0I0O0(sourceCQL interface{}) interface{} {
fromScanner972 := sourceCQL.(bufio.Scanner)
intoByte633 := fromScanner972.Bytes()
return intoByte633
}
func TaintStepTest_BufioScannerText_B0I0O0(sourceCQL interface{}) interface{} {
fromScanner316 := sourceCQL.(bufio.Scanner)
intoString145 := fromScanner316.Text()
return intoString145
}
func TaintStepTest_BufioWriterReadFrom_B0I0O0(sourceCQL interface{}) interface{} {
fromReader817 := sourceCQL.(io.Reader)
var intoWriter474 bufio.Writer
intoWriter474.ReadFrom(fromReader817)
return intoWriter474
}
func TaintStepTest_BufioWriterReset_B0I0O0(sourceCQL interface{}) interface{} {
fromWriter832 := sourceCQL.(bufio.Writer)
var intoWriter378 io.Writer
fromWriter832.Reset(intoWriter378)
return intoWriter378
}
func TaintStepTest_BufioWriterWrite_B0I0O0(sourceCQL interface{}) interface{} {
fromByte541 := sourceCQL.([]byte)
var intoWriter139 bufio.Writer
intoWriter139.Write(fromByte541)
return intoWriter139
}
func TaintStepTest_BufioWriterWriteString_B0I0O0(sourceCQL interface{}) interface{} {
fromString814 := sourceCQL.(string)
var intoWriter768 bufio.Writer
intoWriter768.WriteString(fromString814)
return intoWriter768
}
func RunAllTaints_Bufio() {
{
source := newSource(0)
out := TaintStepTest_BufioNewReadWriter_B0I0O0(source)
sink(0, out)
}
{
source := newSource(1)
out := TaintStepTest_BufioNewReadWriter_B1I0O0(source)
sink(1, out)
}
{
source := newSource(2)
out := TaintStepTest_BufioNewReader_B0I0O0(source)
sink(2, out)
}
{
source := newSource(3)
out := TaintStepTest_BufioNewReaderSize_B0I0O0(source)
sink(3, out)
}
{
source := newSource(4)
out := TaintStepTest_BufioNewScanner_B0I0O0(source)
sink(4, out)
}
{
source := newSource(5)
out := TaintStepTest_BufioNewWriter_B0I0O0(source)
sink(5, out)
}
{
source := newSource(6)
out := TaintStepTest_BufioNewWriterSize_B0I0O0(source)
sink(6, out)
}
{
source := newSource(7)
out := TaintStepTest_BufioScanBytes_B0I0O0(source)
sink(7, out)
}
{
source := newSource(8)
out := TaintStepTest_BufioScanLines_B0I0O0(source)
sink(8, out)
}
{
source := newSource(9)
out := TaintStepTest_BufioScanRunes_B0I0O0(source)
sink(9, out)
}
{
source := newSource(10)
out := TaintStepTest_BufioScanWords_B0I0O0(source)
sink(10, out)
}
{
source := newSource(11)
out := TaintStepTest_BufioReaderPeek_B0I0O0(source)
sink(11, out)
}
{
source := newSource(12)
out := TaintStepTest_BufioReaderRead_B0I0O0(source)
sink(12, out)
}
{
source := newSource(13)
out := TaintStepTest_BufioReaderReadBytes_B0I0O0(source)
sink(13, out)
}
{
source := newSource(14)
out := TaintStepTest_BufioReaderReadLine_B0I0O0(source)
sink(14, out)
}
{
source := newSource(15)
out := TaintStepTest_BufioReaderReadSlice_B0I0O0(source)
sink(15, out)
}
{
source := newSource(16)
out := TaintStepTest_BufioReaderReadString_B0I0O0(source)
sink(16, out)
}
{
source := newSource(17)
out := TaintStepTest_BufioReaderReset_B0I0O0(source)
sink(17, out)
}
{
source := newSource(18)
out := TaintStepTest_BufioReaderWriteTo_B0I0O0(source)
sink(18, out)
}
{
source := newSource(19)
out := TaintStepTest_BufioScannerBytes_B0I0O0(source)
sink(19, out)
}
{
source := newSource(20)
out := TaintStepTest_BufioScannerText_B0I0O0(source)
sink(20, out)
}
{
source := newSource(21)
out := TaintStepTest_BufioWriterReadFrom_B0I0O0(source)
sink(21, out)
}
{
source := newSource(22)
out := TaintStepTest_BufioWriterReset_B0I0O0(source)
sink(22, out)
}
{
source := newSource(23)
out := TaintStepTest_BufioWriterWrite_B0I0O0(source)
sink(23, out)
}
{
source := newSource(24)
out := TaintStepTest_BufioWriterWriteString_B0I0O0(source)
sink(24, out)
}
}

View File

@@ -0,0 +1,570 @@
// Code generated by https://github.com/gagliardetto/codebox. DO NOT EDIT.
package main
import (
"bytes"
"io"
)
func TaintStepTest_BytesFields_B0I0O0(sourceCQL interface{}) interface{} {
fromByte656 := sourceCQL.([]byte)
intoByte414 := bytes.Fields(fromByte656)
return intoByte414
}
func TaintStepTest_BytesFieldsFunc_B0I0O0(sourceCQL interface{}) interface{} {
fromByte518 := sourceCQL.([]byte)
intoByte650 := bytes.FieldsFunc(fromByte518, nil)
return intoByte650
}
func TaintStepTest_BytesJoin_B0I0O0(sourceCQL interface{}) interface{} {
fromByte784 := sourceCQL.([][]byte)
intoByte957 := bytes.Join(fromByte784, nil)
return intoByte957
}
func TaintStepTest_BytesJoin_B0I1O0(sourceCQL interface{}) interface{} {
fromByte520 := sourceCQL.([]byte)
intoByte443 := bytes.Join(nil, fromByte520)
return intoByte443
}
func TaintStepTest_BytesMap_B0I0O0(sourceCQL interface{}) interface{} {
fromByte127 := sourceCQL.([]byte)
intoByte483 := bytes.Map(nil, fromByte127)
return intoByte483
}
func TaintStepTest_BytesNewBuffer_B0I0O0(sourceCQL interface{}) interface{} {
fromByte989 := sourceCQL.([]byte)
intoBuffer982 := bytes.NewBuffer(fromByte989)
return intoBuffer982
}
func TaintStepTest_BytesNewBufferString_B0I0O0(sourceCQL interface{}) interface{} {
fromString417 := sourceCQL.(string)
intoBuffer584 := bytes.NewBufferString(fromString417)
return intoBuffer584
}
func TaintStepTest_BytesNewReader_B0I0O0(sourceCQL interface{}) interface{} {
fromByte991 := sourceCQL.([]byte)
intoReader881 := bytes.NewReader(fromByte991)
return intoReader881
}
func TaintStepTest_BytesRepeat_B0I0O0(sourceCQL interface{}) interface{} {
fromByte186 := sourceCQL.([]byte)
intoByte284 := bytes.Repeat(fromByte186, 0)
return intoByte284
}
func TaintStepTest_BytesReplace_B0I0O0(sourceCQL interface{}) interface{} {
fromByte908 := sourceCQL.([]byte)
intoByte137 := bytes.Replace(fromByte908, nil, nil, 0)
return intoByte137
}
func TaintStepTest_BytesReplace_B0I1O0(sourceCQL interface{}) interface{} {
fromByte494 := sourceCQL.([]byte)
intoByte873 := bytes.Replace(nil, nil, fromByte494, 0)
return intoByte873
}
func TaintStepTest_BytesReplaceAll_B0I0O0(sourceCQL interface{}) interface{} {
fromByte599 := sourceCQL.([]byte)
intoByte409 := bytes.ReplaceAll(fromByte599, nil, nil)
return intoByte409
}
func TaintStepTest_BytesReplaceAll_B0I1O0(sourceCQL interface{}) interface{} {
fromByte246 := sourceCQL.([]byte)
intoByte898 := bytes.ReplaceAll(nil, nil, fromByte246)
return intoByte898
}
func TaintStepTest_BytesRunes_B0I0O0(sourceCQL interface{}) interface{} {
fromByte598 := sourceCQL.([]byte)
intoRune631 := bytes.Runes(fromByte598)
return intoRune631
}
func TaintStepTest_BytesSplit_B0I0O0(sourceCQL interface{}) interface{} {
fromByte165 := sourceCQL.([]byte)
intoByte150 := bytes.Split(fromByte165, nil)
return intoByte150
}
func TaintStepTest_BytesSplitAfter_B0I0O0(sourceCQL interface{}) interface{} {
fromByte340 := sourceCQL.([]byte)
intoByte471 := bytes.SplitAfter(fromByte340, nil)
return intoByte471
}
func TaintStepTest_BytesSplitAfterN_B0I0O0(sourceCQL interface{}) interface{} {
fromByte290 := sourceCQL.([]byte)
intoByte758 := bytes.SplitAfterN(fromByte290, nil, 0)
return intoByte758
}
func TaintStepTest_BytesSplitN_B0I0O0(sourceCQL interface{}) interface{} {
fromByte396 := sourceCQL.([]byte)
intoByte707 := bytes.SplitN(fromByte396, nil, 0)
return intoByte707
}
func TaintStepTest_BytesTitle_B0I0O0(sourceCQL interface{}) interface{} {
fromByte912 := sourceCQL.([]byte)
intoByte718 := bytes.Title(fromByte912)
return intoByte718
}
func TaintStepTest_BytesToLower_B0I0O0(sourceCQL interface{}) interface{} {
fromByte972 := sourceCQL.([]byte)
intoByte633 := bytes.ToLower(fromByte972)
return intoByte633
}
func TaintStepTest_BytesToLowerSpecial_B0I0O0(sourceCQL interface{}) interface{} {
fromByte316 := sourceCQL.([]byte)
intoByte145 := bytes.ToLowerSpecial(nil, fromByte316)
return intoByte145
}
func TaintStepTest_BytesToTitle_B0I0O0(sourceCQL interface{}) interface{} {
fromByte817 := sourceCQL.([]byte)
intoByte474 := bytes.ToTitle(fromByte817)
return intoByte474
}
func TaintStepTest_BytesToTitleSpecial_B0I0O0(sourceCQL interface{}) interface{} {
fromByte832 := sourceCQL.([]byte)
intoByte378 := bytes.ToTitleSpecial(nil, fromByte832)
return intoByte378
}
func TaintStepTest_BytesToUpper_B0I0O0(sourceCQL interface{}) interface{} {
fromByte541 := sourceCQL.([]byte)
intoByte139 := bytes.ToUpper(fromByte541)
return intoByte139
}
func TaintStepTest_BytesToUpperSpecial_B0I0O0(sourceCQL interface{}) interface{} {
fromByte814 := sourceCQL.([]byte)
intoByte768 := bytes.ToUpperSpecial(nil, fromByte814)
return intoByte768
}
func TaintStepTest_BytesToValidUTF8_B0I0O0(sourceCQL interface{}) interface{} {
fromByte468 := sourceCQL.([]byte)
intoByte736 := bytes.ToValidUTF8(fromByte468, nil)
return intoByte736
}
func TaintStepTest_BytesToValidUTF8_B0I1O0(sourceCQL interface{}) interface{} {
fromByte516 := sourceCQL.([]byte)
intoByte246 := bytes.ToValidUTF8(nil, fromByte516)
return intoByte246
}
func TaintStepTest_BytesTrim_B0I0O0(sourceCQL interface{}) interface{} {
fromByte679 := sourceCQL.([]byte)
intoByte736 := bytes.Trim(fromByte679, "")
return intoByte736
}
func TaintStepTest_BytesTrimFunc_B0I0O0(sourceCQL interface{}) interface{} {
fromByte839 := sourceCQL.([]byte)
intoByte273 := bytes.TrimFunc(fromByte839, nil)
return intoByte273
}
func TaintStepTest_BytesTrimLeft_B0I0O0(sourceCQL interface{}) interface{} {
fromByte982 := sourceCQL.([]byte)
intoByte458 := bytes.TrimLeft(fromByte982, "")
return intoByte458
}
func TaintStepTest_BytesTrimLeftFunc_B0I0O0(sourceCQL interface{}) interface{} {
fromByte506 := sourceCQL.([]byte)
intoByte213 := bytes.TrimLeftFunc(fromByte506, nil)
return intoByte213
}
func TaintStepTest_BytesTrimPrefix_B0I0O0(sourceCQL interface{}) interface{} {
fromByte468 := sourceCQL.([]byte)
intoByte219 := bytes.TrimPrefix(fromByte468, nil)
return intoByte219
}
func TaintStepTest_BytesTrimRight_B0I0O0(sourceCQL interface{}) interface{} {
fromByte265 := sourceCQL.([]byte)
intoByte971 := bytes.TrimRight(fromByte265, "")
return intoByte971
}
func TaintStepTest_BytesTrimRightFunc_B0I0O0(sourceCQL interface{}) interface{} {
fromByte320 := sourceCQL.([]byte)
intoByte545 := bytes.TrimRightFunc(fromByte320, nil)
return intoByte545
}
func TaintStepTest_BytesTrimSpace_B0I0O0(sourceCQL interface{}) interface{} {
fromByte566 := sourceCQL.([]byte)
intoByte497 := bytes.TrimSpace(fromByte566)
return intoByte497
}
func TaintStepTest_BytesTrimSuffix_B0I0O0(sourceCQL interface{}) interface{} {
fromByte274 := sourceCQL.([]byte)
intoByte783 := bytes.TrimSuffix(fromByte274, nil)
return intoByte783
}
func TaintStepTest_BytesBufferBytes_B0I0O0(sourceCQL interface{}) interface{} {
fromBuffer905 := sourceCQL.(bytes.Buffer)
intoByte389 := fromBuffer905.Bytes()
return intoByte389
}
func TaintStepTest_BytesBufferNext_B0I0O0(sourceCQL interface{}) interface{} {
fromBuffer198 := sourceCQL.(bytes.Buffer)
intoByte477 := fromBuffer198.Next(0)
return intoByte477
}
func TaintStepTest_BytesBufferRead_B0I0O0(sourceCQL interface{}) interface{} {
fromBuffer544 := sourceCQL.(bytes.Buffer)
var intoByte382 []byte
fromBuffer544.Read(intoByte382)
return intoByte382
}
func TaintStepTest_BytesBufferReadBytes_B0I0O0(sourceCQL interface{}) interface{} {
fromBuffer715 := sourceCQL.(bytes.Buffer)
intoByte179, _ := fromBuffer715.ReadBytes(0)
return intoByte179
}
func TaintStepTest_BytesBufferReadFrom_B0I0O0(sourceCQL interface{}) interface{} {
fromReader366 := sourceCQL.(io.Reader)
var intoBuffer648 bytes.Buffer
intoBuffer648.ReadFrom(fromReader366)
return intoBuffer648
}
func TaintStepTest_BytesBufferReadString_B0I0O0(sourceCQL interface{}) interface{} {
fromBuffer544 := sourceCQL.(bytes.Buffer)
intoString484, _ := fromBuffer544.ReadString(0)
return intoString484
}
func TaintStepTest_BytesBufferString_B0I0O0(sourceCQL interface{}) interface{} {
fromBuffer824 := sourceCQL.(bytes.Buffer)
intoString754 := fromBuffer824.String()
return intoString754
}
func TaintStepTest_BytesBufferWrite_B0I0O0(sourceCQL interface{}) interface{} {
fromByte680 := sourceCQL.([]byte)
var intoBuffer722 bytes.Buffer
intoBuffer722.Write(fromByte680)
return intoBuffer722
}
func TaintStepTest_BytesBufferWriteString_B0I0O0(sourceCQL interface{}) interface{} {
fromString506 := sourceCQL.(string)
var intoBuffer121 bytes.Buffer
intoBuffer121.WriteString(fromString506)
return intoBuffer121
}
func TaintStepTest_BytesBufferWriteTo_B0I0O0(sourceCQL interface{}) interface{} {
fromBuffer293 := sourceCQL.(bytes.Buffer)
var intoWriter151 io.Writer
fromBuffer293.WriteTo(intoWriter151)
return intoWriter151
}
func TaintStepTest_BytesReaderRead_B0I0O0(sourceCQL interface{}) interface{} {
fromReader849 := sourceCQL.(bytes.Reader)
var intoByte322 []byte
fromReader849.Read(intoByte322)
return intoByte322
}
func TaintStepTest_BytesReaderReadAt_B0I0O0(sourceCQL interface{}) interface{} {
fromReader339 := sourceCQL.(bytes.Reader)
var intoByte478 []byte
fromReader339.ReadAt(intoByte478, 0)
return intoByte478
}
func TaintStepTest_BytesReaderReset_B0I0O0(sourceCQL interface{}) interface{} {
fromByte399 := sourceCQL.([]byte)
var intoReader426 bytes.Reader
intoReader426.Reset(fromByte399)
return intoReader426
}
func TaintStepTest_BytesReaderWriteTo_B0I0O0(sourceCQL interface{}) interface{} {
fromReader628 := sourceCQL.(bytes.Reader)
var intoWriter197 io.Writer
fromReader628.WriteTo(intoWriter197)
return intoWriter197
}
func RunAllTaints_Bytes() {
{
source := newSource(0)
out := TaintStepTest_BytesFields_B0I0O0(source)
sink(0, out)
}
{
source := newSource(1)
out := TaintStepTest_BytesFieldsFunc_B0I0O0(source)
sink(1, out)
}
{
source := newSource(2)
out := TaintStepTest_BytesJoin_B0I0O0(source)
sink(2, out)
}
{
source := newSource(3)
out := TaintStepTest_BytesJoin_B0I1O0(source)
sink(3, out)
}
{
source := newSource(4)
out := TaintStepTest_BytesMap_B0I0O0(source)
sink(4, out)
}
{
source := newSource(5)
out := TaintStepTest_BytesNewBuffer_B0I0O0(source)
sink(5, out)
}
{
source := newSource(6)
out := TaintStepTest_BytesNewBufferString_B0I0O0(source)
sink(6, out)
}
{
source := newSource(7)
out := TaintStepTest_BytesNewReader_B0I0O0(source)
sink(7, out)
}
{
source := newSource(8)
out := TaintStepTest_BytesRepeat_B0I0O0(source)
sink(8, out)
}
{
source := newSource(9)
out := TaintStepTest_BytesReplace_B0I0O0(source)
sink(9, out)
}
{
source := newSource(10)
out := TaintStepTest_BytesReplace_B0I1O0(source)
sink(10, out)
}
{
source := newSource(11)
out := TaintStepTest_BytesReplaceAll_B0I0O0(source)
sink(11, out)
}
{
source := newSource(12)
out := TaintStepTest_BytesReplaceAll_B0I1O0(source)
sink(12, out)
}
{
source := newSource(13)
out := TaintStepTest_BytesRunes_B0I0O0(source)
sink(13, out)
}
{
source := newSource(14)
out := TaintStepTest_BytesSplit_B0I0O0(source)
sink(14, out)
}
{
source := newSource(15)
out := TaintStepTest_BytesSplitAfter_B0I0O0(source)
sink(15, out)
}
{
source := newSource(16)
out := TaintStepTest_BytesSplitAfterN_B0I0O0(source)
sink(16, out)
}
{
source := newSource(17)
out := TaintStepTest_BytesSplitN_B0I0O0(source)
sink(17, out)
}
{
source := newSource(18)
out := TaintStepTest_BytesTitle_B0I0O0(source)
sink(18, out)
}
{
source := newSource(19)
out := TaintStepTest_BytesToLower_B0I0O0(source)
sink(19, out)
}
{
source := newSource(20)
out := TaintStepTest_BytesToLowerSpecial_B0I0O0(source)
sink(20, out)
}
{
source := newSource(21)
out := TaintStepTest_BytesToTitle_B0I0O0(source)
sink(21, out)
}
{
source := newSource(22)
out := TaintStepTest_BytesToTitleSpecial_B0I0O0(source)
sink(22, out)
}
{
source := newSource(23)
out := TaintStepTest_BytesToUpper_B0I0O0(source)
sink(23, out)
}
{
source := newSource(24)
out := TaintStepTest_BytesToUpperSpecial_B0I0O0(source)
sink(24, out)
}
{
source := newSource(25)
out := TaintStepTest_BytesToValidUTF8_B0I0O0(source)
sink(25, out)
}
{
source := newSource(26)
out := TaintStepTest_BytesToValidUTF8_B0I1O0(source)
sink(26, out)
}
{
source := newSource(27)
out := TaintStepTest_BytesTrim_B0I0O0(source)
sink(27, out)
}
{
source := newSource(28)
out := TaintStepTest_BytesTrimFunc_B0I0O0(source)
sink(28, out)
}
{
source := newSource(29)
out := TaintStepTest_BytesTrimLeft_B0I0O0(source)
sink(29, out)
}
{
source := newSource(30)
out := TaintStepTest_BytesTrimLeftFunc_B0I0O0(source)
sink(30, out)
}
{
source := newSource(31)
out := TaintStepTest_BytesTrimPrefix_B0I0O0(source)
sink(31, out)
}
{
source := newSource(32)
out := TaintStepTest_BytesTrimRight_B0I0O0(source)
sink(32, out)
}
{
source := newSource(33)
out := TaintStepTest_BytesTrimRightFunc_B0I0O0(source)
sink(33, out)
}
{
source := newSource(34)
out := TaintStepTest_BytesTrimSpace_B0I0O0(source)
sink(34, out)
}
{
source := newSource(35)
out := TaintStepTest_BytesTrimSuffix_B0I0O0(source)
sink(35, out)
}
{
source := newSource(36)
out := TaintStepTest_BytesBufferBytes_B0I0O0(source)
sink(36, out)
}
{
source := newSource(37)
out := TaintStepTest_BytesBufferNext_B0I0O0(source)
sink(37, out)
}
{
source := newSource(38)
out := TaintStepTest_BytesBufferRead_B0I0O0(source)
sink(38, out)
}
{
source := newSource(39)
out := TaintStepTest_BytesBufferReadBytes_B0I0O0(source)
sink(39, out)
}
{
source := newSource(40)
out := TaintStepTest_BytesBufferReadFrom_B0I0O0(source)
sink(40, out)
}
{
source := newSource(41)
out := TaintStepTest_BytesBufferReadString_B0I0O0(source)
sink(41, out)
}
{
source := newSource(42)
out := TaintStepTest_BytesBufferString_B0I0O0(source)
sink(42, out)
}
{
source := newSource(43)
out := TaintStepTest_BytesBufferWrite_B0I0O0(source)
sink(43, out)
}
{
source := newSource(44)
out := TaintStepTest_BytesBufferWriteString_B0I0O0(source)
sink(44, out)
}
{
source := newSource(45)
out := TaintStepTest_BytesBufferWriteTo_B0I0O0(source)
sink(45, out)
}
{
source := newSource(46)
out := TaintStepTest_BytesReaderRead_B0I0O0(source)
sink(46, out)
}
{
source := newSource(47)
out := TaintStepTest_BytesReaderReadAt_B0I0O0(source)
sink(47, out)
}
{
source := newSource(48)
out := TaintStepTest_BytesReaderReset_B0I0O0(source)
sink(48, out)
}
{
source := newSource(49)
out := TaintStepTest_BytesReaderWriteTo_B0I0O0(source)
sink(49, out)
}
}