Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 803b9d3

Browse files
committed
Add missing tests and models for json-patch
1 parent 5e74930 commit 803b9d3

3 files changed

Lines changed: 29 additions & 0 deletions

File tree

go/ql/lib/ext/github.com.evanphx.json-patch.model.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ extensions:
1111
- ["github.com/evanphx/json-patch/$ANYVERSION", "Patch", True, "Apply", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"]
1212
- ["github.com/evanphx/json-patch/$ANYVERSION", "Patch", True, "ApplyIndent", "", "", "Argument[-1]", "ReturnValue[0]", "taint", "manual"]
1313
- ["github.com/evanphx/json-patch/$ANYVERSION", "Patch", True, "ApplyIndent", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"]
14+
- ["github.com/evanphx/json-patch/$ANYVERSION", "Patch", True, "ApplyWithOptions", "", "", "Argument[-1]", "ReturnValue[0]", "taint", "manual"]
15+
- ["github.com/evanphx/json-patch/$ANYVERSION", "Patch", True, "ApplyWithOptions", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"]
16+
- ["github.com/evanphx/json-patch/$ANYVERSION", "Patch", True, "ApplyIndentWithOptions", "", "", "Argument[-1]", "ReturnValue[0]", "taint", "manual"]
17+
- ["github.com/evanphx/json-patch/$ANYVERSION", "Patch", True, "ApplyIndentWithOptions", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"]

go/ql/test/library-tests/semmle/go/frameworks/EvanphxJsonPatch/main.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,18 @@ func main() {
6161

6262
b11, _ := getTaintedPatch().ApplyIndent(untaintedByteArray, " ")
6363
sinkByteArray(b11) // $ taintflow
64+
65+
// func (p Patch) ApplyWithOptions(doc []byte, options *ApplyOptions) ([]byte, error)
66+
b12, _ := untaintedPatch.ApplyWithOptions(getTaintedByteArray(), nil)
67+
sinkByteArray(b12) // $ taintflow
68+
69+
b13, _ := getTaintedPatch().ApplyWithOptions(untaintedByteArray, nil)
70+
sinkByteArray(b13) // $ taintflow
71+
72+
// func (p Patch) ApplyIndentWithOptions(doc []byte, indent string, options *ApplyOptions) ([]byte, error)
73+
b14, _ := untaintedPatch.ApplyIndentWithOptions(getTaintedByteArray(), " ", nil)
74+
sinkByteArray(b14) // $ taintflow
75+
76+
b15, _ := getTaintedPatch().ApplyIndentWithOptions(untaintedByteArray, " ", nil)
77+
sinkByteArray(b15) // $ taintflow
6478
}

go/ql/test/library-tests/semmle/go/frameworks/EvanphxJsonPatch/vendor/github.com/evanphx/json-patch/v5/stub.go

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)