Do not use variadic sink fn in tests

This commit is contained in:
Owen Mansel-Chan
2023-04-13 07:22:47 +01:00
parent bc0f9030e3
commit f2368a9441
4 changed files with 11 additions and 17 deletions

View File

@@ -14,10 +14,8 @@ func UntrustedSources_ClevergoTechClevergoV052() {
{
var receiverContext656 clevergo.Context
resultUsername414, resultPassword518, _ := receiverContext656.BasicAuth()
sink(
resultUsername414, // $ untrustedFlowSource
resultPassword518, // $ untrustedFlowSource
)
sink(resultUsername414) // $ untrustedFlowSource
sink(resultPassword518) // $ untrustedFlowSource
}
// func (*Context).Decode(v interface{}) (err error)
{
@@ -102,10 +100,8 @@ func UntrustedSources_ClevergoTechClevergoV052() {
// Untrusted flow sources from clevergo.tech/clevergo.Param struct fields.
{
structParam246 := new(clevergo.Param)
sink(
structParam246.Key, // $ untrustedFlowSource
structParam246.Value, // $ untrustedFlowSource
)
sink(structParam246.Key) // $ untrustedFlowSource
sink(structParam246.Value) // $ untrustedFlowSource
}
}
// Untrusted flow sources from types.

View File

@@ -7,6 +7,6 @@ func source() interface{} {
return nil
}
func sink(v ...interface{}) {}
func sink(v interface{}) {}
func link(from interface{}, into interface{}) {}

View File

@@ -121,13 +121,11 @@ func UntrustedFlowSources_GithubComGofiberFiberV1146() {
// Untrusted flow sources from github.com/gofiber/fiber.Cookie struct fields.
{
structCookie322 := new(fiber.Cookie)
sink(
structCookie322.Domain, // $ untrustedFlowSource
structCookie322.Name, // $ untrustedFlowSource
structCookie322.Path, // $ untrustedFlowSource
structCookie322.SameSite, // $ untrustedFlowSource
structCookie322.Value, // $ untrustedFlowSource
)
sink(structCookie322.Domain) // $ untrustedFlowSource
sink(structCookie322.Name) // $ untrustedFlowSource
sink(structCookie322.Path) // $ untrustedFlowSource
sink(structCookie322.SameSite) // $ untrustedFlowSource
sink(structCookie322.Value) // $ untrustedFlowSource
}
// Untrusted flow sources from github.com/gofiber/fiber.Error struct fields.
{

View File

@@ -7,6 +7,6 @@ func source() interface{} {
return nil
}
func sink(v ...interface{}) {}
func sink(v interface{}) {}
func link(from interface{}, into interface{}) {}