Skip to content

Commit 0b79087

Browse files
committed
Make predicate name start with has instead of get
1 parent 303deab commit 0b79087

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

go/ql/src/experimental/CWE-918/validator.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class FieldWithTags extends FieldDecl {
2424
* For example: the tag `json:"word" binding:"required,alpha"` yields `key: "json", value: "word"`
2525
* and `key: "binding" values: "required","alpha"`.
2626
*/
27-
predicate getTagByKeyValue(string key, string value) {
27+
predicate hasTagKeyValue(string key, string value) {
2828
exists(string tag, string key_value, string values |
2929
this.getTag().toString() = tag and
3030
// Each key_value is like key:"value1,value2"
@@ -50,7 +50,7 @@ class AlphanumericStructFieldRead extends DataFlow::Node {
5050
exists(FieldWithTags decl, Field field, string tag |
5151
this = field.getARead() and
5252
field.getDeclaration() = decl.getNameExpr(0) and
53-
decl.getTagByKeyValue(key, tag) and
53+
decl.hasTagKeyValue(key, tag) and
5454
isAlphanumericValidationKind(tag)
5555
)
5656
}

0 commit comments

Comments
 (0)