close
The Wayback Machine - https://web.archive.org/web/20260105064421/https://github.com/github/codeql/issues/4442
Skip to content

LGTM.com - false positive Golang varargs confused re item in args vs len of varargs #4442

@philpennock

Description

@philpennock

Description of the false positive

The complaint is This operation, which is used in an allocation, involves a potentially large value and might overflow.; the Go function declaration uses args ...interface{} for varargs, and the code is:

t := make([]interface{}, 3, len(args)+3)

The potentially large object in the complaint paths is not being passed into this function as separate parameters, so even if it were passed in, the contribution to len(args) for that one object would be 1, not varying upon the size of the object.

In fact, I'm actually passing in len(largeObject) as a parameter, and this length value is triggering, so that might be a second false positive, that len(X) does not de-taint the largeness of X.

https://lgtm.com/projects/g/PennockTech/ocsprenewer/snapshot/f3884a03c6ffbf224bd431611a0131480d205a2c/files/renew/log.go?sort=name&dir=ASC&mode=heatmap#xf1b87a2499b61794:1

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions