diff --git a/ql/src/semmle/go/frameworks/Gin.qll b/ql/src/semmle/go/frameworks/Gin.qll index 55aaa82d04b..a3227f7fa0d 100644 --- a/ql/src/semmle/go/frameworks/Gin.qll +++ b/ql/src/semmle/go/frameworks/Gin.qll @@ -76,7 +76,7 @@ private module Gin { or // Field reads: exists(DataFlow::Field fld | - fld.hasQualifiedName(packagePath, typeName, "Accepted") and + fld.hasQualifiedName(packagePath, typeName, ["Accepted", "Params"]) and this = fld.getARead() ) ) @@ -92,11 +92,6 @@ private module Gin { packagePath = "github.com/gin-gonic/gin" and typeName = "Params" | - // Any read of a variable of this type: - exists(DataFlow::ReadNode read | read.getType().hasQualifiedName(packagePath, typeName) | - this = read - ) - or // Method calls: exists(DataFlow::MethodCallNode call | call.getTarget().hasQualifiedName(packagePath, typeName, ["ByName", "Get"]) @@ -116,11 +111,6 @@ private module Gin { packagePath = "github.com/gin-gonic/gin" and typeName = "Param" | - // Any read of a variable of this type: - exists(DataFlow::ReadNode read | read.getType().hasQualifiedName(packagePath, typeName) | - this = read - ) - or // Field reads: exists(DataFlow::Field fld | fld.hasQualifiedName(packagePath, typeName, ["Key", "Value"]) | this = fld.getARead() diff --git a/ql/test/library-tests/semmle/go/frameworks/Gin/Gin.expected b/ql/test/library-tests/semmle/go/frameworks/Gin/Gin.expected index 31678491a98..ccb1fbfa7f0 100644 --- a/ql/test/library-tests/semmle/go/frameworks/Gin/Gin.expected +++ b/ql/test/library-tests/semmle/go/frameworks/Gin/Gin.expected @@ -26,22 +26,15 @@ | Gin.go:123:10:123:23 | call to FullPath | | Gin.go:129:10:129:21 | selection of Accepted | | Gin.go:133:10:133:19 | selection of Params | -| Gin.go:134:7:134:9 | val | -| Gin.go:134:7:134:12 | index expression | | Gin.go:134:7:134:18 | selection of Value | | Gin.go:139:10:139:19 | selection of Params | -| Gin.go:139:10:139:22 | index expression | -| Gin.go:140:7:140:9 | val | | Gin.go:140:7:140:15 | selection of Value | | Gin.go:143:10:143:19 | selection of Params | | Gin.go:143:10:143:34 | call to ByName | | Gin.go:147:3:147:34 | ... := ...[0] | | Gin.go:147:13:147:22 | selection of Params | | Gin.go:153:12:153:21 | selection of Params | -| Gin.go:153:12:153:24 | index expression | -| Gin.go:154:10:154:14 | param | | Gin.go:154:10:154:18 | selection of Key | -| Gin.go:155:10:155:14 | param | | Gin.go:155:10:155:20 | selection of Value | | Gin.go:163:16:163:22 | &... | | Gin.go:167:7:167:19 | definition of personPointer |