diff --git a/ql/src/experimental/frameworks/CleverGo.qll b/ql/src/experimental/frameworks/CleverGo.qll index 9ff5ea7da21..c061c416b88 100644 --- a/ql/src/experimental/frameworks/CleverGo.qll +++ b/ql/src/experimental/frameworks/CleverGo.qll @@ -25,46 +25,46 @@ private module CleverGo { | receiverName = "Context" and ( - // signature: func (*Context).BasicAuth() (username string, password string, ok bool) + // signature: func (*Context) BasicAuth() (username string, password string, ok bool) methodName = "BasicAuth" and out.isResult([0, 1]) or - // signature: func (*Context).Decode(v interface{}) (err error) + // signature: func (*Context) Decode(v interface{}) (err error) methodName = "Decode" and out.isParameter(0) or - // signature: func (*Context).DefaultQuery(key string, defaultVlue string) string + // signature: func (*Context) DefaultQuery(key string, defaultVlue string) string methodName = "DefaultQuery" and out.isResult() or - // signature: func (*Context).FormValue(key string) string + // signature: func (*Context) FormValue(key string) string methodName = "FormValue" and out.isResult() or - // signature: func (*Context).GetHeader(name string) string + // signature: func (*Context) GetHeader(name string) string methodName = "GetHeader" and out.isResult() or - // signature: func (*Context).PostFormValue(key string) string + // signature: func (*Context) PostFormValue(key string) string methodName = "PostFormValue" and out.isResult() or - // signature: func (*Context).QueryParam(key string) string + // signature: func (*Context) QueryParam(key string) string methodName = "QueryParam" and out.isResult() or - // signature: func (*Context).QueryParams() net/url.Values + // signature: func (*Context) QueryParams() net/url.Values methodName = "QueryParams" and out.isResult() or - // signature: func (*Context).QueryString() string + // signature: func (*Context) QueryString() string methodName = "QueryString" and out.isResult() ) or receiverName = "Params" and ( - // signature: func (Params).String(name string) string + // signature: func (Params) String(name string) string methodName = "String" and out.isResult() ) @@ -77,7 +77,7 @@ private module CleverGo { | interfaceName = "Decoder" and ( - // signature: func (Decoder).Decode(req *net/http.Request, v interface{}) error + // signature: func (Decoder) Decode(req *net/http.Request, v interface{}) error methodName = "Decode" and out.isParameter(1) ) @@ -135,31 +135,31 @@ private module CleverGo { // Taint-tracking models for package: clevergo.tech/clevergo@v0.5.2 ( // Receiver type: Application - // signature: func (*Application).RouteURL(name string, args ...string) (*net/url.URL, error) + // signature: func (*Application) RouteURL(name string, args ...string) (*net/url.URL, error) this.hasQualifiedName(packagePath(), "Application", "RouteURL") and inp.isParameter(_) and out.isResult(0) or // Receiver type: Context - // signature: func (*Context).Context() context.Context + // signature: func (*Context) Context() context.Context this.hasQualifiedName(packagePath(), "Context", "Context") and inp.isReceiver() and out.isResult() or // Receiver type: Params - // signature: func (Params).String(name string) string + // signature: func (Params) String(name string) string this.hasQualifiedName(packagePath(), "Params", "String") and inp.isReceiver() and out.isResult() or // Receiver interface: Decoder - // signature: func (Decoder).Decode(req *net/http.Request, v interface{}) error + // signature: func (Decoder) Decode(req *net/http.Request, v interface{}) error this.implements(packagePath(), "Decoder", "Decode") and inp.isParameter(0) and out.isParameter(1) or // Receiver interface: Renderer - // signature: func (Renderer).Render(w io.Writer, name string, data interface{}, c *Context) error + // signature: func (Renderer) Render(w io.Writer, name string, data interface{}, c *Context) error this.implements(packagePath(), "Renderer", "Render") and inp.isParameter(2) and out.isParameter(0) @@ -183,7 +183,7 @@ private module CleverGo { package = packagePath() and // Receiver type: Context ( - // signature: func (*Context).Redirect(code int, url string) error + // signature: func (*Context) Redirect(code int, url string) error this = any(Method m | m.hasQualifiedName(package, "Context", "Redirect")).getACall() and urlNode = this.getArgument(1) ) @@ -227,72 +227,72 @@ private module CleverGo { // Receiver type: Context receiverName = "Context" and ( - // signature: func (*Context).Error(code int, msg string) error + // signature: func (*Context) Error(code int, msg string) error methodName = "Error" and bodyNode = bodySetterCall.getArgument(1) and contentTypeString = "text/plain" or - // signature: func (*Context).HTML(code int, html string) error + // signature: func (*Context) HTML(code int, html string) error methodName = "HTML" and bodyNode = bodySetterCall.getArgument(1) and contentTypeString = "text/html" or - // signature: func (*Context).HTMLBlob(code int, bs []byte) error + // signature: func (*Context) HTMLBlob(code int, bs []byte) error methodName = "HTMLBlob" and bodyNode = bodySetterCall.getArgument(1) and contentTypeString = "text/html" or - // signature: func (*Context).JSON(code int, data interface{}) error + // signature: func (*Context) JSON(code int, data interface{}) error methodName = "JSON" and bodyNode = bodySetterCall.getArgument(1) and contentTypeString = "application/json" or - // signature: func (*Context).JSONBlob(code int, bs []byte) error + // signature: func (*Context) JSONBlob(code int, bs []byte) error methodName = "JSONBlob" and bodyNode = bodySetterCall.getArgument(1) and contentTypeString = "application/json" or - // signature: func (*Context).JSONP(code int, data interface{}) error + // signature: func (*Context) JSONP(code int, data interface{}) error methodName = "JSONP" and bodyNode = bodySetterCall.getArgument(1) and contentTypeString = "application/javascript" or - // signature: func (*Context).JSONPBlob(code int, bs []byte) error + // signature: func (*Context) JSONPBlob(code int, bs []byte) error methodName = "JSONPBlob" and bodyNode = bodySetterCall.getArgument(1) and contentTypeString = "application/javascript" or - // signature: func (*Context).JSONPCallback(code int, callback string, data interface{}) error + // signature: func (*Context) JSONPCallback(code int, callback string, data interface{}) error methodName = "JSONPCallback" and bodyNode = bodySetterCall.getArgument(2) and contentTypeString = "application/javascript" or - // signature: func (*Context).JSONPCallbackBlob(code int, callback string, bs []byte) (err error) + // signature: func (*Context) JSONPCallbackBlob(code int, callback string, bs []byte) (err error) methodName = "JSONPCallbackBlob" and bodyNode = bodySetterCall.getArgument(2) and contentTypeString = "application/javascript" or - // signature: func (*Context).String(code int, s string) error + // signature: func (*Context) String(code int, s string) error methodName = "String" and bodyNode = bodySetterCall.getArgument(1) and contentTypeString = "text/plain" or - // signature: func (*Context).StringBlob(code int, bs []byte) error + // signature: func (*Context) StringBlob(code int, bs []byte) error methodName = "StringBlob" and bodyNode = bodySetterCall.getArgument(1) and contentTypeString = "text/plain" or - // signature: func (*Context).Stringf(code int, format string, a ...interface{}) error + // signature: func (*Context) Stringf(code int, format string, a ...interface{}) error methodName = "Stringf" and bodyNode = bodySetterCall.getArgument([1, any(int i | i >= 2)]) and contentTypeString = "text/plain" or - // signature: func (*Context).XML(code int, data interface{}) error + // signature: func (*Context) XML(code int, data interface{}) error methodName = "XML" and bodyNode = bodySetterCall.getArgument(1) and contentTypeString = "text/xml" or - // signature: func (*Context).XMLBlob(code int, bs []byte) error + // signature: func (*Context) XMLBlob(code int, bs []byte) error methodName = "XMLBlob" and bodyNode = bodySetterCall.getArgument(1) and contentTypeString = "text/xml" @@ -335,12 +335,12 @@ private module CleverGo { // Receiver type: Context receiverName = "Context" and ( - // signature: func (*Context).Blob(code int, contentType string, bs []byte) (err error) + // signature: func (*Context) Blob(code int, contentType string, bs []byte) (err error) methodName = "Blob" and bodyNode = bodySetterCall.getArgument(2) and contentTypeNode = bodySetterCall.getArgument(1) or - // signature: func (*Context).Emit(code int, contentType string, body string) (err error) + // signature: func (*Context) Emit(code int, contentType string, body string) (err error) methodName = "Emit" and bodyNode = bodySetterCall.getArgument(2) and contentTypeNode = bodySetterCall.getArgument(1) @@ -378,11 +378,11 @@ private module CleverGo { // Receiver type: Context receiverName = "Context" and ( - // signature: func (*Context).Write(data []byte) (int, error) + // signature: func (*Context) Write(data []byte) (int, error) methodName = "Write" and bodyNode = bodySetterCall.getArgument(0) or - // signature: func (*Context).WriteString(data string) (int, error) + // signature: func (*Context) WriteString(data string) (int, error) methodName = "WriteString" and bodyNode = bodySetterCall.getArgument(0) ) @@ -425,7 +425,7 @@ private module CleverGo { // Receiver type: Context receiverName = "Context" and ( - // signature: func (*Context).SetHeader(key string, value string) + // signature: func (*Context) SetHeader(key string, value string) methodName = "SetHeader" and headerNameNode = headerSetterCall.getArgument(0) and headerValueNode = headerSetterCall.getArgument(1) @@ -471,19 +471,19 @@ private module CleverGo { // Receiver type: Context receiverName = "Context" and ( - // signature: func (*Context).SetContentTypeHTML() + // signature: func (*Context) SetContentTypeHTML() methodName = "SetContentTypeHTML" and valueString = "text/html" or - // signature: func (*Context).SetContentTypeJSON() + // signature: func (*Context) SetContentTypeJSON() methodName = "SetContentTypeJSON" and valueString = "application/json" or - // signature: func (*Context).SetContentTypeText() + // signature: func (*Context) SetContentTypeText() methodName = "SetContentTypeText" and valueString = "text/plain" or - // signature: func (*Context).SetContentTypeXML() + // signature: func (*Context) SetContentTypeXML() methodName = "SetContentTypeXML" and valueString = "text/xml" ) @@ -526,7 +526,7 @@ private module CleverGo { // Receiver type: Context receiverName = "Context" and ( - // signature: func (*Context).SetContentType(v string) + // signature: func (*Context) SetContentType(v string) methodName = "SetContentType" and valueNode = setterCall.getArgument(0) ) diff --git a/ql/src/experimental/frameworks/Fiber.qll b/ql/src/experimental/frameworks/Fiber.qll index 08a0d961d41..a3240a0b85a 100644 --- a/ql/src/experimental/frameworks/Fiber.qll +++ b/ql/src/experimental/frameworks/Fiber.qll @@ -138,7 +138,7 @@ private module Fiber { package = fiberPackagePath() and // Receiver type: Ctx ( - // signature: func (*Ctx).Redirect(location string, status ...int) + // signature: func (*Ctx) Redirect(location string, status ...int) this = any(Method m | m.hasQualifiedName(package, "Ctx", "Redirect")).getACall() and urlNode = this.getArgument(0) ) @@ -184,12 +184,12 @@ private module Fiber { // Receiver type: Ctx receiverName = "Ctx" and ( - // signature: func (*Ctx).Append(field string, values ...string) + // signature: func (*Ctx) Append(field string, values ...string) methodName = "Append" and headerNameNode = headerSetterCall.getArgument(0) and headerValueNode = headerSetterCall.getArgument(any(int i | i >= 1)) or - // signature: func (*Ctx).Set(key string, val string) + // signature: func (*Ctx) Set(key string, val string) methodName = "Set" and headerNameNode = headerSetterCall.getArgument(0) and headerValueNode = headerSetterCall.getArgument(1) @@ -231,12 +231,12 @@ private module Fiber { // Receiver type: Ctx receiverName = "Ctx" and ( - // signature: func (*Ctx).JSON(data interface{}) error + // signature: func (*Ctx) JSON(data interface{}) error methodName = "JSON" and bodyNode = bodySetterCall.getArgument(0) and contentTypeString = "application/json" or - // signature: func (*Ctx).JSONP(data interface{}, callback ...string) error + // signature: func (*Ctx) JSONP(data interface{}, callback ...string) error methodName = "JSONP" and bodyNode = bodySetterCall.getArgument(0) and contentTypeString = "application/javascript" @@ -274,27 +274,27 @@ private module Fiber { // Receiver type: Ctx receiverName = "Ctx" and ( - // signature: func (*Ctx).Format(body interface{}) + // signature: func (*Ctx) Format(body interface{}) methodName = "Format" and bodyNode = bodySetterCall.getArgument(0) or - // signature: func (*Ctx).Send(bodies ...interface{}) + // signature: func (*Ctx) Send(bodies ...interface{}) methodName = "Send" and bodyNode = bodySetterCall.getArgument(_) or - // signature: func (*Ctx).SendBytes(body []byte) + // signature: func (*Ctx) SendBytes(body []byte) methodName = "SendBytes" and bodyNode = bodySetterCall.getArgument(0) or - // signature: func (*Ctx).SendStream(stream io.Reader, size ...int) + // signature: func (*Ctx) SendStream(stream io.Reader, size ...int) methodName = "SendStream" and bodyNode = bodySetterCall.getArgument(0) or - // signature: func (*Ctx).SendString(body string) + // signature: func (*Ctx) SendString(body string) methodName = "SendString" and bodyNode = bodySetterCall.getArgument(0) or - // signature: func (*Ctx).Write(bodies ...interface{}) + // signature: func (*Ctx) Write(bodies ...interface{}) methodName = "Write" and bodyNode = bodySetterCall.getArgument(_) ) @@ -314,71 +314,71 @@ private module Fiber { | receiverName = "Ctx" and ( - // signature: func (*Ctx).BaseURL() string + // signature: func (*Ctx) BaseURL() string methodName = "BaseURL" and out.isResult() or - // signature: func (*Ctx).Body() string + // signature: func (*Ctx) Body() string methodName = "Body" and out.isResult() or - // signature: func (*Ctx).BodyParser(out interface{}) error + // signature: func (*Ctx) BodyParser(out interface{}) error methodName = "BodyParser" and out.isParameter(0) or - // signature: func (*Ctx).Cookies(key string, defaultValue ...string) string + // signature: func (*Ctx) Cookies(key string, defaultValue ...string) string methodName = "Cookies" and out.isResult() or - // signature: func (*Ctx).FormFile(key string) (*mime/multipart.FileHeader, error) + // signature: func (*Ctx) FormFile(key string) (*mime/multipart.FileHeader, error) methodName = "FormFile" and out.isResult(0) or - // signature: func (*Ctx).FormValue(key string) (value string) + // signature: func (*Ctx) FormValue(key string) (value string) methodName = "FormValue" and out.isResult() or - // signature: func (*Ctx).Get(key string, defaultValue ...string) string + // signature: func (*Ctx) Get(key string, defaultValue ...string) string methodName = "Get" and out.isResult() or - // signature: func (*Ctx).Hostname() string + // signature: func (*Ctx) Hostname() string methodName = "Hostname" and out.isResult() or - // signature: func (*Ctx).Method(override ...string) string + // signature: func (*Ctx) Method(override ...string) string methodName = "Method" and out.isResult() or - // signature: func (*Ctx).MultipartForm() (*mime/multipart.Form, error) + // signature: func (*Ctx) MultipartForm() (*mime/multipart.Form, error) methodName = "MultipartForm" and out.isResult(0) or - // signature: func (*Ctx).OriginalURL() string + // signature: func (*Ctx) OriginalURL() string methodName = "OriginalURL" and out.isResult() or - // signature: func (*Ctx).Params(key string, defaultValue ...string) string + // signature: func (*Ctx) Params(key string, defaultValue ...string) string methodName = "Params" and out.isResult() or - // signature: func (*Ctx).Path(override ...string) string + // signature: func (*Ctx) Path(override ...string) string methodName = "Path" and out.isResult() or - // signature: func (*Ctx).Query(key string, defaultValue ...string) string + // signature: func (*Ctx) Query(key string, defaultValue ...string) string methodName = "Query" and out.isResult() or - // signature: func (*Ctx).QueryParser(out interface{}) error + // signature: func (*Ctx) QueryParser(out interface{}) error methodName = "QueryParser" and out.isParameter(0) or - // signature: func (*Ctx).Range(size int) (rangeData Range, err error) + // signature: func (*Ctx) Range(size int) (rangeData Range, err error) methodName = "Range" and out.isResult(0) or - // signature: func (*Ctx).Subdomains(offset ...int) []string + // signature: func (*Ctx) Subdomains(offset ...int) []string methodName = "Subdomains" and out.isResult() ) diff --git a/ql/src/semmle/go/frameworks/stdlib/ArchiveTar.qll b/ql/src/semmle/go/frameworks/stdlib/ArchiveTar.qll index 4b57dd6919c..baaf8ca603f 100644 --- a/ql/src/semmle/go/frameworks/stdlib/ArchiveTar.qll +++ b/ql/src/semmle/go/frameworks/stdlib/ArchiveTar.qll @@ -35,15 +35,15 @@ module ArchiveTar { MethodModels() { // Methods: - // signature: func (*Header).FileInfo() os.FileInfo + // signature: func (*Header) FileInfo() os.FileInfo hasQualifiedName("archive/tar", "Header", "FileInfo") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*Reader).Next() (*Header, error) + // signature: func (*Reader) Next() (*Header, error) hasQualifiedName("archive/tar", "Reader", "Next") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Writer).WriteHeader(hdr *Header) error + // signature: func (*Writer) WriteHeader(hdr *Header) error hasQualifiedName("archive/tar", "Writer", "WriteHeader") and (inp.isParameter(0) and outp.isReceiver()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/ArchiveZip.qll b/ql/src/semmle/go/frameworks/stdlib/ArchiveZip.qll index e1e480b285f..02a51b54ffb 100644 --- a/ql/src/semmle/go/frameworks/stdlib/ArchiveZip.qll +++ b/ql/src/semmle/go/frameworks/stdlib/ArchiveZip.qll @@ -38,15 +38,15 @@ module ArchiveZip { FunctionOutput outp; MethodModels() { - // signature: func (*File).Open() (io.ReadCloser, error) + // signature: func (*File) Open() (io.ReadCloser, error) hasQualifiedName("archive/zip", "File", "Open") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Writer).Create(name string) (io.Writer, error) + // signature: func (*Writer) Create(name string) (io.Writer, error) hasQualifiedName("archive/zip", "Writer", "Create") and (inp.isResult(0) and outp.isReceiver()) or - // signature: func (*Writer).CreateHeader(fh *FileHeader) (io.Writer, error) + // signature: func (*Writer) CreateHeader(fh *FileHeader) (io.Writer, error) hasQualifiedName("archive/zip", "Writer", "CreateHeader") and (inp.isResult(0) and outp.isReceiver()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/Bufio.qll b/ql/src/semmle/go/frameworks/stdlib/Bufio.qll index 4c81861a12c..dc0fa3a5cc6 100644 --- a/ql/src/semmle/go/frameworks/stdlib/Bufio.qll +++ b/ql/src/semmle/go/frameworks/stdlib/Bufio.qll @@ -79,39 +79,39 @@ module Bufio { FunctionOutput outp; MethodModels() { - // signature: func (*Reader).Peek(n int) ([]byte, error) + // signature: func (*Reader) Peek(n int) ([]byte, error) hasQualifiedName("bufio", "Reader", "Peek") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Reader).ReadBytes(delim byte) ([]byte, error) + // signature: func (*Reader) ReadBytes(delim byte) ([]byte, error) hasQualifiedName("bufio", "Reader", "ReadBytes") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Reader).ReadLine() (line []byte, isPrefix bool, err error) + // signature: func (*Reader) ReadLine() (line []byte, isPrefix bool, err error) hasQualifiedName("bufio", "Reader", "ReadLine") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Reader).ReadSlice(delim byte) (line []byte, err error) + // signature: func (*Reader) ReadSlice(delim byte) (line []byte, err error) hasQualifiedName("bufio", "Reader", "ReadSlice") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Reader).ReadString(delim byte) (string, error) + // signature: func (*Reader) ReadString(delim byte) (string, error) hasQualifiedName("bufio", "Reader", "ReadString") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Reader).Reset(r io.Reader) + // signature: func (*Reader) Reset(r io.Reader) hasQualifiedName("bufio", "Reader", "Reset") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (*Scanner).Bytes() []byte + // signature: func (*Scanner) Bytes() []byte hasQualifiedName("bufio", "Scanner", "Bytes") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*Scanner).Text() string + // signature: func (*Scanner) Text() string hasQualifiedName("bufio", "Scanner", "Text") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*Writer).Reset(w io.Writer) + // signature: func (*Writer) Reset(w io.Writer) hasQualifiedName("bufio", "Writer", "Reset") and (inp.isReceiver() and outp.isParameter(0)) } diff --git a/ql/src/semmle/go/frameworks/stdlib/Bytes.qll b/ql/src/semmle/go/frameworks/stdlib/Bytes.qll index c87d69b4541..c2791b1eaa3 100644 --- a/ql/src/semmle/go/frameworks/stdlib/Bytes.qll +++ b/ql/src/semmle/go/frameworks/stdlib/Bytes.qll @@ -150,23 +150,23 @@ module Bytes { FunctionOutput outp; MethodModels() { - // signature: func (*Buffer).Bytes() []byte + // signature: func (*Buffer) Bytes() []byte hasQualifiedName("bytes", "Buffer", "Bytes") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*Buffer).Next(n int) []byte + // signature: func (*Buffer) Next(n int) []byte hasQualifiedName("bytes", "Buffer", "Next") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*Buffer).ReadBytes(delim byte) (line []byte, err error) + // signature: func (*Buffer) ReadBytes(delim byte) (line []byte, err error) hasQualifiedName("bytes", "Buffer", "ReadBytes") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Buffer).ReadString(delim byte) (line string, err error) + // signature: func (*Buffer) ReadString(delim byte) (line string, err error) hasQualifiedName("bytes", "Buffer", "ReadString") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Reader).Reset(b []byte) + // signature: func (*Reader) Reset(b []byte) hasQualifiedName("bytes", "Reader", "Reset") and (inp.isParameter(0) and outp.isReceiver()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/CompressFlate.qll b/ql/src/semmle/go/frameworks/stdlib/CompressFlate.qll index dee4bf9aca3..a26ad967699 100644 --- a/ql/src/semmle/go/frameworks/stdlib/CompressFlate.qll +++ b/ql/src/semmle/go/frameworks/stdlib/CompressFlate.qll @@ -38,11 +38,11 @@ module CompressFlate { FunctionOutput outp; MethodModels() { - // signature: func (*Writer).Reset(dst io.Writer) + // signature: func (*Writer) Reset(dst io.Writer) hasQualifiedName("compress/flate", "Writer", "Reset") and (inp.isReceiver() and outp.isParameter(0)) or - // signature: func (Resetter).Reset(r io.Reader, dict []byte) error + // signature: func (Resetter) Reset(r io.Reader, dict []byte) error implements("compress/flate", "Resetter", "Reset") and (inp.isParameter(0) and outp.isReceiver()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/CompressGzip.qll b/ql/src/semmle/go/frameworks/stdlib/CompressGzip.qll index 772ee24cded..366f8c7a634 100644 --- a/ql/src/semmle/go/frameworks/stdlib/CompressGzip.qll +++ b/ql/src/semmle/go/frameworks/stdlib/CompressGzip.qll @@ -34,11 +34,11 @@ module CompressGzip { FunctionOutput outp; MethodModels() { - // signature: func (*Reader).Reset(r io.Reader) error + // signature: func (*Reader) Reset(r io.Reader) error hasQualifiedName("compress/gzip", "Reader", "Reset") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (*Writer).Reset(w io.Writer) + // signature: func (*Writer) Reset(w io.Writer) hasQualifiedName("compress/gzip", "Writer", "Reset") and (inp.isReceiver() and outp.isParameter(0)) } diff --git a/ql/src/semmle/go/frameworks/stdlib/CompressZlib.qll b/ql/src/semmle/go/frameworks/stdlib/CompressZlib.qll index 91f1b62318e..ab88b6319aa 100644 --- a/ql/src/semmle/go/frameworks/stdlib/CompressZlib.qll +++ b/ql/src/semmle/go/frameworks/stdlib/CompressZlib.qll @@ -42,11 +42,11 @@ module CompressZlib { FunctionOutput outp; MethodModels() { - // signature: func (*Writer).Reset(w io.Writer) + // signature: func (*Writer) Reset(w io.Writer) hasQualifiedName("compress/zlib", "Writer", "Reset") and (inp.isReceiver() and outp.isParameter(0)) or - // signature: func (Resetter).Reset(r io.Reader, dict []byte) error + // signature: func (Resetter) Reset(r io.Reader, dict []byte) error implements("compress/zlib", "Resetter", "Reset") and (inp.isParameter(0) and outp.isReceiver()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/ContainerHeap.qll b/ql/src/semmle/go/frameworks/stdlib/ContainerHeap.qll index c62e5fe4725..ddd8c602c51 100644 --- a/ql/src/semmle/go/frameworks/stdlib/ContainerHeap.qll +++ b/ql/src/semmle/go/frameworks/stdlib/ContainerHeap.qll @@ -34,11 +34,11 @@ module ContainerHeap { FunctionOutput outp; MethodModels() { - // signature: func (Interface).Pop() interface{} + // signature: func (Interface) Pop() interface{} implements("container/heap", "Interface", "Pop") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Interface).Push(x interface{}) + // signature: func (Interface) Push(x interface{}) implements("container/heap", "Interface", "Push") and (inp.isParameter(0) and outp.isReceiver()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/ContainerList.qll b/ql/src/semmle/go/frameworks/stdlib/ContainerList.qll index 3b44e3c8bed..6efa1e96b8e 100644 --- a/ql/src/semmle/go/frameworks/stdlib/ContainerList.qll +++ b/ql/src/semmle/go/frameworks/stdlib/ContainerList.qll @@ -11,79 +11,79 @@ module ContainerList { FunctionOutput outp; MethodModels() { - // signature: func (*Element).Next() *Element + // signature: func (*Element) Next() *Element hasQualifiedName("container/list", "Element", "Next") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*Element).Prev() *Element + // signature: func (*Element) Prev() *Element hasQualifiedName("container/list", "Element", "Prev") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*List).Back() *Element + // signature: func (*List) Back() *Element hasQualifiedName("container/list", "List", "Back") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*List).Front() *Element + // signature: func (*List) Front() *Element hasQualifiedName("container/list", "List", "Front") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*List).Init() *List + // signature: func (*List) Init() *List hasQualifiedName("container/list", "List", "Init") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*List).InsertAfter(v interface{}, mark *Element) *Element + // signature: func (*List) InsertAfter(v interface{}, mark *Element) *Element hasQualifiedName("container/list", "List", "InsertAfter") and ( inp.isParameter(0) and (outp.isReceiver() or outp.isResult()) ) or - // signature: func (*List).InsertBefore(v interface{}, mark *Element) *Element + // signature: func (*List) InsertBefore(v interface{}, mark *Element) *Element hasQualifiedName("container/list", "List", "InsertBefore") and ( inp.isParameter(0) and (outp.isReceiver() or outp.isResult()) ) or - // signature: func (*List).MoveAfter(e *Element, mark *Element) + // signature: func (*List) MoveAfter(e *Element, mark *Element) hasQualifiedName("container/list", "List", "MoveAfter") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (*List).MoveBefore(e *Element, mark *Element) + // signature: func (*List) MoveBefore(e *Element, mark *Element) hasQualifiedName("container/list", "List", "MoveBefore") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (*List).MoveToBack(e *Element) + // signature: func (*List) MoveToBack(e *Element) hasQualifiedName("container/list", "List", "MoveToBack") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (*List).MoveToFront(e *Element) + // signature: func (*List) MoveToFront(e *Element) hasQualifiedName("container/list", "List", "MoveToFront") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (*List).PushBack(v interface{}) *Element + // signature: func (*List) PushBack(v interface{}) *Element hasQualifiedName("container/list", "List", "PushBack") and ( inp.isParameter(0) and (outp.isReceiver() or outp.isResult()) ) or - // signature: func (*List).PushBackList(other *List) + // signature: func (*List) PushBackList(other *List) hasQualifiedName("container/list", "List", "PushBackList") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (*List).PushFront(v interface{}) *Element + // signature: func (*List) PushFront(v interface{}) *Element hasQualifiedName("container/list", "List", "PushFront") and ( inp.isParameter(0) and (outp.isReceiver() or outp.isResult()) ) or - // signature: func (*List).PushFrontList(other *List) + // signature: func (*List) PushFrontList(other *List) hasQualifiedName("container/list", "List", "PushFrontList") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (*List).Remove(e *Element) interface{} + // signature: func (*List) Remove(e *Element) interface{} hasQualifiedName("container/list", "List", "Remove") and (inp.isParameter(0) and outp.isResult()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/ContainerRing.qll b/ql/src/semmle/go/frameworks/stdlib/ContainerRing.qll index 94b83b6faf2..7463c0455f6 100644 --- a/ql/src/semmle/go/frameworks/stdlib/ContainerRing.qll +++ b/ql/src/semmle/go/frameworks/stdlib/ContainerRing.qll @@ -11,23 +11,23 @@ module ContainerRing { FunctionOutput outp; MethodModels() { - // signature: func (*Ring).Link(s *Ring) *Ring + // signature: func (*Ring) Link(s *Ring) *Ring hasQualifiedName("container/ring", "Ring", "Link") and (inp.isParameter(0) and outp.isResult()) or - // signature: func (*Ring).Move(n int) *Ring + // signature: func (*Ring) Move(n int) *Ring hasQualifiedName("container/ring", "Ring", "Move") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*Ring).Next() *Ring + // signature: func (*Ring) Next() *Ring hasQualifiedName("container/ring", "Ring", "Next") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*Ring).Prev() *Ring + // signature: func (*Ring) Prev() *Ring hasQualifiedName("container/ring", "Ring", "Prev") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*Ring).Unlink(n int) *Ring + // signature: func (*Ring) Unlink(n int) *Ring hasQualifiedName("container/ring", "Ring", "Unlink") and (inp.isReceiver() and outp.isResult()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/Context.qll b/ql/src/semmle/go/frameworks/stdlib/Context.qll index d8e7a133726..d65aa5c68dd 100644 --- a/ql/src/semmle/go/frameworks/stdlib/Context.qll +++ b/ql/src/semmle/go/frameworks/stdlib/Context.qll @@ -46,7 +46,7 @@ module Context { FunctionOutput outp; MethodModels() { - // signature: func (Context).Value(key interface{}) interface{} + // signature: func (Context) Value(key interface{}) interface{} implements(packagePath(), "Context", "Value") and (inp.isReceiver() and outp.isResult()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/Crypto.qll b/ql/src/semmle/go/frameworks/stdlib/Crypto.qll index bf9e32086b2..f1517304f7c 100644 --- a/ql/src/semmle/go/frameworks/stdlib/Crypto.qll +++ b/ql/src/semmle/go/frameworks/stdlib/Crypto.qll @@ -11,7 +11,7 @@ module Crypto { FunctionOutput outp; MethodModels() { - // signature: func (Decrypter).Decrypt(rand io.Reader, msg []byte, opts DecrypterOpts) (plaintext []byte, err error) + // signature: func (Decrypter) Decrypt(rand io.Reader, msg []byte, opts DecrypterOpts) (plaintext []byte, err error) implements("crypto", "Decrypter", "Decrypt") and (inp.isParameter(1) and outp.isResult(0)) } diff --git a/ql/src/semmle/go/frameworks/stdlib/CryptoCipher.qll b/ql/src/semmle/go/frameworks/stdlib/CryptoCipher.qll index 8575afd3adb..a4817fe03b0 100644 --- a/ql/src/semmle/go/frameworks/stdlib/CryptoCipher.qll +++ b/ql/src/semmle/go/frameworks/stdlib/CryptoCipher.qll @@ -11,11 +11,11 @@ module CryptoCipher { FunctionOutput outp; MethodModels() { - // signature: func (Block).Decrypt(dst []byte, src []byte) + // signature: func (Block) Decrypt(dst []byte, src []byte) implements("crypto/cipher", "Block", "Decrypt") and (inp.isParameter(1) and outp.isParameter(0)) or - // signature: func (AEAD).Open(dst []byte, nonce []byte, ciphertext []byte, additionalData []byte) ([]byte, error) + // signature: func (AEAD) Open(dst []byte, nonce []byte, ciphertext []byte, additionalData []byte) ([]byte, error) implements("crypto/cipher", "AEAD", "Open") and ( inp.isParameter(2) and diff --git a/ql/src/semmle/go/frameworks/stdlib/CryptoRsa.qll b/ql/src/semmle/go/frameworks/stdlib/CryptoRsa.qll index d43fd282baf..6b48847d6bf 100644 --- a/ql/src/semmle/go/frameworks/stdlib/CryptoRsa.qll +++ b/ql/src/semmle/go/frameworks/stdlib/CryptoRsa.qll @@ -30,7 +30,7 @@ module CryptoRsa { FunctionOutput outp; MethodModels() { - // signature: func (*PrivateKey).Decrypt(rand io.Reader, ciphertext []byte, opts crypto.DecrypterOpts) (plaintext []byte, err error) + // signature: func (*PrivateKey) Decrypt(rand io.Reader, ciphertext []byte, opts crypto.DecrypterOpts) (plaintext []byte, err error) hasQualifiedName("crypto/rsa", "PrivateKey", "Decrypt") and (inp.isParameter(1) and outp.isResult(0)) } diff --git a/ql/src/semmle/go/frameworks/stdlib/DatabaseSql.qll b/ql/src/semmle/go/frameworks/stdlib/DatabaseSql.qll index 85cf5adeeaf..fa6bf309fa7 100644 --- a/ql/src/semmle/go/frameworks/stdlib/DatabaseSql.qll +++ b/ql/src/semmle/go/frameworks/stdlib/DatabaseSql.qll @@ -128,15 +128,15 @@ module DatabaseSql { FunctionOutput outp; SqlMethodModels() { - // signature: func (*Row).Scan(dest ...interface{}) error + // signature: func (*Row) Scan(dest ...interface{}) error this.hasQualifiedName("database/sql", "Row", "Scan") and (inp.isReceiver() and outp.isParameter(_)) or - // signature: func (*Rows).Scan(dest ...interface{}) error + // signature: func (*Rows) Scan(dest ...interface{}) error this.hasQualifiedName("database/sql", "Rows", "Scan") and (inp.isReceiver() and outp.isParameter(_)) or - // signature: func (Scanner).Scan(src interface{}) error + // signature: func (Scanner) Scan(src interface{}) error this.implements("database/sql", "Scanner", "Scan") and (inp.isParameter(0) and outp.isReceiver()) or @@ -159,27 +159,27 @@ module DatabaseSql { FunctionOutput outp; SqlDriverMethodModels() { - // signature: func (NotNull).ConvertValue(v interface{}) (Value, error) + // signature: func (NotNull) ConvertValue(v interface{}) (Value, error) this.hasQualifiedName("database/sql/driver", "NotNull", "ConvertValue") and (inp.isParameter(0) and outp.isResult(0)) or - // signature: func (Null).ConvertValue(v interface{}) (Value, error) + // signature: func (Null) ConvertValue(v interface{}) (Value, error) this.hasQualifiedName("database/sql/driver", "Null", "ConvertValue") and (inp.isParameter(0) and outp.isResult(0)) or - // signature: func (ValueConverter).ConvertValue(v interface{}) (Value, error) + // signature: func (ValueConverter) ConvertValue(v interface{}) (Value, error) this.implements("database/sql/driver", "ValueConverter", "ConvertValue") and (inp.isParameter(0) and outp.isResult(0)) or - // signature: func (Conn).Prepare(query string) (Stmt, error) + // signature: func (Conn) Prepare(query string) (Stmt, error) this.implements("database/sql/driver", "Conn", "Prepare") and (inp.isParameter(0) and outp.isResult(0)) or - // signature: func (ConnPrepareContext).PrepareContext(ctx context.Context, query string) (Stmt, error) + // signature: func (ConnPrepareContext) PrepareContext(ctx context.Context, query string) (Stmt, error) this.implements("database/sql/driver", "ConnPrepareContext", "PrepareContext") and (inp.isParameter(1) and outp.isResult(0)) or - // signature: func (Valuer).Value() (Value, error) + // signature: func (Valuer) Value() (Value, error) this.implements("database/sql/driver", "Valuer", "Value") and (inp.isReceiver() and outp.isResult(0)) } diff --git a/ql/src/semmle/go/frameworks/stdlib/Encoding.qll b/ql/src/semmle/go/frameworks/stdlib/Encoding.qll index 732434489d1..767d2d64cd8 100644 --- a/ql/src/semmle/go/frameworks/stdlib/Encoding.qll +++ b/ql/src/semmle/go/frameworks/stdlib/Encoding.qll @@ -11,19 +11,19 @@ module Encoding { FunctionOutput outp; MethodModels() { - // signature: func (BinaryMarshaler).MarshalBinary() (data []byte, err error) + // signature: func (BinaryMarshaler) MarshalBinary() (data []byte, err error) implements("encoding", "BinaryMarshaler", "MarshalBinary") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (TextMarshaler).MarshalText() (text []byte, err error) + // signature: func (TextMarshaler) MarshalText() (text []byte, err error) implements("encoding", "TextMarshaler", "MarshalText") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (BinaryUnmarshaler).UnmarshalBinary(data []byte) error + // signature: func (BinaryUnmarshaler) UnmarshalBinary(data []byte) error implements("encoding", "BinaryUnmarshaler", "UnmarshalBinary") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (TextUnmarshaler).UnmarshalText(text []byte) error + // signature: func (TextUnmarshaler) UnmarshalText(text []byte) error implements("encoding", "TextUnmarshaler", "UnmarshalText") and (inp.isParameter(0) and outp.isReceiver()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/EncodingBase32.qll b/ql/src/semmle/go/frameworks/stdlib/EncodingBase32.qll index 2d9dd67ec11..d1eae83abc2 100644 --- a/ql/src/semmle/go/frameworks/stdlib/EncodingBase32.qll +++ b/ql/src/semmle/go/frameworks/stdlib/EncodingBase32.qll @@ -26,11 +26,11 @@ module EncodingBase32 { FunctionOutput outp; MethodModels() { - // signature: func (*Encoding).Decode(dst []byte, src []byte) (n int, err error) + // signature: func (*Encoding) Decode(dst []byte, src []byte) (n int, err error) hasQualifiedName("encoding/base32", "Encoding", "Decode") and (inp.isParameter(1) and outp.isParameter(0)) or - // signature: func (*Encoding).DecodeString(s string) ([]byte, error) + // signature: func (*Encoding) DecodeString(s string) ([]byte, error) hasQualifiedName("encoding/base32", "Encoding", "DecodeString") and (inp.isParameter(0) and outp.isResult(0)) } diff --git a/ql/src/semmle/go/frameworks/stdlib/EncodingBase64.qll b/ql/src/semmle/go/frameworks/stdlib/EncodingBase64.qll index a70a4afe648..82a68b5d0c2 100644 --- a/ql/src/semmle/go/frameworks/stdlib/EncodingBase64.qll +++ b/ql/src/semmle/go/frameworks/stdlib/EncodingBase64.qll @@ -26,11 +26,11 @@ module EncodingBase64 { FunctionOutput outp; MethodModels() { - // signature: func (*Encoding).Decode(dst []byte, src []byte) (n int, err error) + // signature: func (*Encoding) Decode(dst []byte, src []byte) (n int, err error) hasQualifiedName("encoding/base64", "Encoding", "Decode") and (inp.isParameter(1) and outp.isParameter(0)) or - // signature: func (*Encoding).DecodeString(s string) ([]byte, error) + // signature: func (*Encoding) DecodeString(s string) ([]byte, error) hasQualifiedName("encoding/base64", "Encoding", "DecodeString") and (inp.isParameter(0) and outp.isResult(0)) } diff --git a/ql/src/semmle/go/frameworks/stdlib/EncodingCsv.qll b/ql/src/semmle/go/frameworks/stdlib/EncodingCsv.qll index f5c0d32e2bb..481dce5a5fd 100644 --- a/ql/src/semmle/go/frameworks/stdlib/EncodingCsv.qll +++ b/ql/src/semmle/go/frameworks/stdlib/EncodingCsv.qll @@ -30,19 +30,19 @@ module EncodingCsv { FunctionOutput outp; MethodModels() { - // signature: func (*Reader).Read() (record []string, err error) + // signature: func (*Reader) Read() (record []string, err error) hasQualifiedName("encoding/csv", "Reader", "Read") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Reader).ReadAll() (records [][]string, err error) + // signature: func (*Reader) ReadAll() (records [][]string, err error) hasQualifiedName("encoding/csv", "Reader", "ReadAll") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Writer).Write(record []string) error + // signature: func (*Writer) Write(record []string) error hasQualifiedName("encoding/csv", "Writer", "Write") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (*Writer).WriteAll(records [][]string) error + // signature: func (*Writer) WriteAll(records [][]string) error hasQualifiedName("encoding/csv", "Writer", "WriteAll") and (inp.isParameter(0) and outp.isReceiver()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/EncodingGob.qll b/ql/src/semmle/go/frameworks/stdlib/EncodingGob.qll index 98958be76db..19f7c1c6004 100644 --- a/ql/src/semmle/go/frameworks/stdlib/EncodingGob.qll +++ b/ql/src/semmle/go/frameworks/stdlib/EncodingGob.qll @@ -30,27 +30,27 @@ module EncodingGob { FunctionOutput outp; MethodModels() { - // signature: func (*Decoder).Decode(e interface{}) error + // signature: func (*Decoder) Decode(e interface{}) error hasQualifiedName("encoding/gob", "Decoder", "Decode") and (inp.isReceiver() and outp.isParameter(0)) or - // signature: func (*Decoder).DecodeValue(v reflect.Value) error + // signature: func (*Decoder) DecodeValue(v reflect.Value) error hasQualifiedName("encoding/gob", "Decoder", "DecodeValue") and (inp.isReceiver() and outp.isParameter(0)) or - // signature: func (*Encoder).Encode(e interface{}) error + // signature: func (*Encoder) Encode(e interface{}) error hasQualifiedName("encoding/gob", "Encoder", "Encode") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (*Encoder).EncodeValue(value reflect.Value) error + // signature: func (*Encoder) EncodeValue(value reflect.Value) error hasQualifiedName("encoding/gob", "Encoder", "EncodeValue") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (GobDecoder).GobDecode([]byte) error + // signature: func (GobDecoder) GobDecode([]byte) error implements("encoding/gob", "GobDecoder", "GobDecode") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (GobEncoder).GobEncode() ([]byte, error) + // signature: func (GobEncoder) GobEncode() ([]byte, error) implements("encoding/gob", "GobEncoder", "GobEncode") and (inp.isReceiver() and outp.isResult(0)) } diff --git a/ql/src/semmle/go/frameworks/stdlib/EncodingJson.qll b/ql/src/semmle/go/frameworks/stdlib/EncodingJson.qll index d05cc73c25f..6d58176d85a 100644 --- a/ql/src/semmle/go/frameworks/stdlib/EncodingJson.qll +++ b/ql/src/semmle/go/frameworks/stdlib/EncodingJson.qll @@ -81,31 +81,31 @@ module EncodingJson { FunctionOutput outp; MethodModels() { - // signature: func (*Decoder).Buffered() io.Reader + // signature: func (*Decoder) Buffered() io.Reader hasQualifiedName("encoding/json", "Decoder", "Buffered") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*Decoder).Decode(v interface{}) error + // signature: func (*Decoder) Decode(v interface{}) error hasQualifiedName("encoding/json", "Decoder", "Decode") and (inp.isReceiver() and outp.isParameter(0)) or - // signature: func (*Decoder).Token() (Token, error) + // signature: func (*Decoder) Token() (Token, error) hasQualifiedName("encoding/json", "Decoder", "Token") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Encoder).Encode(v interface{}) error + // signature: func (*Encoder) Encode(v interface{}) error hasQualifiedName("encoding/json", "Encoder", "Encode") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (*Encoder).SetIndent(prefix string, indent string) + // signature: func (*Encoder) SetIndent(prefix string, indent string) hasQualifiedName("encoding/json", "Encoder", "SetIndent") and (inp.isParameter(_) and outp.isReceiver()) or - // signature: func (Marshaler).MarshalJSON() ([]byte, error) + // signature: func (Marshaler) MarshalJSON() ([]byte, error) implements("encoding/json", "Marshaler", "MarshalJSON") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (Unmarshaler).UnmarshalJSON([]byte) error + // signature: func (Unmarshaler) UnmarshalJSON([]byte) error implements("encoding/json", "Unmarshaler", "UnmarshalJSON") and (inp.isParameter(0) and outp.isReceiver()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/EncodingXml.qll b/ql/src/semmle/go/frameworks/stdlib/EncodingXml.qll index 84ddecdd498..14d2e63e961 100644 --- a/ql/src/semmle/go/frameworks/stdlib/EncodingXml.qll +++ b/ql/src/semmle/go/frameworks/stdlib/EncodingXml.qll @@ -82,67 +82,67 @@ module EncodingXml { FunctionOutput outp; MethodModels() { - // signature: func (CharData).Copy() CharData + // signature: func (CharData) Copy() CharData hasQualifiedName("encoding/xml", "CharData", "Copy") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Comment).Copy() Comment + // signature: func (Comment) Copy() Comment hasQualifiedName("encoding/xml", "Comment", "Copy") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*Decoder).Decode(v interface{}) error + // signature: func (*Decoder) Decode(v interface{}) error hasQualifiedName("encoding/xml", "Decoder", "Decode") and (inp.isReceiver() and outp.isParameter(0)) or - // signature: func (*Decoder).DecodeElement(v interface{}, start *StartElement) error + // signature: func (*Decoder) DecodeElement(v interface{}, start *StartElement) error hasQualifiedName("encoding/xml", "Decoder", "DecodeElement") and (inp.isReceiver() and outp.isParameter(0)) or - // signature: func (*Decoder).RawToken() (Token, error) + // signature: func (*Decoder) RawToken() (Token, error) hasQualifiedName("encoding/xml", "Decoder", "RawToken") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Decoder).Token() (Token, error) + // signature: func (*Decoder) Token() (Token, error) hasQualifiedName("encoding/xml", "Decoder", "Token") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (Directive).Copy() Directive + // signature: func (Directive) Copy() Directive hasQualifiedName("encoding/xml", "Directive", "Copy") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*Encoder).Encode(v interface{}) error + // signature: func (*Encoder) Encode(v interface{}) error hasQualifiedName("encoding/xml", "Encoder", "Encode") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (*Encoder).EncodeElement(v interface{}, start StartElement) error + // signature: func (*Encoder) EncodeElement(v interface{}, start StartElement) error hasQualifiedName("encoding/xml", "Encoder", "EncodeElement") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (*Encoder).EncodeToken(t Token) error + // signature: func (*Encoder) EncodeToken(t Token) error hasQualifiedName("encoding/xml", "Encoder", "EncodeToken") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (*Encoder).Indent(prefix string, indent string) + // signature: func (*Encoder) Indent(prefix string, indent string) hasQualifiedName("encoding/xml", "Encoder", "Indent") and (inp.isParameter(_) and outp.isReceiver()) or - // signature: func (ProcInst).Copy() ProcInst + // signature: func (ProcInst) Copy() ProcInst hasQualifiedName("encoding/xml", "ProcInst", "Copy") and (inp.isReceiver() and outp.isResult()) or - // signature: func (StartElement).Copy() StartElement + // signature: func (StartElement) Copy() StartElement hasQualifiedName("encoding/xml", "StartElement", "Copy") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Marshaler).MarshalXML(e *Encoder, start StartElement) error + // signature: func (Marshaler) MarshalXML(e *Encoder, start StartElement) error this.implements("encoding/xml", "Marshaler", "MarshalXML") and (inp.isReceiver() and outp.isParameter(0)) or - // signature: func (TokenReader).Token() (Token, error) + // signature: func (TokenReader) Token() (Token, error) this.implements("encoding/xml", "TokenReader", "Token") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (Unmarshaler).UnmarshalXML(d *Decoder, start StartElement) error + // signature: func (Unmarshaler) UnmarshalXML(d *Decoder, start StartElement) error this.implements("encoding/xml", "Unmarshaler", "UnmarshalXML") and (inp.isParameter(0) and outp.isReceiver()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/Expvar.qll b/ql/src/semmle/go/frameworks/stdlib/Expvar.qll index 1132a4f2350..01fbda900f4 100644 --- a/ql/src/semmle/go/frameworks/stdlib/Expvar.qll +++ b/ql/src/semmle/go/frameworks/stdlib/Expvar.qll @@ -11,27 +11,27 @@ module Expvar { FunctionOutput outp; MethodModels() { - // signature: func (Func).Value() interface{} + // signature: func (Func) Value() interface{} hasQualifiedName("expvar", "Func", "Value") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*Map).Get(key string) Var + // signature: func (*Map) Get(key string) Var hasQualifiedName("expvar", "Map", "Get") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*Map).Set(key string, av Var) + // signature: func (*Map) Set(key string, av Var) hasQualifiedName("expvar", "Map", "Set") and (inp.isParameter(_) and outp.isReceiver()) or - // signature: func (*String).Set(value string) + // signature: func (*String) Set(value string) hasQualifiedName("expvar", "String", "Set") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (*String).Value() string + // signature: func (*String) Value() string hasQualifiedName("expvar", "String", "Value") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Var).String() string + // signature: func (Var) String() string implements("expvar", "Var", "String") and (inp.isReceiver() and outp.isResult()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/Fmt.qll b/ql/src/semmle/go/frameworks/stdlib/Fmt.qll index f3151c579d3..41a833c122a 100644 --- a/ql/src/semmle/go/frameworks/stdlib/Fmt.qll +++ b/ql/src/semmle/go/frameworks/stdlib/Fmt.qll @@ -137,23 +137,23 @@ module Fmt { FunctionOutput outp; MethodModels() { - // signature: func (GoStringer).GoString() string + // signature: func (GoStringer) GoString() string implements("fmt", "GoStringer", "GoString") and (inp.isReceiver() and outp.isResult()) or - // signature: func (ScanState).Read(buf []byte) (n int, err error) + // signature: func (ScanState) Read(buf []byte) (n int, err error) implements("fmt", "ScanState", "Read") and (inp.isReceiver() and outp.isParameter(0)) or - // signature: func (Stringer).String() string + // signature: func (Stringer) String() string implements("fmt", "Stringer", "String") and (inp.isReceiver() and outp.isResult()) or - // signature: func (ScanState).Token(skipSpace bool, f func(rune) bool) (token []byte, err error) + // signature: func (ScanState) Token(skipSpace bool, f func(rune) bool) (token []byte, err error) implements("fmt", "ScanState", "Token") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (State).Write(b []byte) (n int, err error) + // signature: func (State) Write(b []byte) (n int, err error) this.implements("fmt", "State", "Write") and (inp.isParameter(0) and outp.isReceiver()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/HtmlTemplate.qll b/ql/src/semmle/go/frameworks/stdlib/HtmlTemplate.qll index 45a7532afdb..54f3b959593 100644 --- a/ql/src/semmle/go/frameworks/stdlib/HtmlTemplate.qll +++ b/ql/src/semmle/go/frameworks/stdlib/HtmlTemplate.qll @@ -68,11 +68,11 @@ module HtmlTemplate { FunctionOutput outp; MethodModels() { - // signature: func (*Template).Execute(wr io.Writer, data interface{}) error + // signature: func (*Template) Execute(wr io.Writer, data interface{}) error hasQualifiedName("html/template", "Template", "Execute") and (inp.isParameter(1) and outp.isParameter(0)) or - // signature: func (*Template).ExecuteTemplate(wr io.Writer, name string, data interface{}) error + // signature: func (*Template) ExecuteTemplate(wr io.Writer, name string, data interface{}) error hasQualifiedName("html/template", "Template", "ExecuteTemplate") and (inp.isParameter(2) and outp.isParameter(0)) } diff --git a/ql/src/semmle/go/frameworks/stdlib/Io.qll b/ql/src/semmle/go/frameworks/stdlib/Io.qll index 968f45dfe9b..ffd95a660e0 100644 --- a/ql/src/semmle/go/frameworks/stdlib/Io.qll +++ b/ql/src/semmle/go/frameworks/stdlib/Io.qll @@ -81,31 +81,31 @@ module Io { FunctionOutput outp; MethodModels() { - // signature: func (Reader).Read(p []byte) (n int, err error) + // signature: func (Reader) Read(p []byte) (n int, err error) implements("io", "Reader", "Read") and (inp.isReceiver() and outp.isParameter(0)) or - // signature: func (ReaderAt).ReadAt(p []byte, off int64) (n int, err error) + // signature: func (ReaderAt) ReadAt(p []byte, off int64) (n int, err error) implements("io", "ReaderAt", "ReadAt") and (inp.isReceiver() and outp.isParameter(0)) or - // signature: func (ReaderFrom).ReadFrom(r Reader) (n int64, err error) + // signature: func (ReaderFrom) ReadFrom(r Reader) (n int64, err error) implements("io", "ReaderFrom", "ReadFrom") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (Writer).Write(p []byte) (n int, err error) + // signature: func (Writer) Write(p []byte) (n int, err error) implements("io", "Writer", "Write") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (WriterAt).WriteAt(p []byte, off int64) (n int, err error) + // signature: func (WriterAt) WriteAt(p []byte, off int64) (n int, err error) implements("io", "WriterAt", "WriteAt") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (StringWriter).WriteString(s string) (n int, err error) + // signature: func (StringWriter) WriteString(s string) (n int, err error) implements("io", "StringWriter", "WriteString") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (WriterTo).WriteTo(w Writer) (n int64, err error) + // signature: func (WriterTo) WriteTo(w Writer) (n int64, err error) implements("io", "WriterTo", "WriteTo") and (inp.isReceiver() and outp.isParameter(0)) } diff --git a/ql/src/semmle/go/frameworks/stdlib/IoFs.qll b/ql/src/semmle/go/frameworks/stdlib/IoFs.qll index 310d6da5749..1aa52cd8b51 100644 --- a/ql/src/semmle/go/frameworks/stdlib/IoFs.qll +++ b/ql/src/semmle/go/frameworks/stdlib/IoFs.qll @@ -60,35 +60,35 @@ module IoFs { FunctionOutput outp; MethodModels() { - //signature: func (DirEntry).Name() string + //signature: func (DirEntry) Name() string this.implements(packagePath(), "DirEntry", "Name") and (inp.isReceiver() and outp.isResult()) or - //signature: func (DirEntry).Info() (FileInfo, error) + //signature: func (DirEntry) Info() (FileInfo, error) this.implements(packagePath(), "DirEntry", "Info") and (inp.isReceiver() and outp.isResult(0)) or - //signature: func (FS).Open(name string) (File, error) + //signature: func (FS) Open(name string) (File, error) this.implements(packagePath(), "FS", "Open") and (inp.isReceiver() and outp.isResult(0)) or - //signature: func (GlobFS).Glob(pattern string) ([]string, error) + //signature: func (GlobFS) Glob(pattern string) ([]string, error) this.implements(packagePath(), "GlobFS", "Glob") and (inp.isReceiver() and outp.isResult(0)) or - //signature: func (ReadDirFS).ReadDir(name string) ([]DirEntry, error) + //signature: func (ReadDirFS) ReadDir(name string) ([]DirEntry, error) this.implements(packagePath(), "ReadDirFS", "ReadDir") and (inp.isReceiver() and outp.isResult(0)) or - //signature: func (ReadFileFS).ReadFile(name string) ([]byte, error) + //signature: func (ReadFileFS) ReadFile(name string) ([]byte, error) this.implements(packagePath(), "ReadFileFS", "ReadFile") and (inp.isReceiver() and outp.isResult(0)) or - //signature: func (SubFS).Sub(dir string) (FS, error) + //signature: func (SubFS) Sub(dir string) (FS, error) this.implements(packagePath(), "SubFS", "Sub") and (inp.isReceiver() and outp.isResult(0)) or - //signature: func (File).Read([]byte) (int, error) + //signature: func (File) Read([]byte) (int, error) this.implements(packagePath(), "File", "Read") and (inp.isReceiver() and outp.isParameter(0)) } diff --git a/ql/src/semmle/go/frameworks/stdlib/Log.qll b/ql/src/semmle/go/frameworks/stdlib/Log.qll index f6b2dcfbd03..9d4c677be50 100644 --- a/ql/src/semmle/go/frameworks/stdlib/Log.qll +++ b/ql/src/semmle/go/frameworks/stdlib/Log.qll @@ -51,51 +51,51 @@ module Log { FunctionOutput outp; MethodModels() { - // signature: func (*Logger).Fatal(v ...interface{}) + // signature: func (*Logger) Fatal(v ...interface{}) hasQualifiedName("log", "Logger", "Fatal") and (inp.isParameter(_) and outp.isReceiver()) or - // signature: func (*Logger).Fatalf(format string, v ...interface{}) + // signature: func (*Logger) Fatalf(format string, v ...interface{}) hasQualifiedName("log", "Logger", "Fatalf") and (inp.isParameter(_) and outp.isReceiver()) or - // signature: func (*Logger).Fatalln(v ...interface{}) + // signature: func (*Logger) Fatalln(v ...interface{}) hasQualifiedName("log", "Logger", "Fatalln") and (inp.isParameter(_) and outp.isReceiver()) or - // signature: func (*Logger).Panic(v ...interface{}) + // signature: func (*Logger) Panic(v ...interface{}) hasQualifiedName("log", "Logger", "Panic") and (inp.isParameter(_) and outp.isReceiver()) or - // signature: func (*Logger).Panicf(format string, v ...interface{}) + // signature: func (*Logger) Panicf(format string, v ...interface{}) hasQualifiedName("log", "Logger", "Panicf") and (inp.isParameter(_) and outp.isReceiver()) or - // signature: func (*Logger).Panicln(v ...interface{}) + // signature: func (*Logger) Panicln(v ...interface{}) hasQualifiedName("log", "Logger", "Panicln") and (inp.isParameter(_) and outp.isReceiver()) or - // signature: func (*Logger).Print(v ...interface{}) + // signature: func (*Logger) Print(v ...interface{}) hasQualifiedName("log", "Logger", "Print") and (inp.isParameter(_) and outp.isReceiver()) or - // signature: func (*Logger).Printf(format string, v ...interface{}) + // signature: func (*Logger) Printf(format string, v ...interface{}) hasQualifiedName("log", "Logger", "Printf") and (inp.isParameter(_) and outp.isReceiver()) or - // signature: func (*Logger).Println(v ...interface{}) + // signature: func (*Logger) Println(v ...interface{}) hasQualifiedName("log", "Logger", "Println") and (inp.isParameter(_) and outp.isReceiver()) or - // signature: func (*Logger).SetOutput(w io.Writer) + // signature: func (*Logger) SetOutput(w io.Writer) hasQualifiedName("log", "Logger", "SetOutput") and (inp.isReceiver() and outp.isParameter(0)) or - // signature: func (*Logger).SetPrefix(prefix string) + // signature: func (*Logger) SetPrefix(prefix string) hasQualifiedName("log", "Logger", "SetPrefix") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (*Logger).Writer() io.Writer + // signature: func (*Logger) Writer() io.Writer hasQualifiedName("log", "Logger", "Writer") and (inp.isReceiver() and outp.isResult()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/Mime.qll b/ql/src/semmle/go/frameworks/stdlib/Mime.qll index 34117d0f1ec..b04acdf4e6f 100644 --- a/ql/src/semmle/go/frameworks/stdlib/Mime.qll +++ b/ql/src/semmle/go/frameworks/stdlib/Mime.qll @@ -30,15 +30,15 @@ module Mime { FunctionOutput outp; MethodModels() { - // signature: func (*WordDecoder).Decode(word string) (string, error) + // signature: func (*WordDecoder) Decode(word string) (string, error) hasQualifiedName("mime", "WordDecoder", "Decode") and (inp.isParameter(0) and outp.isResult(0)) or - // signature: func (*WordDecoder).DecodeHeader(header string) (string, error) + // signature: func (*WordDecoder) DecodeHeader(header string) (string, error) hasQualifiedName("mime", "WordDecoder", "DecodeHeader") and (inp.isParameter(0) and outp.isResult(0)) or - // signature: func (WordEncoder).Encode(charset string, s string) string + // signature: func (WordEncoder) Encode(charset string, s string) string hasQualifiedName("mime", "WordEncoder", "Encode") and (inp.isParameter(1) and outp.isResult()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/MimeMultipart.qll b/ql/src/semmle/go/frameworks/stdlib/MimeMultipart.qll index 9de15b824be..3f384b29454 100644 --- a/ql/src/semmle/go/frameworks/stdlib/MimeMultipart.qll +++ b/ql/src/semmle/go/frameworks/stdlib/MimeMultipart.qll @@ -30,43 +30,43 @@ module MimeMultipart { FunctionOutput outp; MethodModels() { - // signature: func (*FileHeader).Open() (File, error) + // signature: func (*FileHeader) Open() (File, error) hasQualifiedName("mime/multipart", "FileHeader", "Open") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Part).FileName() string + // signature: func (*Part) FileName() string hasQualifiedName("mime/multipart", "Part", "FileName") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Part).FormName() string + // signature: func (*Part) FormName() string hasQualifiedName("mime/multipart", "Part", "FormName") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Reader).NextPart() (*Part, error) + // signature: func (*Reader) NextPart() (*Part, error) hasQualifiedName("mime/multipart", "Reader", "NextPart") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Reader).NextRawPart() (*Part, error) + // signature: func (*Reader) NextRawPart() (*Part, error) hasQualifiedName("mime/multipart", "Reader", "NextRawPart") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Reader).ReadForm(maxMemory int64) (*Form, error) + // signature: func (*Reader) ReadForm(maxMemory int64) (*Form, error) hasQualifiedName("mime/multipart", "Reader", "ReadForm") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Writer).CreateFormField(fieldname string) (io.Writer, error) + // signature: func (*Writer) CreateFormField(fieldname string) (io.Writer, error) hasQualifiedName("mime/multipart", "Writer", "CreateFormField") and (inp.isResult(0) and outp.isReceiver()) or - // signature: func (*Writer).CreateFormFile(fieldname string, filename string) (io.Writer, error) + // signature: func (*Writer) CreateFormFile(fieldname string, filename string) (io.Writer, error) hasQualifiedName("mime/multipart", "Writer", "CreateFormFile") and (inp.isResult(0) and outp.isReceiver()) or - // signature: func (*Writer).CreatePart(header net/textproto.MIMEHeader) (io.Writer, error) + // signature: func (*Writer) CreatePart(header net/textproto.MIMEHeader) (io.Writer, error) hasQualifiedName("mime/multipart", "Writer", "CreatePart") and (inp.isResult(0) and outp.isReceiver()) or - // signature: func (*Writer).WriteField(fieldname string, value string) error + // signature: func (*Writer) WriteField(fieldname string, value string) error hasQualifiedName("mime/multipart", "Writer", "WriteField") and (inp.isParameter(_) and outp.isReceiver()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/Net.qll b/ql/src/semmle/go/frameworks/stdlib/Net.qll index 0efc51218e2..96cf161ade6 100644 --- a/ql/src/semmle/go/frameworks/stdlib/Net.qll +++ b/ql/src/semmle/go/frameworks/stdlib/Net.qll @@ -54,15 +54,15 @@ module Net { FunctionOutput outp; MethodModels() { - // signature: func (*IPConn).ReadFromIP(b []byte) (int, *IPAddr, error) + // signature: func (*IPConn) ReadFromIP(b []byte) (int, *IPAddr, error) hasQualifiedName("net", "IPConn", "ReadFromIP") and (inp.isReceiver() and outp.isParameter(0)) or - // signature: func (*IPConn).ReadMsgIP(b []byte, oob []byte) (n int, oobn int, flags int, addr *IPAddr, err error) + // signature: func (*IPConn) ReadMsgIP(b []byte, oob []byte) (n int, oobn int, flags int, addr *IPAddr, err error) hasQualifiedName("net", "IPConn", "ReadMsgIP") and (inp.isReceiver() and outp.isParameter(_)) or - // signature: func (*IPConn).SyscallConn() (syscall.RawConn, error) + // signature: func (*IPConn) SyscallConn() (syscall.RawConn, error) hasQualifiedName("net", "IPConn", "SyscallConn") and ( inp.isReceiver() and outp.isResult(0) @@ -70,15 +70,15 @@ module Net { inp.isResult(0) and outp.isReceiver() ) or - // signature: func (*IPConn).WriteMsgIP(b []byte, oob []byte, addr *IPAddr) (n int, oobn int, err error) + // signature: func (*IPConn) WriteMsgIP(b []byte, oob []byte, addr *IPAddr) (n int, oobn int, err error) hasQualifiedName("net", "IPConn", "WriteMsgIP") and (inp.isParameter([0, 1]) and outp.isReceiver()) or - // signature: func (*IPConn).WriteToIP(b []byte, addr *IPAddr) (int, error) + // signature: func (*IPConn) WriteToIP(b []byte, addr *IPAddr) (int, error) hasQualifiedName("net", "IPConn", "WriteToIP") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (*TCPConn).SyscallConn() (syscall.RawConn, error) + // signature: func (*TCPConn) SyscallConn() (syscall.RawConn, error) hasQualifiedName("net", "TCPConn", "SyscallConn") and ( inp.isReceiver() and outp.isResult(0) @@ -86,7 +86,7 @@ module Net { inp.isResult(0) and outp.isReceiver() ) or - // signature: func (*TCPListener).File() (f *os.File, err error) + // signature: func (*TCPListener) File() (f *os.File, err error) hasQualifiedName("net", "TCPListener", "File") and ( inp.isReceiver() and outp.isResult(0) @@ -94,7 +94,7 @@ module Net { inp.isResult(0) and outp.isReceiver() ) or - // signature: func (*TCPListener).SyscallConn() (syscall.RawConn, error) + // signature: func (*TCPListener) SyscallConn() (syscall.RawConn, error) hasQualifiedName("net", "TCPListener", "SyscallConn") and ( inp.isReceiver() and outp.isResult(0) @@ -102,15 +102,15 @@ module Net { inp.isResult(0) and outp.isReceiver() ) or - // signature: func (*UDPConn).ReadFromUDP(b []byte) (int, *UDPAddr, error) + // signature: func (*UDPConn) ReadFromUDP(b []byte) (int, *UDPAddr, error) hasQualifiedName("net", "UDPConn", "ReadFromUDP") and (inp.isReceiver() and outp.isParameter(0)) or - // signature: func (*UDPConn).ReadMsgUDP(b []byte, oob []byte) (n int, oobn int, flags int, addr *UDPAddr, err error) + // signature: func (*UDPConn) ReadMsgUDP(b []byte, oob []byte) (n int, oobn int, flags int, addr *UDPAddr, err error) hasQualifiedName("net", "UDPConn", "ReadMsgUDP") and (inp.isReceiver() and outp.isParameter(_)) or - // signature: func (*UDPConn).SyscallConn() (syscall.RawConn, error) + // signature: func (*UDPConn) SyscallConn() (syscall.RawConn, error) hasQualifiedName("net", "UDPConn", "SyscallConn") and ( inp.isReceiver() and outp.isResult(0) @@ -118,23 +118,23 @@ module Net { inp.isResult(0) and outp.isReceiver() ) or - // signature: func (*UDPConn).WriteMsgUDP(b []byte, oob []byte, addr *UDPAddr) (n int, oobn int, err error) + // signature: func (*UDPConn) WriteMsgUDP(b []byte, oob []byte, addr *UDPAddr) (n int, oobn int, err error) hasQualifiedName("net", "UDPConn", "WriteMsgUDP") and (inp.isParameter([0, 1]) and outp.isReceiver()) or - // signature: func (*UDPConn).WriteToUDP(b []byte, addr *UDPAddr) (int, error) + // signature: func (*UDPConn) WriteToUDP(b []byte, addr *UDPAddr) (int, error) hasQualifiedName("net", "UDPConn", "WriteToUDP") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (*UnixConn).ReadFromUnix(b []byte) (int, *UnixAddr, error) + // signature: func (*UnixConn) ReadFromUnix(b []byte) (int, *UnixAddr, error) hasQualifiedName("net", "UnixConn", "ReadFromUnix") and (inp.isReceiver() and outp.isParameter(0)) or - // signature: func (*UnixConn).ReadMsgUnix(b []byte, oob []byte) (n int, oobn int, flags int, addr *UnixAddr, err error) + // signature: func (*UnixConn) ReadMsgUnix(b []byte, oob []byte) (n int, oobn int, flags int, addr *UnixAddr, err error) hasQualifiedName("net", "UnixConn", "ReadMsgUnix") and (inp.isReceiver() and outp.isParameter(_)) or - // signature: func (*UnixConn).SyscallConn() (syscall.RawConn, error) + // signature: func (*UnixConn) SyscallConn() (syscall.RawConn, error) hasQualifiedName("net", "UnixConn", "SyscallConn") and ( inp.isReceiver() and outp.isResult(0) @@ -142,15 +142,15 @@ module Net { inp.isResult(0) and outp.isReceiver() ) or - // signature: func (*UnixConn).WriteMsgUnix(b []byte, oob []byte, addr *UnixAddr) (n int, oobn int, err error) + // signature: func (*UnixConn) WriteMsgUnix(b []byte, oob []byte, addr *UnixAddr) (n int, oobn int, err error) hasQualifiedName("net", "UnixConn", "WriteMsgUnix") and (inp.isParameter([0, 1]) and outp.isReceiver()) or - // signature: func (*UnixConn).WriteToUnix(b []byte, addr *UnixAddr) (int, error) + // signature: func (*UnixConn) WriteToUnix(b []byte, addr *UnixAddr) (int, error) hasQualifiedName("net", "UnixConn", "WriteToUnix") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (*UnixListener).File() (f *os.File, err error) + // signature: func (*UnixListener) File() (f *os.File, err error) hasQualifiedName("net", "UnixListener", "File") and ( inp.isReceiver() and outp.isResult(0) @@ -158,7 +158,7 @@ module Net { inp.isResult(0) and outp.isReceiver() ) or - // signature: func (*UnixListener).SyscallConn() (syscall.RawConn, error) + // signature: func (*UnixListener) SyscallConn() (syscall.RawConn, error) hasQualifiedName("net", "UnixListener", "SyscallConn") and ( inp.isReceiver() and outp.isResult(0) @@ -166,23 +166,23 @@ module Net { inp.isResult(0) and outp.isReceiver() ) or - // signature: func (Conn).Read(b []byte) (n int, err error) + // signature: func (Conn) Read(b []byte) (n int, err error) implements("net", "Conn", "Read") and (inp.isReceiver() and outp.isParameter(0)) or - // signature: func (PacketConn).ReadFrom(p []byte) (n int, addr Addr, err error) + // signature: func (PacketConn) ReadFrom(p []byte) (n int, addr Addr, err error) implements("net", "PacketConn", "ReadFrom") and (inp.isReceiver() and outp.isParameter(0)) or - // signature: func (Addr).String() string + // signature: func (Addr) String() string implements("net", "Addr", "String") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Conn).Write(b []byte) (n int, err error) + // signature: func (Conn) Write(b []byte) (n int, err error) implements("net", "Conn", "Write") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (PacketConn).WriteTo(p []byte, addr Addr) (n int, err error) + // signature: func (PacketConn) WriteTo(p []byte, addr Addr) (n int, err error) implements("net", "PacketConn", "WriteTo") and (inp.isParameter(0) and outp.isReceiver()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/NetHttp.qll b/ql/src/semmle/go/frameworks/stdlib/NetHttp.qll index cb38284d116..23549f2fd4e 100644 --- a/ql/src/semmle/go/frameworks/stdlib/NetHttp.qll +++ b/ql/src/semmle/go/frameworks/stdlib/NetHttp.qll @@ -326,63 +326,63 @@ module NetHttp { FunctionOutput outp; MethodModels() { - // signature: func (Header).Add(key string, value string) + // signature: func (Header) Add(key string, value string) hasQualifiedName("net/http", "Header", "Add") and (inp.isParameter(_) and outp.isReceiver()) or - // signature: func (Header).Clone() Header + // signature: func (Header) Clone() Header hasQualifiedName("net/http", "Header", "Clone") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Header).Get(key string) string + // signature: func (Header) Get(key string) string hasQualifiedName("net/http", "Header", "Get") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Header).Set(key string, value string) + // signature: func (Header) Set(key string, value string) hasQualifiedName("net/http", "Header", "Set") and (inp.isParameter(_) and outp.isReceiver()) or - // signature: func (Header).Values(key string) []string + // signature: func (Header) Values(key string) []string hasQualifiedName("net/http", "Header", "Values") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Header).Write(w io.Writer) error + // signature: func (Header) Write(w io.Writer) error hasQualifiedName("net/http", "Header", "Write") and (inp.isReceiver() and outp.isParameter(0)) or - // signature: func (Header).WriteSubset(w io.Writer, exclude map[string]bool) error + // signature: func (Header) WriteSubset(w io.Writer, exclude map[string]bool) error hasQualifiedName("net/http", "Header", "WriteSubset") and (inp.isReceiver() and outp.isParameter(0)) or - // signature: func (*Request).AddCookie(c *Cookie) + // signature: func (*Request) AddCookie(c *Cookie) hasQualifiedName("net/http", "Request", "AddCookie") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (*Request).Clone(ctx context.Context) *Request + // signature: func (*Request) Clone(ctx context.Context) *Request hasQualifiedName("net/http", "Request", "Clone") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*Request).Write(w io.Writer) error + // signature: func (*Request) Write(w io.Writer) error hasQualifiedName("net/http", "Request", "Write") and (inp.isReceiver() and outp.isParameter(0)) or - // signature: func (*Request).WriteProxy(w io.Writer) error + // signature: func (*Request) WriteProxy(w io.Writer) error hasQualifiedName("net/http", "Request", "WriteProxy") and (inp.isReceiver() and outp.isParameter(0)) or - // signature: func (*Response).Write(w io.Writer) error + // signature: func (*Response) Write(w io.Writer) error hasQualifiedName("net/http", "Response", "Write") and (inp.isReceiver() and outp.isParameter(0)) or - // signature: func (*Transport).Clone() *Transport + // signature: func (*Transport) Clone() *Transport hasQualifiedName("net/http", "Transport", "Clone") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Hijacker).Hijack() (net.Conn, *bufio.ReadWriter, error) + // signature: func (Hijacker) Hijack() (net.Conn, *bufio.ReadWriter, error) implements("net/http", "Hijacker", "Hijack") and (inp.isReceiver() and outp.isResult([0, 1])) or - // signature: func (ResponseWriter).Write([]byte) (int, error) + // signature: func (ResponseWriter) Write([]byte) (int, error) implements("net/http", "ResponseWriter", "Write") and (inp.isParameter(0) and outp.isReceiver()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/NetHttpHttputil.qll b/ql/src/semmle/go/frameworks/stdlib/NetHttpHttputil.qll index 116f9bdc9c5..aa7668d46b8 100644 --- a/ql/src/semmle/go/frameworks/stdlib/NetHttpHttputil.qll +++ b/ql/src/semmle/go/frameworks/stdlib/NetHttpHttputil.qll @@ -58,7 +58,7 @@ module NetHttpHttputil { FunctionOutput outp; MethodModels() { - // signature: func (*ClientConn).Hijack() (c net.Conn, r *bufio.Reader) + // signature: func (*ClientConn) Hijack() (c net.Conn, r *bufio.Reader) hasQualifiedName("net/http/httputil", "ClientConn", "Hijack") and ( inp.isReceiver() and outp.isResult(_) @@ -66,7 +66,7 @@ module NetHttpHttputil { inp.isResult(0) and outp.isReceiver() ) or - // signature: func (*ServerConn).Hijack() (net.Conn, *bufio.Reader) + // signature: func (*ServerConn) Hijack() (net.Conn, *bufio.Reader) hasQualifiedName("net/http/httputil", "ServerConn", "Hijack") and ( inp.isReceiver() and outp.isResult(_) @@ -74,11 +74,11 @@ module NetHttpHttputil { inp.isResult(0) and outp.isReceiver() ) or - // signature: func (BufferPool).Get() []byte + // signature: func (BufferPool) Get() []byte implements("net/http/httputil", "BufferPool", "Get") and (inp.isReceiver() and outp.isResult()) or - // signature: func (BufferPool).Put([]byte) + // signature: func (BufferPool) Put([]byte) implements("net/http/httputil", "BufferPool", "Put") and (inp.isParameter(0) and outp.isReceiver()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/NetMail.qll b/ql/src/semmle/go/frameworks/stdlib/NetMail.qll index 3f9ce44e80a..20e94219752 100644 --- a/ql/src/semmle/go/frameworks/stdlib/NetMail.qll +++ b/ql/src/semmle/go/frameworks/stdlib/NetMail.qll @@ -34,15 +34,15 @@ module NetMail { FunctionOutput outp; MethodModels() { - // signature: func (*AddressParser).Parse(address string) (*Address, error) + // signature: func (*AddressParser) Parse(address string) (*Address, error) hasQualifiedName("net/mail", "AddressParser", "Parse") and (inp.isParameter(0) and outp.isResult(0)) or - // signature: func (*AddressParser).ParseList(list string) ([]*Address, error) + // signature: func (*AddressParser) ParseList(list string) ([]*Address, error) hasQualifiedName("net/mail", "AddressParser", "ParseList") and (inp.isParameter(0) and outp.isResult(0)) or - // signature: func (Header).Get(key string) string + // signature: func (Header) Get(key string) string hasQualifiedName("net/mail", "Header", "Get") and (inp.isReceiver() and outp.isResult()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/NetTextproto.qll b/ql/src/semmle/go/frameworks/stdlib/NetTextproto.qll index b31a57fb248..7704b5486f9 100644 --- a/ql/src/semmle/go/frameworks/stdlib/NetTextproto.qll +++ b/ql/src/semmle/go/frameworks/stdlib/NetTextproto.qll @@ -50,67 +50,67 @@ module NetTextproto { FunctionOutput outp; MethodModels() { - // signature: func (MIMEHeader).Add(key string, value string) + // signature: func (MIMEHeader) Add(key string, value string) hasQualifiedName("net/textproto", "MIMEHeader", "Add") and (inp.isParameter(_) and outp.isReceiver()) or - // signature: func (MIMEHeader).Get(key string) string + // signature: func (MIMEHeader) Get(key string) string hasQualifiedName("net/textproto", "MIMEHeader", "Get") and (inp.isReceiver() and outp.isResult()) or - // signature: func (MIMEHeader).Set(key string, value string) + // signature: func (MIMEHeader) Set(key string, value string) hasQualifiedName("net/textproto", "MIMEHeader", "Set") and (inp.isParameter(_) and outp.isReceiver()) or - // signature: func (MIMEHeader).Values(key string) []string + // signature: func (MIMEHeader) Values(key string) []string hasQualifiedName("net/textproto", "MIMEHeader", "Values") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*Reader).DotReader() io.Reader + // signature: func (*Reader) DotReader() io.Reader hasQualifiedName("net/textproto", "Reader", "DotReader") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*Reader).ReadCodeLine(expectCode int) (code int, message string, err error) + // signature: func (*Reader) ReadCodeLine(expectCode int) (code int, message string, err error) hasQualifiedName("net/textproto", "Reader", "ReadCodeLine") and (inp.isReceiver() and outp.isResult(1)) or - // signature: func (*Reader).ReadContinuedLine() (string, error) + // signature: func (*Reader) ReadContinuedLine() (string, error) hasQualifiedName("net/textproto", "Reader", "ReadContinuedLine") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Reader).ReadContinuedLineBytes() ([]byte, error) + // signature: func (*Reader) ReadContinuedLineBytes() ([]byte, error) hasQualifiedName("net/textproto", "Reader", "ReadContinuedLineBytes") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Reader).ReadDotBytes() ([]byte, error) + // signature: func (*Reader) ReadDotBytes() ([]byte, error) hasQualifiedName("net/textproto", "Reader", "ReadDotBytes") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Reader).ReadDotLines() ([]string, error) + // signature: func (*Reader) ReadDotLines() ([]string, error) hasQualifiedName("net/textproto", "Reader", "ReadDotLines") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Reader).ReadLine() (string, error) + // signature: func (*Reader) ReadLine() (string, error) hasQualifiedName("net/textproto", "Reader", "ReadLine") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Reader).ReadLineBytes() ([]byte, error) + // signature: func (*Reader) ReadLineBytes() ([]byte, error) hasQualifiedName("net/textproto", "Reader", "ReadLineBytes") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Reader).ReadMIMEHeader() (MIMEHeader, error) + // signature: func (*Reader) ReadMIMEHeader() (MIMEHeader, error) hasQualifiedName("net/textproto", "Reader", "ReadMIMEHeader") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Reader).ReadResponse(expectCode int) (code int, message string, err error) + // signature: func (*Reader) ReadResponse(expectCode int) (code int, message string, err error) hasQualifiedName("net/textproto", "Reader", "ReadResponse") and (inp.isReceiver() and outp.isResult(1)) or - // signature: func (*Writer).DotWriter() io.WriteCloser + // signature: func (*Writer) DotWriter() io.WriteCloser hasQualifiedName("net/textproto", "Writer", "DotWriter") and (inp.isResult() and outp.isReceiver()) or - // signature: func (*Writer).PrintfLine(format string, args ...interface{}) error + // signature: func (*Writer) PrintfLine(format string, args ...interface{}) error hasQualifiedName("net/textproto", "Writer", "PrintfLine") and (inp.isParameter(_) and outp.isReceiver()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/Os.qll b/ql/src/semmle/go/frameworks/stdlib/Os.qll index a5b94f3a471..a022b416d9e 100644 --- a/ql/src/semmle/go/frameworks/stdlib/Os.qll +++ b/ql/src/semmle/go/frameworks/stdlib/Os.qll @@ -110,11 +110,11 @@ module Os { FunctionOutput outp; MethodModels() { - // signature: func (*File).Fd() uintptr + // signature: func (*File) Fd() uintptr hasQualifiedName("os", "File", "Fd") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*File).SyscallConn() (syscall.RawConn, error) + // signature: func (*File) SyscallConn() (syscall.RawConn, error) hasQualifiedName("os", "File", "SyscallConn") and ( inp.isReceiver() and outp.isResult(0) diff --git a/ql/src/semmle/go/frameworks/stdlib/Reflect.qll b/ql/src/semmle/go/frameworks/stdlib/Reflect.qll index 46948a57148..150c3ae798e 100644 --- a/ql/src/semmle/go/frameworks/stdlib/Reflect.qll +++ b/ql/src/semmle/go/frameworks/stdlib/Reflect.qll @@ -42,139 +42,139 @@ module Reflect { FunctionOutput outp; MethodModels() { - // signature: func (*MapIter).Key() Value + // signature: func (*MapIter) Key() Value hasQualifiedName("reflect", "MapIter", "Key") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*MapIter).Value() Value + // signature: func (*MapIter) Value() Value hasQualifiedName("reflect", "MapIter", "Value") and (inp.isReceiver() and outp.isResult()) or - // signature: func (StructTag).Get(key string) string + // signature: func (StructTag) Get(key string) string hasQualifiedName("reflect", "StructTag", "Get") and (inp.isReceiver() and outp.isResult()) or - // signature: func (StructTag).Lookup(key string) (value string, ok bool) + // signature: func (StructTag) Lookup(key string) (value string, ok bool) hasQualifiedName("reflect", "StructTag", "Lookup") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (Value).Addr() Value + // signature: func (Value) Addr() Value hasQualifiedName("reflect", "Value", "Addr") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Value).Bytes() []byte + // signature: func (Value) Bytes() []byte hasQualifiedName("reflect", "Value", "Bytes") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Value).Convert(t Type) Value + // signature: func (Value) Convert(t Type) Value hasQualifiedName("reflect", "Value", "Convert") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Value).Elem() Value + // signature: func (Value) Elem() Value hasQualifiedName("reflect", "Value", "Elem") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Value).Field(i int) Value + // signature: func (Value) Field(i int) Value hasQualifiedName("reflect", "Value", "Field") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Value).FieldByIndex(index []int) Value + // signature: func (Value) FieldByIndex(index []int) Value hasQualifiedName("reflect", "Value", "FieldByIndex") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Value).FieldByName(name string) Value + // signature: func (Value) FieldByName(name string) Value hasQualifiedName("reflect", "Value", "FieldByName") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Value).FieldByNameFunc(match func(string) bool) Value + // signature: func (Value) FieldByNameFunc(match func(string) bool) Value hasQualifiedName("reflect", "Value", "FieldByNameFunc") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Value).Index(i int) Value + // signature: func (Value) Index(i int) Value hasQualifiedName("reflect", "Value", "Index") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Value).Interface() (i interface{}) + // signature: func (Value) Interface() (i interface{}) hasQualifiedName("reflect", "Value", "Interface") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Value).InterfaceData() [2]uintptr + // signature: func (Value) InterfaceData() [2]uintptr hasQualifiedName("reflect", "Value", "InterfaceData") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Value).MapIndex(key Value) Value + // signature: func (Value) MapIndex(key Value) Value hasQualifiedName("reflect", "Value", "MapIndex") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Value).MapKeys() []Value + // signature: func (Value) MapKeys() []Value hasQualifiedName("reflect", "Value", "MapKeys") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Value).MapRange() *MapIter + // signature: func (Value) MapRange() *MapIter hasQualifiedName("reflect", "Value", "MapRange") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Value).Method(i int) Value + // signature: func (Value) Method(i int) Value hasQualifiedName("reflect", "Value", "Method") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Value).MethodByName(name string) Value + // signature: func (Value) MethodByName(name string) Value hasQualifiedName("reflect", "Value", "MethodByName") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Value).Pointer() uintptr + // signature: func (Value) Pointer() uintptr hasQualifiedName("reflect", "Value", "Pointer") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Value).Recv() (x Value, ok bool) + // signature: func (Value) Recv() (x Value, ok bool) hasQualifiedName("reflect", "Value", "Recv") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (Value).Send(x Value) + // signature: func (Value) Send(x Value) hasQualifiedName("reflect", "Value", "Send") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (Value).Set(x Value) + // signature: func (Value) Set(x Value) hasQualifiedName("reflect", "Value", "Set") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (Value).SetBytes(x []byte) + // signature: func (Value) SetBytes(x []byte) hasQualifiedName("reflect", "Value", "SetBytes") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (Value).SetMapIndex(key Value, elem Value) + // signature: func (Value) SetMapIndex(key Value, elem Value) hasQualifiedName("reflect", "Value", "SetMapIndex") and (inp.isParameter(_) and outp.isReceiver()) or - // signature: func (Value).SetPointer(x unsafe.Pointer) + // signature: func (Value) SetPointer(x unsafe.Pointer) hasQualifiedName("reflect", "Value", "SetPointer") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (Value).SetString(x string) + // signature: func (Value) SetString(x string) hasQualifiedName("reflect", "Value", "SetString") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (Value).Slice(i int, j int) Value + // signature: func (Value) Slice(i int, j int) Value hasQualifiedName("reflect", "Value", "Slice") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Value).Slice3(i int, j int, k int) Value + // signature: func (Value) Slice3(i int, j int, k int) Value hasQualifiedName("reflect", "Value", "Slice3") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Value).String() string + // signature: func (Value) String() string hasQualifiedName("reflect", "Value", "String") and (inp.isReceiver() and outp.isResult()) or - // signature: func (Value).TryRecv() (x Value, ok bool) + // signature: func (Value) TryRecv() (x Value, ok bool) hasQualifiedName("reflect", "Value", "TryRecv") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (Value).TrySend(x Value) bool + // signature: func (Value) TrySend(x Value) bool hasQualifiedName("reflect", "Value", "TrySend") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (Value).UnsafeAddr() uintptr + // signature: func (Value) UnsafeAddr() uintptr hasQualifiedName("reflect", "Value", "UnsafeAddr") and (inp.isReceiver() and outp.isResult()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/Regexp.qll b/ql/src/semmle/go/frameworks/stdlib/Regexp.qll index c83d950df39..bd12c50fd20 100644 --- a/ql/src/semmle/go/frameworks/stdlib/Regexp.qll +++ b/ql/src/semmle/go/frameworks/stdlib/Regexp.qll @@ -85,77 +85,77 @@ module Regexp { FunctionOutput outp; MethodModels() { - // signature: func (*Regexp).Expand(dst []byte, template []byte, src []byte, match []int) []byte + // signature: func (*Regexp) Expand(dst []byte, template []byte, src []byte, match []int) []byte hasQualifiedName("regexp", "Regexp", "Expand") and ( inp.isParameter([1, 2]) and (outp.isParameter(0) or outp.isResult()) ) or - // signature: func (*Regexp).ExpandString(dst []byte, template string, src string, match []int) []byte + // signature: func (*Regexp) ExpandString(dst []byte, template string, src string, match []int) []byte hasQualifiedName("regexp", "Regexp", "ExpandString") and ( inp.isParameter([1, 2]) and (outp.isParameter(0) or outp.isResult()) ) or - // signature: func (*Regexp).Find(b []byte) []byte + // signature: func (*Regexp) Find(b []byte) []byte hasQualifiedName("regexp", "Regexp", "Find") and (inp.isParameter(0) and outp.isResult()) or - // signature: func (*Regexp).FindAll(b []byte, n int) [][]byte + // signature: func (*Regexp) FindAll(b []byte, n int) [][]byte hasQualifiedName("regexp", "Regexp", "FindAll") and (inp.isParameter(0) and outp.isResult()) or - // signature: func (*Regexp).FindAllString(s string, n int) []string + // signature: func (*Regexp) FindAllString(s string, n int) []string hasQualifiedName("regexp", "Regexp", "FindAllString") and (inp.isParameter(0) and outp.isResult()) or - // signature: func (*Regexp).FindAllStringSubmatch(s string, n int) [][]string + // signature: func (*Regexp) FindAllStringSubmatch(s string, n int) [][]string hasQualifiedName("regexp", "Regexp", "FindAllStringSubmatch") and (inp.isParameter(0) and outp.isResult()) or - // signature: func (*Regexp).FindAllSubmatch(b []byte, n int) [][][]byte + // signature: func (*Regexp) FindAllSubmatch(b []byte, n int) [][][]byte hasQualifiedName("regexp", "Regexp", "FindAllSubmatch") and (inp.isParameter(0) and outp.isResult()) or - // signature: func (*Regexp).FindString(s string) string + // signature: func (*Regexp) FindString(s string) string hasQualifiedName("regexp", "Regexp", "FindString") and (inp.isParameter(0) and outp.isResult()) or - // signature: func (*Regexp).FindStringSubmatch(s string) []string + // signature: func (*Regexp) FindStringSubmatch(s string) []string hasQualifiedName("regexp", "Regexp", "FindStringSubmatch") and (inp.isParameter(0) and outp.isResult()) or - // signature: func (*Regexp).FindSubmatch(b []byte) [][]byte + // signature: func (*Regexp) FindSubmatch(b []byte) [][]byte hasQualifiedName("regexp", "Regexp", "FindSubmatch") and (inp.isParameter(0) and outp.isResult()) or - // signature: func (*Regexp).ReplaceAll(src []byte, repl []byte) []byte + // signature: func (*Regexp) ReplaceAll(src []byte, repl []byte) []byte hasQualifiedName("regexp", "Regexp", "ReplaceAll") and (inp.isParameter(_) and outp.isResult()) or - // signature: func (*Regexp).ReplaceAllFunc(src []byte, repl func([]byte) []byte) []byte + // signature: func (*Regexp) ReplaceAllFunc(src []byte, repl func([]byte) []byte) []byte hasQualifiedName("regexp", "Regexp", "ReplaceAllFunc") and (inp.isParameter(_) and outp.isResult()) or - // signature: func (*Regexp).ReplaceAllLiteral(src []byte, repl []byte) []byte + // signature: func (*Regexp) ReplaceAllLiteral(src []byte, repl []byte) []byte hasQualifiedName("regexp", "Regexp", "ReplaceAllLiteral") and (inp.isParameter(_) and outp.isResult()) or - // signature: func (*Regexp).ReplaceAllLiteralString(src string, repl string) string + // signature: func (*Regexp) ReplaceAllLiteralString(src string, repl string) string hasQualifiedName("regexp", "Regexp", "ReplaceAllLiteralString") and (inp.isParameter(_) and outp.isResult()) or - // signature: func (*Regexp).ReplaceAllString(src string, repl string) string + // signature: func (*Regexp) ReplaceAllString(src string, repl string) string hasQualifiedName("regexp", "Regexp", "ReplaceAllString") and (inp.isParameter(_) and outp.isResult()) or - // signature: func (*Regexp).ReplaceAllStringFunc(src string, repl func(string) string) string + // signature: func (*Regexp) ReplaceAllStringFunc(src string, repl func(string) string) string hasQualifiedName("regexp", "Regexp", "ReplaceAllStringFunc") and (inp.isParameter(_) and outp.isResult()) or - // signature: func (*Regexp).Split(s string, n int) []string + // signature: func (*Regexp) Split(s string, n int) []string hasQualifiedName("regexp", "Regexp", "Split") and (inp.isParameter(0) and outp.isResult()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/Strings.qll b/ql/src/semmle/go/frameworks/stdlib/Strings.qll index f704634ff9b..07a2dcf23df 100644 --- a/ql/src/semmle/go/frameworks/stdlib/Strings.qll +++ b/ql/src/semmle/go/frameworks/stdlib/Strings.qll @@ -142,15 +142,15 @@ module Strings { FunctionOutput outp; MethodModels() { - // signature: func (*Reader).Reset(s string) + // signature: func (*Reader) Reset(s string) hasQualifiedName("strings", "Reader", "Reset") and (inp.isParameter(0) and outp.isReceiver()) or - // signature: func (*Replacer).Replace(s string) string + // signature: func (*Replacer) Replace(s string) string hasQualifiedName("strings", "Replacer", "Replace") and (inp.isParameter(0) and outp.isResult()) or - // signature: func (*Replacer).WriteString(w io.Writer, s string) (n int, err error) + // signature: func (*Replacer) WriteString(w io.Writer, s string) (n int, err error) hasQualifiedName("strings", "Replacer", "WriteString") and (inp.isParameter(1) and outp.isParameter(0)) } diff --git a/ql/src/semmle/go/frameworks/stdlib/Sync.qll b/ql/src/semmle/go/frameworks/stdlib/Sync.qll index 3e7a5b8f0f6..b82e1e59804 100644 --- a/ql/src/semmle/go/frameworks/stdlib/Sync.qll +++ b/ql/src/semmle/go/frameworks/stdlib/Sync.qll @@ -11,11 +11,11 @@ module Sync { FunctionOutput outp; MethodModels() { - // signature: func (*Map).Load(key interface{}) (value interface{}, ok bool) + // signature: func (*Map) Load(key interface{}) (value interface{}, ok bool) hasQualifiedName("sync", "Map", "Load") and (inp.isReceiver() and outp.isResult(0)) or - // signature: func (*Map).LoadOrStore(key interface{}, value interface{}) (actual interface{}, loaded bool) + // signature: func (*Map) LoadOrStore(key interface{}, value interface{}) (actual interface{}, loaded bool) hasQualifiedName("sync", "Map", "LoadOrStore") and ( inp.isReceiver() and outp.isResult(0) @@ -24,15 +24,15 @@ module Sync { (outp.isReceiver() or outp.isResult(0)) ) or - // signature: func (*Map).Store(key interface{}, value interface{}) + // signature: func (*Map) Store(key interface{}, value interface{}) hasQualifiedName("sync", "Map", "Store") and (inp.isParameter(_) and outp.isReceiver()) or - // signature: func (*Pool).Get() interface{} + // signature: func (*Pool) Get() interface{} hasQualifiedName("sync", "Pool", "Get") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*Pool).Put(x interface{}) + // signature: func (*Pool) Put(x interface{}) hasQualifiedName("sync", "Pool", "Put") and (inp.isParameter(0) and outp.isReceiver()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/SyncAtomic.qll b/ql/src/semmle/go/frameworks/stdlib/SyncAtomic.qll index 35f16ba15a6..373ea1d71ca 100644 --- a/ql/src/semmle/go/frameworks/stdlib/SyncAtomic.qll +++ b/ql/src/semmle/go/frameworks/stdlib/SyncAtomic.qll @@ -69,11 +69,11 @@ module SyncAtomic { FunctionOutput outp; MethodModels() { - // signature: func (*Value).Load() (x interface{}) + // signature: func (*Value) Load() (x interface{}) hasQualifiedName("sync/atomic", "Value", "Load") and (inp.isReceiver() and outp.isResult()) or - // signature: func (*Value).Store(x interface{}) + // signature: func (*Value) Store(x interface{}) hasQualifiedName("sync/atomic", "Value", "Store") and (inp.isParameter(0) and outp.isReceiver()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/Syscall.qll b/ql/src/semmle/go/frameworks/stdlib/Syscall.qll index e70591da381..7652a58b6e4 100644 --- a/ql/src/semmle/go/frameworks/stdlib/Syscall.qll +++ b/ql/src/semmle/go/frameworks/stdlib/Syscall.qll @@ -42,11 +42,11 @@ module Syscall { FunctionOutput outp; MethodModels() { - // signature: func (RawConn).Read(f func(fd uintptr) (done bool)) error + // signature: func (RawConn) Read(f func(fd uintptr) (done bool)) error implements("syscall", "RawConn", "Read") and (inp.isReceiver() and outp.isParameter(0)) or - // signature: func (Conn).SyscallConn() (RawConn, error) + // signature: func (Conn) SyscallConn() (RawConn, error) implements("syscall", "Conn", "SyscallConn") and ( inp.isReceiver() and outp.isResult(0) @@ -54,7 +54,7 @@ module Syscall { inp.isResult(0) and outp.isReceiver() ) or - // signature: func (RawConn).Write(f func(fd uintptr) (done bool)) error + // signature: func (RawConn) Write(f func(fd uintptr) (done bool)) error implements("syscall", "RawConn", "Write") and (inp.isParameter(0) and outp.isReceiver()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/TextScanner.qll b/ql/src/semmle/go/frameworks/stdlib/TextScanner.qll index c97104d6ac4..54864078e49 100644 --- a/ql/src/semmle/go/frameworks/stdlib/TextScanner.qll +++ b/ql/src/semmle/go/frameworks/stdlib/TextScanner.qll @@ -11,14 +11,14 @@ module TextScanner { FunctionOutput outp; MethodModels() { - // signature: func (*Scanner).Init(src io.Reader) *Scanner + // signature: func (*Scanner) Init(src io.Reader) *Scanner hasQualifiedName("text/scanner", "Scanner", "Init") and ( inp.isParameter(0) and (outp.isReceiver() or outp.isResult()) ) or - // signature: func (*Scanner).TokenText() string + // signature: func (*Scanner) TokenText() string hasQualifiedName("text/scanner", "Scanner", "TokenText") and (inp.isReceiver() and outp.isResult()) } diff --git a/ql/src/semmle/go/frameworks/stdlib/TextTabwriter.qll b/ql/src/semmle/go/frameworks/stdlib/TextTabwriter.qll index b4928eeb028..5d40f38b72e 100644 --- a/ql/src/semmle/go/frameworks/stdlib/TextTabwriter.qll +++ b/ql/src/semmle/go/frameworks/stdlib/TextTabwriter.qll @@ -26,7 +26,7 @@ module TextTabwriter { FunctionOutput outp; MethodModels() { - // signature: func (*Writer).Init(output io.Writer, minwidth int, tabwidth int, padding int, padchar byte, flags uint) *Writer + // signature: func (*Writer) Init(output io.Writer, minwidth int, tabwidth int, padding int, padchar byte, flags uint) *Writer hasQualifiedName("text/tabwriter", "Writer", "Init") and ( (inp.isReceiver() or inp.isResult()) and diff --git a/ql/src/semmle/go/frameworks/stdlib/TextTemplate.qll b/ql/src/semmle/go/frameworks/stdlib/TextTemplate.qll index 7b17a1679b9..d32630b56cc 100644 --- a/ql/src/semmle/go/frameworks/stdlib/TextTemplate.qll +++ b/ql/src/semmle/go/frameworks/stdlib/TextTemplate.qll @@ -87,11 +87,11 @@ module TextTemplate { FunctionOutput outp; MethodModels() { - // signature: func (*Template).Execute(wr io.Writer, data interface{}) error + // signature: func (*Template) Execute(wr io.Writer, data interface{}) error hasQualifiedName("text/template", "Template", "Execute") and (inp.isParameter(1) and outp.isParameter(0)) or - // signature: func (*Template).ExecuteTemplate(wr io.Writer, name string, data interface{}) error + // signature: func (*Template) ExecuteTemplate(wr io.Writer, name string, data interface{}) error hasQualifiedName("text/template", "Template", "ExecuteTemplate") and (inp.isParameter(2) and outp.isParameter(0)) }