|
4 | 4 |
|
5 | 5 | import go |
6 | 6 |
|
| 7 | +/** |
| 8 | + * Provides classes modeling security-relevant aspects of the `gorqlite` package. |
| 9 | + */ |
7 | 10 | module Gorqlite { |
8 | | - private string packagePath() { |
9 | | - result = package(["github.com/rqlite/gorqlite", "github.com/raindog308/gorqlite", "github.com/kanikanema/gorqlite"], "") |
10 | | - } |
| 11 | + private string packagePath() { |
| 12 | + result = |
| 13 | + package([ |
| 14 | + "github.com/rqlite/gorqlite", "github.com/raindog308/gorqlite", |
| 15 | + "github.com/kanikanema/gorqlite" |
| 16 | + ], "") |
| 17 | + } |
11 | 18 |
|
12 | | - // These are expressed using TaintTracking::FunctionModel because varargs functions don't work with Models-as-Data sumamries yet. |
13 | | - private class QueryResultScan extends SQL::Query::Range, TaintTracking::FunctionModel, Method { |
14 | | - FunctionInput inp; |
15 | | - FunctionOutput outp; |
| 19 | + // These are expressed using TaintTracking::FunctionModel because varargs functions don't work with Models-as-Data summaries yet. |
| 20 | + private class QueryResultScan extends TaintTracking::FunctionModel, Method { |
| 21 | + FunctionInput inp; |
| 22 | + FunctionOutput outp; |
16 | 23 |
|
17 | | - QueryResultScan() { |
18 | | - // signature: func (qr *QueryResult) Scan(dest ...interface{}) error |
19 | | - this.hasQualifiedName(packagePath(), "QueryResult", "Scan") and |
20 | | - inp.isReceiver() and |
21 | | - outp.isParameter(_) |
22 | | - } |
| 24 | + QueryResultScan() { |
| 25 | + // signature: func (qr *QueryResult) Scan(dest ...interface{}) error |
| 26 | + this.hasQualifiedName(packagePath(), "QueryResult", "Scan") and |
| 27 | + inp.isReceiver() and |
| 28 | + outp.isParameter(_) |
| 29 | + } |
23 | 30 |
|
24 | | - override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) { |
25 | | - input = inp and output = outp |
26 | | - } |
| 31 | + override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) { |
| 32 | + input = inp and output = outp |
27 | 33 | } |
| 34 | + } |
28 | 35 | } |
0 commit comments