-
-
Notifications
You must be signed in to change notification settings - Fork 655
Closed
Description
Summary
When converting a uintptr to an unsafe.Pointer I get the error G115: integer overflow conversion uintptr -> unsafe.Pointer
, even though these can be safely converted (see https://pkg.go.dev/unsafe#Pointer "A uintptr can be converted to a Pointer.").
Steps to reproduce the behavior
Code sample:
package main
func main() {
i := uintptr(123)
p := unsafe.Pointer(i)
_ = p
}
gosec version
v2.20.1-0.20240822074752-ab3f6c1c83a0
Go version (output of 'go version')
go version go1.23.0 darwin/amd64
Operating system / Environment
MacOS 14.6.1
Expected behavior
Passes without errors.
Actual behavior
Throws error G115: integer overflow conversion uintptr -> unsafe.Pointer
Metadata
Metadata
Assignees
Labels
No labels